source: Include/api_psapi.sbp@ 191

Last change on this file since 191 was 142, checked in by イグトランス (egtra), 18 years ago

Environment, OperatingSystem, Versionの追加、Unicode対応修正ほか

File size: 5.7 KB
RevLine 
[141]1' api_psapi.sbp
2
[96]3#ifndef _INC_PSAPI_
4#define _INC_PSAPI_
[1]5
[141]6#ifdef UNICODE
7Const _FuncName_GetModuleBaseName = "GetModuleBaseNameW"
8Const _FuncName_GetModuleFileNameEx = "GetModuleFileNameExW"
9Const _FuncName_GetMappedFileName = "GetMappedFileNameW"
10Const _FuncName_GetDeviceDriverBaseName = "GetDeviceDriverBaseNameW"
11Const _FuncName_GetDeviceDriverFileName = "GetDeviceDriverFileNameW"
12Const _FuncName_GetProcessImageFileName = "GetProcessImageFileNameW"
13Const _FuncName_EnumPageFiles = "EnumPageFilesW"
14#else
15Const _FuncName_GetModuleBaseName = "GetModuleBaseNameA"
16Const _FuncName_GetModuleFileNameEx = "GetModuleFileNameExA"
17Const _FuncName_GetMappedFileName = "GetMappedFileNameA"
18Const _FuncName_GetDeviceDriverBaseName = "GetDeviceDriverBaseNameA"
19Const _FuncName_GetDeviceDriverFileName = "GetDeviceDriverFileNameA"
20Const _FuncName_GetProcessImageFileName = "GetProcessImageFileNameA"
21Const _FuncName_EnumPageFiles = "EnumPageFilesA"
22#endif
23
[96]24Declare Function EnumProcesses Lib "psapi" (lpidProcess As *DWord, cb As DWord, ByRef cbNeeded As DWord) As BOOL
25Declare Function EnumProcessModules Lib "psapi" (hProcess As HANDLE, lphModule As *HANDLE, cb As DWord, ByRef lpcbNeeded As DWord) As BOOL
[141]26Declare Function GetModuleBaseName Lib "psapi" Alias _FuncName_GetModuleBaseName (hProcess As HANDLE, hModule As HANDLE, lpBaseName As LPTSTR, nSize As DWord) As DWORD
27Declare Function GetModuleFileNameEx Lib "psapi" Alias _FuncName_GetModuleFileNameEx (hProcess As HANDLE, hModule As HANDLE, lpFilename As LPTSTR, nSize As DWord) As DWORD
[1]28
[96]29Type MODULEINFO
30 lpBaseOfDll As VoidPtr
31 SizeOfImage As DWORD
32 EntryPoint As VoidPtr
33End Type
34TypeDef LPMODULEINFO = *MODULEINFO
[1]35
[96]36Declare Function GetModuleInformation Lib "psapi" (hProcess As HANDLE, hModule As HANDLE, lpmodinfo As LPMODULEINFO, cb As DWord) As BOOL
37Declare Function EmptyWorkingSet Lib "psapi" (hProcess As HANDLE) As BOOL
38Declare Function QueryWorkingSet Lib "psapi" (hProcess As HANDLE, pv As VoidPtr, cb As DWord) As BOOL
39Declare Function QueryWorkingSetEx Lib "psapi" (hProcess As HANDLE, pv As VoidPtr, cb As DWord) As BOOL
40Declare Function InitializeProcessForWsWatch Lib "psapi" (hProcess As HANDLE) As BOOL
[1]41
[96]42Type PSAPI_WS_WATCH_INFORMATION
43 FaultingPc As VoidPtr
44 FaultingVa As VoidPtr
45End Type
46TypeDef PPSAPI_WS_WATCH_INFORMATION = *PSAPI_WS_WATCH_INFORMATION
[1]47
[96]48Declare Function GetWsChanges Lib "psapi" (hProcess As HANDLE, lpWatchInfo As PPSAPI_WS_WATCH_INFORMATION, cb As DWord) As BOOL
[141]49Declare Function GetMappedFileName Lib "psapi" Alias _FuncName_GetMappedFileName (hProcess As HANDLE, lpv As VoidPtr, lpFilename As LPTSTR, nSize As DWord) As DWORD
[96]50Declare Function EnumDeviceDrivers Lib "psapi" (ByRef lpImageBase As VoidPtr, cb As DWord, ByRef lpcbNeeded As DWord) As BOOL
[141]51Declare Function GetDeviceDriverBaseName Lib "psapi" Alias _FuncName_GetDeviceDriverBaseName (ImageBase As VoidPtr, lpBaseName As LPTSTR, nSize As DWord) As DWORD
52Declare Function GetDeviceDriverFileName Lib "psapi" Alias _FuncName_GetDeviceDriverFileName (ImageBase As VoidPtr, lpFilename As LPTSTR, nSize As DWord) As DWORD
[1]53
[96]54' Structure for GetProcessMemoryInfo()
55Type PROCESS_MEMORY_COUNTERS
56 cb As DWORD
57 PageFaultCount As DWORD
58 PeakWorkingSetSize As SIZE_T
59 WorkingSetSize As SIZE_T
60 QuotaPeakPagedPoolUsage As SIZE_T
61 QuotaPagedPoolUsage As SIZE_T
62 QuotaPeakNonPagedPoolUsage As SIZE_T
63 QuotaNonPagedPoolUsage As SIZE_T
64 PagefileUsage As SIZE_T
65 PeakPagefileUsage As SIZE_T
66End Type
67
68TypeDef PPROCESS_MEMORY_COUNTERS = *PROCESS_MEMORY_COUNTERS
69
70#ifdef _WIN32_WINNT
71Type PROCESS_MEMORY_COUNTERS_EX
72 cb As DWORD
73 PageFaultCount As DWORD
74 PeakWorkingSetSize As SIZE_T
75 WorkingSetSize As SIZE_T
76 QuotaPeakPagedPoolUsage As SIZE_T
77 QuotaPagedPoolUsage As SIZE_T
78 QuotaPeakNonPagedPoolUsage As SIZE_T
79 QuotaNonPagedPoolUsage As SIZE_T
80 PagefileUsage As SIZE_T
81 PeakPagefileUsage As SIZE_T
82 PrivateUsage As SIZE_T
83End Type
84TypeDef PPROCESS_MEMORY_COUNTERS_EX = *PROCESS_MEMORY_COUNTERS_EX
85#endif
86
[142]87Declare Function GetProcessMemoryInfo Lib "psapi" (Process As HANDLE, ppsmemCounters As PPROCESS_MEMORY_COUNTERS, cb As DWord) As BOOL
[96]88
89Type PERFORMANCE_INFORMATION
90 cb As DWORD
91 CommitTotal As SIZE_T
92 CommitLimit As SIZE_T
93 CommitPeak As SIZE_T
94 PhysicalTotal As SIZE_T
95 PhysicalAvailable As SIZE_T
96 SystemCache As SIZE_T
97 KernelTotal As SIZE_T
98 KernelPaged As SIZE_T
99 KernelNonpaged As SIZE_T
100 PageSize As SIZE_T
101 HandleCount As DWORD
102 ProcessCount As DWORD
103 ThreadCount As DWORD
104End Type
105TypeDef PPERFORMANCE_INFORMATION = *PERFORMANCE_INFORMATION
106TypeDef PERFORMACE_INFORMATION = PERFORMANCE_INFORMATION
107TypeDef PPERFORMACE_INFORMATION = *PERFORMANCE_INFORMATION
108
[142]109Declare Function GetPerformanceInfo Lib "psapi" (pPerformanceInformation As PPERFORMACE_INFORMATION, cb As DWord) As BOOL
[96]110
111Type ENUM_PAGE_FILE_INFORMATION
112 cb As DWORD
113 Reserved As DWORD
114 TotalSize As SIZE_T
115 TotalInUse As SIZE_T
116 PeakUsage As SIZE_T
117End Type
118TypeDef PENUM_PAGE_FILE_INFORMATION = *ENUM_PAGE_FILE_INFORMATION
119
120TypeDef PENUM_PAGE_FILE_CALLBACKW = *Function(pContext As VoidPtr, pPageFileInfo As PENUM_PAGE_FILE_INFORMATION, lpFilename As LPCWSTR) As BOOL
121TypeDef PENUM_PAGE_FILE_CALLBACKA = *Function(pContext As VoidPtr, pPageFileInfo As PENUM_PAGE_FILE_INFORMATION, lpFilename As LPCSTR) As BOOL
[141]122#ifdef UNICODE
123TypeDef PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKW
124#else
125TypeDef PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKA
126#endif
[96]127
[141]128Declare Function EnumPageFiles Lib "psapi" Alias _FuncName_EnumPageFiles (pCallBackRoutine As PENUM_PAGE_FILE_CALLBACK, pContext As VoidPtr) As BOOL
129Declare Function GetProcessImageFileName Lib "psapi" Alias _FuncName_GetProcessImageFileName (hProcess As HANDLE, lpImageFileName As LPTSTR, nSize As DWord) As DWORD
[96]130
[1]131#endif '_INC_PSAPI
Note: See TracBrowser for help on using the repository browser.