Windows System Services API Reference
Overview
This section provides detailed API reference documentation for Windows System Services. These services are fundamental components that enable various functionalities within the Windows operating system, ranging from process management and inter-process communication to security and network operations.
Understanding these services is crucial for developing robust and efficient Windows applications that interact with the operating system at a deep level.
Key System Services Categories
Explore the following categories to find relevant APIs:
Process and Thread Management
CreateProcess
Creates a new process and its primary thread. The new process runs in the same address space of the calling process.
Header: windows.h
Syntax:
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
ExitProcess
Terminates the calling process and all of its threads.
Header: windows.h
VOID ExitProcess(
UINT uExitCode
);
Memory Management
VirtualAlloc
Reserves, commits, or changes the state of a region of pages in the virtual address space of the calling process.
Header: windows.h
LPVOID VirtualAlloc(
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flAllocationType,
DWORD flProtect
);
Inter-Process Communication (IPC)
CreatePipe
Creates an unnamed pipe, a unidirectional data-flow mechanism.
Header: windows.h
BOOL CreatePipe(
PHANDLE hReadPipe,
PHANDLE hWritePipe,
LPSECURITY_ATTRIBUTES lpPipeAttributes,
DWORD nSize
);
Security Services
CreateFile` (with security attributes)
For details on file operations with security considerations, refer to the File System APIs.
Registry APIs
RegOpenKeyEx
Opens an existing registry key. If the key is not under the root of the hive and the calling application does not have access to the root, the function fails.
Header: winreg.h
LONG RegOpenKeyEx(
HKEY hKey,
LPCSTR lpSubKey,
DWORD ulOptions,
REGSAM samDesired,
PHKEY phkResult
);