1 | ' api_system.sbp - System API
|
---|
2 |
|
---|
3 | #ifndef _INC_SYSTEM
|
---|
4 | #define _INC_SYSTEM
|
---|
5 |
|
---|
6 | #ifdef UNICODE
|
---|
7 | Const _FuncName_CompareString = "CompareStringW"
|
---|
8 | Const _FuncName_CopyFile = "CopyFileW"
|
---|
9 | Const _FuncName_CreateDirectory = "CreateDirectoryW"
|
---|
10 | Const _FuncName_CreateEvent = "CreateEventW"
|
---|
11 | Const _FuncName_CreateMutex = "CreateMutexW"
|
---|
12 | Const _FuncName_CreateSemaphore = "CreateSemaphoreW"
|
---|
13 | Const _FuncName_CreateWaitableTimer = "CreateWaitableTimerW"
|
---|
14 | Const _FuncName_CreateFile = "CreateFileW"
|
---|
15 | Const _FuncName_CreateFileMapping = "CreateFileMappingW"
|
---|
16 | Const _FuncName_OpenFileMapping = "OpenFileMappingW"
|
---|
17 | Const _FuncName_CreateMailslot = "CreateMailslotW"
|
---|
18 | Const _FuncName_CreateProcess = "CreateProcessW"
|
---|
19 | Const _FuncName_DeleteFile = "DeleteFileW"
|
---|
20 | Const _FuncName_ExpandEnvironmentStrings = "ExpandEnvironmentStringsW"
|
---|
21 | Const _FuncName_FatalAppExit = "FatalAppExitW"
|
---|
22 | Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationW"
|
---|
23 | Const _FuncName_FindFirstFile = "FindFirstFileW"
|
---|
24 | Const _FuncName_FindNextFile = "FindNextFileW"
|
---|
25 | Const _FuncName_FindResource = "FindResourceW"
|
---|
26 | Const _FuncName_FormatMessage = "FormatMessageW"
|
---|
27 | Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsW"
|
---|
28 | Const _FuncName_GetCompressedFileSize = "GetCompressedFileSizeW"
|
---|
29 | Const _FuncName_GetComputerName = "GetComputerNameW"
|
---|
30 | Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryW"
|
---|
31 | Const _FuncName_GetDateFormat = "GetDateFormatW"
|
---|
32 | Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceW"
|
---|
33 | Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExW"
|
---|
34 | Const _FuncName_GetVolumeInformation = "GetVolumeInformationW"
|
---|
35 | Const _FuncName_GetDriveType = "GetDriveTypeW"
|
---|
36 | Const _FuncName_GetEnvironmentVariable = "GetEnvironmentVariableW"
|
---|
37 | Const _FuncName_GetEnvironmentStrings = "GetEnvironmentStringsW"
|
---|
38 | Const _FuncName_GetFileAttributes = "GetFileAttributesW"
|
---|
39 | Const _FuncName_GetFullPathName = "GetFullPathNameW"
|
---|
40 | Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsW"
|
---|
41 | Const _FuncName_GetLongPathName = "GetLongPathNameW"
|
---|
42 | Const _FuncName_GetModuleFileName = "GetModuleFileNameW"
|
---|
43 | Const _FuncName_GetModuleHandle = "GetModuleHandleW"
|
---|
44 | Const _FuncName_GetShortPathName = "GetShortPathNameW"
|
---|
45 | Const _FuncName_GetStartupInfo = "GetStartupInfoW"
|
---|
46 | Const _FuncName_GetSystemDirectory = "GetSystemDirectoryW"
|
---|
47 | Const _FuncName_GetTempFileName = "GetTempFileNameW"
|
---|
48 | Const _FuncName_GetTempPath = "GetTempPathW"
|
---|
49 | Const _FuncName_GetTimeFormat = "GetTimeFormatW"
|
---|
50 | Const _FuncName_GetUserName = "GetUserNameW"
|
---|
51 | Const _FuncName_GetVersionEx = "GetVersionExW"
|
---|
52 | Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryW"
|
---|
53 | Const _FuncName_LCMapString = "LCMapStringW"
|
---|
54 | Const _FuncName_LoadLibrary = "LoadLibraryW"
|
---|
55 | Const _FuncName_LoadLibraryEx = "LoadLibraryExW"
|
---|
56 | Const _FuncName_LookupPrivilegeValue = "LookupPrivilegeValueW"
|
---|
57 | Const _FuncName_lstrcat = "lstrcatW"
|
---|
58 | Const _FuncName_lstrcmp = "lstrcmpW"
|
---|
59 | Const _FuncName_lstrcmpi = "lstrcmpiW"
|
---|
60 | Const _FuncName_lstrcpy = "lstrcpyW"
|
---|
61 | Const _FuncName_lstrcpyn = "lstrcpynW"
|
---|
62 | Const _FuncName_MoveFile = "MoveFileW"
|
---|
63 | Const _FuncName_OpenEvent = "OpenEventW"
|
---|
64 | Const _FuncName_OpenMutex = "OpenMutexW"
|
---|
65 | Const _FuncName_OpenSemaphore = "OpenSemaphoreW"
|
---|
66 | Const _FuncName_OpenWaitableTimer = "OpenWaitableTimerW"
|
---|
67 | Const _FuncName_RemoveDirectory = "RemoveDirectoryW"
|
---|
68 | Const _FuncName_SetComputerName = "SetComputerNameW"
|
---|
69 | Const _FuncName_SetCurrentDirectory = "SetCurrentDirectoryW"
|
---|
70 | Const _FuncName_SearchPath = "SearchPathW"
|
---|
71 | Const _FuncName_SetEnvironmentVariable = "SetEnvironmentVariableW"
|
---|
72 | Const _FuncName_SetFileAttributes = "SetFileAttributesW"
|
---|
73 | #else
|
---|
74 | Const _FuncName_CompareString = "CompareStringA"
|
---|
75 | Const _FuncName_CopyFile = "CopyFileA"
|
---|
76 | Const _FuncName_CreateDirectory = "CreateDirectoryA"
|
---|
77 | Const _FuncName_CreateEvent = "CreateEventA"
|
---|
78 | Const _FuncName_CreateMutex = "CreateMutexA"
|
---|
79 | Const _FuncName_CreateSemaphore = "CreateSemaphoreA"
|
---|
80 | Const _FuncName_CreateWaitableTimer = "CreateWaitableTimerA"
|
---|
81 | Const _FuncName_CreateFile = "CreateFileA"
|
---|
82 | Const _FuncName_CreateFileMapping = "CreateFileMappingA"
|
---|
83 | Const _FuncName_OpenFileMapping = "OpenFileMappingA"
|
---|
84 | Const _FuncName_CreateMailslot = "CreateMailslotA"
|
---|
85 | Const _FuncName_CreateProcess = "CreateProcessA"
|
---|
86 | Const _FuncName_DeleteFile = "DeleteFileA"
|
---|
87 | Const _FuncName_ExpandEnvironmentStrings = "ExpandEnvironmentStringsA"
|
---|
88 | Const _FuncName_FatalAppExit = "FatalAppExitA"
|
---|
89 | Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationA"
|
---|
90 | Const _FuncName_FindFirstFile = "FindFirstFileA"
|
---|
91 | Const _FuncName_FindNextFile = "FindNextFileA"
|
---|
92 | Const _FuncName_FindResource = "FindResourceA"
|
---|
93 | Const _FuncName_FormatMessage = "FormatMessageA"
|
---|
94 | Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsA"
|
---|
95 | Const _FuncName_GetCompressedFileSize = "GetCompressedFileSizeA"
|
---|
96 | Const _FuncName_GetComputerName = "GetComputerNameA"
|
---|
97 | Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryA"
|
---|
98 | Const _FuncName_GetDateFormat = "GetDateFormatA"
|
---|
99 | Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceA"
|
---|
100 | Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExA"
|
---|
101 | Const _FuncName_GetVolumeInformation = "GetVolumeInformationA"
|
---|
102 | Const _FuncName_GetDriveType = "GetDriveTypeA"
|
---|
103 | Const _FuncName_GetEnvironmentVariable = "GetEnvironmentVariableA"
|
---|
104 | Const _FuncName_GetEnvironmentStrings = "GetEnvironmentStringsA"
|
---|
105 | Const _FuncName_GetFileAttributes = "GetFileAttributesA"
|
---|
106 | Const _FuncName_GetFullPathName = "GetFullPathNameA"
|
---|
107 | Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsA"
|
---|
108 | Const _FuncName_GetLongPathName = "GetLongPathNameA"
|
---|
109 | Const _FuncName_GetModuleFileName = "GetModuleFileNameA"
|
---|
110 | Const _FuncName_GetModuleHandle = "GetModuleHandleA"
|
---|
111 | Const _FuncName_GetShortPathName = "GetShortPathNameA"
|
---|
112 | Const _FuncName_GetStartupInfo = "GetStartupInfoA"
|
---|
113 | Const _FuncName_GetSystemDirectory = "GetSystemDirectoryA"
|
---|
114 | Const _FuncName_GetTempFileName = "GetTempFileNameA"
|
---|
115 | Const _FuncName_GetTempPath = "GetTempPathA"
|
---|
116 | Const _FuncName_GetTimeFormat = "GetTimeFormatA"
|
---|
117 | Const _FuncName_GetUserName = "GetUserNameA"
|
---|
118 | Const _FuncName_GetVersionEx = "GetVersionExA"
|
---|
119 | Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryA"
|
---|
120 | Const _FuncName_LCMapString = "LCMapStringA"
|
---|
121 | Const _FuncName_LoadLibrary = "LoadLibraryA"
|
---|
122 | Const _FuncName_LoadLibraryEx = "LoadLibraryExA"
|
---|
123 | Const _FuncName_LookupPrivilegeValue = "LookupPrivilegeValueA"
|
---|
124 | Const _FuncName_lstrcat = "lstrcatA"
|
---|
125 | Const _FuncName_lstrcmp = "lstrcmpA"
|
---|
126 | Const _FuncName_lstrcmpi = "lstrcmpiA"
|
---|
127 | Const _FuncName_lstrcpy = "lstrcpyA"
|
---|
128 | Const _FuncName_lstrcpyn = "lstrcpynA"
|
---|
129 | Const _FuncName_MoveFile = "MoveFileA"
|
---|
130 | Const _FuncName_OpenEvent = "OpenEventA"
|
---|
131 | Const _FuncName_OpenMutex = "OpenMutexA"
|
---|
132 | Const _FuncName_OpenSemaphore = "OpenSemaphoreA"
|
---|
133 | Const _FuncName_OpenWaitableTimer = "OpenWaitableTimerA"
|
---|
134 | Const _FuncName_RemoveDirectory = "RemoveDirectoryA"
|
---|
135 | Const _FuncName_SetComputerName = "SetComputerNameA"
|
---|
136 | Const _FuncName_SetCurrentDirectory = "SetCurrentDirectoryA"
|
---|
137 | Const _FuncName_SearchPath = "SearchPathA"
|
---|
138 | Const _FuncName_SetEnvironmentVariable = "SetEnvironmentVariableA"
|
---|
139 | Const _FuncName_SetFileAttributes = "SetFileAttributesA"
|
---|
140 | #endif
|
---|
141 |
|
---|
142 |
|
---|
143 | '-------------------
|
---|
144 | ' default constants
|
---|
145 | Const INVALID_HANDLE_VALUE = -1 As HANDLE
|
---|
146 | Const INVALID_SET_FILE_POINTER = &HFFFFFFFF
|
---|
147 |
|
---|
148 | '-----------------
|
---|
149 | ' data structs
|
---|
150 |
|
---|
151 | 'variable type - System
|
---|
152 | TypeDef HFILE = Long
|
---|
153 | Type _System_DeclareHandle_HANDLE:unused As DWord:End Type
|
---|
154 | TypeDef HRSRC = *_System_DeclareHandle_HANDLE
|
---|
155 |
|
---|
156 | ' File structure
|
---|
157 | Type SECURITY_ATTRIBUTES
|
---|
158 | nLength As DWord
|
---|
159 | lpSecurityDescriptor As VoidPtr
|
---|
160 | bInheritHandle As BOOL
|
---|
161 | End Type
|
---|
162 |
|
---|
163 | Type OVERLAPPED
|
---|
164 | Internal As ULONG_PTR
|
---|
165 | InternalHigh As ULONG_PTR
|
---|
166 | Offset As DWord
|
---|
167 | OffsetHigh As DWord
|
---|
168 | hEvent As HANDLE
|
---|
169 | End Type
|
---|
170 |
|
---|
171 | ' System time
|
---|
172 | Type SYSTEMTIME
|
---|
173 | wYear As Word
|
---|
174 | wMonth As Word
|
---|
175 | wDayOfWeek As Word
|
---|
176 | wDay As Word
|
---|
177 | wHour As Word
|
---|
178 | wMinute As Word
|
---|
179 | wSecond As Word
|
---|
180 | wMilliseconds As Word
|
---|
181 | End Type
|
---|
182 |
|
---|
183 | ' Global Memory Flags
|
---|
184 | Const GMEM_FIXED = &H0000
|
---|
185 | Const GMEM_MOVEABLE = &H0002
|
---|
186 | Const GMEM_NOCOMPACT = &H0010
|
---|
187 | Const GMEM_NODISCARD = &H0020
|
---|
188 | Const GMEM_ZEROINIT = &H0040
|
---|
189 | Const GMEM_MODIFY = &H0080
|
---|
190 | Const GMEM_DISCARDABLE = &H0100
|
---|
191 | Const GMEM_NOT_BANKED = &H1000
|
---|
192 | Const GMEM_SHARE = &H2000
|
---|
193 | Const GMEM_DDESHARE = &H2000
|
---|
194 | Const GMEM_INVALID_HANDLE = &H8000
|
---|
195 | Const GHND = GMEM_MOVEABLE or GMEM_ZEROINIT
|
---|
196 | Const GPTR = GMEM_FIXED or GMEM_ZEROINIT
|
---|
197 | Const GMEM_DISCARDED = &H4000
|
---|
198 |
|
---|
199 | ' Locale flag
|
---|
200 | Const LOCALE_NOUSEROVERRIDE = &H80000000
|
---|
201 |
|
---|
202 | 'Critical Section
|
---|
203 | Type CRITICAL_SECTION
|
---|
204 | DebugInfo As VoidPtr
|
---|
205 | LockCount As Long
|
---|
206 | RecursionCount As Long
|
---|
207 | OwningThread As HANDLE
|
---|
208 | LockSemaphore As HANDLE
|
---|
209 | SpinCount As ULONG_PTR
|
---|
210 | End Type
|
---|
211 |
|
---|
212 | 'Mutex
|
---|
213 | Const MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS
|
---|
214 |
|
---|
215 | '----------------------
|
---|
216 | ' Kernel Operation API
|
---|
217 | Declare Function InterlockedIncrement Lib "kernel32" (ByRef lpAddend As Long) As Long
|
---|
218 | Declare Function InterlockedDecrement Lib "kernel32" (ByRef lpAddend As Long) As Long
|
---|
219 | Declare Function InterlockedExchange Lib "kernel32" (ByRef Target As Long, Value As Long) As Long
|
---|
220 | Declare Function InterlockedCompareExchange Lib "kernel32" (ByRef Destination As Long, Exchange As Long, Comperand As Long) As Long
|
---|
221 | Declare Function InterlockedExchangeAdd Lib "kernel32" (ByRef Addend As Long, Value As Long) As Long
|
---|
222 | #ifdef _WIN64
|
---|
223 | Declare Function InterlockedCompareExchangePointer Lib "kernel32" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
|
---|
224 | Declare Function InterlockedExchangePointer Lib "kernel32" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
|
---|
225 | #else
|
---|
226 | Declare Function InterlockedCompareExchangePointer Lib "kernel32" Alias "InterlockedCompareExchange" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
|
---|
227 | Declare Function InterlockedExchangePointer Lib "kernel32" Alias "InterlockedExchange" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
|
---|
228 | #endif
|
---|
229 |
|
---|
230 |
|
---|
231 | Declare Function Beep Lib "kernel32" (dwFreq As DWord, dwDuration As DWord) As BOOL
|
---|
232 | Declare Function CloseHandle Lib "kernel32" (hObject As HANDLE) As BOOL
|
---|
233 |
|
---|
234 | Declare Function CompareFileTime Lib "kernel32" (ByRef FileTime1 As FILETIME, ByRef FileTime2 As FILETIME) As Long
|
---|
235 |
|
---|
236 | Const NORM_IGNORECASE = &H00000001
|
---|
237 | Const NORM_IGNORENONSPACE = &H00000002
|
---|
238 | Const NORM_IGNORESYMBOLS = &H00000004
|
---|
239 | Const SORT_STRINGSORT = &H00001000
|
---|
240 | Const NORM_IGNOREKANATYPE = &H00010000
|
---|
241 | Const NORM_IGNOREWIDTH = &H00020000
|
---|
242 | Const CSTR_LESS_THAN = 1
|
---|
243 | Const CSTR_EQUAL = 2
|
---|
244 | Const CSTR_GREATER_THAN = 3
|
---|
245 | Declare Function CompareString Lib "kernel32" Alias _FuncName_CompareString (Locale As LCID, dwCmpFlags As DWord, pString1 As PCTSTR, cchCount1 As Long, pString2 As PCTSTR, cchCount2 As Long) As Long
|
---|
246 |
|
---|
247 | Declare Function CopyFile Lib "kernel32" Alias _FuncName_CopyFile (pExistingFileName As PCTSTR, pNewFileName As PCTSTR, bFailIfExists As BOOL) As BOOL
|
---|
248 | Declare Function CreateDirectory Lib "kernel32" Alias _FuncName_CreateDirectory (pPathName As PCTSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As BOOL
|
---|
249 | Declare Function CreateEvent Lib "kernel32" Alias _FuncName_CreateEvent (pEventAttributes As *SECURITY_ATTRIBUTES, bManualReset As BOOL, bInitialState As BOOL, pName As PCTSTR) As HANDLE
|
---|
250 | Declare Function CreateMutex Lib "kernel32" Alias _FuncName_CreateMutex (lpMutexAttributes As *SECURITY_ATTRIBUTES, bInitialOwner As BOOL, lpName As PCTSTR) As HANDLE
|
---|
251 | Declare Function CreatePipe Lib "Kernel32" (
|
---|
252 | ByRef hReadPipe As HANDLE,
|
---|
253 | ByRef hWritePipe As HANDLE,
|
---|
254 | ByVal pPipeAttributes As *SECURITY_ATTRIBUTES,
|
---|
255 | ByVal nSize As DWord) As Long
|
---|
256 | Declare Function CreateSemaphore Lib "kernel32" Alias _FuncName_CreateSemaphore (pSemaphoreAttributes As *SECURITY_ATTRIBUTES, lInitialCount As Long, lMaximumCount As Long, pName As PCTSTR) As HANDLE
|
---|
257 |
|
---|
258 | TypeDef PTIMERAPCROUTINE = *Sub(lpArgToCompletionRoutine As VoidPtr, dwTimerLowValue As DWord, dwTimerHighValue As DWord)
|
---|
259 | Declare Function CreateWaitableTimer Lib "kernel32" Alias _FuncName_CreateWaitableTimer (pTimerAttributes As *SECURITY_ATTRIBUTES, bManualReset As BOOL, pTimerName As PCTSTR) As HANDLE
|
---|
260 | Declare Function OpenWaitableTimer Lib "kernel32" Alias _FuncName_OpenWaitableTimer (dwDesiredAccess As DWord, bInheritHandle As BOOL, pTimerName As PCTSTR) As HANDLE
|
---|
261 | Declare Function SetWaitableTimer Lib "kernel32" (hTimer As HANDLE, pDueTime As *LARGE_INTEGER, lPeriod As Long, pfnCompletionRoutine As PTIMERAPCROUTINE, pArgToCompletionRoutine As VoidPtr, fResume As BOOL) As BOOL
|
---|
262 | Declare Function CancelWaitableTimer Lib "kernel32" (hTimer As HANDLE) As BOOL
|
---|
263 |
|
---|
264 | Const CREATE_NEW = 1
|
---|
265 | Const CREATE_ALWAYS = 2
|
---|
266 | Const OPEN_EXISTING = 3
|
---|
267 | Const OPEN_ALWAYS = 4
|
---|
268 | Const TRUNCATE_EXISTING = 5
|
---|
269 | Const FILE_FLAG_WRITE_THROUGH = &H80000000
|
---|
270 | Const FILE_FLAG_OVERLAPPED = &H40000000
|
---|
271 | Const FILE_FLAG_NO_BUFFERING = &H20000000
|
---|
272 | Const FILE_FLAG_RANDOM_ACCESS = &H10000000
|
---|
273 | Const FILE_FLAG_SEQUENTIAL_SCAN = &H08000000
|
---|
274 | Const FILE_FLAG_DELETE_ON_CLOSE = &H04000000
|
---|
275 | Const FILE_FLAG_BACKUP_SEMANTICS = &H02000000
|
---|
276 | Const FILE_FLAG_POSIX_SEMANTICS = &H01000000
|
---|
277 | Const FILE_FLAG_OPEN_REPARSE_POINT = &H00200000
|
---|
278 | Const FILE_FLAG_OPEN_NO_RECALL = &H00100000
|
---|
279 | Declare Function CreateFile Lib "kernel32" Alias _FuncName_CreateFile (pFileName As PCTSTR, dwDesiredAccess As DWord, dwShareMode As DWord, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, dwCreationDisposition As DWord, dwFlagsAndAttributes As DWord, hTemplateFile As HANDLE) As HANDLE
|
---|
280 |
|
---|
281 | Const FILE_MAP_COPY = SECTION_QUERY
|
---|
282 | Const FILE_MAP_WRITE = SECTION_MAP_WRITE
|
---|
283 | Const FILE_MAP_READ = SECTION_MAP_READ
|
---|
284 | Const FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS
|
---|
285 | Declare Function CreateFileMapping Lib "kernel32" Alias _FuncName_CreateFileMapping (hFile As HANDLE, pFileMappingAttributes As *SECURITY_ATTRIBUTES, flProtect As DWord, dwMaximumSizeHigh As DWord, dwMaximumSizeLow As DWord, pName As PCSTR) As HANDLE
|
---|
286 | Declare Function OpenFileMapping Lib "kernel32" Alias _FuncName_OpenFileMapping (dwDesiredAccess As DWord, bInheritHandle As BOOL, pName As PCSTR) As HANDLE
|
---|
287 | Declare Function MapViewOfFile Lib "kernel32" (hFileMappingObject As HANDLE, dwDesiredAccess As DWord, dwFileOffsetHigh As DWord, dwFileOffsetLow As DWord, dwNumberOfBytesToMap As DWord) As VoidPtr
|
---|
288 | Declare Function MapViewOfFileEx Lib "kernel32" (hFileMappingObject As HANDLE, dwDesiredAccess As DWord, dwFileOffsetHigh As DWord, dwFileOffsetLow As DWord, dwNumberOfBytesToMap As DWord, lpBaseAddress As VoidPtr) As VoidPtr
|
---|
289 | Declare Function FlushViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr, dwNumberOfBytesToFlush As DWord) As BOOL
|
---|
290 | Declare Function UnmapViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr) As BOOL
|
---|
291 | Declare Function CreateMailslot Lib "kernel32" Alias _FuncName_CreateMailslot (pName As PCTSTR, nMaxMessageSize As DWord, lReadTimeout As DWord, pSecurityAttributes As *SECURITY_ATTRIBUTES) As HANDLE
|
---|
292 |
|
---|
293 | Const DEBUG_PROCESS = &H00000001
|
---|
294 | Const DEBUG_ONLY_THIS_PROCESS = &H00000002
|
---|
295 | Const CREATE_SUSPENDED = &H00000004
|
---|
296 | Const DETACHED_PROCESS = &H00000008
|
---|
297 | Const CREATE_NEW_CONSOLE = &H00000010
|
---|
298 | Const NORMAL_PRIORITY_CLASS = &H00000020
|
---|
299 | Const IDLE_PRIORITY_CLASS = &H00000040
|
---|
300 | Const HIGH_PRIORITY_CLASS = &H00000080
|
---|
301 | Const REALTIME_PRIORITY_CLASS = &H00000100
|
---|
302 | Const CREATE_NEW_PROCESS_GROUP = &H00000200
|
---|
303 | Const CREATE_UNICODE_ENVIRONMENT = &H00000400
|
---|
304 | Const CREATE_SEPARATE_WOW_VDM = &H00000800
|
---|
305 | Const CREATE_SHARED_WOW_VDM = &H00001000
|
---|
306 | Const CREATE_FORCEDOS = &H00002000
|
---|
307 | Const CREATE_DEFAULT_ERROR_MODE = &H04000000
|
---|
308 | Const CREATE_NO_WINDOW = &H08000000
|
---|
309 | Const PROFILE_USER = &H10000000
|
---|
310 | Const PROFILE_KERNEL = &H20000000
|
---|
311 | Const PROFILE_SERVER = &H40000000
|
---|
312 |
|
---|
313 | Const STARTF_USESHOWWINDOW = &H00000001
|
---|
314 | Const STARTF_USESIZE = &H00000002
|
---|
315 | Const STARTF_USEPOSITION = &H00000004
|
---|
316 | Const STARTF_USECOUNTCHARS = &H00000008
|
---|
317 | Const STARTF_USEFILLATTRIBUTE = &H00000010
|
---|
318 | Const STARTF_RUNFULLSCREEN = &H00000020
|
---|
319 | Const STARTF_FORCEONFEEDBACK = &H00000040
|
---|
320 | Const STARTF_FORCEOFFFEEDBACK = &H00000080
|
---|
321 | Const STARTF_USESTDHANDLES = &H00000100
|
---|
322 | Const STARTF_USEHOTKEY = &H00000200
|
---|
323 | Type STARTUPINFOW
|
---|
324 | cb As DWord
|
---|
325 | lpReserved As LPWSTR
|
---|
326 | lpDesktop As LPWSTR
|
---|
327 | lpTitle As LPWSTR
|
---|
328 | dwX As DWord
|
---|
329 | dwY As DWord
|
---|
330 | dwXSize As DWord
|
---|
331 | dwYSize As DWord
|
---|
332 | dwXCountChars As DWord
|
---|
333 | dwYCountChars As DWord
|
---|
334 | dwFillAttribute As DWord
|
---|
335 | dwFlags As DWord
|
---|
336 | wShowWindow As Word
|
---|
337 | cbReserved2 As Word
|
---|
338 | lpReserved2 As *Byte
|
---|
339 | hStdInput As HANDLE
|
---|
340 | hStdOutput As HANDLE
|
---|
341 | hStdError As HANDLE
|
---|
342 | End Type
|
---|
343 | Type STARTUPINFOA
|
---|
344 | cb As DWord
|
---|
345 | lpReserved As LPSTR
|
---|
346 | lpDesktop As LPSTR
|
---|
347 | lpTitle As LPSTR
|
---|
348 | dwX As DWord
|
---|
349 | dwY As DWord
|
---|
350 | dwXSize As DWord
|
---|
351 | dwYSize As DWord
|
---|
352 | dwXCountChars As DWord
|
---|
353 | dwYCountChars As DWord
|
---|
354 | dwFillAttribute As DWord
|
---|
355 | dwFlags As DWord
|
---|
356 | wShowWindow As Word
|
---|
357 | cbReserved2 As Word
|
---|
358 | lpReserved2 As *Byte
|
---|
359 | hStdInput As HANDLE
|
---|
360 | hStdOutput As HANDLE
|
---|
361 | hStdError As HANDLE
|
---|
362 | End Type
|
---|
363 | #ifdef UNICODE
|
---|
364 | TypeDef STARTUPINFO = STARTUPINFOW
|
---|
365 | #else
|
---|
366 | TypeDef STARTUPINFO = STARTUPINFOA
|
---|
367 | #endif
|
---|
368 | Type PROCESS_INFORMATION
|
---|
369 | hProcess As HANDLE
|
---|
370 | hThread As HANDLE
|
---|
371 | dwProcessId As DWord
|
---|
372 | dwThreadId As DWord
|
---|
373 | End Type
|
---|
374 | Declare Function CreateProcess Lib "kernel32" Alias _FuncName_CreateProcess (pApplicationName As PCTSTR, pCommandLine As PTSTR, ByRef ProcessAttributes As SECURITY_ATTRIBUTES, ByRef ThreadAttributes As SECURITY_ATTRIBUTES, bInheritHandles As BOOL, dwCreationFlags As DWord, lpEnvironment As VoidPtr, pCurrentDirectory As PCTSTR, ByRef lpStartupInfo As STARTUPINFO, ByRef lpProcessInformation As PROCESS_INFORMATION) As BOOL
|
---|
375 |
|
---|
376 | TypeDef LPTHREAD_START_ROUTINE = *Function(lpThreadParameter As VoidPtr) As DWord
|
---|
377 | Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As *SECURITY_ATTRIBUTES, dwStackSize As DWord, lpStartAddress As LPTHREAD_START_ROUTINE, pParameter As VoidPtr, dwCreationFlags As DWord, ByRef ThreadId As DWord) As HANDLE
|
---|
378 |
|
---|
379 | Declare Sub DebugBreak Lib "kernel32" ()
|
---|
380 | Declare Sub DeleteCriticalSection Lib "kernel32" (ByRef CriticalSection As CRITICAL_SECTION)
|
---|
381 | Declare Function DeleteFile Lib "kernel32" Alias _FuncName_DeleteFile (pFileName As PCTSTR) As BOOL
|
---|
382 | Declare Function DeviceIoControl Lib "Kernel32" (
|
---|
383 | hDevice As HANDLE,
|
---|
384 | dwIoControlCode As DWord,
|
---|
385 | pInBuffer As VoidPtr,
|
---|
386 | nInBufferSize As DWord,
|
---|
387 | pOutBuffer As VoidPtr,
|
---|
388 | nOutBufferSize As DWord,
|
---|
389 | pBytesReturned As DWordPtr,
|
---|
390 | pOverlapped As *OVERLAPPED
|
---|
391 | ) As Long
|
---|
392 | Declare Function DisableThreadLibraryCalls Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
|
---|
393 | Declare Function DosDateTimeToFileTime Lib "kernel32" (wFatDate As Word, wFatTime As Word, ByRef FileTime As FILETIME) As BOOL
|
---|
394 | Declare Function DuplicateHandle Lib "kernel32" (hSourceProcessHandle As HANDLE, hSourceHandle As HANDLE, hTargetProcessHandle As HANDLE, ByRef TargetHandle As HANDLE, dwDesiredAccess As DWord, bInheritHandle As BOOL, dwOptions As DWord) As BOOL
|
---|
395 | Declare Sub EnterCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
|
---|
396 | Declare Sub ExitProcess Lib "kernel32" (dwExitCode As DWord)
|
---|
397 | Declare Sub ExitThread Lib "kernel32" (dwExitCode As DWord)
|
---|
398 | Declare Sub FatalAppExit Lib "kernel32" Alias _FuncName_FatalAppExit (Action As DWord, pMessageText As PCTSTR)
|
---|
399 | Declare Function FileTimeToDosDateTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpFatDate As Word, ByRef lpFatTime As Word) As BOOL
|
---|
400 | Declare Function FileTimeToLocalFileTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpLocalFileTime As FILETIME) As BOOL
|
---|
401 | Declare Function FileTimeToSystemTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpSystemTime As SYSTEMTIME) As BOOL
|
---|
402 | Declare Sub FillMemory Lib "kernel32" Alias "RtlFillMemory" (pDest As VoidPtr, stLength As SIZE_T, c As Byte)
|
---|
403 | Declare Function FindClose Lib "kernel32" (hFindFile As HANDLE) As BOOL
|
---|
404 | Declare Function FindCloseChangeNotification Lib "kernel32" (hChangeHandle As HANDLE) As BOOL
|
---|
405 | Declare Function FindFirstChangeNotification Lib "kernel32" Alias _FuncName_FindFirstChangeNotification (
|
---|
406 | pPathName As PCTSTR,
|
---|
407 | bWatchSubtree As BOOL,
|
---|
408 | dwNotifyFilter As DWord
|
---|
409 | ) As HANDLE
|
---|
410 |
|
---|
411 | Type WIN32_FIND_DATAW
|
---|
412 | dwFileAttributes As DWord
|
---|
413 | ftCreationTime As FILETIME
|
---|
414 | ftLastAccessTime As FILETIME
|
---|
415 | ftLastWriteTime As FILETIME
|
---|
416 | nFileSizeHigh As DWord
|
---|
417 | nFileSizeLow As DWord
|
---|
418 | dwReserved0 As DWord
|
---|
419 | dwReserved1 As DWord
|
---|
420 | cFileName[ELM(MAX_PATH)] As WCHAR
|
---|
421 | cAlternateFileName[13] As WCHAR
|
---|
422 | End Type
|
---|
423 | Type WIN32_FIND_DATAA
|
---|
424 | dwFileAttributes As DWord
|
---|
425 | ftCreationTime As FILETIME
|
---|
426 | ftLastAccessTime As FILETIME
|
---|
427 | ftLastWriteTime As FILETIME
|
---|
428 | nFileSizeHigh As DWord
|
---|
429 | nFileSizeLow As DWord
|
---|
430 | dwReserved0 As DWord
|
---|
431 | dwReserved1 As DWord
|
---|
432 | cFileName[ELM(MAX_PATH)] As SByte
|
---|
433 | cAlternateFileName[13] As SByte
|
---|
434 | End Type
|
---|
435 | #ifdef UNICODE
|
---|
436 | TypeDef WIN32_FIND_DATA = WIN32_FIND_DATAW
|
---|
437 | #else
|
---|
438 | TypeDef WIN32_FIND_DATA = WIN32_FIND_DATAA
|
---|
439 | #endif
|
---|
440 | TypeDef LPWIN32_FIND_DATA = *WIN32_FIND_DATA
|
---|
441 | Declare Function FindFirstFile Lib "kernel32" Alias _FuncName_FindFirstFile (pFileName As PCTSTR, ByRef FindFildData As WIN32_FIND_DATA) As HANDLE
|
---|
442 | Declare Function FindNextChangeNotification Lib "kernel32" (hChangeHandle As HANDLE) As BOOL
|
---|
443 | Declare Function FindNextFile Lib "kernel32" Alias _FuncName_FindNextFile (hFindFile As HANDLE, ByRef FindFildData As WIN32_FIND_DATA) As BOOL
|
---|
444 | Declare Function FlushFileBuffers Lib "kernel32" (hFile As HANDLE) As BOOL
|
---|
445 | Declare Function FlushInstructionCache Lib "kernel32"(hProcess As HANDLE, pBaseAddress As VoidPtr, Size As SIZE_T) As BOOL
|
---|
446 |
|
---|
447 | Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H00000100
|
---|
448 | Const FORMAT_MESSAGE_IGNORE_INSERTS = &H00000200
|
---|
449 | Const FORMAT_MESSAGE_FROM_STRING = &H00000400
|
---|
450 | Const FORMAT_MESSAGE_FROM_HMODULE = &H00000800
|
---|
451 | Const FORMAT_MESSAGE_FROM_SYSTEM = &H00001000
|
---|
452 | Const FORMAT_MESSAGE_ARGUMENT_ARRAY = &H00002000
|
---|
453 | Declare Function FormatMessage Lib "kernel32" Alias _FuncName_FormatMessage (dwFlags As DWord, lpSource As VoidPtr, dwMessageId As DWord, dwLanguageId As DWord, pBuffer As PTSTR, nSize As DWord, Arguments As *DWord) As DWord
|
---|
454 | Declare Function FreeEnvironmentStrings Lib "kernel32" Alias _FuncName_FreeEnvironmentStrings (pszEnvironmentBlock As PCTSTR) As BOOL
|
---|
455 | Declare Function FreeLibrary Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
|
---|
456 | Declare Sub FreeLibraryAndExitThread Lib "kernel32" (hModule As HANDLE, dwExitCode As DWord)
|
---|
457 | Declare Function GetCommandLineA Lib "kernel32" () As PCSTR
|
---|
458 | Declare Function GetCommandLineW Lib "kernel32" () As PCWSTR
|
---|
459 | #ifdef UNICODE
|
---|
460 | Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineW" () As PCWSTR
|
---|
461 | #else
|
---|
462 | Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As PCSTR
|
---|
463 | #endif
|
---|
464 | Declare Function GetCompressedFileSize Lib "kernel32" Alias _FuncName_GetCompressedFileSize (pFileName As PCTSTR, ByRef FileSizeHigh As DWord) As DWord
|
---|
465 |
|
---|
466 | Const MAX_COMPUTERNAME_LENGTH = 15
|
---|
467 | Declare Function GetComputerName Lib "kernel32" Alias _FuncName_GetComputerName (pBuffer As PTSTR, ByRef nSize As Long) As Long
|
---|
468 |
|
---|
469 | Declare Function GetCurrentDirectory Lib "kernel32" Alias _FuncName_GetCurrentDirectory (nBufferLength As DWord, pBuffer As PTSTR) As DWord
|
---|
470 | Declare Function GetCurrentProcess Lib "kernel32" () As HANDLE
|
---|
471 | Declare Function GetCurrentProcessId Lib "kernel32" () As DWord
|
---|
472 | Declare Function GetCurrentThread Lib "kernel32" () As HANDLE
|
---|
473 | Declare Function GetCurrentThreadId Lib "kernel32" () As DWord
|
---|
474 |
|
---|
475 | Const DATE_SHORTDATE = &H00000001
|
---|
476 | Const DATE_LONGDATE = &H00000002
|
---|
477 | Const DATE_USE_ALT_CALENDAR = &H00000004
|
---|
478 | Declare Function GetDateFormat Lib "kernel32" Alias _FuncName_GetDateFormat (Locale As LCID, dwFlags As DWord, ByRef Date As SYSTEMTIME, pFormat As PCTSTR, pDateStr As PTSTR, cchDate As Long) As Long
|
---|
479 |
|
---|
480 | Declare Function GetDiskFreeSpace Lib "kernel32" Alias _FuncName_GetDiskFreeSpace (pRootPathName As PCTSTR, lpSectorsPerCluster As *DWord, pBytesPerSector As *DWord, pNumberOfFreeClusters As *DWord, pTotalNumberOfClusters As *DWord) As BOOL
|
---|
481 | Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias _FuncName_GetDiskFreeSpaceEx (pDirectoryName As PCTSTR, ByRef lpFreeBytesAvailableToCaller As ULARGE_INTEGER, ByRef TotalNumberOfBytes As ULARGE_INTEGER, ByRef TotalNumberOfFreeBytes As ULARGE_INTEGER) As BOOL
|
---|
482 |
|
---|
483 | Const DRIVE_UNKNOWN = 0
|
---|
484 | Const DRIVE_NO_ROOT_DIR = 1
|
---|
485 | Const DRIVE_REMOVABLE = 2
|
---|
486 | Const DRIVE_FIXED = 3
|
---|
487 | Const DRIVE_REMOTE = 4
|
---|
488 | Const DRIVE_CDROM = 5
|
---|
489 | Const DRIVE_RAMDISK = 6
|
---|
490 | Declare Function GetVolumeInformation Lib "kernel32" Alias _FuncName_GetVolumeInformation (pRootPathName As PCTSTR, pVolumeNameBuffer As PTSTR, nVolumeNameSize As DWord, lpVolumeSerialNumber As *Word, lpMaximumComponentLength As *Word, lpFileSystemFlags As *Word, pFileSystemNameBuffer As PTSTR, nFileSystemNameSize As DWord) As BOOL
|
---|
491 | Declare Function GetDriveType Lib "kernel32" Alias _FuncName_GetDriveType (lpRootPathName As PCTSTR) As DWord
|
---|
492 |
|
---|
493 | Declare Function GetEnvironmentVariable Lib "kernel32" Alias _FuncName_GetEnvironmentVariable (lpName As PCTSTR, lpBuffer As PTSTR, nSize As DWord) As DWord
|
---|
494 | Declare Function GetEnvironmentStrings Lib "kernel32" Alias _FuncName_GetEnvironmentStrings () As VoidPtr
|
---|
495 | Const STILL_ACTIVE = &H00000103
|
---|
496 | Declare Function GetExitCodeProcess Lib "kernel32" (hProcess As HANDLE, ByRef lpExitCode As DWord) As BOOL
|
---|
497 | Declare Function GetExitCodeThread Lib "kernel32" (hThread As HANDLE, ByRef lpExitCode As DWord) As BOOL
|
---|
498 |
|
---|
499 | Declare Function GetFileAttributes Lib "kernel32" Alias _FuncName_GetFileAttributes (lpFileName As PCTSTR) As DWord
|
---|
500 | Type BY_HANDLE_FILE_INFORMATION
|
---|
501 | dwFileAttributes As DWord
|
---|
502 | ftCreationTime As FILETIME
|
---|
503 | ftLastAccessTime As FILETIME
|
---|
504 | ftLastWriteTime As FILETIME
|
---|
505 | dwVolumeSerialNumber As DWord
|
---|
506 | nFileSizeHigh As DWord
|
---|
507 | nFileSizeLow As DWord
|
---|
508 | nNumberOfLinks As DWord
|
---|
509 | nFileIndexHigh As DWord
|
---|
510 | nFileIndexLow As DWord
|
---|
511 | End Type
|
---|
512 | Declare Function GetFileInformationByHandle Lib "kernel32" (
|
---|
513 | ByVal hFile As HANDLE,
|
---|
514 | ByRef FileInformation As BY_HANDLE_FILE_INFORMATION
|
---|
515 | ) As BOOL
|
---|
516 | Declare Function GetFileSize Lib "kernel32" (hFile As HANDLE, pFileSizeHigh As *DWord) As DWord
|
---|
517 | Declare Function GetFileTime Lib "kernel32" (hFile As HANDLE, ByRef lpCreationTime As FILETIME, ByRef lpLastAccessTime As FILETIME, ByRef lpLastWriteTime As FILETIME) As BOOL
|
---|
518 |
|
---|
519 | Const FILE_TYPE_UNKNOWN = &H0000
|
---|
520 | Const FILE_TYPE_DISK = &H0001
|
---|
521 | Const FILE_TYPE_CHAR = &H0002
|
---|
522 | Const FILE_TYPE_PIPE = &H0003
|
---|
523 | Const FILE_TYPE_REMOTE = &H8000
|
---|
524 | Declare Function GetFileType Lib "kernel32" (hFile As HANDLE) As DWord
|
---|
525 |
|
---|
526 | Declare Function GetFullPathName Lib "kernel32" Alias _FuncName_GetFullPathName (lpFileName As PCSTR, nBufferLength As DWord, pBuffer As PSTR, lpFilePart As *DWord) As DWord
|
---|
527 | Declare Function GetLastError Lib "kernel32" () As DWord
|
---|
528 | Declare Sub GetLocalTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME)
|
---|
529 | Declare Function GetLogicalDrives Lib "kernel32" () As DWord
|
---|
530 | Declare Function GetLogicalDriveStrings Lib "kernel32" Alias _FuncName_GetLogicalDriveStrings (nBufferLength As DWord, pBuffer As PTSTR) As DWord
|
---|
531 | Declare Function GetLongPathName Lib "kernel32" Alias _FuncName_GetLongPathName (lpszShortPath As LPCTSTR, lpszLongPath As LPTSTR, cchBuffer As DWord) As DWord
|
---|
532 | Declare Function GetModuleFileName Lib "kernel32" Alias _FuncName_GetModuleFileName (hModule As HINSTANCE, lpFileName As PTSTR, nSize As DWord) As DWord
|
---|
533 | Declare Function GetModuleHandle Lib "kernel32" Alias _FuncName_GetModuleHandle (lpModuleName As PTSTR) As HINSTANCE
|
---|
534 | Declare Function GetOverlappedResult Lib "kernel32" (
|
---|
535 | hFile As HANDLE,
|
---|
536 | pOverlapped As *OVERLAPPED,
|
---|
537 | pNumberOfBytesTransferred AS *DWord,
|
---|
538 | bWait As BOOL
|
---|
539 | ) As BOOL
|
---|
540 | Type SYSTEM_POWER_STATUS
|
---|
541 | ACLineStatus As Byte
|
---|
542 | BatteryFlag As Byte
|
---|
543 | BatteryLifePercent As Byte
|
---|
544 | Reserved1 As Byte
|
---|
545 | BatteryLifeTime As Long
|
---|
546 | BatteryFullLifeTime As Long
|
---|
547 | End Type
|
---|
548 | Declare Function GetSystemPowerStatus Lib "kernel32" (ByRef SystemPowerStatus As SYSTEM_POWER_STATUS) As Long
|
---|
549 | Declare Function GetPriorityClass Lib "kernel32" (hProcess As HANDLE) As DWord
|
---|
550 | Declare Function GetProcAddress Lib "kernel32" (hModule As HINSTANCE, pProcName As PCSTR) As DWord
|
---|
551 | Declare Function GetProcessAffinityMask Lib "kernel32" (
|
---|
552 | hProcess As HANDLE,
|
---|
553 | ByRef ProcessAffinityMask As ULONG_PTR,
|
---|
554 | ByRef SystemAffinityMask As ULONG_PTR
|
---|
555 | ) As BOOL
|
---|
556 | Declare Function GetProcessHeap Lib "kernel32" () As HANDLE
|
---|
557 | Declare Function GetShortPathName Lib "kernel32" Alias _FuncName_GetShortPathName (
|
---|
558 | pszLongPath As PCTSTR,
|
---|
559 | pszShortPath As PTSTR,
|
---|
560 | cchBuffer As DWord
|
---|
561 | ) As DWord
|
---|
562 |
|
---|
563 | Declare Sub GetStartupInfo Lib "kernel32" Alias _FuncName_GetStartupInfo (ByRef StartupInfo As STARTUPINFO)
|
---|
564 |
|
---|
565 | Const STD_INPUT_HANDLE = -10
|
---|
566 | Const STD_OUTPUT_HANDLE = -11
|
---|
567 | Const STD_ERROR_HANDLE = -12
|
---|
568 | Declare Function GetStdHandle Lib "kernel32" (nStdHandle As DWord) As HANDLE
|
---|
569 |
|
---|
570 | Declare Function GetSystemDirectory Lib "kernel32" Alias _FuncName_GetSystemDirectory (pBuffer As PTSTR, uSize As DWord) As DWord
|
---|
571 |
|
---|
572 | Type SYSTEM_INFO
|
---|
573 | dwOemId As DWord
|
---|
574 | dwPageSize As DWord
|
---|
575 | lpMinimumApplicationAddress As VoidPtr
|
---|
576 | lpMaximumApplicationAddress As VoidPtr
|
---|
577 | dwActiveProcessorMask As ULONG_PTR
|
---|
578 | dwNumberOfProcessors As DWord
|
---|
579 | dwProcessorType As DWord
|
---|
580 | dwAllocationGranularity As DWord
|
---|
581 | wProcessorLevel As Word
|
---|
582 | wProcessorRevision As Word
|
---|
583 | End Type
|
---|
584 | Declare Sub GetSystemInfo Lib "kernel32" (ByRef SystemInfo As SYSTEM_INFO)
|
---|
585 |
|
---|
586 | Declare Sub GetSystemTime Lib "kernel32" (ByRef SystemTime As SYSTEMTIME)
|
---|
587 | Declare Sub GetSystemTimeAsFileTime Lib "kernel32" (ByRef SystemTimeAsFileTime As FILETIME)
|
---|
588 |
|
---|
589 | Declare Function GetTempFileName Lib "kernel32" Alias _FuncName_GetTempFileName (
|
---|
590 | pPathName As PCTSTR,
|
---|
591 | pPrefixString As PCTSTR,
|
---|
592 | uUnique As DWord,
|
---|
593 | pTempFileName As PTSTR
|
---|
594 | ) As DWord
|
---|
595 | Declare Function GetTempPath Lib "kernel32" Alias _FuncName_GetTempPath (nBufferLength As DWord, lpBuffer As PTSTR) As DWord
|
---|
596 | Declare Function GetThreadContext Lib "kernel32" (hThread As HANDLE, ByRef Context As CONTEXT) As BOOL
|
---|
597 | /*
|
---|
598 | Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
|
---|
599 | Const THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWEST+1
|
---|
600 | Const THREAD_PRIORITY_NORMAL = 0
|
---|
601 | Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
|
---|
602 | Const THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHEST-1
|
---|
603 | Const THREAD_PRIORITY_ERROR_RETURN = LONG_MAX
|
---|
604 | Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
|
---|
605 | Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
|
---|
606 | */
|
---|
607 | Declare Function GetThreadPriority Lib "kernel32" (hThread As HANDLE) As Long
|
---|
608 | Declare Function GetThreadPriorityBoost Lib "kernel32" (
|
---|
609 | hThread As HANDLE,
|
---|
610 | ByRef pDisablePriorityBoost As BOOL) As BOOL
|
---|
611 | Declare Function GetTickCount Lib "kernel32" () As DWord
|
---|
612 |
|
---|
613 | Const TIME_NOMINUTESORSECONDS = &H00000001
|
---|
614 | Const TIME_NOSECONDS = &H00000002
|
---|
615 | Const TIME_NOTIMEMARKER = &H00000004
|
---|
616 | Const TIME_FORCE24HOURFORMAT = &H00000008
|
---|
617 | Declare Function GetTimeFormat Lib "kernel32" Alias _FuncName_GetTimeFormat (Locale As LCID, dwFlags As DWord, ByRef Time As SYSTEMTIME, lpFormat As PCTSTR, lpTimeStr As PTSTR, cchTime As DWord) As BOOL
|
---|
618 | Declare Function GetUserDefaultLCID Lib "kernel32" () As LCID
|
---|
619 | Declare Function GetUserName Lib "advapi32" Alias _FuncName_GetUserName (pBuffer As PTSTR, ByRef nSize As DWord) As BOOL
|
---|
620 | Declare Function GetVersionEx Lib "kernel32" Alias _FuncName_GetVersionEx (ByRef VersionInformation As OSVERSIONINFO) As BOOL
|
---|
621 | Declare Function GetWindowsDirectory Lib "kernel32" Alias _FuncName_GetWindowsDirectory (pBuffer As PTSTR, uSize As DWord) As DWord
|
---|
622 | Declare Function GlobalAlloc Lib "kernel32" (uFlags As DWord, dwBytes As SIZE_T) As HGLOBAL
|
---|
623 | Declare Function GlobalFrags Lib "kernel32" (hMem As HGLOBAL) As DWord
|
---|
624 | Declare Function GlobalFree Lib "kernel32" (hMem As HGLOBAL) As HGLOBAL
|
---|
625 | Declare Function GlobalHandle Lib "kernel32" (pMem As VoidPtr) As HGLOBAL
|
---|
626 | Declare Function GlobalLock Lib "kernel32" (hMem As HGLOBAL) As VoidPtr
|
---|
627 |
|
---|
628 | Type MEMORYSTATUS
|
---|
629 | dwLength As DWord
|
---|
630 | dwMemoryLoad As DWord
|
---|
631 | dwTotalPhys As SIZE_T
|
---|
632 | dwAvailPhys As SIZE_T
|
---|
633 | dwTotalPageFile As SIZE_T
|
---|
634 | dwAvailPageFile As SIZE_T
|
---|
635 | dwTotalVirtual As SIZE_T
|
---|
636 | dwAvailVirtual As SIZE_T
|
---|
637 | End Type
|
---|
638 | Declare Sub GlobalMemoryStatus Lib "kernel32" (ByRef lpMemStatus As MEMORYSTATUS)
|
---|
639 |
|
---|
640 | Declare Function GlobalReAlloc Lib "kernel32" (hMem As HGLOBAL, dwBytes As SIZE_T, uFlags As DWord) As HGLOBAL
|
---|
641 | Declare Function GlobalSize Lib "kernel32" (hMem As HGLOBAL) As SIZE_T
|
---|
642 | Declare Function GlobalUnlock Lib "kernel32" (hMem As HGLOBAL) As BOOL
|
---|
643 | Declare Function HeapAlloc Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, dwBytes As SIZE_T) As VoidPtr
|
---|
644 | Declare Function HeapCreate Lib "kernel32" (flOptions As DWord, dwInitialSize As SIZE_T, dwMaximumSize As SIZE_T) As HANDLE
|
---|
645 | Declare Function HeapDestroy Lib "kernel32" (hHeap As HANDLE) As Long
|
---|
646 | Declare Function HeapFree Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr) As Long
|
---|
647 | Declare Function HeapReAlloc Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr, dwBytes As SIZE_T) As VoidPtr
|
---|
648 | Declare Function HeapSize Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr) As SIZE_T
|
---|
649 | Declare Sub InitializeCriticalSection Lib "kernel32" (ByRef CriticalSection As CRITICAL_SECTION)
|
---|
650 | Declare Function IsBadReadPtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
|
---|
651 | Declare Function IsBadWritePtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
|
---|
652 | Declare Function IsDBCSLeadByte Lib "kernel32" (TestChar As Byte) As BOOL
|
---|
653 |
|
---|
654 | #ifdef _WIN64
|
---|
655 | Declare Function IsWow64Process Lib "kernel32" (hProcess As HANDLE, ByRef bWow64Process As BOOL) As BOOL
|
---|
656 | #endif
|
---|
657 |
|
---|
658 | Const LCMAP_LOWERCASE = &H00000100 ' lower case letters
|
---|
659 | Const LCMAP_UPPERCASE = &H00000200 ' upper case letters
|
---|
660 | Const LCMAP_SORTKEY = &H00000400 ' WC sort key (normalize)
|
---|
661 | Const LCMAP_BYTEREV = &H00000800 ' byte reversal
|
---|
662 | Const LCMAP_HIRAGANA = &H00100000 ' map katakana to hiragana
|
---|
663 | Const LCMAP_KATAKANA = &H00200000 ' map hiragana to katakana
|
---|
664 | Const LCMAP_HALFWIDTH = &H00400000 ' map double byte to single byte
|
---|
665 | Const LCMAP_FULLWIDTH = &H00800000 ' map single byte to double byte
|
---|
666 | Const LCMAP_LINGUISTIC_CASING = &H01000000 ' use linguistic rules for casing
|
---|
667 | Const LCMAP_SIMPLIFIED_CHINESE = &H02000000 ' map traditional chinese to simplified chinese
|
---|
668 | Const LCMAP_TRADITIONAL_CHINESE = &H04000000 ' map simplified chinese to traditional chinese
|
---|
669 | Declare Function LCMapString Lib "kernel32" Alias _FuncName_LCMapString (Locale As LCID, dwMapFlags As DWord, lpSrcStr As LPCTSTR, cchSrc As Long, lpDestStr As LPTSTR, cchDest As Long) As Long
|
---|
670 |
|
---|
671 | Declare Sub LeaveCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
|
---|
672 | Declare Function LocalAlloc Lib "kernel32" (uFlags As DWord, uBytes As SIZE_T) As HLOCAL
|
---|
673 | Declare Function LocalFileTimeToFileTime Lib "kernel32" (ByRef lpLocalFileTime As FILETIME, ByRef lpFileTime As FILETIME) As BOOL
|
---|
674 | Declare Function LocalFree Lib "kernel32" (hMem As HLOCAL) As HLOCAL
|
---|
675 | Declare Function LocalHandle Lib "kernel32" (pMem As VoidPtr) As HLOCAL
|
---|
676 | Declare Function LocalLock Lib "kernel32" (hMem As HLOCAL) As VoidPtr
|
---|
677 | Declare Function LocalReAlloc Lib "kernel32" (hMem As HLOCAL, dwBytes As SIZE_T, uFlags As DWord) As HLOCAL
|
---|
678 | Declare Function LocalSize Lib "kernel32" (hMem As HLOCAL) As SIZE_T
|
---|
679 | Declare Function LocalUnlock Lib "kernel32" (hMem As HLOCAL) As BOOL
|
---|
680 | Declare Function LockFile Lib "kernel32" (hFile As DWord, dwFileOffsetLow As DWord, dwFileOffsetHigh As DWord, nNumberOfBytesToLockLow As DWord, nNumberOfBytesToLockHigh As DWord) As BOOL
|
---|
681 | Declare Function LoadLibrary Lib "kernel32" Alias _FuncName_LoadLibrary (pLibFileName As PCTSTR) As HINSTANCE
|
---|
682 |
|
---|
683 | Const DONT_RESOLVE_DLL_REFERENCES = &h00000001
|
---|
684 | Const LOAD_LIBRARY_AS_DATAFILE = &h00000002
|
---|
685 | Const LOAD_WITH_ALTERED_SEARCH_PATH = &h00000008
|
---|
686 | Const LOAD_IGNORE_CODE_AUTHZ_LEVEL = &h00000010
|
---|
687 | Declare Function LoadLibraryEx Lib "kernel32" Alias _FuncName_LoadLibraryEx (pLibFileName As PCTSTR, hFile As HANDLE, dwFlags As DWord) As HINSTANCE
|
---|
688 |
|
---|
689 | Declare Function lstrcat Lib "kernel32" Alias _FuncName_lstrcat (lpString1 As LPTSTR, lpString2 As LPCTSTR) As LPTSTR
|
---|
690 | Declare Function lstrcmp Lib "kernel32" Alias _FuncName_lstrcmp (lpString1 As LPCTSTR, lpString2 As LPCTSTR) As Long
|
---|
691 | Declare Function lstrcmpi Lib "kernel32" Alias _FuncName_lstrcmpi (lpString1 As LPCTSTR, lpString2 As LPCTSTR) As Long
|
---|
692 | Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (lpString1 As LPTSTR, lpString2 As LPCTSTR) As LPTSTR
|
---|
693 | Declare Function lstrcpyn Lib "kernel32" Alias _FuncName_lstrcpyn (lpString1 As LPTSTR,ByVal lpString2 As LPCTSTR,ByVal iMaxLength As Long) As LPTSTR
|
---|
694 | Declare Function lstrlenA Lib "kernel32" (lpString As LPCSTR) As Long
|
---|
695 | Declare Function lstrlenW Lib "kernel32" (lpString As LPCWSTR) As Long
|
---|
696 | #ifdef UNICODE
|
---|
697 | Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (lpString As LPCWSTR) As Long
|
---|
698 | #else
|
---|
699 | Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As LPCSTR) As Long
|
---|
700 | #endif
|
---|
701 | Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
|
---|
702 | Declare Function MoveFile Lib "kernel32" Alias _FuncName_MoveFile (lpExistingFileName As LPCTSTR, lpNewFileName As LPCTSTR) As BOOL
|
---|
703 | Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As PVOID, pSrc As VoidPtr, length As SIZE_T)
|
---|
704 |
|
---|
705 | Declare Function MulDiv Lib "kernel32" (
|
---|
706 | nNumber As Long,
|
---|
707 | nNumerator As Long,
|
---|
708 | nDenominator As Long
|
---|
709 | ) As Long
|
---|
710 |
|
---|
711 | Const CP_ACP = 0 'default to ANSI code page
|
---|
712 | Const CP_OEMCP = 1 'default to OEM code page
|
---|
713 | Const CP_MACCP = 2 'default to MAC code page
|
---|
714 | Const CP_THREAD_ACP = 3 'current thread's ANSI code page
|
---|
715 | Const CP_SYMBOL = 42 'SYMBOL translations
|
---|
716 | Const CP_UTF7 = 65000 'UTF-7 translation
|
---|
717 | Const CP_UTF8 = 65001 'UTF-8 translation
|
---|
718 |
|
---|
719 | Declare Function MultiByteToWideChar Lib "kernel32" (CodePage As DWord, dwFlags As DWord, pMultiByteStr As PCSTR, cchMultiByte As Long, pWideCharStr As PWSTR, cchWideChar As Long) As Long
|
---|
720 | Declare Function OpenEvent Lib "kernel32" Alias _FuncName_OpenEvent (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
|
---|
721 | Declare Function OpenMutex Lib "kernel32" Alias _FuncName_OpenMutex (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
|
---|
722 | Declare Function OpenSemaphore Lib "kernel32" Alias _FuncName_OpenSemaphore (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
|
---|
723 | Declare Function OpenProcess Lib "kernel32" (dwDesiredAccess As DWord, bInheritHandle As Long, dwProcessId As DWord) As HANDLE
|
---|
724 | Declare Sub OutputDebugStringA Lib "kernel32" (pOutputString As PCSTR)
|
---|
725 | Declare Sub OutputDebugStringW Lib "kernel32" (pOutputString As PCWSTR)
|
---|
726 | #ifdef UNICODE
|
---|
727 | Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringW" (pOutputString As PCWSTR)
|
---|
728 | #else
|
---|
729 | Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (pOutputString As PCSTR)
|
---|
730 | #endif
|
---|
731 | Declare Function PulseEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
|
---|
732 | Declare Sub RaiseException Lib "kernel32" (
|
---|
733 | dwExceptionCode As DWord,
|
---|
734 | dwExceptionFlags As DWord,
|
---|
735 | NumberOfArguments As DWord,
|
---|
736 | pArguments As *ULONG_PTR)
|
---|
737 | Declare Function ReadFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToRead As DWord, lpNumberOfBytesRead As DWordPtr, ByRef lpOverlapped As OVERLAPPED) As BOOL
|
---|
738 | Declare Function ReadProcessMemory Lib "Kernel32" (hProcess As HANDLE, lpBaseAddress As VoidPtr, lpBuffer As VoidPtr, nSize As SIZE_T, lpNumberOfBytesRead As *SIZE_T) As BOOL
|
---|
739 | Declare Function ReleaseMutex Lib "kernel32" (hMutex As HANDLE) As BOOL
|
---|
740 | Declare Function ReleaseSemaphore Lib "kernel32" (hSemaphore As HANDLE, lReleaseCount As Long, ByRef lpPreviousCount As Long) As BOOL
|
---|
741 | Declare Function RemoveDirectory Lib "kernel32" Alias _FuncName_RemoveDirectory (lpPathName As LPCTSTR) As BOOL
|
---|
742 | Declare Function ResetEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
|
---|
743 | Declare Function ResumeThread Lib "kernel32" (hThread As HANDLE) As DWord
|
---|
744 | Declare Function SetComputerName Lib "kernel32" Alias _FuncName_SetComputerName (lpComputerName As LPCTSTR) As BOOL
|
---|
745 | Declare Function SetCurrentDirectory Lib "kernel32" Alias _FuncName_SetCurrentDirectory (lpPathName As LPCTSTR) As BOOL
|
---|
746 | Declare Function SearchPath Lib "kernel32" Alias _FuncName_SearchPath (pPath As PCSTR, pFileName As PCTSTR, pExtension As PCTSTR, BufferLength As DWord, pBuffer As PTSTR, ByRef pFilePart As PTSTR) As DWord
|
---|
747 | Declare Function SetEndOfFile Lib "kernel32" (hFile As HANDLE) As BOOL
|
---|
748 | Declare Function SetEnvironmentVariable Lib "kernel32" Alias _FuncName_SetEnvironmentVariable (lpName As LPCTSTR, lpValue As LPTSTR) As BOOL
|
---|
749 |
|
---|
750 | Const SEM_FAILCRITICALERRORS = &h0001
|
---|
751 | Const SEM_NOGPFAULTERRORBOX = &h0002
|
---|
752 | Const SEM_NOALIGNMENTFAULTEXCEPT = &h0004
|
---|
753 | Const SEM_NOOPENFILEERRORBOX = &h8000
|
---|
754 | Declare Function SetErrorMode Lib "kernel32" (uMode As DWord) As DWord
|
---|
755 | Declare Function SetEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
|
---|
756 | Declare Function SetFileAttributes Lib "kernel32" Alias _FuncName_SetFileAttributes (lpFileName As LPCTSTR, dwFileAttributes As DWord) As BOOL
|
---|
757 |
|
---|
758 | Const FILE_BEGIN = 0
|
---|
759 | Const FILE_CURRENT = 1
|
---|
760 | Const FILE_END = 2
|
---|
761 | Declare Function SetFilePointer Lib "kernel32" (hFile As HANDLE, lDistanceToMove As Long, lpDistanceToMoveHigh As DWordPtr, dwMoveMethod As DWord) As DWord
|
---|
762 |
|
---|
763 | Declare Function SetFileTime Lib "kernel32" (hFile As HANDLE, ByRef lpCreationTime As FILETIME, ByRef lpLastAccessTime As FILETIME, ByRef lpLastWriteTime As FILETIME) As BOOL
|
---|
764 | Declare Sub SetLastError Lib "kernel32" (dwErrCode As DWord)
|
---|
765 | Declare Sub SetLastErrorEx Lib "kernel32" (dwErrCode As DWord, dwType As DWord)
|
---|
766 | Declare Function SetLocalTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME) As BOOL
|
---|
767 | Declare Function SetPriorityClass Lib "kernel32" (hProcess As HANDLE, dwPriorityClass As DWord) As BOOL
|
---|
768 | Declare Function SetThreadContext Lib "kernel32" (hThread As HANDLE, ByRef Context As CONTEXT) As BOOL
|
---|
769 | Declare Function SetThreadPriority Lib "kernel32" (hThread As HANDLE, nPriority As Long) As BOOL
|
---|
770 | Declare Function SetThreadPriorityBoost Lib "kernel32" (
|
---|
771 | hThread As HANDLE,
|
---|
772 | DisablePriorityBoost As BOOL
|
---|
773 | ) As BOOL
|
---|
774 |
|
---|
775 | TypeDef PTOP_LEVEL_EXCEPTION_FILTER = *Function(ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
|
---|
776 |
|
---|
777 | Declare Function SetUnhandledExceptionFilter Lib "kernel32" (pTopLevelExceptionFilter As PTOP_LEVEL_EXCEPTION_FILTER) As PTOP_LEVEL_EXCEPTION_FILTER
|
---|
778 |
|
---|
779 | Const INFINITE = &HFFFFFFFF
|
---|
780 | Declare Sub Sleep Lib "kernel32" (dwMilliseconds As DWord)
|
---|
781 | Declare Function SleepEx Lib "kernel32" (dwMilliseconds As DWord, bAlertable As BOOL) As DWord
|
---|
782 |
|
---|
783 | Declare Function SuspendThread Lib "kernel32" (hThread As HANDLE) As DWord
|
---|
784 | Declare Function SystemTimeToFileTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME, ByRef lpFileTime As FILETIME) As BOOL
|
---|
785 | Declare Function TerminateProcess Lib "kernel32" (hProcess As HANDLE, dwExitCode As DWord) As BOOL
|
---|
786 | Declare Function TerminateThread Lib "kernel32" (hThread As HANDLE, dwExitCode As DWord) As BOOL
|
---|
787 | Declare Function TlsAlloc Lib "kernel32" () As DWord
|
---|
788 | Declare Function TlsFree Lib "kernel32" (dwTlsIndex As DWord) As BOOL
|
---|
789 | Declare Function TlsGetValue Lib "kernel32" (dwTlsIndex As DWord) As VoidPtr
|
---|
790 | Declare Function TlsSetValue Lib "kernel32" (dwTlsIndex As DWord, pTlsValue As VoidPtr) As BOOL
|
---|
791 | Declare Function UnlockFile Lib "kernel32" (hFile As HANDLE, dwFileOffsetLow As DWord, dwFileOffsetHigh As DWord, nNumberOfBytesToUnlockLow As DWord, nNumberOfBytesToUnlockHigh As DWord) As BOOL
|
---|
792 | Declare Function UnhandledExceptionFilter Lib "kernel32" (ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
|
---|
793 | Declare Function VirtualAlloc Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, flAllocationType As DWord, flProtect As DWord) As VoidPtr
|
---|
794 | Declare Function VirtualFree Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, dwFreeType As DWord) As BOOL
|
---|
795 | Declare Function VirtualLock Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T) As BOOL
|
---|
796 | Declare Function VirtualProtect Lib "kernel32" (
|
---|
797 | pAddress As VoidPtr,
|
---|
798 | Size As SIZE_T,
|
---|
799 | flNewProtect As DWord,
|
---|
800 | ByRef flOldProtect As DWord
|
---|
801 | ) As BOOL
|
---|
802 | Declare Function VirtualProtectEx Lib "kernel32" (
|
---|
803 | hProcess As HANDLE,
|
---|
804 | pAddress As VoidPtr,
|
---|
805 | Size As SIZE_T,
|
---|
806 | flNewProtect As DWord,
|
---|
807 | ByRef flOldProtect As DWord
|
---|
808 | ) As BOOL
|
---|
809 | Declare Function VirtualQuery Lib "kernel32" (
|
---|
810 | pAddress As VoidPtr,
|
---|
811 | ByRef mbi As MEMORY_BASIC_INFORMATION,
|
---|
812 | Length As SIZE_T
|
---|
813 | ) As SIZE_T
|
---|
814 | Declare Function VirtualQueryEx Lib "kernel32" (
|
---|
815 | hProcess As HANDLE,
|
---|
816 | pAddress As VoidPtr,
|
---|
817 | ByRef mbi As MEMORY_BASIC_INFORMATION,
|
---|
818 | Length As SIZE_T
|
---|
819 | ) As SIZE_T
|
---|
820 | Declare Function VirtualUnlock Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T) As BOOL
|
---|
821 | Declare Function WaitForMultipleObjects Lib "kernel32" (nCount As DWord, pHandles As *HANDLE, fWaitAll As BOOL, dwMilliseconds As DWord) As DWord
|
---|
822 | Declare Function WaitForMultipleObjectsEx Lib "kernel32" (nCount As DWord, pHandles As *HANDLE, fWaitAll As BOOL, dwMilliseconds As DWord, bAlertable As BOOL) As DWord
|
---|
823 | Declare Function WaitForSingleObject Lib "kernel32" (hHandle As HANDLE, dwMilliseconds As DWord) As DWord
|
---|
824 | Declare Function WaitForSingleObjectEx Lib "kernel32" (hHandle As HANDLE, dwMilliseconds As DWord, bAlertable As BOOL) As DWord
|
---|
825 |
|
---|
826 | Const WC_COMPOSITECHECK = &H00000200
|
---|
827 | Const WC_DISCARDNS = &H00000010
|
---|
828 | Const WC_SEPCHARS = &H00000020
|
---|
829 | Const WC_DEFAULTCHAR = &H00000040
|
---|
830 | Const WC_NO_BEST_FIT_CHARS = &H00000400
|
---|
831 | Declare Function WideCharToMultiByte Lib "Kernel32" (
|
---|
832 | CodePage As DWord,
|
---|
833 | dwFlags As DWord,
|
---|
834 | pWideCharStr As PCWSTR,
|
---|
835 | cchWideChar As Long,
|
---|
836 | pMultiByteStr As PSTR,
|
---|
837 | cbMultiByte As Long,
|
---|
838 | pDefaultChar As PCSTR,
|
---|
839 | pUsedDefaultChar As *BOOL
|
---|
840 | ) As Long
|
---|
841 |
|
---|
842 | Declare Function WriteFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToWrite As DWord, lpNumberOfBytesWritten As DWordPtr, ByRef lpOverlapped As OVERLAPPED) As BOOL
|
---|
843 | Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (Destination As VoidPtr, dwLength As DWord)
|
---|
844 |
|
---|
845 | '
|
---|
846 | ' Wait functions' results.
|
---|
847 | '
|
---|
848 | Const WAIT_FAILED = (&hFFFFFFFF As DWord)
|
---|
849 | Const WAIT_OBJECT_0 = ((STATUS_WAIT_0 ) + 0)
|
---|
850 |
|
---|
851 | Const WAIT_ABANDONED = ((STATUS_ABANDONED_WAIT_0 ) + 0)
|
---|
852 | Const WAIT_ABANDONED_0 = ((STATUS_ABANDONED_WAIT_0 ) + 0)
|
---|
853 |
|
---|
854 | Const WAIT_IO_COMPLETION = STATUS_USER_APC
|
---|
855 |
|
---|
856 | Declare Function FindResource Lib "kernel32" Alias _FuncName_FindResource (hInstance As HINSTANCE, lpName As LPCTSTR, lpType As LPCTSTR) As HRSRC
|
---|
857 | Declare Function LoadResource Lib "kernel32" (hModule As HMODULE, hResInfo As HRSRC) As HGLOBAL
|
---|
858 | Declare Function FreeResource Lib "kernel32" (hResData As HGLOBAL) As BOOL
|
---|
859 | Declare Function LockResource Lib "kernel32" (hResData As HGLOBAL) As VoidPtr
|
---|
860 | Declare Function SizeofResource Lib "kernel32" (hModule As HANDLE, hResInfo As HRSRC) As DWord
|
---|
861 |
|
---|
862 | Declare Function ExpandEnvironmentStrings Lib "kernel32" Alias _FuncName_ExpandEnvironmentStrings (lpSrc As LPCTSTR, lpDst As LPTSTR, nSize As DWord) As DWord
|
---|
863 |
|
---|
864 | Type DCB
|
---|
865 | DCBlength As DWord
|
---|
866 | BaudRate As DWord
|
---|
867 | fBitFields As DWord
|
---|
868 | wReserved As Word
|
---|
869 | XonLim As Word
|
---|
870 | XoffLim As Word
|
---|
871 | ByteSize As Byte
|
---|
872 | Parity As Byte
|
---|
873 | StopBits As Byte
|
---|
874 | XonChar As CHAR
|
---|
875 | XoffChar As CHAR
|
---|
876 | ErrorChar As CHAR
|
---|
877 | EofChar As CHAR
|
---|
878 | EvtChar As CHAR
|
---|
879 | wReserved1 As Word
|
---|
880 | End Type
|
---|
881 |
|
---|
882 | Type COMMTIMEOUTS
|
---|
883 | ReadIntervalTimeout As DWord
|
---|
884 | ReadTotalTimeoutMultiplier As DWord
|
---|
885 | ReadTotalTimeoutConstant As DWord
|
---|
886 | WriteTotalTimeoutMultiplier As DWord
|
---|
887 | WriteTotalTimeoutConstant As DWord
|
---|
888 | End Type
|
---|
889 | Type COMSTAT
|
---|
890 | fCoBitFlds As Long 'See Comment in Win32API.Txt
|
---|
891 | cbInQue As DWord
|
---|
892 | cbOutQue As DWord
|
---|
893 | End Type
|
---|
894 | Declare Function SetCommState Lib "kernel32" (hCommDev As HANDLE, ByRef dcb As DCB) As BOOL
|
---|
895 | Declare Function SetCommTimeouts Lib "kernel32" (hFile As HANDLE ,ByRef pCommTimeouts As COMMTIMEOUTS) As BOOL
|
---|
896 | Declare Function ClearCommError Lib "kernel32" (hCommDevs As HANDLE, ByRef Errors As DWord, ByRef Stat As COMSTAT) As BOOL
|
---|
897 | Declare Function EscapeCommFunction Lib "kernel32" (nCid As HANDLE, ByVal nFunc As DWord) As BOOL
|
---|
898 | Declare Function GetCommModemStatus Lib "kernel32" (hFile As HANDLE, ByRef ModemStat As DWord) As BOOL
|
---|
899 | Declare Function SetCommMask Lib "kernel32" (hFile As HANDLE, dwEvtMask As DWord) As BOOL
|
---|
900 | Declare Function WaitCommEvent Lib "kernel32" (hFile As HANDLE, ByRef EvtMask As DWord, lpOverlapped As *OVERLAPPED) As BOOL
|
---|
901 |
|
---|
902 | Declare Function OpenProcessToken Lib "advapi32" (ProcessHandle As HANDLE, DesiredAccess As DWord, ByRef TokenHandle As HANDLE) As BOOL
|
---|
903 | Declare Function LookupPrivilegeValue Lib "advapi32" Alias _FuncName_LookupPrivilegeValue (lpSystemName As LPCTSTR, lpName As LPCTSTR, ByRef Luid As LUID) As Long
|
---|
904 | Declare Function AdjustTokenPrivileges Lib "advapi32" (TokenHandle As Long, DisableAllPrivileges As Long,_
|
---|
905 | ByRef NewState As TOKEN_PRIVILEGES, BufferLength As Long,
|
---|
906 | ByRef PreviousState As TOKEN_PRIVILEGES, ByRef ReturnLength As Long) As Long
|
---|
907 |
|
---|
908 | #endif '_INC_SYSTEM
|
---|