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