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