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