EnumProcesses Function
Retrieves the process identifier for each process object in the system.Syntax
Parameters
- pProcessIds [out]
- A pointer to an array that receives the list of process identifiers.
- cb [in]
- The size of the pProcessIds array, in bytes.
- pBytesReturned [out]
- The number of bytes returned in the pProcessIds array.
Return Value
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError.
Requirements
Minimum supported client | Windows 2000 Professional |
---|---|
Minimum supported server | Windows 2000 Server |
Header | Psapi.h |
Library | Kernel32.lib on Windows 7 and Windows Server 2008 R2, Psapi.lib if PSAPI_VERSION=1 on Windows 7 and Windows Server 2008 R2, Psapi.lib on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000 |
DLL | Kernel32.dll on Windows 7 and Windows Server 2008 R2, Psapi.dll if PSAPI_VERSION=1 on Windows 7 and Windows Server 2008 R2, Psapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000 |
GetModuleBaseName FunctionRetrieves the base name of the specified module.SyntaxDWORD WINAPI GetModuleBaseName( __in HANDLE hProcess, __in_opt HMODULE hModule, __out LPTSTR lpBaseName, __in DWORD nSize ); Parameters
Return ValueIf the function succeeds, the return value specifies the length of the string copied to the buffer, in characters. If the function fails, the return value is zero. To get extended error information, call GetLastError.OpenProcess FunctionOpens an existing local process object.SyntaxHANDLE WINAPI OpenProcess( __in DWORD dwDesiredAccess, __in BOOL bInheritHandle, __in DWORD dwProcessId ); Parameters
Return ValueIf the function succeeds, the return value is an open handle to the specified process.If the function fails, the return value is NULL. To get extended error information, call GetLastError. Sample: HANDLE h = ::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); |
No comments:
Post a Comment