0% found this document useful (0 votes)
15 views4 pages

Windows System Calls

Opertaing system assignment

Uploaded by

areebejaz030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Windows System Calls

Opertaing system assignment

Uploaded by

areebejaz030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

“ Windows System Calls ”

Q:What are Windows system calls? Describe three categories of system


calls with examples.
System Calls :-
In operating systems, a system call is the mechanism used by applications to
interact with the kernel or low-level system components.

Windows System Calls :-


In the context of Windows, system calls enable user-level programs to request
services such as file operations, memory management, process control, and inter-
process communication.

Types of Windows System Calls


Windows system calls can be broadly categorized into several groups based on the
types of operations they perform. Some of the key categories include:

Process and Thread Management:

o CreateProcess(): Creates a new process and its primary thread.


o ExitProcess(): Terminates the calling process.
o CreateThread(): Creates a new thread within a process.
o ExitThread(): Terminates a thread.
o SuspendThread / ResumeThread(): Pauses or resumes the
execution of a thread.

Memory Management:

 VirtualAlloc(): Allocates a region of memory within the process’s


address space.
 VirtualFree(): Frees a region of memory.
 HeapAlloc(): Allocates a block of memory from the heap.
 HeapFree(): Frees a block of memory from the heap.
 GlobalAlloc / GlobalFree(): Manages memory for global variables
File Management:

 CreateFile(): Opens or creates a file or I/O device.


 ReadFile / WriteFile(): Reads from or writes to a file or device.
 CloseHandle(): Closes a file or device handle.
 SetFilePointer(): Changes the file pointer to a specified position.
 DeleteFile(): Deletes a specified file.
 GetFileSize(): Retrieves the size of a file.

Input/Output and Device Management:

o DeviceIoControl(): Sends control codes to devices.


o ReadFile / WriteFile(): Interacts with files or devices through
handles.
o SetConsoleMode(): Configures the console’s input/output
behavior.

Security and Access Control:

o OpenProcessToken(): Opens the access token associated with a


process.
o GetTokenInformation(): Retrieves information about a specific
token.
o SetSecurityDescriptor(): Sets the security descriptor of an object.

Inter-Process Communication (IPC):

o CreateMutex(): Creates a mutex object for synchronizing threads


or processes.
o CreateEvent(): Creates an event object for synchronization.
o CreateSemaphore(): Creates a semaphore object.
o WaitForSingleObject / WaitForMultipleObjects(): Blocks a
thread until an object is signaled.
o PostMessage(): Posts a message to a window's message queue.
Networking and Communication:

o WSAStartup(): Initializes the Windows Sockets library.


o socket: Creates a socket.
o connect / bind(): Establishes a connection or binds a socket to a
port.
o send / recv(): Sends or receives data through a socket.
o Closesocket(): Closes a socket.
o Shutdown(): Disables send or receive operations on a socket.

Time and Date Operations:

o GetSystemTime(): Retrieves the current system time.


o SetSystemTime(): Sets the system's date and time.
o GetLocalTime(): Retrieves the current local time.

System Information and Configuration:

o GetSystemInfo(): Retrieves information about the system


hardware and configuration.
o GetComputerName(): Retrieves the name of the computer.
o SetEnvironmentVariable(): Sets the value of an environment
variable.

Examples

Memory Management Example:

 VirtualAlloc:
Process Management Example:

 CreateProcess:

File Management Example:

 CreateFile:

The End.

You might also like