source: Include/api_system.sbp@ 141

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

#50 API宣言の変更完了

File size: 64.9 KB
Line 
1' api_system.sbp - System API
2
3#ifndef _INC_SYSTEM
4#define _INC_SYSTEM
5
6#ifdef UNICODE
7Const _FuncName_CompareString = "CompareStringW"
8Const _FuncName_CopyFile = "CopyFileW"
9Const _FuncName_CreateDirectory = "CreateDirectoryW"
10Const _FuncName_CreateEvent = "CreateEventW"
11Const _FuncName_CreateMutex = "CreateMutexW"
12Const _FuncName_CreateSemaphore = "CreateSemaphoreW"
13Const _FuncName_CreateWaitableTimer = "CreateWaitableTimerW"
14Const _FuncName_CreateFile = "CreateFileW"
15Const _FuncName_CreateFileMapping = "CreateFileMappingW"
16Const _FuncName_OpenFileMapping = "OpenFileMappingW"
17Const _FuncName_CreateMailslot = "CreateMailslotW"
18Const _FuncName_CreateProcess = "CreateProcessW"
19Const _FuncName_DeleteFile = "DeleteFileW"
20Const _FuncName_FatalAppExit = "FatalAppExitW"
21Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationW"
22Const _FuncName_FindFirstFile = "FindFirstFileW"
23Const _FuncName_FindNextFile = "FindNextFileW"
24Const _FuncName_FormatMessage = "FormatMessageW"
25Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsW"
26Const _FuncName_GetCompressedFileSize = "GetCompressedFileSizeW"
27Const _FuncName_GetComputerName = "GetComputerNameW"
28Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryW"
29Const _FuncName_GetDateFormat = "GetDateFormatW"
30Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceW"
31Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExW"
32Const _FuncName_GetVolumeInformation = "GetVolumeInformationW"
33Const _FuncName_GetDriveType = "GetDriveTypeW"
34Const _FuncName_GetEnvironmentVariable = "GetEnvironmentVariableW"
35Const _FuncName_GetEnvironmentStrings = "GetEnvironmentStringsW"
36Const _FuncName_GetFileAttributes = "GetFileAttributesW"
37Const _FuncName_GetFullPathName = "GetFullPathNameW"
38Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsW"
39Const _FuncName_GetModuleFileName = "GetModuleFileNameW"
40Const _FuncName_GetModuleHandle = "GetModuleHandleW"
41Const _FuncName_GetShortPathName = "GetShortPathNameW"
42Const _FuncName_GetStartupInfo = "GetStartupInfoW"
43Const _FuncName_GetSystemDirectory = "GetSystemDirectoryW"
44Const _FuncName_GetTempFileName = "GetTempFileNameW"
45Const _FuncName_GetTempPath = "GetTempPathW"
46Const _FuncName_GetTimeFormat = "GetTimeFormatW"
47Const _FuncName_GetUserName = "GetUserNameW"
48Const _FuncName_GetVersionEx = "GetVersionExW"
49Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryW"
50Const _FuncName_LCMapString = "LCMapStringW"
51Const _FuncName_LoadLibrary = "LoadLibraryW"
52Const _FuncName_LoadLibraryEx = "LoadLibraryExW"
53Const _FuncName_lstrcat = "lstrcatW"
54Const _FuncName_lstrcmp = "lstrcmpW"
55Const _FuncName_lstrcmpi = "lstrcmpiW"
56Const _FuncName_lstrcpy = "lstrcpyW"
57Const _FuncName_MoveFile = "MoveFileW"
58Const _FuncName_OpenEvent = "OpenEventW"
59Const _FuncName_OpenMutex = "OpenMutexW"
60Const _FuncName_OpenSemaphore = "OpenSemaphoreW"
61Const _FuncName_OpenWaitableTimer = "OpenWaitableTimerW"
62Const _FuncName_RemoveDirectory = "RemoveDirectoryW"
63Const _FuncName_SetComputerName = "SetComputerNameW"
64Const _FuncName_SetCurrentDirectory = "SetCurrentDirectoryW"
65Const _FuncName_SearchPath = "SearchPathW"
66Const _FuncName_SetEnvironmentVariable = "SetEnvironmentVariableW"
67Const _FuncName_SetFileAttributes = "SetFileAttributesW"
68#else
69Const _FuncName_CompareString = "CompareStringA"
70Const _FuncName_CopyFile = "CopyFileA"
71Const _FuncName_CreateDirectory = "CreateDirectoryA"
72Const _FuncName_CreateEvent = "CreateEventA"
73Const _FuncName_CreateMutex = "CreateMutexA"
74Const _FuncName_CreateSemaphore = "CreateSemaphoreA"
75Const _FuncName_CreateWaitableTimer = "CreateWaitableTimerA"
76Const _FuncName_CreateFile = "CreateFileA"
77Const _FuncName_CreateFileMapping = "CreateFileMappingA"
78Const _FuncName_OpenFileMapping = "OpenFileMappingA"
79Const _FuncName_CreateMailslot = "CreateMailslotA"
80Const _FuncName_CreateProcess = "CreateProcessA"
81Const _FuncName_DeleteFile = "DeleteFileA"
82Const _FuncName_FatalAppExit = "FatalAppExitA"
83Const _FuncName_FindFirstChangeNotification = "FindFirstChangeNotificationA"
84Const _FuncName_FindFirstFile = "FindFirstFileA"
85Const _FuncName_FindNextFile = "FindNextFileA"
86Const _FuncName_FormatMessage = "FormatMessageA"
87Const _FuncName_FreeEnvironmentStrings = "FreeEnvironmentStringsA"
88Const _FuncName_GetCompressedFileSize = "GetCompressedFileSizeA"
89Const _FuncName_GetComputerName = "GetComputerNameA"
90Const _FuncName_GetCurrentDirectory = "GetCurrentDirectoryA"
91Const _FuncName_GetDateFormat = "GetDateFormatA"
92Const _FuncName_GetDiskFreeSpace = "GetDiskFreeSpaceA"
93Const _FuncName_GetDiskFreeSpaceEx = "GetDiskFreeSpaceExA"
94Const _FuncName_GetVolumeInformation = "GetVolumeInformationA"
95Const _FuncName_GetDriveType = "GetDriveTypeA"
96Const _FuncName_GetEnvironmentVariable = "GetEnvironmentVariableA"
97Const _FuncName_GetEnvironmentStrings = "GetEnvironmentStringsA"
98Const _FuncName_GetFileAttributes = "GetFileAttributesA"
99Const _FuncName_GetFullPathName = "GetFullPathNameA"
100Const _FuncName_GetLogicalDriveStrings = "GetLogicalDriveStringsA"
101Const _FuncName_GetModuleFileName = "GetModuleFileNameA"
102Const _FuncName_GetModuleHandle = "GetModuleHandleA"
103Const _FuncName_GetShortPathName = "GetShortPathNameA"
104Const _FuncName_GetStartupInfo = "GetStartupInfoA"
105Const _FuncName_GetSystemDirectory = "GetSystemDirectoryA"
106Const _FuncName_GetTempFileName = "GetTempFileNameA"
107Const _FuncName_GetTempPath = "GetTempPathA"
108Const _FuncName_GetTimeFormat = "GetTimeFormatA"
109Const _FuncName_GetUserName = "GetUserNameA"
110Const _FuncName_GetVersionEx = "GetVersionExA"
111Const _FuncName_GetWindowsDirectory = "GetWindowsDirectoryA"
112Const _FuncName_LCMapString = "LCMapStringA"
113Const _FuncName_LoadLibrary = "LoadLibraryA"
114Const _FuncName_LoadLibraryEx = "LoadLibraryExA"
115Const _FuncName_lstrcat = "lstrcatA"
116Const _FuncName_lstrcmp = "lstrcmpA"
117Const _FuncName_lstrcmpi = "lstrcmpiA"
118Const _FuncName_lstrcpy = "lstrcpyA"
119Const _FuncName_MoveFile = "MoveFileA"
120Const _FuncName_OpenEvent = "OpenEventA"
121Const _FuncName_OpenMutex = "OpenMutexA"
122Const _FuncName_OpenSemaphore = "OpenSemaphoreA"
123Const _FuncName_OpenWaitableTimer = "OpenWaitableTimerA"
124Const _FuncName_RemoveDirectory = "RemoveDirectoryA"
125Const _FuncName_SetComputerName = "SetComputerNameA"
126Const _FuncName_SetCurrentDirectory = "SetCurrentDirectoryA"
127Const _FuncName_SearchPath = "SearchPathA"
128Const _FuncName_SetEnvironmentVariable = "SetEnvironmentVariableA"
129Const _FuncName_SetFileAttributes = "SetFileAttributesA"
130#endif
131
132
133'-------------------
134' default constants
135Const NULL = 0
136Const TRUE = 1
137Const FALSE = 0
138
139Const _System_TRUE = -1
140Const _System_FALSE = 0
141
142Const MAX_PATH = 260
143Const INVALID_HANDLE_VALUE = -1 As HANDLE
144Const INVALID_SET_FILE_POINTER = &HFFFFFFFF
145
146Const SYNCHRONIZE = &H00100000
147Const STANDARD_RIGHTS_REQUIRED = &H000F0000
148
149Const MAXIMUM_WAIT_OBJECTS = 64
150
151'-----------------
152' data structs
153Type LARGE_INTEGER
154 LowPart As DWord
155 HighPart As Long
156End Type
157Type ULARGE_INTEGER
158 LowPart As DWord
159 HighPart As DWord
160End Type
161
162
163'Globally Unique Identifier 128 bit(16 byte)
164Type GUID
165 Data1 As DWord
166 Data2 As Word
167 Data3 As Word
168 Data4[7] As Byte
169End Type
170
171' File structure
172Type SECURITY_ATTRIBUTES
173 nLength As DWord
174 lpSecurityDescriptor As VoidPtr
175 bInheritHandle As BOOL
176End Type
177
178Type OVERLAPPED
179 Internal As ULONG_PTR
180 InternalHigh As ULONG_PTR
181 Offset As DWord
182 OffsetHigh As DWord
183 hEvent As HANDLE
184End Type
185
186Type FILETIME
187 dwLowDateTime As DWord
188 dwHighDateTime As DWord
189End Type
190
191' System time
192Type SYSTEMTIME
193 wYear As Word
194 wMonth As Word
195 wDayOfWeek As Word
196 wDay As Word
197 wHour As Word
198 wMinute As Word
199 wSecond As Word
200 wMilliseconds As Word
201End Type
202
203#ifdef _WIN64
204Const CONTEXT_AMD64 = &h100000
205
206Const CONTEXT_CONTROL = (CONTEXT_AMD64 Or &h1)
207Const CONTEXT_INTEGER = (CONTEXT_AMD64 Or &h2)
208Const CONTEXT_SEGMENTS = (CONTEXT_AMD64 Or &h4)
209Const CONTEXT_FLOATING_POINT = (CONTEXT_AMD64 Or &h8)
210Const CONTEXT_DEBUG_REGISTERS = (CONTEXT_AMD64 Or &h10)
211
212Const CONTEXT_FULL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_FLOATING_POINT)
213
214Const CONTEXT_ALL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS Or CONTEXT_FLOATING_POINT Or CONTEXT_DEBUG_REGISTERS)
215
216Type Align(16) M128
217 Low As QWord
218 High As Int64
219End Type
220
221Type LEGACY_SAVE_AREA 'Winnt.h
222 ControlWord As Word
223 Reserved0 As Word
224 StatusWord As Word
225 Reserved1 As Word
226 TagWord As Word
227 Reserved2 As Word
228 ErrorOffset As DWord
229 ErrorSelector As Word
230 ErrorOpcode As Word
231 DataOffset As DWord
232 DataSelector As Word
233 Reserved3 As Word
234 FloatRegisters[ELM(8 * 10)] As Byte
235End Type
236
237Type Align(16) CONTEXT 'Winnt.h
238 'Register parameter home addresses.
239 P1Home As QWord
240 P2Home As QWord
241 P3Home As QWord
242 P4Home As QWord
243 P5Home As QWord
244 P6Home As QWord
245 'Control flags.
246 ContextFlags As DWord
247 MxCsr As DWord
248 'Segment Registers and processor flags.
249 SegCs As Word
250 SegDs As Word
251 SegEs As Word
252 SegFs As Word
253 SegGs As Word
254 SegSs As Word
255 EFlags As DWord
256 'Debug registers
257 Dr0 As QWord
258 Dr1 As QWord
259 Dr2 As QWord
260 Dr3 As QWord
261 Dr6 As QWord
262 Dr7 As QWord
263 'Integer registers.
264 Rax As QWord
265 Rcx As QWord
266 Rdx As QWord
267 Rbx As QWord
268 Rsp As QWord
269 Rbp As QWord
270 Rsi As QWord
271 Rdi As QWord
272 R8 As QWord
273 R9 As QWord
274 R10 As QWord
275 R11 As QWord
276 R12 As QWord
277 R13 As QWord
278 R14 As QWord
279 R15 As QWord
280 'Program counter.
281 Rip As QWord
282 'MMX/floating point state.
283 Header[ELM(2)] As M128
284 Legacy[ELM(8)] As M128
285 Xmm0 As M128
286 Xmm1 As M128
287 Xmm2 As M128
288 Xmm3 As M128
289 Xmm4 As M128
290 Xmm5 As M128
291 Xmm6 As M128
292 Xmm7 As M128
293 Xmm8 As M128
294 Xmm9 As M128
295 Xmm10 As M128
296 Xmm11 As M128
297 Xmm12 As M128
298 Xmm13 As M128
299 Xmm14 As M128
300 Xmm15 As M128
301 Reserve[ELM(96)] As Byte
302 'Vector registers
303 VectorRegisters[ELM(26)] As M128
304 VectorControl As QWord
305 'Special debug control registers.
306 DebugControl As QWord
307 LastBranchToRip As QWord
308 LastBranchFromRip As QWord
309 LastExceptionToRip As QWord
310 LastExceptionFromRip As QWord
311End Type
312
313#else
314
315Const SIZE_OF_80387_REGISTERS = 80
316Const MAXIMUM_SUPPORTED_EXTENSION = 512
317
318Type FLOATING_SAVE_AREA
319 ControlWord As DWord
320 StatusWord As DWord
321 TagWord As DWord
322 ErrorOffset As DWord
323 ErrorSelector As DWord
324 DataOffset As DWord
325 DataSelector As DWord
326 RegisterArea[ELM(SIZE_OF_80387_REGISTERS)] As Byte
327 Cr0NpxState As DWord
328End Type
329
330Const CONTEXT_i386 = &h00010000
331Const CONTEXT_i486 = &h00010000
332
333Const CONTEXT_CONTROL = (CONTEXT_i386 Or &h00000001) 'SS:SP, CS:IP, FLAGS, BP
334Const CONTEXT_INTEGER = (CONTEXT_i386 Or &h00000002) 'AX, BX, CX, DX, SI, DI
335Const CONTEXT_SEGMENTS = (CONTEXT_i386 Or &h00000004) 'DS, ES, FS, GS
336Const CONTEXT_FLOATING_POINT = (CONTEXT_i386 Or &h00000008) '387 state
337Const CONTEXT_DEBUG_REGISTERS = (CONTEXT_i386 Or &h00000010) 'DB 0-3,6,7
338Const CONTEXT_EXTENDED_REGISTERS = (CONTEXT_i386 Or &h0000002) 'cpu specific extensions
339
340Const CONTEXT_FULL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS)
341
342Const CONTEXT_ALL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS Or CONTEXT_FLOATING_POINT Or CONTEXT_DEBUG_REGISTERS Or CONTEXT_EXTENDED_REGISTERS)
343
344Type CONTEXT
345 ContextFlags As DWord
346
347 Dr0 As DWord
348 Dr1 As DWord
349 Dr2 As DWord
350 Dr3 As DWord
351 Dr6 As DWord
352 Dr7 As DWord
353
354 FloatSave As FLOATING_SAVE_AREA
355
356 SegGs As DWord
357 SegFs As DWord
358 SegEs As DWord
359 SegDs As DWord
360
361 Edi As DWord
362 Esi As DWord
363 Ebx As DWord
364 Edx As DWord
365 Ecx As DWord
366 Eax As DWord
367
368 Ebp As DWord
369 Eip As DWord
370 SegCs As DWord
371 EFlags As DWord
372 Esp As DWord
373 SegSs As DWord
374
375 ExtendedRegisters[ELM(MAXIMUM_SUPPORTED_EXTENSION)] As Byte
376End Type
377
378#endif
379
380' Global Memory Flags
381Const GMEM_FIXED = &H0000
382Const GMEM_MOVEABLE = &H0002
383Const GMEM_NOCOMPACT = &H0010
384Const GMEM_NODISCARD = &H0020
385Const GMEM_ZEROINIT = &H0040
386Const GMEM_MODIFY = &H0080
387Const GMEM_DISCARDABLE = &H0100
388Const GMEM_NOT_BANKED = &H1000
389Const GMEM_SHARE = &H2000
390Const GMEM_DDESHARE = &H2000
391Const GMEM_INVALID_HANDLE = &H8000
392Const GHND = GMEM_MOVEABLE or GMEM_ZEROINIT
393Const GPTR = GMEM_FIXED or GMEM_ZEROINIT
394Const GMEM_DISCARDED = &H4000
395
396
397' Heap
398Const HEAP_NO_SERIALIZE = &H00000001
399Const HEAP_GROWABLE = &H00000002
400Const HEAP_GENERATE_EXCEPTIONS = &H00000004
401Const HEAP_ZERO_MEMORY = &H00000008
402Const HEAP_REALLOC_IN_PLACE_ONLY = &H00000010
403
404
405' Locale
406Const LOCALE_SYSTEM_DEFAULT = &H400 'Standard Systemsprache
407Const LOCALE_USER_DEFAULT = &H800 'Standard Benutzersprache
408
409
410' Locale flag
411Const LOCALE_NOUSEROVERRIDE = &H80000000
412
413
414'Critical Section
415Type CRITICAL_SECTION
416 DebugInfo As VoidPtr
417 LockCount As Long
418 RecursionCount As Long
419 OwningThread As HANDLE
420 LockSemaphore As HANDLE
421 SpinCount As ULONG_PTR
422End Type
423
424
425'DllMain
426Const DLL_PROCESS_ATTACH = 1
427Const DLL_THREAD_ATTACH = 2
428Const DLL_THREAD_DETACH = 3
429Const DLL_PROCESS_DETACH = 0
430
431'Event
432Const EVENT_MODIFY_STATE = &H0002
433Const EVENT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
434
435'Mutex
436Const MUTANT_QUERY_STATE = &H0001
437Const MUTANT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or MUTANT_QUERY_STATE)
438Const MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS
439
440'Semaphore
441Const SEMAPHORE_MODIFY_STATE = &H0002
442Const SEMAPHORE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
443
444'Timer
445Const TIMER_QUERY_STATE = &H0001
446Const TIMER_MODIFY_STATE = &H0002
447Const TIMER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or TIMER_QUERY_STATE Or TIMER_MODIFY_STATE)
448
449'----------------------
450' Kernel Operation API
451Declare Function InterlockedIncrement Lib "kernel32" (ByRef lpAddend As Long) As Long
452Declare Function InterlockedDecrement Lib "kernel32" (ByRef lpAddend As Long) As Long
453Declare Function InterlockedExchange Lib "kernel32" (ByRef Target As Long, Value As Long) As Long
454Declare Function InterlockedCompareExchange Lib "kernel32" (ByRef Destination As Long, Exchange As Long, Comperand As Long) As Long
455Declare Function InterlockedExchangeAdd Lib "kernel32" (ByRef Addend As Long, Value As Long) As Long
456#ifdef _WIN64
457Declare Function InterlockedCompareExchangePointer Lib "kernel32" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
458Declare Function InterlockedExchangePointer Lib "kernel32" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
459#else
460Declare Function InterlockedCompareExchangePointer Lib "kernel32" Alias "InterlockedCompareExchange" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
461Declare Function InterlockedExchangePointer Lib "kernel32" Alias "InterlockedExchange" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
462#endif
463
464
465Declare Function Beep Lib "kernel32" (dwFreq As DWord, dwDuration As DWord) As BOOL
466Declare Function CloseHandle Lib "kernel32" (hObject As HANDLE) As BOOL
467
468Declare Function CompareFileTime Lib "kernel32" (ByRef FileTime1 As FILETIME, ByRef FileTime2 As FILETIME) As Long
469
470Const NORM_IGNORECASE = &H00000001
471Const NORM_IGNORENONSPACE = &H00000002
472Const NORM_IGNORESYMBOLS = &H00000004
473Const SORT_STRINGSORT = &H00001000
474Const NORM_IGNOREKANATYPE = &H00010000
475Const NORM_IGNOREWIDTH = &H00020000
476Const CSTR_LESS_THAN = 1
477Const CSTR_EQUAL = 2
478Const CSTR_GREATER_THAN = 3
479Declare 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
480
481Declare Function CopyFile Lib "kernel32" Alias _FuncName_CopyFile (pExistingFileName As PCTSTR, pNewFileName As PCTSTR, bFailIfExists As BOOL) As BOOL
482Declare Function CreateDirectory Lib "kernel32" Alias _FuncName_CreateDirectory (pPathName As PCTSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As BOOL
483Declare Function CreateEvent Lib "kernel32" Alias _FuncName_CreateEvent (pEventAttributes As *SECURITY_ATTRIBUTES, bManualReset As BOOL, bInitialState As BOOL, pName As PCTSTR) As HANDLE
484Declare Function CreateMutex Lib "kernel32" Alias _FuncName_CreateMutex (lpMutexAttributes As *SECURITY_ATTRIBUTES, bInitialOwner As BOOL, lpName As PCTSTR) As HANDLE
485Declare Function CreateSemaphore Lib "kernel32" Alias _FuncName_CreateSemaphore (pSemaphoreAttributes As *SECURITY_ATTRIBUTES, lInitialCount As Long, lMaximumCount As Long, pName As PCTSTR) As HANDLE
486
487TypeDef PTIMERAPCROUTINE = *Sub(lpArgToCompletionRoutine As VoidPtr, dwTimerLowValue As DWord, dwTimerHighValue As DWord)
488Declare Function CreateWaitableTimer Lib "kernel32" Alias _FuncName_CreateWaitableTimer (pTimerAttributes As *SECURITY_ATTRIBUTES, bManualReset As BOOL, pTimerName As PCTSTR) As HANDLE
489Declare Function OpenWaitableTimer Lib "kernel32" Alias _FuncName_OpenWaitableTimer (dwDesiredAccess As DWord, bInheritHandle As BOOL, pTimerName As PCTSTR) As HANDLE
490Declare 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
491Declare Function CancelWaitableTimer Lib "kernel32" (hTimer As HANDLE) As BOOL
492
493Const GENERIC_READ = &H80000000
494Const GENERIC_WRITE = &H40000000
495Const FILE_SHARE_READ = &H00000001
496Const FILE_SHARE_WRITE = &H00000002
497Const FILE_SHARE_DELETE = &H00000004
498Const CREATE_NEW = 1
499Const CREATE_ALWAYS = 2
500Const OPEN_EXISTING = 3
501Const OPEN_ALWAYS = 4
502Const TRUNCATE_EXISTING = 5
503Const FILE_ATTRIBUTE_READONLY = &H00000001
504Const FILE_ATTRIBUTE_HIDDEN = &H00000002
505Const FILE_ATTRIBUTE_SYSTEM = &H00000004
506Const FILE_ATTRIBUTE_DIRECTORY = &H00000010
507Const FILE_ATTRIBUTE_ARCHIVE = &H00000020
508Const FILE_ATTRIBUTE_ENCRYPTED = &H00000040
509Const FILE_ATTRIBUTE_NORMAL = &H00000080
510Const FILE_ATTRIBUTE_TEMPORARY = &H00000100
511Const FILE_ATTRIBUTE_SPARSE_FILE = &H00000200
512Const FILE_ATTRIBUTE_REPARSE_POINT = &H00000400
513Const FILE_ATTRIBUTE_COMPRESSED = &H00000800
514Const FILE_ATTRIBUTE_OFFLINE = &H00001000
515Const FILE_FLAG_WRITE_THROUGH = &H80000000
516Const FILE_FLAG_OVERLAPPED = &H40000000
517Const FILE_FLAG_NO_BUFFERING = &H20000000
518Const FILE_FLAG_RANDOM_ACCESS = &H10000000
519Const FILE_FLAG_SEQUENTIAL_SCAN = &H08000000
520Const FILE_FLAG_DELETE_ON_CLOSE = &H04000000
521Const FILE_FLAG_BACKUP_SEMANTICS = &H02000000
522Const FILE_FLAG_POSIX_SEMANTICS = &H01000000
523Const FILE_FLAG_OPEN_REPARSE_POINT = &H00200000
524Const FILE_FLAG_OPEN_NO_RECALL = &H00100000
525Declare 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
526
527Const SECTION_QUERY = &H0001
528Const SECTION_MAP_WRITE = &H0002
529Const SECTION_MAP_READ = &H0004
530Const SECTION_MAP_EXECUTE = &H0008
531Const SECTION_EXTEND_SIZE = &H0010
532Const SECTION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SECTION_QUERY Or SECTION_MAP_WRITE Or SECTION_MAP_READ Or SECTION_MAP_EXECUTE Or SECTION_EXTEND_SIZE)
533
534Const FILE_MAP_COPY = SECTION_QUERY
535Const FILE_MAP_WRITE = SECTION_MAP_WRITE
536Const FILE_MAP_READ = SECTION_MAP_READ
537Const FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS
538Declare 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
539Declare Function OpenFileMapping Lib "kernel32" Alias _FuncName_OpenFileMapping (dwDesiredAccess As DWord, bInheritHandle As BOOL, pName As PCSTR) As HANDLE
540Declare Function MapViewOfFile Lib "kernel32" (hFileMappingObject As HANDLE, dwDesiredAccess As DWord, dwFileOffsetHigh As DWord, dwFileOffsetLow As DWord, dwNumberOfBytesToMap As DWord) As VoidPtr
541Declare Function MapViewOfFileEx Lib "kernel32" (hFileMappingObject As HANDLE, dwDesiredAccess As DWord, dwFileOffsetHigh As DWord, dwFileOffsetLow As DWord, dwNumberOfBytesToMap As DWord, lpBaseAddress As VoidPtr) As VoidPtr
542Declare Function FlushViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr, dwNumberOfBytesToFlush As DWord) As BOOL
543Declare Function UnmapViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr) As BOOL
544
545Const MAILSLOT_WAIT_FOREVER = &HFFFFFFFF
546Declare Function CreateMailslot Lib "kernel32" Alias _FuncName_CreateMailslot (pName As PCTSTR, nMaxMessageSize As DWord, lReadTimeout As DWord, pSecurityAttributes As *SECURITY_ATTRIBUTES) As HANDLE
547
548Const DEBUG_PROCESS = &H00000001
549Const DEBUG_ONLY_THIS_PROCESS = &H00000002
550Const CREATE_SUSPENDED = &H00000004
551Const DETACHED_PROCESS = &H00000008
552Const CREATE_NEW_CONSOLE = &H00000010
553Const NORMAL_PRIORITY_CLASS = &H00000020
554Const IDLE_PRIORITY_CLASS = &H00000040
555Const HIGH_PRIORITY_CLASS = &H00000080
556Const REALTIME_PRIORITY_CLASS = &H00000100
557Const CREATE_NEW_PROCESS_GROUP = &H00000200
558Const CREATE_UNICODE_ENVIRONMENT = &H00000400
559Const CREATE_SEPARATE_WOW_VDM = &H00000800
560Const CREATE_SHARED_WOW_VDM = &H00001000
561Const CREATE_FORCEDOS = &H00002000
562Const CREATE_DEFAULT_ERROR_MODE = &H04000000
563Const CREATE_NO_WINDOW = &H08000000
564Const PROFILE_USER = &H10000000
565Const PROFILE_KERNEL = &H20000000
566Const PROFILE_SERVER = &H40000000
567
568Const STARTF_USESHOWWINDOW = &H00000001
569Const STARTF_USESIZE = &H00000002
570Const STARTF_USEPOSITION = &H00000004
571Const STARTF_USECOUNTCHARS = &H00000008
572Const STARTF_USEFILLATTRIBUTE = &H00000010
573Const STARTF_RUNFULLSCREEN = &H00000020
574Const STARTF_FORCEONFEEDBACK = &H00000040
575Const STARTF_FORCEOFFFEEDBACK = &H00000080
576Const STARTF_USESTDHANDLES = &H00000100
577Const STARTF_USEHOTKEY = &H00000200
578Type STARTUPINFOW
579 cb As DWord
580 lpReserved As LPWSTR
581 lpDesktop As LPWSTR
582 lpTitle As LPWSTR
583 dwX As DWord
584 dwY As DWord
585 dwXSize As DWord
586 dwYSize As DWord
587 dwXCountChars As DWord
588 dwYCountChars As DWord
589 dwFillAttribute As DWord
590 dwFlags As DWord
591 wShowWindow As Word
592 cbReserved2 As Word
593 lpReserved2 As *Byte
594 hStdInput As HANDLE
595 hStdOutput As HANDLE
596 hStdError As HANDLE
597End Type
598Type STARTUPINFOA
599 cb As DWord
600 lpReserved As LPSTR
601 lpDesktop As LPSTR
602 lpTitle As LPSTR
603 dwX As DWord
604 dwY As DWord
605 dwXSize As DWord
606 dwYSize As DWord
607 dwXCountChars As DWord
608 dwYCountChars As DWord
609 dwFillAttribute As DWord
610 dwFlags As DWord
611 wShowWindow As Word
612 cbReserved2 As Word
613 lpReserved2 As *Byte
614 hStdInput As HANDLE
615 hStdOutput As HANDLE
616 hStdError As HANDLE
617End Type
618#ifdef UNICODE
619TypeDef STARTUPINFO = STARTUPINFOW
620#else
621TypeDef STARTUPINFO = STARTUPINFOA
622#endif
623Type PROCESS_INFORMATION
624 hProcess As HANDLE
625 hThread As HANDLE
626 dwProcessId As DWord
627 dwThreadId As DWord
628End Type
629Declare 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
630
631TypeDef LPTHREAD_START_ROUTINE = *Function(lpThreadParameter As VoidPtr) As DWord
632Declare 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
633
634Declare Sub DebugBreak Lib "kernel32" ()
635Declare Sub DeleteCriticalSection Lib "kernel32" (ByRef CriticalSection As CRITICAL_SECTION)
636Declare Function DeleteFile Lib "kernel32" Alias _FuncName_DeleteFile (pFileName As PCTSTR) As BOOL
637Declare Function DeviceIoControl Lib "Kernel32" (
638 hDevice As HANDLE,
639 dwIoControlCode As DWord,
640 pInBuffer As VoidPtr,
641 nInBufferSize As DWord,
642 pOutBuffer As VoidPtr,
643 nOutBufferSize As DWord,
644 pBytesReturned As DWordPtr,
645 pOverlapped As *OVERLAPPED
646) As Long
647Declare Function DisableThreadLibraryCalls Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
648Declare Function DosDateTimeToFileTime Lib "kernel32" (wFatDate As Word, wFatTime As Word, ByRef lpFileTime As FILETIME) As BOOL
649
650Const DUPLICATE_CLOSE_SOURCE = 1
651Const DUPLICATE_SAME_ACCESS = 2
652Declare 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
653
654Declare Sub EnterCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
655Declare Sub ExitProcess Lib "kernel32" (dwExitCode As DWord)
656Declare Sub ExitThread Lib "kernel32" (dwExitCode As DWord)
657Declare Sub FatalAppExit Lib "kernel32" Alias _FuncName_FatalAppExit (Action As DWord, pMessageText As PCTSTR)
658Declare Function FileTimeToDosDateTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpFatDate As Word, ByRef lpFatTime As Word) As BOOL
659Declare Function FileTimeToLocalFileTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpLocalFileTime As FILETIME) As BOOL
660Declare Function FileTimeToSystemTime Lib "kernel32" (ByRef lpFileTime As FILETIME, ByRef lpSystemTime As SYSTEMTIME) As BOOL
661Declare Sub FillMemory Lib "kernel32" Alias "RtlFillMemory" (pDest As VoidPtr, stLength As SIZE_T, c As Byte)
662Declare Function FindClose Lib "kernel32" (hFindFile As HANDLE) As BOOL
663Declare Function FindCloseChangeNotification Lib "kernel32" (hChangeHandle As HANDLE) As BOOL
664Declare Function FindFirstChangeNotification Lib "kernel32" Alias _FuncName_FindFirstChangeNotification (
665 pPathName As PCTSTR,
666 bWatchSubtree As BOOL,
667 dwNotifyFilter As DWord
668) As HANDLE
669
670Type WIN32_FIND_DATAW
671 dwFileAttributes As DWord
672 ftCreationTime As FILETIME
673 ftLastAccessTime As FILETIME
674 ftLastWriteTime As FILETIME
675 nFileSizeHigh As DWord
676 nFileSizeLow As DWord
677 dwReserved0 As DWord
678 dwReserved1 As DWord
679 cFileName[ELM(MAX_PATH)] As WCHAR
680 cAlternateFileName[13] As WCHAR
681End Type
682Type WIN32_FIND_DATAA
683 dwFileAttributes As DWord
684 ftCreationTime As FILETIME
685 ftLastAccessTime As FILETIME
686 ftLastWriteTime As FILETIME
687 nFileSizeHigh As DWord
688 nFileSizeLow As DWord
689 dwReserved0 As DWord
690 dwReserved1 As DWord
691 cFileName[ELM(MAX_PATH)] As SByte
692 cAlternateFileName[13] As SByte
693End Type
694#ifdef UNICODE
695TypeDef WIN32_FIND_DATA = WIN32_FIND_DATAW
696#else
697TypeDef WIN32_FIND_DATA = WIN32_FIND_DATAA
698#endif
699TypeDef LPWIN32_FIND_DATA = *WIN32_FIND_DATA
700Declare Function FindFirstFile Lib "kernel32" Alias _FuncName_FindFirstFile (pFileName As PCTSTR, ByRef FindFildData As WIN32_FIND_DATA) As HANDLE
701Declare Function FindNextChangeNotification Lib "kernel32" (hChangeHandle As HANDLE) As BOOL
702Declare Function FindNextFile Lib "kernel32" Alias _FuncName_FindNextFile (hFindFile As HANDLE, ByRef FindFildData As WIN32_FIND_DATA) As BOOL
703Declare Function FlushFileBuffers Lib "kernel32" (hFile As HANDLE) As BOOL
704Declare Function FlushInstructionCache Lib "kernel32"(hProcess As HANDLE, pBaseAddress As VoidPtr, Size As SIZE_T) As BOOL
705
706Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H00000100
707Const FORMAT_MESSAGE_IGNORE_INSERTS = &H00000200
708Const FORMAT_MESSAGE_FROM_STRING = &H00000400
709Const FORMAT_MESSAGE_FROM_HMODULE = &H00000800
710Const FORMAT_MESSAGE_FROM_SYSTEM = &H00001000
711Const FORMAT_MESSAGE_ARGUMENT_ARRAY = &H00002000
712Declare 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
713Declare Function FreeEnvironmentStrings Lib "kernel32" Alias _FuncName_FreeEnvironmentStrings (pszEnvironmentBlock As PCTSTR) As BOOL
714Declare Function FreeLibrary Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
715Declare Sub FreeLibraryAndExitThread Lib "kernel32" (hModule As HANDLE, dwExitCode As DWord)
716Declare Function GetCommandLineA Lib "kernel32" () As PCSTR
717Declare Function GetCommandLineW Lib "kernel32" () As PCWSTR
718#ifdef UNICODE
719Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineW" () As PCWSTR
720#else
721Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As PCSTR
722#endif
723Declare Function GetCompressedFileSize Lib "kernel32" Alias _FuncName_GetCompressedFileSize (pFileName As PCTSTR, ByRef FileSizeHigh As DWord) As DWord
724
725Const MAX_COMPUTERNAME_LENGTH = 15
726Declare Function GetComputerName Lib "kernel32" Alias _FuncName_GetComputerName (pBuffer As PTSTR, ByRef nSize As Long) As Long
727
728Declare Function GetCurrentDirectory Lib "kernel32" Alias _FuncName_GetCurrentDirectory (nBufferLength As DWord, pBuffer As PTSTR) As DWord
729Declare Function GetCurrentProcess Lib "kernel32" () As HANDLE
730Declare Function GetCurrentProcessId Lib "kernel32" () As DWord
731Declare Function GetCurrentThread Lib "kernel32" () As HANDLE
732Declare Function GetCurrentThreadId Lib "kernel32" () As DWord
733
734Const DATE_SHORTDATE = &H00000001
735Const DATE_LONGDATE = &H00000002
736Const DATE_USE_ALT_CALENDAR = &H00000004
737Declare 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
738
739Declare Function GetDiskFreeSpace Lib "kernel32" Alias _FuncName_GetDiskFreeSpace (pRootPathName As PCTSTR, lpSectorsPerCluster As *DWord, pBytesPerSector As *DWord, pNumberOfFreeClusters As *DWord, pTotalNumberOfClusters As *DWord) As BOOL
740Declare 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
741
742Const DRIVE_UNKNOWN = 0
743Const DRIVE_NO_ROOT_DIR = 1
744Const DRIVE_REMOVABLE = 2
745Const DRIVE_FIXED = 3
746Const DRIVE_REMOTE = 4
747Const DRIVE_CDROM = 5
748Const DRIVE_RAMDISK = 6
749Declare 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
750Declare Function GetDriveType Lib "kernel32" Alias _FuncName_GetDriveType (lpRootPathName As PCTSTR) As DWord
751
752Declare Function GetEnvironmentVariable Lib "kernel32" Alias _FuncName_GetEnvironmentVariable (lpName As PCTSTR, lpBuffer As PTSTR, nSize As DWord) As DWord
753Declare Function GetEnvironmentStrings Lib "kernel32" Alias _FuncName_GetEnvironmentStrings () As VoidPtr
754Const STILL_ACTIVE = &H00000103
755Declare Function GetExitCodeProcess Lib "kernel32" (hProcess As HANDLE, ByRef lpExitCode As DWord) As BOOL
756Declare Function GetExitCodeThread Lib "kernel32" (hThread As HANDLE, ByRef lpExitCode As DWord) As BOOL
757
758Declare Function GetFileAttributes Lib "kernel32" Alias _FuncName_GetFileAttributes (lpFileName As PCTSTR) As DWord
759Type BY_HANDLE_FILE_INFORMATION
760 dwFileAttributes As DWord
761 ftCreationTime As FILETIME
762 ftLastAccessTime As FILETIME
763 ftLastWriteTime As FILETIME
764 dwVolumeSerialNumber As DWord
765 nFileSizeHigh As DWord
766 nFileSizeLow As DWord
767 nNumberOfLinks As DWord
768 nFileIndexHigh As DWord
769 nFileIndexLow As DWord
770End Type
771Declare Function GetFileInformationByHandle Lib "kernel32" (
772 ByVal hFile As HANDLE,
773 ByRef FileInformation As BY_HANDLE_FILE_INFORMATION
774) As BOOL
775Declare Function GetFileSize Lib "kernel32" (hFile As HANDLE, pFileSizeHigh As *DWord) As DWord
776Declare Function GetFileTime Lib "kernel32" (hFile As HANDLE, ByRef lpCreationTime As FILETIME, ByRef lpLastAccessTime As FILETIME, ByRef lpLastWriteTime As FILETIME) As BOOL
777
778Const FILE_TYPE_UNKNOWN = &H0000
779Const FILE_TYPE_DISK = &H0001
780Const FILE_TYPE_CHAR = &H0002
781Const FILE_TYPE_PIPE = &H0003
782Const FILE_TYPE_REMOTE = &H8000
783Declare Function GetFileType Lib "kernel32" (hFile As HANDLE) As DWord
784
785Declare Function GetFullPathName Lib "kernel32" Alias _FuncName_GetFullPathName (lpFileName As PCSTR, nBufferLength As DWord, pBuffer As PSTR, lpFilePart As *DWord) As DWord
786Declare Function GetLastError Lib "kernel32" () As DWord
787Declare Sub GetLocalTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME)
788Declare Function GetLogicalDrives Lib "kernel32" () As DWord
789Declare Function GetLogicalDriveStrings Lib "kernel32" Alias _FuncName_GetLogicalDriveStrings (nBufferLength As DWord, pBuffer As PTSTR) As DWord
790Declare Function GetModuleFileName Lib "kernel32" Alias _FuncName_GetModuleFileName (hModule As HINSTANCE, lpFileName As PTSTR, nSize As DWord) As DWord
791Declare Function GetModuleHandle Lib "kernel32" Alias _FuncName_GetModuleHandle (lpModuleName As PTSTR) As HINSTANCE
792Declare Function GetOverlappedResult Lib "kernel32" (
793 hFile As HANDLE,
794 pOverlapped As *OVERLAPPED,
795 pNumberOfBytesTransferred AS *DWord,
796 bWait As BOOL
797) As BOOL
798Declare Function GetPriorityClass Lib "kernel32" (hProcess As HANDLE) As DWord
799Declare Function GetProcAddress Lib "kernel32" (hModule As HINSTANCE, pProcName As PCSTR) As DWord
800Declare Function GetProcessAffinityMask Lib "kernel32" (
801 hProcess As HANDLE,
802 ByRef ProcessAffinityMask As ULONG_PTR,
803 ByRef SystemAffinityMask As ULONG_PTR
804) As BOOL
805Declare Function GetProcessHeap Lib "kernel32" () As HANDLE
806Declare Function GetShortPathName Lib "kernel32" Alias _FuncName_GetShortPathName (
807 pszLongPath As PCTSTR,
808 pszShortPath As PTSTR,
809 cchBuffer As DWord
810) As DWord
811
812Declare Sub GetStartupInfo Lib "kernel32" Alias _FuncName_GetStartupInfo (ByRef StartupInfo As STARTUPINFO)
813
814Const STD_INPUT_HANDLE = -10
815Const STD_OUTPUT_HANDLE = -11
816Const STD_ERROR_HANDLE = -12
817Declare Function GetStdHandle Lib "kernel32" (nStdHandle As DWord) As HANDLE
818
819Declare Function GetSystemDirectory Lib "kernel32" Alias _FuncName_GetSystemDirectory (pBuffer As PTSTR, uSize As DWord) As DWord
820
821Type SYSTEM_INFO
822 dwOemId As DWord
823 dwPageSize As DWord
824 lpMinimumApplicationAddress As VoidPtr
825 lpMaximumApplicationAddress As VoidPtr
826 dwActiveProcessorMask As ULONG_PTR
827 dwNumberOfProcessors As DWord
828 dwProcessorType As DWord
829 dwAllocationGranularity As DWord
830 wProcessorLevel As Word
831 wProcessorRevision As Word
832End Type
833Declare Sub GetSystemInfo Lib "kernel32" (ByRef SystemInfo As SYSTEM_INFO)
834
835Declare Sub GetSystemTime Lib "kernel32" (ByRef SystemTime As SYSTEMTIME)
836Declare Sub GetSystemTimeAsFileTime Lib "kernel32" (ByRef SystemTimeAsFileTime As FILETIME)
837
838Declare Function GetTempFileName Lib "kernel32" Alias _FuncName_GetTempFileName (
839 pPathName As PCTSTR,
840 pPrefixString As PCTSTR,
841 uUnique As DWord,
842 pTempFileName As PTSTR
843) As DWord
844Declare Function GetTempPath Lib "kernel32" Alias _FuncName_GetTempPath (nBufferLength As DWord, lpBuffer As PTSTR) As DWord
845Declare Function GetThreadContext Lib "kernel32" (hThread As HANDLE, ByRef Context As CONTEXT) As BOOL
846
847Const THREAD_BASE_PRIORITY_LOWRT = 15
848Const THREAD_BASE_PRIORITY_MAX = 2
849Const THREAD_BASE_PRIORITY_MIN = -2
850Const THREAD_BASE_PRIORITY_IDLE = -15
851Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
852Const THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWEST+1
853Const THREAD_PRIORITY_NORMAL = 0
854Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
855Const THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHEST-1
856Const THREAD_PRIORITY_ERROR_RETURN = LONG_MAX
857Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
858Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
859Declare Function GetThreadPriority Lib "kernel32" (hThread As HANDLE) As Long
860Declare Function GetThreadPriorityBoost Lib "kernel32" (
861 hThread As HANDLE,
862 ByRef pDisablePriorityBoost As BOOL) As BOOL
863Declare Function GetTickCount Lib "kernel32" () As DWord
864
865Const TIME_NOMINUTESORSECONDS = &H00000001
866Const TIME_NOSECONDS = &H00000002
867Const TIME_NOTIMEMARKER = &H00000004
868Const TIME_FORCE24HOURFORMAT = &H00000008
869Declare 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
870
871Declare Function GetUserDefaultLCID Lib "kernel32" () As LCID
872Declare Function GetUserName Lib "advapi32" Alias _FuncName_GetUserName (pBuffer As PTSTR, ByRef nSize As DWord) As BOOL
873
874Const VER_PLATFORM_WIN32s = 0
875Const VER_PLATFORM_WIN32_WINDOWS = 1
876Const VER_PLATFORM_WIN32_NT = 2
877Type OSVERSIONINFOW
878 dwOSVersionInfoSize As DWord
879 dwMajorVersion As DWord
880 dwMinorVersion As DWord
881 dwBuildNumber As DWord
882 dwPlatformId As DWord
883 szCSDVersion[ELM(128)] As WCHAR
884End Type
885Type OSVERSIONINFOA
886 dwOSVersionInfoSize As DWord
887 dwMajorVersion As DWord
888 dwMinorVersion As DWord
889 dwBuildNumber As DWord
890 dwPlatformId As DWord
891 szCSDVersion[ELM(128)] As SByte
892End Type
893#ifdef UNICODE
894TypeDef OSVERSIONINFO = OSVERSIONINFOW
895#else
896TypeDef OSVERSIONINFO = OSVERSIONINFOA
897#endif
898Declare Function GetVersionEx Lib "kernel32" Alias _FuncName_GetVersionEx (ByRef VersionInformation As OSVERSIONINFO) As BOOL
899
900Declare Function GetWindowsDirectory Lib "kernel32" Alias _FuncName_GetWindowsDirectory (pBuffer As PTSTR, uSize As DWord) As DWord
901Declare Function GlobalAlloc Lib "kernel32" (uFlags As DWord, dwBytes As SIZE_T) As HGLOBAL
902Declare Function GlobalFrags Lib "kernel32" (hMem As HGLOBAL) As DWord
903Declare Function GlobalFree Lib "kernel32" (hMem As HGLOBAL) As HGLOBAL
904Declare Function GlobalHandle Lib "kernel32" (pMem As VoidPtr) As HGLOBAL
905Declare Function GlobalLock Lib "kernel32" (hMem As HGLOBAL) As VoidPtr
906
907Type MEMORYSTATUS
908 dwLength As DWord
909 dwMemoryLoad As DWord
910 dwTotalPhys As SIZE_T
911 dwAvailPhys As SIZE_T
912 dwTotalPageFile As SIZE_T
913 dwAvailPageFile As SIZE_T
914 dwTotalVirtual As SIZE_T
915 dwAvailVirtual As SIZE_T
916End Type
917Declare Sub GlobalMemoryStatus Lib "kernel32" (ByRef lpMemStatus As MEMORYSTATUS)
918
919Declare Function GlobalReAlloc Lib "kernel32" (hMem As HGLOBAL, dwBytes As SIZE_T, uFlags As DWord) As HGLOBAL
920Declare Function GlobalSize Lib "kernel32" (hMem As HGLOBAL) As SIZE_T
921Declare Function GlobalUnlock Lib "kernel32" (hMem As HGLOBAL) As BOOL
922Declare Function HeapAlloc Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, dwBytes As SIZE_T) As VoidPtr
923Declare Function HeapCreate Lib "kernel32" (flOptions As DWord, dwInitialSize As SIZE_T, dwMaximumSize As SIZE_T) As HANDLE
924Declare Function HeapDestroy Lib "kernel32" (hHeap As HANDLE) As Long
925Declare Function HeapFree Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr) As Long
926Declare Function HeapReAlloc Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr, dwBytes As SIZE_T) As VoidPtr
927Declare Function HeapSize Lib "kernel32" (hHeap As HANDLE, dwFlags As DWord, lpMem As VoidPtr) As SIZE_T
928Declare Sub InitializeCriticalSection Lib "kernel32" (ByRef CriticalSection As CRITICAL_SECTION)
929Declare Function IsBadReadPtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
930Declare Function IsBadWritePtr Lib "kernel32" (lp As VoidPtr, ucb As ULONG_PTR) As BOOL
931Declare Function IsDBCSLeadByte Lib "kernel32" (TestChar As Byte) As BOOL
932
933#ifdef _WIN64
934Declare Function IsWow64Process Lib "kernel32" (hProcess As HANDLE, ByRef bWow64Process As BOOL) As BOOL
935#endif
936
937Const LCMAP_LOWERCASE = &H00000100 ' lower case letters
938Const LCMAP_UPPERCASE = &H00000200 ' upper case letters
939Const LCMAP_SORTKEY = &H00000400 ' WC sort key (normalize)
940Const LCMAP_BYTEREV = &H00000800 ' byte reversal
941Const LCMAP_HIRAGANA = &H00100000 ' map katakana to hiragana
942Const LCMAP_KATAKANA = &H00200000 ' map hiragana to katakana
943Const LCMAP_HALFWIDTH = &H00400000 ' map double byte to single byte
944Const LCMAP_FULLWIDTH = &H00800000 ' map single byte to double byte
945Const LCMAP_LINGUISTIC_CASING = &H01000000 ' use linguistic rules for casing
946Const LCMAP_SIMPLIFIED_CHINESE = &H02000000 ' map traditional chinese to simplified chinese
947Const LCMAP_TRADITIONAL_CHINESE = &H04000000 ' map simplified chinese to traditional chinese
948Declare 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
949
950Declare Sub LeaveCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
951Declare Function LocalAlloc Lib "kernel32" (uFlags As DWord, uBytes As SIZE_T) As HLOCAL
952Declare Function LocalFileTimeToFileTime Lib "kernel32" (ByRef lpLocalFileTime As FILETIME, ByRef lpFileTime As FILETIME) As BOOL
953Declare Function LocalFree Lib "kernel32" (hMem As HLOCAL) As HLOCAL
954Declare Function LocalHandle Lib "kernel32" (pMem As VoidPtr) As HLOCAL
955Declare Function LocalLock Lib "kernel32" (hMem As HLOCAL) As VoidPtr
956Declare Function LocalReAlloc Lib "kernel32" (hMem As HLOCAL, dwBytes As SIZE_T, uFlags As DWord) As HLOCAL
957Declare Function LocalSize Lib "kernel32" (hMem As HLOCAL) As SIZE_T
958Declare Function LocalUnlock Lib "kernel32" (hMem As HLOCAL) As BOOL
959Declare Function LockFile Lib "kernel32" (hFile As DWord, dwFileOffsetLow As DWord, dwFileOffsetHigh As DWord, nNumberOfBytesToLockLow As DWord, nNumberOfBytesToLockHigh As DWord) As BOOL
960Declare Function LoadLibrary Lib "kernel32" Alias _FuncName_LoadLibrary (pLibFileName As PCTSTR) As HINSTANCE
961
962Const DONT_RESOLVE_DLL_REFERENCES = &h00000001
963Const LOAD_LIBRARY_AS_DATAFILE = &h00000002
964Const LOAD_WITH_ALTERED_SEARCH_PATH = &h00000008
965Const LOAD_IGNORE_CODE_AUTHZ_LEVEL = &h00000010
966Declare Function LoadLibraryEx Lib "kernel32" Alias _FuncName_LoadLibraryEx (pLibFileName As PCTSTR, hFile As HANDLE, dwFlags As DWord) As HINSTANCE
967
968Declare Function lstrcat Lib "kernel32" Alias _FuncName_lstrcat (pString1 As PTSTR, pString2 As PCTSTR) As PSTR
969Declare Function lstrcmp Lib "kernel32" Alias _FuncName_lstrcmp (pString1 As PCTSTR, pString2 As PCTSTR) As Long
970Declare Function lstrcmpi Lib "kernel32" Alias _FuncName_lstrcmpi (pString1 As PCTSTR, pString2 As PCTSTR) As Long
971Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (pString1 As PTSTR, pString2 As PCTSTR) As PSTR
972Declare Function lstrlenA Lib "kernel32" (pString As PCSTR) As Long
973Declare Function lstrlenW Lib "kernel32" (pString As PCWSTR) As Long
974#ifdef UNICODE
975Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (pString As PCWSTR) As Long
976#else
977Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (pString As PCSTR) As Long
978#endif
979Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
980Declare Function MoveFile Lib "kernel32" Alias _FuncName_MoveFile (lpExistingFileName As LPCTSTR, lpNewFileName As LPCTSTR) As BOOL
981Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
982
983Declare Function MulDiv Lib "kernel32" (
984 nNumber As Long,
985 nNumerator As Long,
986 nDenominator As Long
987) As Long
988
989Const CP_ACP = 0 'default to ANSI code page
990Const CP_OEMCP = 1 'default to OEM code page
991Const CP_MACCP = 2 'default to MAC code page
992Const CP_THREAD_ACP = 3 'current thread's ANSI code page
993Const CP_SYMBOL = 42 'SYMBOL translations
994Const CP_UTF7 = 65000 'UTF-7 translation
995Const CP_UTF8 = 65001 'UTF-8 translation
996
997Declare Function MultiByteToWideChar Lib "kernel32" (CodePage As DWord, dwFlags As DWord, pMultiByteStr As PCSTR, cchMultiByte As Long, pWideCharStr As PWSTR, cchWideChar As Long) As Long
998
999Declare Function OpenEvent Lib "kernel32" Alias _FuncName_OpenEvent (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
1000Declare Function OpenMutex Lib "kernel32" Alias _FuncName_OpenMutex (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
1001Declare Function OpenSemaphore Lib "kernel32" Alias _FuncName_OpenSemaphore (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
1002
1003Const PROCESS_TERMINATE = &H0001
1004Const PROCESS_CREATE_THREAD = &H0002
1005Const PROCESS_SET_SESSIONID = &H0004
1006Const PROCESS_VM_OPERATION = &H0008
1007Const PROCESS_VM_READ = &H0010
1008Const PROCESS_VM_WRITE = &H0020
1009Const PROCESS_DUP_HANDLE = &H0040
1010Const PROCESS_CREATE_PROCESS = &H0080
1011Const PROCESS_SET_QUOTA = &H0100
1012Const PROCESS_SET_INFORMATION = &H0200
1013Const PROCESS_QUERY_INFORMATION = &H0400
1014Const PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or &HFFF
1015Declare Function OpenProcess Lib "kernel32" (dwDesiredAccess As DWord, bInheritHandle As Long, dwProcessId As DWord) As HANDLE
1016
1017Declare Sub OutputDebugStringA Lib "kernel32" (pOutputString As PCSTR)
1018Declare Sub OutputDebugStringW Lib "kernel32" (pOutputString As PCWSTR)
1019#ifdef UNICODE
1020Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringW" (pOutputString As PCWSTR)
1021#else
1022Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (pOutputString As PCSTR)
1023#endif
1024Declare Function PulseEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
1025Declare Sub RaiseException Lib "kernel32" (
1026 dwExceptionCode As DWord,
1027 dwExceptionFlags As DWord,
1028 NumberOfArguments As DWord,
1029 pArguments As *ULONG_PTR)
1030Declare Function ReadFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToRead As DWord, lpNumberOfBytesRead As DWordPtr, ByRef lpOverlapped As OVERLAPPED) As BOOL
1031Declare Function ReleaseMutex Lib "kernel32" (hMutex As HANDLE) As BOOL
1032Declare Function ReleaseSemaphore Lib "kernel32" (hSemaphore As HANDLE, lReleaseCount As Long, ByRef lpPreviousCount As Long) As BOOL
1033Declare Function RemoveDirectory Lib "kernel32" Alias _FuncName_RemoveDirectory (lpPathName As LPCTSTR) As BOOL
1034Declare Function ResetEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
1035Declare Function ResumeThread Lib "kernel32" (hThread As HANDLE) As DWord
1036Declare Function SetComputerName Lib "kernel32" Alias _FuncName_SetComputerName (lpComputerName As LPCTSTR) As BOOL
1037Declare Function SetCurrentDirectory Lib "kernel32" Alias _FuncName_SetCurrentDirectory (lpPathName As LPCTSTR) As BOOL
1038Declare 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
1039Declare Function SetEndOfFile Lib "kernel32" (hFile As HANDLE) As BOOL
1040Declare Function SetEnvironmentVariable Lib "kernel32" Alias _FuncName_SetEnvironmentVariable (lpName As LPCTSTR, lpValue As LPTSTR) As BOOL
1041
1042Const SEM_FAILCRITICALERRORS = &h0001
1043Const SEM_NOGPFAULTERRORBOX = &h0002
1044Const SEM_NOALIGNMENTFAULTEXCEPT = &h0004
1045Const SEM_NOOPENFILEERRORBOX = &h8000
1046Declare Function SetErrorMode Lib "kernel32" (uMode As DWord) As DWord
1047Declare Function SetEvent Lib "kernel32" (hEvent As HANDLE) As BOOL
1048Declare Function SetFileAttributes Lib "kernel32" Alias _FuncName_SetFileAttributes (lpFileName As LPCTSTR, dwFileAttributes As DWord) As BOOL
1049
1050Const FILE_BEGIN = 0
1051Const FILE_CURRENT = 1
1052Const FILE_END = 2
1053Declare Function SetFilePointer Lib "kernel32" (hFile As HANDLE, lDistanceToMove As Long, lpDistanceToMoveHigh As DWordPtr, dwMoveMethod As DWord) As DWord
1054
1055Declare Function SetFileTime Lib "kernel32" (hFile As HANDLE, ByRef lpCreationTime As FILETIME, ByRef lpLastAccessTime As FILETIME, ByRef lpLastWriteTime As FILETIME) As BOOL
1056Declare Function SetLastError Lib "kernel32" (dwErrCode As DWord)
1057Declare Function SetLastErrorEx Lib "kernel32" (dwErrCode As DWord, dwType As DWord)
1058Declare Function SetLocalTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME) As BOOL
1059Declare Function SetPriorityClass Lib "kernel32" (hProcess As HANDLE, dwPriorityClass As DWord) As BOOL
1060Declare Function SetThreadContext Lib "kernel32" (hThread As HANDLE, ByRef Context As CONTEXT) As BOOL
1061Declare Function SetThreadPriority Lib "kernel32" (hThread As HANDLE, nPriority As Long) As BOOL
1062Declare Function SetThreadPriorityBoost Lib "kernel32" (
1063 hThread As HANDLE,
1064 DisablePriorityBoost As BOOL
1065) As BOOL
1066
1067Const EXCEPTION_MAXIMUM_PARAMETERS = ELM(15)
1068
1069Type EXCEPTION_RECORD
1070 ExceptionCode As DWord
1071 ExceptionFlags As DWord
1072 ExceptionRecord As *EXCEPTION_RECORD
1073 ExceptionAddress As VoidPtr
1074 NumberParameters As DWord
1075 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS] As ULONG_PTR
1076End Type
1077
1078Type EXCEPTION_POINTERS
1079 ExceptionRecord As *EXCEPTION_RECORD
1080 ContextRecord As *CONTEXT
1081End Type
1082
1083TypeDef PTOP_LEVEL_EXCEPTION_FILTER = *Function(ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
1084
1085Declare Function SetUnhandledExceptionFilter Lib "kernel32" (pTopLevelExceptionFilter As PTOP_LEVEL_EXCEPTION_FILTER) As PTOP_LEVEL_EXCEPTION_FILTER
1086
1087Const INFINITE = &HFFFFFFFF
1088Declare Sub Sleep Lib "kernel32" (dwMilliseconds As DWord)
1089Declare Function SleepEx Lib "kernel32" (dwMilliseconds As DWord, bAlertable As BOOL) As DWord
1090
1091Declare Function SuspendThread Lib "kernel32" (hThread As HANDLE) As DWord
1092Declare Function SystemTimeToFileTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME, ByRef lpFileTime As FILETIME) As BOOL
1093Declare Function TerminateProcess Lib "kernel32" (hProcess As HANDLE, dwExitCode As DWord) As BOOL
1094Declare Function TerminateThread Lib "kernel32" (hThread As HANDLE, dwExitCode As DWord) As BOOL
1095Declare Function TlsAlloc Lib "kernel32" () As DWord
1096Declare Function TlsFree Lib "kernel32" (dwTlsIndex As DWord) As BOOL
1097Declare Function TlsGetValue Lib "kernel32" (dwTlsIndex As DWord) As VoidPtr
1098Declare Function TlsSetValue Lib "kernel32" (dwTlsIndex As DWord, pTlsValue As VoidPtr) As BOOL
1099Declare Function UnlockFile Lib "kernel32" (hFile As HANDLE, dwFileOffsetLow As DWord, dwFileOffsetHigh As DWord, nNumberOfBytesToUnlockLow As DWord, nNumberOfBytesToUnlockHigh As DWord) As BOOL
1100Declare Function UnhandledExceptionFilter Lib "kernel32" (ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
1101
1102Const PAGE_NOACCESS = &H01
1103Const PAGE_READONLY = &H02
1104Const PAGE_READWRITE = &H04
1105Const PAGE_WRITECOPY = &H08
1106Const PAGE_EXECUTE = &H10
1107Const PAGE_EXECUTE_READ = &H20
1108Const PAGE_EXECUTE_READWRITE = &H40
1109Const PAGE_EXECUTE_WRITECOPY = &H80
1110Const PAGE_GUARD = &H100
1111Const PAGE_NOCACHE = &H200
1112Const PAGE_WRITECOMBINE = &H400
1113Const MEM_COMMIT = &H1000
1114Const MEM_RESERVE = &H2000
1115Const MEM_DECOMMIT = &H4000
1116Const MEM_RELEASE = &H8000
1117Const MEM_FREE = &H10000
1118Const MEM_PRIVATE = &H20000
1119Const MEM_MAPPED = &H40000
1120Const MEM_RESET = &H80000
1121Const MEM_TOP_DOWN = &H100000
1122Const MEM_4MB_PAGES = &H80000000
1123Declare Function VirtualAlloc Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, flAllocationType As DWord, flProtect As DWord) As VoidPtr
1124Declare Function VirtualFree Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, dwFreeType As DWord) As BOOL
1125Declare Function VirtualLock Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T) As BOOL
1126Declare Function VirtualProtect Lib "kernel32" (
1127 pAddress As VoidPtr,
1128 Size As SIZE_T,
1129 flNewProtect As DWord,
1130 ByRef flOldProtect As DWord
1131) As BOOL
1132Declare Function VirtualProtectEx Lib "kernel32" (
1133 hProcess As HANDLE,
1134 pAddress As VoidPtr,
1135 Size As SIZE_T,
1136 flNewProtect As DWord,
1137 ByRef flOldProtect As DWord
1138) As BOOL
1139Type MEMORY_BASIC_INFORMATION
1140 BaseAddress As VoidPtr
1141 AllocationBase As VoidPtr
1142 AllocationProtect As DWord
1143 RegionSize As SIZE_T
1144 State As DWord
1145 Protect As DWord
1146 MBIType As DWord
1147End Type
1148Declare Function VirtualQuery Lib "kernel32" (
1149 pAddress As VoidPtr,
1150 ByRef mbi As MEMORY_BASIC_INFORMATION,
1151 Length As SIZE_T
1152) As SIZE_T
1153Declare Function VirtualQueryEx Lib "kernel32" (
1154 hProcess As HANDLE,
1155 pAddress As VoidPtr,
1156 ByRef mbi As MEMORY_BASIC_INFORMATION,
1157 Length As SIZE_T
1158) As SIZE_T
1159Declare Function VirtualUnlock Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T) As BOOL
1160Declare Function WaitForMultipleObjects Lib "kernel32" (nCount As DWord, pHandles As *HANDLE, fWaitAll As BOOL, dwMilliseconds As DWord) As DWord
1161Declare Function WaitForMultipleObjectsEx Lib "kernel32" (nCount As DWord, pHandles As *HANDLE, fWaitAll As BOOL, dwMilliseconds As DWord, bAlertable As BOOL) As DWord
1162Declare Function WaitForSingleObject Lib "kernel32" (hHandle As HANDLE, dwMilliseconds As DWord) As DWord
1163Declare Function WaitForSingleObjectEx Lib "kernel32" (hHandle As HANDLE, dwMilliseconds As DWord, bAlertable As BOOL) As DWord
1164
1165Const WC_COMPOSITECHECK = &H00000200
1166Const WC_DISCARDNS = &H00000010
1167Const WC_SEPCHARS = &H00000020
1168Const WC_DEFAULTCHAR = &H00000040
1169Const WC_NO_BEST_FIT_CHARS = &H00000400
1170Declare Function WideCharToMultiByte Lib "Kernel32" (
1171 CodePage As DWord,
1172 dwFlags As DWord,
1173 pWideCharStr As PCWSTR,
1174 cchWideChar As Long,
1175 pMultiByteStr As PSTR,
1176 cbMultiByte As Long,
1177 pDefaultChar As PCSTR,
1178 pUsedDefaultChar As *BOOL
1179) As Long
1180
1181Declare Function WriteFile Lib "kernel32" (hFile As HANDLE, lpBuffer As VoidPtr, nNumberOfBytesToWrite As DWord, lpNumberOfBytesWritten As DWordPtr, ByRef lpOverlapped As OVERLAPPED) As BOOL
1182Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (Destination As VoidPtr, dwLength As DWord)
1183
1184Const MAKELCID(lgid, srtid) = ((((srtid As Word) As DWord)<<16) or ((lgid As Word) As DWord))
1185Const MAKELANGID(p, s) = (((s As Word) << 10) or (p As Word))
1186Const PRIMARYLANGID(lgid) = ((lgid As Word) and &H3ff)
1187Const SUBLANGID(lgid) = ((lgid As Word) >> 10)
1188
1189
1190'
1191' Primary language IDs.
1192'
1193
1194Const LANG_NEUTRAL = &H00
1195Const LANG_INVARIANT = &H7f
1196
1197Const LANG_AFRIKAANS = &H36
1198Const LANG_ALBANIAN = &H1c
1199Const LANG_ARABIC = &H01
1200Const LANG_ARMENIAN = &H2b
1201Const LANG_ASSAMESE = &H4d
1202Const LANG_AZERI = &H2c
1203Const LANG_BASQUE = &H2d
1204Const LANG_BELARUSIAN = &H23
1205Const LANG_BENGALI = &H45
1206Const LANG_BULGARIAN = &H02
1207Const LANG_CATALAN = &H03
1208Const LANG_CHINESE = &H04
1209Const LANG_CROATIAN = &H1a
1210Const LANG_CZECH = &H05
1211Const LANG_DANISH = &H06
1212Const LANG_DIVEHI = &H65
1213Const LANG_DUTCH = &H13
1214Const LANG_ENGLISH = &H09
1215Const LANG_ESTONIAN = &H25
1216Const LANG_FAEROESE = &H38
1217Const LANG_FARSI = &H29
1218Const LANG_FINNISH = &H0b
1219Const LANG_FRENCH = &H0c
1220Const LANG_GALICIAN = &H56
1221Const LANG_GEORGIAN = &H37
1222Const LANG_GERMAN = &H07
1223Const LANG_GREEK = &H08
1224Const LANG_GUJARATI = &H47
1225Const LANG_HEBREW = &H0d
1226Const LANG_HINDI = &H39
1227Const LANG_HUNGARIAN = &H0e
1228Const LANG_ICELANDIC = &H0f
1229Const LANG_INDONESIAN = &H21
1230Const LANG_ITALIAN = &H10
1231Const LANG_JAPANESE = &H11
1232Const LANG_KANNADA = &H4b
1233Const LANG_KASHMIRI = &H60
1234Const LANG_KAZAK = &H3f
1235Const LANG_KONKANI = &H57
1236Const LANG_KOREAN = &H12
1237Const LANG_KYRGYZ = &H40
1238Const LANG_LATVIAN = &H26
1239Const LANG_LITHUANIAN = &H27
1240Const LANG_MACEDONIAN = &H2f ' the Former Yugoslav Republic of Macedonia
1241Const LANG_MALAY = &H3e
1242Const LANG_MALAYALAM = &H4c
1243Const LANG_MANIPURI = &H58
1244Const LANG_MARATHI = &H4e
1245Const LANG_MONGOLIAN = &H50
1246Const LANG_NEPALI = &H61
1247Const LANG_NORWEGIAN = &H14
1248Const LANG_ORIYA = &H48
1249Const LANG_POLISH = &H15
1250Const LANG_PORTUGUESE = &H16
1251Const LANG_PUNJABI = &H46
1252Const LANG_ROMANIAN = &H18
1253Const LANG_RUSSIAN = &H19
1254Const LANG_SANSKRIT = &H4f
1255Const LANG_SERBIAN = &H1a
1256Const LANG_SINDHI = &H59
1257Const LANG_SLOVAK = &H1b
1258Const LANG_SLOVENIAN = &H24
1259Const LANG_SPANISH = &H0a
1260Const LANG_SWAHILI = &H41
1261Const LANG_SWEDISH = &H1d
1262Const LANG_SYRIAC = &H5a
1263Const LANG_TAMIL = &H49
1264Const LANG_TATAR = &H44
1265Const LANG_TELUGU = &H4a
1266Const LANG_THAI = &H1e
1267Const LANG_TURKISH = &H1f
1268Const LANG_UKRAINIAN = &H22
1269Const LANG_URDU = &H20
1270Const LANG_UZBEK = &H43
1271Const LANG_VIETNAMESE = &H2a
1272
1273'
1274' Sublanguage IDs.
1275'
1276' The name immediately following SUBLANG_ dictates which primary
1277' language ID that sublanguage ID can be combined with to form a
1278' valid language ID.
1279'
1280
1281Const SUBLANG_NEUTRAL = &H00 ' language neutral
1282Const SUBLANG_DEFAULT = &H01 ' user default
1283Const SUBLANG_SYS_DEFAULT = &H02 ' system default
1284
1285Const SUBLANG_ARABIC_SAUDI_ARABIA = &H01 ' Arabic (Saudi Arabia)
1286Const SUBLANG_ARABIC_IRAQ = &H02 ' Arabic (Iraq)
1287Const SUBLANG_ARABIC_EGYPT = &H03 ' Arabic (Egypt)
1288Const SUBLANG_ARABIC_LIBYA = &H04 ' Arabic (Libya)
1289Const SUBLANG_ARABIC_ALGERIA = &H05 ' Arabic (Algeria)
1290Const SUBLANG_ARABIC_MOROCCO = &H06 ' Arabic (Morocco)
1291Const SUBLANG_ARABIC_TUNISIA = &H07 ' Arabic (Tunisia)
1292Const SUBLANG_ARABIC_OMAN = &H08 ' Arabic (Oman)
1293Const SUBLANG_ARABIC_YEMEN = &H09 ' Arabic (Yemen)
1294Const SUBLANG_ARABIC_SYRIA = &H0a ' Arabic (Syria)
1295Const SUBLANG_ARABIC_JORDAN = &H0b ' Arabic (Jordan)
1296Const SUBLANG_ARABIC_LEBANON = &H0c ' Arabic (Lebanon)
1297Const SUBLANG_ARABIC_KUWAIT = &H0d ' Arabic (Kuwait)
1298Const SUBLANG_ARABIC_UAE = &H0e ' Arabic (U.A.E)
1299Const SUBLANG_ARABIC_BAHRAIN = &H0f ' Arabic (Bahrain)
1300Const SUBLANG_ARABIC_QATAR = &H10 ' Arabic (Qatar)
1301Const SUBLANG_AZERI_LATIN = &H01 ' Azeri (Latin)
1302Const SUBLANG_AZERI_CYRILLIC = &H02 ' Azeri (Cyrillic)
1303Const SUBLANG_CHINESE_TRADITIONAL = &H01 ' Chinese (Taiwan)
1304Const SUBLANG_CHINESE_SIMPLIFIED = &H02 ' Chinese (PR China)
1305Const SUBLANG_CHINESE_HONGKONG = &H03 ' Chinese (Hong Kong S.A.R., P.R.C.)
1306Const SUBLANG_CHINESE_SINGAPORE = &H04 ' Chinese (Singapore)
1307Const SUBLANG_CHINESE_MACAU = &H05 ' Chinese (Macau S.A.R.)
1308Const SUBLANG_DUTCH = &H01 ' Dutch
1309Const SUBLANG_DUTCH_BELGIAN = &H02 ' Dutch (Belgian)
1310Const SUBLANG_ENGLISH_US = &H01 ' English (USA)
1311Const SUBLANG_ENGLISH_UK = &H02 ' English (UK)
1312Const SUBLANG_ENGLISH_AUS = &H03 ' English (Australian)
1313Const SUBLANG_ENGLISH_CAN = &H04 ' English (Canadian)
1314Const SUBLANG_ENGLISH_NZ = &H05 ' English (New Zealand)
1315Const SUBLANG_ENGLISH_EIRE = &H06 ' English (Irish)
1316Const SUBLANG_ENGLISH_SOUTH_AFRICA = &H07 ' English (South Africa)
1317Const SUBLANG_ENGLISH_JAMAICA = &H08 ' English (Jamaica)
1318Const SUBLANG_ENGLISH_CARIBBEAN = &H09 ' English (Caribbean)
1319Const SUBLANG_ENGLISH_BELIZE = &H0a ' English (Belize)
1320Const SUBLANG_ENGLISH_TRINIDAD = &H0b ' English (Trinidad)
1321Const SUBLANG_ENGLISH_ZIMBABWE = &H0c ' English (Zimbabwe)
1322Const SUBLANG_ENGLISH_PHILIPPINES = &H0d ' English (Philippines)
1323Const SUBLANG_FRENCH = &H01 ' French
1324Const SUBLANG_FRENCH_BELGIAN = &H02 ' French (Belgian)
1325Const SUBLANG_FRENCH_CANADIAN = &H03 ' French (Canadian)
1326Const SUBLANG_FRENCH_SWISS = &H04 ' French (Swiss)
1327Const SUBLANG_FRENCH_LUXEMBOURG = &H05 ' French (Luxembourg)
1328Const SUBLANG_FRENCH_MONACO = &H06 ' French (Monaco)
1329Const SUBLANG_GERMAN = &H01 ' German
1330Const SUBLANG_GERMAN_SWISS = &H02 ' German (Swiss)
1331Const SUBLANG_GERMAN_AUSTRIAN = &H03 ' German (Austrian)
1332Const SUBLANG_GERMAN_LUXEMBOURG = &H04 ' German (Luxembourg)
1333Const SUBLANG_GERMAN_LIECHTENSTEIN = &H05 ' German (Liechtenstein)
1334Const SUBLANG_ITALIAN = &H01 ' Italian
1335Const SUBLANG_ITALIAN_SWISS = &H02 ' Italian (Swiss)
1336Const SUBLANG_KASHMIRI_SASIA = &H02 ' Kashmiri (South Asia)
1337Const SUBLANG_KOREAN = &H01 ' Korean (Extended Wansung)
1338Const SUBLANG_LITHUANIAN = &H01 ' Lithuanian
1339Const SUBLANG_MALAY_MALAYSIA = &H01 ' Malay (Malaysia)
1340Const SUBLANG_MALAY_BRUNEI_DARUSSALAM = &H02 ' Malay (Brunei Darussalam)
1341Const SUBLANG_NEPALI_INDIA = &H02 ' Nepali (India)
1342Const SUBLANG_NORWEGIAN_BOKMAL = &H01 ' Norwegian (Bokmal)
1343Const SUBLANG_NORWEGIAN_NYNORSK = &H02 ' Norwegian (Nynorsk)
1344Const SUBLANG_PORTUGUESE = &H02 ' Portuguese
1345Const SUBLANG_PORTUGUESE_BRAZILIAN = &H01 ' Portuguese (Brazilian)
1346Const SUBLANG_SERBIAN_LATIN = &H02 ' Serbian (Latin)
1347Const SUBLANG_SERBIAN_CYRILLIC = &H03 ' Serbian (Cyrillic)
1348Const SUBLANG_SPANISH = &H01 ' Spanish (Castilian)
1349Const SUBLANG_SPANISH_MEXICAN = &H02 ' Spanish (Mexican)
1350Const SUBLANG_SPANISH_MODERN = &H03 ' Spanish (Spain)
1351Const SUBLANG_SPANISH_GUATEMALA = &H04 ' Spanish (Guatemala)
1352Const SUBLANG_SPANISH_COSTA_RICA = &H05 ' Spanish (Costa Rica)
1353Const SUBLANG_SPANISH_PANAMA = &H06 ' Spanish (Panama)
1354Const SUBLANG_SPANISH_DOMINICAN_REPUBLIC = &H07 ' Spanish (Dominican Republic)
1355Const SUBLANG_SPANISH_VENEZUELA = &H08 ' Spanish (Venezuela)
1356Const SUBLANG_SPANISH_COLOMBIA = &H09 ' Spanish (Colombia)
1357Const SUBLANG_SPANISH_PERU = &H0a ' Spanish (Peru)
1358Const SUBLANG_SPANISH_ARGENTINA = &H0b ' Spanish (Argentina)
1359Const SUBLANG_SPANISH_ECUADOR = &H0c ' Spanish (Ecuador)
1360Const SUBLANG_SPANISH_CHILE = &H0d ' Spanish (Chile)
1361Const SUBLANG_SPANISH_URUGUAY = &H0e ' Spanish (Uruguay)
1362Const SUBLANG_SPANISH_PARAGUAY = &H0f ' Spanish (Paraguay)
1363Const SUBLANG_SPANISH_BOLIVIA = &H10 ' Spanish (Bolivia)
1364Const SUBLANG_SPANISH_EL_SALVADOR = &H11 ' Spanish (El Salvador)
1365Const SUBLANG_SPANISH_HONDURAS = &H12 ' Spanish (Honduras)
1366Const SUBLANG_SPANISH_NICARAGUA = &H13 ' Spanish (Nicaragua)
1367Const SUBLANG_SPANISH_PUERTO_RICO = &H14 ' Spanish (Puerto Rico)
1368Const SUBLANG_SWEDISH = &H01 ' Swedish
1369Const SUBLANG_SWEDISH_FINLAND = &H02 ' Swedish (Finland)
1370Const SUBLANG_URDU_PAKISTAN = &H01 ' Urdu (Pakistan)
1371Const SUBLANG_URDU_INDIA = &H02 ' Urdu (India)
1372Const SUBLANG_UZBEK_LATIN = &H01 ' Uzbek (Latin)
1373Const SUBLANG_UZBEK_CYRILLIC = &H02 ' Uzbek (Cyrillic)
1374
1375
1376Const LANG_SYSTEM_DEFAULT = (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
1377Const LANG_USER_DEFAULT = (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
1378
1379
1380'
1381' Sorting IDs.
1382'
1383
1384Const SORT_DEFAULT = &H0 ' sorting default
1385
1386Const SORT_JAPANESE_XJIS = &H0 ' Japanese XJIS order
1387Const SORT_JAPANESE_UNICODE = &H1 ' Japanese Unicode order
1388
1389Const SORT_CHINESE_BIG5 = &H0 ' Chinese BIG5 order
1390Const SORT_CHINESE_PRCP = &H0 ' PRC Chinese Phonetic order
1391Const SORT_CHINESE_UNICODE = &H1 ' Chinese Unicode order
1392Const SORT_CHINESE_PRC = &H2 ' PRC Chinese Stroke Count order
1393Const SORT_CHINESE_BOPOMOFO = &H3 ' Traditional Chinese Bopomofo order
1394
1395Const SORT_KOREAN_KSC = &H0 ' Korean KSC order
1396Const SORT_KOREAN_UNICODE = &H1 ' Korean Unicode order
1397
1398Const SORT_GERMAN_PHONE_BOOK = &H1 ' German Phone Book order
1399
1400Const SORT_HUNGARIAN_DEFAULT = &H0 ' Hungarian Default order
1401Const SORT_HUNGARIAN_TECHNICAL = &H1 ' Hungarian Technical order
1402
1403Const SORT_GEORGIAN_TRADITIONAL = &H0 ' Georgian Traditional order
1404Const SORT_GEORGIAN_MODERN = &H1 ' Georgian Modern order
1405
1406'
1407' Wait functions' results.
1408'
1409Const WAIT_FAILED = (&hFFFFFFFF As DWord)
1410Const WAIT_OBJECT_0 = 0 '((STATUS_WAIT_0 ) + 0)
1411
1412Const WAIT_ABANDONED = &h00000080 As DWord '((STATUS_ABANDONED_WAIT_0 ) + 0)
1413Const WAIT_ABANDONED_0 = WAIT_ABANDONED '((STATUS_ABANDONED_WAIT_0 ) + 0)
1414
1415Const WAIT_IO_COMPLETION = &h000000C0 'STATUS_USER_APC
1416
1417#endif '_INC_SYSTEM
Note: See TracBrowser for help on using the repository browser.