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