Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Certainly!

Here's a brief description of each command along with the parameters passed and
their definitions:

1. **Process**

- `CreateProcess()`: Creates a new process and its primary thread in Windows.

- Parameters:

- `lpApplicationName`: The name of the module to be executed.

- `lpCommandLine`: The command line to be executed.

- `lpProcessAttributes`: Security attributes for the new process object.

- `lpThreadAttributes`: Security attributes for the new thread object.

- `bInheritHandles`: Determines whether handles are inherited.

- `dwCreationFlags`: Flags that control the creation of the process.

- `lpEnvironment`: The environment block for the new process.

- `lpCurrentDirectory`: The current directory for the new process.

- `fork()`: Creates a new process (child process) in Unix.

- Parameters: None.

2. **Control**

- `ExitProcess()`: Terminates the calling process in Windows.

- Parameters:

- `uExitCode`: The exit code for the process.

- `exit()`: Terminates the calling process in Unix.

- Parameters:
- `status`: The status code or exit status for the process.

3. **Wait**

- `WaitForSingleObject()`: Waits until the specified object is in the signaled state in


Windows.

- Parameters:

- `hObject`: Handle to the object to wait for.

- `dwMilliseconds`: The time-out interval, in milliseconds.

- `wait()`: Waits for the child process to terminate in Unix.

- Parameters: None.

4. **File**

- `CreateFile()`: Creates or opens a file or I/O device in Windows.

- Parameters:

- `lpFileName`: The name of the file or device to be opened or created.

- `dwDesiredAccess`: The access to the file or device.

- `dwShareMode`: The sharing mode of the file or device.

- `lpSecurityAttributes`: Security attributes for the new file or device.

- `dwCreationDisposition`: Action to take on files that exist or don't exist.

- `dwFlagsAndAttributes`: File or device attributes and flags.

- `hTemplateFile`: Handle to a template file.

- `open()`: Opens a file in Unix.

- Parameters:
- `pathname`: The path to the file.

- `flags`: The access mode and options.

- `mode`: The file mode if the file is created.

5. **Manipulation**

- `ReadFile()`: Reads data from the specified file or I/O device in Windows.

- Parameters:

- `hFile`: Handle to the file or device.

- `lpBuffer`: Buffer to receive the data.

- `nNumberOfBytesToRead`: Number of bytes to read.

- `lpNumberOfBytesRead`: Number of bytes read.

- `lpOverlapped`: Overlapped structure for asynchronous I/O.

- `read()`: Reads data from a file descriptor in Unix.

- Parameters:

- `fd`: File descriptor.

- `buf`: Buffer to store the read data.

- `count`: Maximum number of bytes to read.

- `WriteFile()`: Writes data to the specified file or I/O device in Windows.

- Parameters:

- `hFile`: Handle to the file or device.

- `lpBuffer`: Buffer containing the data to be written.

- `nNumberOfBytesToWrite`: Number of bytes to write.


- `lpNumberOfBytesWritten`: Number of bytes written.

- `lpOverlapped`: Overlapped structure for asynchronous I/O.

6. **Close**

- `CloseHandle()`: Closes an open object handle in Windows.

- Parameters:

- `hObject`: Handle to the object to be closed.

- `close()`: Closes a file descriptor in Unix.

- Parameters:

- `fd`: File descriptor to be closed.

7. **Device**

- `SetConsoleMode()`: Sets the input mode of a console's input buffer or the output mode of
a console screen buffer in Windows.

- Parameters:

- `hConsoleHandle`: Handle to the console input or output buffer.

- `dwMode`: The input or output mode to be set.

- `ioctl()`: Performs device control operations in Unix.

- Parameters: Varies depending on the operation.

8. **Information**

- `GetCurrentProcessID()`: Retrieves the process identifier of the calling process in


Windows.
- Parameters: None.

- `getpid()`: Retrieves the process ID of the calling process in Unix.

- Parameters: None.

9. **Maintenance**

- `SetTimer()`: Sets a timer to call the specified function at regular intervals in Windows.

- Parameters:

- `uElapse`: The time-out value, in milliseconds.

- `lpTimerFunc`: The callback function.

- `alarm()`: Sets an alarm signal to be delivered to the calling process in Unix.

- Parameters:

- `seconds`: The number of seconds before the alarm signal is generated.

10. **Sleep**

- `Sleep()`: Suspends the execution of the current thread for a specified interval in
Windows.

- Parameters:

- `dwMilliseconds`: The time interval to sleep, in milliseconds.

- `sleep()`: Suspends execution of the calling thread for a specified number of seconds in
Unix.

- Parameters:

- `seconds`: The number of seconds to sleep.


11. **Communication**

- `CreatePipe()`: Creates an anonymous pipe in Windows.

- Parameters:

- `lpPipeName`: Pointer to a buffer that receives the pipe's name.

- `nSize`: The size of the buffer.

- `pipe()`: Creates an interprocess communication channel in Unix.

- Parameters:

- `pipefd`: Array to store the file descriptors for the read and write ends of the pipe.

12. **Memory Mapping**

- `CreateFileMapping()`: Creates or opens a named or unnamed file mapping object for a


specified file in Windows.

- Parameters:

- `lpName`: The name of the file mapping object.

- `bInheritHandle`: Determines whether the handle can be inherited.

- `flProtect`: The protection for the file mapping object.

- `dwMaximumSizeHigh`, `dwMaximumSizeLow`: The maximum size of the file


mapping object.

- `lpFileName`: The name of the file.

- `shm_open()`: Creates or opens a shared memory object in Unix.

- Parameters:

- `name`: The name of the shared memory object.


- `oflag`: The access mode and flags.

- `mode`: The permissions to be applied to the shared memory object.

- `mmap()`: Maps files or devices into memory in Unix.

- Parameters:

- `addr`: The starting address of the mapping.

- `length`: The length of the mapping.

- `prot`: The desired memory protection.

- `flags`: Additional flags.

- `fd`: The file descriptor.

- `offset`: The offset within the file.

13. **Protection**

`SetFileSecurity()`: Sets the access control information on the specified file in Windows.

- Parameters:

- `lpFileName`: The name of the file.

- `lpSecurityInformation`: The type of security information to set.

- `pSecurityDescriptor`: The security descriptor.

- `chmod()`: Changes the permissions of a file in Unix.

- Parameters:

- `pathname`: The path to the file.


- `mode`: The permissions to set.

14. **Initialization**

- `InitializeSecurityDescriptor()`: Initializes a new security descriptor in Windows.

- Parameters:

- `pSecurityDescriptor`: Pointer to the security descriptor.

- `umask()`: Sets the file creation mask for the current process in Unix.

- Parameters:

- `mask`: The file creation mask.

15. **Group Security**

- `SetSecurityDescriptorGroup()`: Sets the primary group information of a security


descriptor in Windows.

- Parameters:

- `pSecurityDescriptor`: Pointer to the security descriptor.

- `pGroup`: Pointer to the new primary group.

- `chown()`: Changes the ownership of a file in Unix.

- Parameters:

- `pathname`: The path to the file.

- `owner`: The new owner of the file.

- `group`: The new group owner of the file.


These descriptions provide a high-level overview of each command and their respective
parameters.

You might also like