JwaWinBase.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:683k
源码类别:
Windows编程
开发平台:
Delphi
- function CreateDirectory(lpPathName: LPCSTR; lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateDirectory}
- {$ENDIF}
- function CreateDirectoryExA(lpTemplateDirectory: LPCSTR; lpNewDirectory: LPCSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateDirectoryExA}
- function CreateDirectoryExW(lpTemplateDirectory: LPCWSTR; lpNewDirectory: LPCWSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateDirectoryExW}
- {$IFDEF UNICODE}
- function CreateDirectoryEx(lpTemplateDirectory: LPCWSTR; lpNewDirectory: LPCWSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateDirectoryEx}
- {$ELSE}
- function CreateDirectoryEx(lpTemplateDirectory: LPCSTR; lpNewDirectory: LPCSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateDirectoryEx}
- {$ENDIF}
- function RemoveDirectoryA(lpPathName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM RemoveDirectoryA}
- function RemoveDirectoryW(lpPathName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM RemoveDirectoryW}
- {$IFDEF UNICODE}
- function RemoveDirectory(lpPathName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM RemoveDirectory}
- {$ELSE}
- function RemoveDirectory(lpPathName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM RemoveDirectory}
- {$ENDIF}
- function GetFullPathNameA(lpFileName: LPCSTR; nBufferLength: DWORD;
- lpBuffer: LPSTR; var lpFilePart: LPSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFullPathNameA}
- function GetFullPathNameW(lpFileName: LPCWSTR; nBufferLength: DWORD;
- lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFullPathNameA}
- {$IFDEF UNICODE}
- function GetFullPathName(lpFileName: LPCWSTR; nBufferLength: DWORD;
- lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFullPathName}
- {$ELSE}
- function GetFullPathName(lpFileName: LPCSTR; nBufferLength: DWORD;
- lpBuffer: LPSTR; var lpFilePart: LPSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFullPathName}
- {$ENDIF}
- const
- DDD_RAW_TARGET_PATH = $00000001;
- {$EXTERNALSYM DDD_RAW_TARGET_PATH}
- DDD_REMOVE_DEFINITION = $00000002;
- {$EXTERNALSYM DDD_REMOVE_DEFINITION}
- DDD_EXACT_MATCH_ON_REMOVE = $00000004;
- {$EXTERNALSYM DDD_EXACT_MATCH_ON_REMOVE}
- DDD_NO_BROADCAST_SYSTEM = $00000008;
- {$EXTERNALSYM DDD_NO_BROADCAST_SYSTEM}
- DDD_LUID_BROADCAST_DRIVE = $00000010;
- {$EXTERNALSYM DDD_LUID_BROADCAST_DRIVE}
- function DefineDosDeviceA(dwFlags: DWORD; lpDeviceName, lpTargetPath: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DefineDosDeviceA}
- function DefineDosDeviceW(dwFlags: DWORD; lpDeviceName, lpTargetPath: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DefineDosDeviceW}
- {$IFDEF UNICODE}
- function DefineDosDevice(dwFlags: DWORD; lpDeviceName, lpTargetPath: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DefineDosDevice}
- {$ELSE}
- function DefineDosDevice(dwFlags: DWORD; lpDeviceName, lpTargetPath: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DefineDosDevice}
- {$ENDIF}
- function QueryDosDeviceA(lpDeviceName, lpTargetPath: LPSTR; ucchMax: DWORD): DWORD; stdcall;
- {$EXTERNALSYM QueryDosDeviceA}
- function QueryDosDeviceW(lpDeviceName, lpTargetPath: LPWSTR; ucchMax: DWORD): DWORD; stdcall;
- {$EXTERNALSYM QueryDosDeviceW}
- {$IFDEF UNICODE}
- function QueryDosDevice(lpDeviceName, lpTargetPath: LPWSTR; ucchMax: DWORD): DWORD; stdcall;
- {$EXTERNALSYM QueryDosDevice}
- {$ELSE}
- function QueryDosDevice(lpDeviceName, lpTargetPath: LPSTR; ucchMax: DWORD): DWORD; stdcall;
- {$EXTERNALSYM QueryDosDevice}
- {$ENDIF}
- function CreateFileA(lpFileName: LPCSTR; dwDesiredAccess, dwShareMode: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES; dwCreationDisposition: DWORD;
- dwFlagsAndAttributes: DWORD; hTemplateFile: HANDLE): HANDLE; stdcall;
- {$EXTERNALSYM CreateFileA}
- function CreateFileW(lpFileName: LPCWSTR; dwDesiredAccess, dwShareMode: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES; dwCreationDisposition: DWORD;
- dwFlagsAndAttributes: DWORD; hTemplateFile: HANDLE): HANDLE; stdcall;
- {$EXTERNALSYM CreateFileW}
- {$IFDEF UNICODE}
- function CreateFile(lpFileName: LPCWSTR; dwDesiredAccess, dwShareMode: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES; dwCreationDisposition: DWORD;
- dwFlagsAndAttributes: DWORD; hTemplateFile: HANDLE): HANDLE; stdcall;
- {$EXTERNALSYM CreateFile}
- {$ELSE}
- function CreateFile(lpFileName: LPCSTR; dwDesiredAccess, dwShareMode: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES; dwCreationDisposition: DWORD;
- dwFlagsAndAttributes: DWORD; hTemplateFile: HANDLE): HANDLE; stdcall;
- {$EXTERNALSYM CreateFile}
- {$ENDIF}
- function SetFileAttributesA(lpFileName: LPCSTR; dwFileAttributes: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetFileAttributesA}
- function SetFileAttributesW(lpFileName: LPCWSTR; dwFileAttributes: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetFileAttributesW}
- {$IFDEF UNICODE}
- function SetFileAttributes(lpFileName: LPCWSTR; dwFileAttributes: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetFileAttributes}
- {$ELSE}
- function SetFileAttributes(lpFileName: LPCSTR; dwFileAttributes: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetFileAttributes}
- {$ENDIF}
- function GetFileAttributesA(lpFileName: LPCSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFileAttributesA}
- function GetFileAttributesW(lpFileName: LPCWSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFileAttributesW}
- {$IFDEF UNICODE}
- function GetFileAttributes(lpFileName: LPCWSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFileAttributes}
- {$ELSE}
- function GetFileAttributes(lpFileName: LPCSTR): DWORD; stdcall;
- {$EXTERNALSYM GetFileAttributes}
- {$ENDIF}
- type
- _GET_FILEEX_INFO_LEVELS = (GetFileExInfoStandard, GetFileExMaxInfoLevel);
- {$EXTERNALSYM _GET_FILEEX_INFO_LEVELS}
- GET_FILEEX_INFO_LEVELS = _GET_FILEEX_INFO_LEVELS;
- {$EXTERNALSYM GET_FILEEX_INFO_LEVELS}
- TGetFileExInfoLevels = GET_FILEEX_INFO_LEVELS;
- function GetFileAttributesExA(lpFileName: LPCSTR;
- fInfoLevelId: GET_FILEEX_INFO_LEVELS; lpFileInformation: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM GetFileAttributesExA}
- function GetFileAttributesExW(lpFileName: LPCWSTR;
- fInfoLevelId: GET_FILEEX_INFO_LEVELS; lpFileInformation: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM GetFileAttributesExW}
- {$IFDEF UNICODE}
- function GetFileAttributesEx(lpFileName: LPCWSTR;
- fInfoLevelId: GET_FILEEX_INFO_LEVELS; lpFileInformation: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM GetFileAttributesEx}
- {$ELSE}
- function GetFileAttributesEx(lpFileName: LPCSTR;
- fInfoLevelId: GET_FILEEX_INFO_LEVELS; lpFileInformation: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM GetFileAttributesEx}
- {$ENDIF}
- function GetCompressedFileSizeA(lpFileName: LPCSTR; lpFileSizeHigh: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM GetCompressedFileSizeA}
- function GetCompressedFileSizeW(lpFileName: LPCWSTR; lpFileSizeHigh: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM GetCompressedFileSizeW}
- {$IFDEF UNICODE}
- function GetCompressedFileSize(lpFileName: LPCWSTR; lpFileSizeHigh: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM GetCompressedFileSize}
- {$ELSE}
- function GetCompressedFileSize(lpFileName: LPCSTR; lpFileSizeHigh: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM GetCompressedFileSize}
- {$ENDIF}
- function DeleteFileA(lpFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteFileA}
- function DeleteFileW(lpFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteFileW}
- {$IFDEF UNICODE}
- function DeleteFile(lpFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteFile}
- {$ELSE}
- function DeleteFile(lpFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteFile}
- {$ENDIF}
- type
- _FINDEX_INFO_LEVELS = (FindExInfoStandard, FindExInfoMaxInfoLevel);
- {$EXTERNALSYM _FINDEX_INFO_LEVELS}
- FINDEX_INFO_LEVELS = _FINDEX_INFO_LEVELS;
- {$EXTERNALSYM FINDEX_INFO_LEVELS}
- TFindExInfoLevels = FINDEX_INFO_LEVELS;
- _FINDEX_SEARCH_OPS = (
- FindExSearchNameMatch,
- FindExSearchLimitToDirectories,
- FindExSearchLimitToDevices,
- FindExSearchMaxSearchOp);
- {$EXTERNALSYM _FINDEX_SEARCH_OPS}
- FINDEX_SEARCH_OPS = _FINDEX_SEARCH_OPS;
- {$EXTERNALSYM FINDEX_SEARCH_OPS}
- TFindExSearchOps = FINDEX_SEARCH_OPS;
- const
- FIND_FIRST_EX_CASE_SENSITIVE = $00000001;
- {$EXTERNALSYM FIND_FIRST_EX_CASE_SENSITIVE}
- function FindFirstFileExA(lpFileName: LPCSTR; fInfoLevelId: FINDEX_INFO_LEVELS;
- lpFindFileData: LPVOID; fSearchOp: FINDEX_SEARCH_OPS; lpSearchFilter: LPVOID;
- dwAdditionalFlags: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileExA}
- function FindFirstFileExW(lpFileName: LPCWSTR; fInfoLevelId: FINDEX_INFO_LEVELS;
- lpFindFileData: LPVOID; fSearchOp: FINDEX_SEARCH_OPS; lpSearchFilter: LPVOID;
- dwAdditionalFlags: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileExW}
- {$IFDEF UNICODE}
- function FindFirstFileEx(lpFileName: LPCWSTR; fInfoLevelId: FINDEX_INFO_LEVELS;
- lpFindFileData: LPVOID; fSearchOp: FINDEX_SEARCH_OPS; lpSearchFilter: LPVOID;
- dwAdditionalFlags: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileEx}
- {$ELSE}
- function FindFirstFileEx(lpFileName: LPCSTR; fInfoLevelId: FINDEX_INFO_LEVELS;
- lpFindFileData: LPVOID; fSearchOp: FINDEX_SEARCH_OPS; lpSearchFilter: LPVOID;
- dwAdditionalFlags: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileEx}
- {$ENDIF}
- function FindFirstFileA(lpFileName: LPCSTR; var lpFindFileData: WIN32_FIND_DATAA): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileA}
- function FindFirstFileW(lpFileName: LPCWSTR; var lpFindFileData: WIN32_FIND_DATAW): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFileW}
- {$IFDEF UNICODE}
- function FindFirstFile(lpFileName: LPCWSTR; var lpFindFileData: WIN32_FIND_DATAW): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFile}
- {$ELSE}
- function FindFirstFile(lpFileName: LPCSTR; var lpFindFileData: WIN32_FIND_DATAA): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstFile}
- {$ENDIF}
- function FindNextFileA(hFindFile: HANDLE; var FindFileData: WIN32_FIND_DATAA): BOOL; stdcall;
- {$EXTERNALSYM FindNextFileA}
- function FindNextFileW(hFindFile: HANDLE; var lpFindFileData: WIN32_FIND_DATAW): BOOL; stdcall;
- {$EXTERNALSYM FindNextFileW}
- {$IFDEF UNICODE}
- function FindNextFile(hFindFile: HANDLE; var lpFindFileData: WIN32_FIND_DATAW): BOOL; stdcall;
- {$EXTERNALSYM FindNextFile}
- {$ELSE}
- function FindNextFile(hFindFile: HANDLE; var lpFindFileData: WIN32_FIND_DATAA): BOOL; stdcall;
- {$EXTERNALSYM FindNextFile}
- {$ENDIF}
- function SearchPathA(lpPath, lpFileName, lpExtension: LPCSTR; nBufferLength: DWORD;
- lpBuffer: LPSTR; var lpFilePart: LPSTR): DWORD; stdcall;
- {$EXTERNALSYM SearchPathA}
- function SearchPathW(lpPath, lpFileName, lpExtension: LPCWSTR; nBufferLength: DWORD;
- lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall;
- {$EXTERNALSYM SearchPathW}
- {$IFDEF UNICODE}
- function SearchPath(lpPath, lpFileName, lpExtension: LPCWSTR; nBufferLength: DWORD;
- lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall;
- {$EXTERNALSYM SearchPath}
- {$ELSE}
- function SearchPath(lpPath, lpFileName, lpExtension: LPCSTR; nBufferLength: DWORD;
- lpBuffer: LPSTR; var lpFilePart: LPSTR): DWORD; stdcall;
- {$EXTERNALSYM SearchPath}
- {$ENDIF}
- function CopyFileA(lpExistingFileName, lpNewFileName: LPCSTR; bFailIfExists: BOOL): BOOL; stdcall;
- {$EXTERNALSYM CopyFileA}
- function CopyFileW(lpExistingFileName, lpNewFileName: LPCWSTR; bFailIfExists: BOOL): BOOL; stdcall;
- {$EXTERNALSYM CopyFileW}
- {$IFDEF UNICODE}
- function CopyFile(lpExistingFileName, lpNewFileName: LPCWSTR; bFailIfExists: BOOL): BOOL; stdcall;
- {$EXTERNALSYM CopyFile}
- {$ELSE}
- function CopyFile(lpExistingFileName, lpNewFileName: LPCSTR; bFailIfExists: BOOL): BOOL; stdcall;
- {$EXTERNALSYM CopyFile}
- {$ENDIF}
- type
- LPPROGRESS_ROUTINE = function (
- TotalFileSize: LARGE_INTEGER;
- TotalBytesTransferred: LARGE_INTEGER;
- StreamSize: LARGE_INTEGER;
- StreamBytesTransferred: LARGE_INTEGER;
- dwStreamNumber: DWORD;
- dwCallbackReason: DWORD;
- hSourceFile: HANDLE;
- hDestinationFile: HANDLE;
- lpData: LPVOID): DWORD; stdcall;
- {$EXTERNALSYM LPPROGRESS_ROUTINE}
- TProgressRoutine = LPPROGRESS_ROUTINE;
- function CopyFileExA(lpExistingFileName, lpNewFileName: LPCSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; var pbCancel: BOOL;
- dwCopyFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CopyFileExA}
- function CopyFileExW(lpExistingFileName, lpNewFileName: LPCWSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; var pbCancel: BOOL;
- dwCopyFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CopyFileExW}
- {$IFDEF UNICODE}
- function CopyFileEx(lpExistingFileName, lpNewFileName: LPCWSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; var pbCancel: BOOL;
- dwCopyFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CopyFileEx}
- {$ELSE}
- function CopyFileEx(lpExistingFileName, lpNewFileName: LPCSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; var pbCancel: BOOL;
- dwCopyFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CopyFileEx}
- {$ENDIF}
- function MoveFileA(lpExistingFileName, lpNewFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM MoveFileA}
- function MoveFileW(lpExistingFileName, lpNewFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM MoveFileW}
- {$IFDEF UNICODE}
- function MoveFile(lpExistingFileName, lpNewFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM MoveFile}
- {$ELSE}
- function MoveFile(lpExistingFileName, lpNewFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM MoveFile}
- {$ENDIF}
- function MoveFileExA(lpExistingFileName, lpNewFileName: LPCSTR; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileExA}
- function MoveFileExW(lpExistingFileName, lpNewFileName: LPCWSTR; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileExW}
- {$IFDEF UNICODE}
- function MoveFileEx(lpExistingFileName, lpNewFileName: LPCWSTR; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileEx}
- {$ELSE}
- function MoveFileEx(lpExistingFileName, lpNewFileName: LPCSTR; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileEx}
- {$ENDIF}
- function MoveFileWithProgressA(lpExistingFileName, lpNewFileName: LPCSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileWithProgressA}
- function MoveFileWithProgressW(lpExistingFileName, lpNewFileName: LPCWSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileWithProgressW}
- {$IFDEF UNICODE}
- function MoveFileWithProgress(lpExistingFileName, lpNewFileName: LPCWSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileWithProgress}
- {$ELSE}
- function MoveFileWithProgress(lpExistingFileName, lpNewFileName: LPCSTR;
- lpProgressRoutine: LPPROGRESS_ROUTINE; lpData: LPVOID; dwFlags: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MoveFileWithProgress}
- {$ENDIF}
- const
- MOVEFILE_REPLACE_EXISTING = $00000001;
- {$EXTERNALSYM MOVEFILE_REPLACE_EXISTING}
- MOVEFILE_COPY_ALLOWED = $00000002;
- {$EXTERNALSYM MOVEFILE_COPY_ALLOWED}
- MOVEFILE_DELAY_UNTIL_REBOOT = $00000004;
- {$EXTERNALSYM MOVEFILE_DELAY_UNTIL_REBOOT}
- MOVEFILE_WRITE_THROUGH = $00000008;
- {$EXTERNALSYM MOVEFILE_WRITE_THROUGH}
- MOVEFILE_CREATE_HARDLINK = $00000010;
- {$EXTERNALSYM MOVEFILE_CREATE_HARDLINK}
- MOVEFILE_FAIL_IF_NOT_TRACKABLE = $00000020;
- {$EXTERNALSYM MOVEFILE_FAIL_IF_NOT_TRACKABLE}
- function ReplaceFileA(lpReplacedFileName, lpReplacementFileName,
- lpBackupFileName: LPCSTR; dwReplaceFlags: DWORD; lpExclude: LPVOID;
- lpReserved: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReplaceFileA}
- function ReplaceFileW(lpReplacedFileName, lpReplacementFileName,
- lpBackupFileName: LPCWSTR; dwReplaceFlags: DWORD; lpExclude: LPVOID;
- lpReserved: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReplaceFileW}
- {$IFDEF UNICODE}
- function ReplaceFile(lpReplacedFileName, lpReplacementFileName,
- lpBackupFileName: LPCWSTR; dwReplaceFlags: DWORD; lpExclude: LPVOID;
- lpReserved: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReplaceFile}
- {$ELSE}
- function ReplaceFile(lpReplacedFileName, lpReplacementFileName,
- lpBackupFileName: LPCSTR; dwReplaceFlags: DWORD; lpExclude: LPVOID;
- lpReserved: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReplaceFile}
- {$ENDIF}
- //
- // API call to create hard links.
- //
- function CreateHardLinkA(lpFileName, lpExistingFileName: LPCSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateHardLinkA}
- function CreateHardLinkW(lpFileName, lpExistingFileName: LPCWSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateHardLinkW}
- {$IFDEF UNICODE}
- function CreateHardLink(lpFileName, lpExistingFileName: LPCWSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateHardLink}
- {$ELSE}
- function CreateHardLink(lpFileName, lpExistingFileName: LPCSTR;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): BOOL; stdcall;
- {$EXTERNALSYM CreateHardLink}
- {$ENDIF}
- //#if (_WIN32_WINNT >= 0x0501)
- //
- // API call to enumerate for streams within a file
- //
- type
- _STREAM_INFO_LEVELS = (FindStreamInfoStandard, FindStreamInfoMaxInfoLevel);
- {$EXTERNALSYM _STREAM_INFO_LEVELS}
- STREAM_INFO_LEVELS = _STREAM_INFO_LEVELS;
- {$EXTERNALSYM STREAM_INFO_LEVELS}
- TStreamInfoLevels = STREAM_INFO_LEVELS;
- _WIN32_FIND_STREAM_DATA = record
- StreamSize: LARGE_INTEGER;
- cStreamName: array [0..MAX_PATH + 35] of WCHAR;
- end;
- {$EXTERNALSYM _WIN32_FIND_STREAM_DATA}
- WIN32_FIND_STREAM_DATA = _WIN32_FIND_STREAM_DATA;
- {$EXTERNALSYM WIN32_FIND_STREAM_DATA}
- PWIN32_FIND_STREAM_DATA = ^WIN32_FIND_STREAM_DATA;
- {$EXTERNALSYM PWIN32_FIND_STREAM_DATA}
- TWin32FindStreamData = WIN32_FIND_STREAM_DATA;
- PWin32FindStreamData = PWIN32_FIND_STREAM_DATA;
- function FindFirstStreamW(lpFileName: LPCWSTR; InfoLevel: STREAM_INFO_LEVELS; lpFindStreamData: LPVOID; dwFlags: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstStreamW}
- function FindNextStreamW(hFindStream: HANDLE; lpFindStreamData: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM FindNextStreamW}
- //#endif // (_WIN32_WINNT >= 0x0500)
- function CreateNamedPipeA(lpName: LPCSTR; dwOpenMode, dwPipeMode, nMaxInstances,
- nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE; stdcall;
- {$EXTERNALSYM CreateNamedPipeA}
- function CreateNamedPipeW(lpName: LPCWSTR; dwOpenMode, dwPipeMode, nMaxInstances,
- nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE; stdcall;
- {$EXTERNALSYM CreateNamedPipeW}
- {$IFDEF UNICODE}
- function CreateNamedPipe(lpName: LPCWSTR; dwOpenMode, dwPipeMode, nMaxInstances,
- nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE; stdcall;
- {$EXTERNALSYM CreateNamedPipe}
- {$ELSE}
- function CreateNamedPipe(lpName: LPCSTR; dwOpenMode, dwPipeMode, nMaxInstances,
- nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE; stdcall;
- {$EXTERNALSYM CreateNamedPipe}
- {$ENDIF}
- function GetNamedPipeHandleStateA(hNamedPipe: HANDLE; lpState, lpCurInstances,
- lpMaxCollectionCount, lpCollectDataTimeout: LPDWORD; lpUserName: LPSTR;
- nMaxUserNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetNamedPipeHandleStateA}
- function GetNamedPipeHandleStateW(hNamedPipe: HANDLE; lpState, lpCurInstances,
- lpMaxCollectionCount, lpCollectDataTimeout: LPDWORD; lpUserName: LPWSTR;
- nMaxUserNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetNamedPipeHandleStateW}
- {$IFDEF UNICODE}
- function GetNamedPipeHandleState(hNamedPipe: HANDLE; lpState, lpCurInstances,
- lpMaxCollectionCount, lpCollectDataTimeout: LPDWORD; lpUserName: LPWSTR;
- nMaxUserNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetNamedPipeHandleState}
- {$ELSE}
- function GetNamedPipeHandleState(hNamedPipe: HANDLE; lpState, lpCurInstances,
- lpMaxCollectionCount, lpCollectDataTimeout: LPDWORD; lpUserName: LPSTR;
- nMaxUserNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetNamedPipeHandleState}
- {$ENDIF}
- function CallNamedPipeA(lpNamedPipeName: LPCSTR; lpInBuffer: LPVOID;
- nInBufferSize: DWORD; lpOutBuffer: LPVOID; nOutBufferSize: DWORD;
- var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CallNamedPipeA}
- function CallNamedPipeW(lpNamedPipeName: LPCWSTR; lpInBuffer: LPVOID;
- nInBufferSize: DWORD; lpOutBuffer: LPVOID; nOutBufferSize: DWORD;
- var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CallNamedPipeW}
- {$IFDEF UNICODE}
- function CallNamedPipe(lpNamedPipeName: LPCWSTR; lpInBuffer: LPVOID;
- nInBufferSize: DWORD; lpOutBuffer: LPVOID; nOutBufferSize: DWORD;
- var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CallNamedPipe}
- {$ELSE}
- function CallNamedPipe(lpNamedPipeName: LPCSTR; lpInBuffer: LPVOID;
- nInBufferSize: DWORD; lpOutBuffer: LPVOID; nOutBufferSize: DWORD;
- var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CallNamedPipe}
- {$ENDIF}
- function WaitNamedPipeA(lpNamedPipeName: LPCSTR; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM WaitNamedPipeA}
- function WaitNamedPipeW(lpNamedPipeName: LPCWSTR; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM WaitNamedPipeW}
- {$IFDEF UNICODE}
- function WaitNamedPipe(lpNamedPipeName: LPCWSTR; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM WaitNamedPipe}
- {$ELSE}
- function WaitNamedPipe(lpNamedPipeName: LPCSTR; nTimeOut: DWORD): BOOL; stdcall;
- {$EXTERNALSYM WaitNamedPipe}
- {$ENDIF}
- function SetVolumeLabelA(lpRootPathName, lpVolumeName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeLabelA}
- function SetVolumeLabelW(lpRootPathName, lpVolumeName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeLabelW}
- {$IFDEF UNICODE}
- function SetVolumeLabel(lpRootPathName, lpVolumeName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeLabel}
- {$ELSE}
- function SetVolumeLabel(lpRootPathName, lpVolumeName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeLabel}
- {$ENDIF}
- procedure SetFileApisToOEM; stdcall;
- {$EXTERNALSYM SetFileApisToOEM}
- procedure SetFileApisToANSI; stdcall;
- {$EXTERNALSYM SetFileApisToANSI}
- function AreFileApisANSI: BOOL; stdcall;
- {$EXTERNALSYM AreFileApisANSI}
- function GetVolumeInformationA(lpRootPathName: LPCSTR; lpVolumeNameBuffer: LPSTR;
- nVolumeNameSize: DWORD; lpVolumeSerialNumber: LPDWORD;
- var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
- lpFileSystemNameBuffer: LPSTR; nFileSystemNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeInformationA}
- function GetVolumeInformationW(lpRootPathName: LPCWSTR; lpVolumeNameBuffer: LPWSTR;
- nVolumeNameSize: DWORD; lpVolumeSerialNumber: LPDWORD;
- var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
- lpFileSystemNameBuffer: LPWSTR; nFileSystemNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeInformationW}
- {$IFDEF UNICODE}
- function GetVolumeInformation(lpRootPathName: LPCWSTR; lpVolumeNameBuffer: LPWSTR;
- nVolumeNameSize: DWORD; lpVolumeSerialNumber: LPDWORD;
- var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
- lpFileSystemNameBuffer: LPWSTR; nFileSystemNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeInformation}
- {$ELSE}
- function GetVolumeInformation(lpRootPathName: LPCSTR; lpVolumeNameBuffer: LPSTR;
- nVolumeNameSize: DWORD; lpVolumeSerialNumber: LPDWORD;
- var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
- lpFileSystemNameBuffer: LPSTR; nFileSystemNameSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeInformation}
- {$ENDIF}
- function CancelIo(hFile: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM CancelIo}
- //
- // Event logging APIs
- //
- function ClearEventLogA(hEventLog: HANDLE; lpBackupFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM ClearEventLogA}
- function ClearEventLogW(hEventLog: HANDLE; lpBackupFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM ClearEventLogW}
- {$IFDEF UNICODE}
- function ClearEventLog(hEventLog: HANDLE; lpBackupFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM ClearEventLogA}
- {$ELSE}
- function ClearEventLog(hEventLog: HANDLE; lpBackupFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM ClearEventLogA}
- {$ENDIF}
- function BackupEventLogA(hEventLog: HANDLE; lpBackupFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM BackupEventLogA}
- function BackupEventLogW(hEventLog: HANDLE; lpBackupFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM BackupEventLogW}
- {$IFDEF UNICODE}
- function BackupEventLog(hEventLog: HANDLE; lpBackupFileName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM BackupEventLogA}
- {$ELSE}
- function BackupEventLog(hEventLog: HANDLE; lpBackupFileName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM BackupEventLogA}
- {$ENDIF}
- function CloseEventLog(hEventLog: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM CloseEventLog}
- function DeregisterEventSource(hEventLog: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM DeregisterEventSource}
- function NotifyChangeEventLog(hEventLog, hEvent: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM NotifyChangeEventLog}
- function GetNumberOfEventLogRecords(hEventLog: HANDLE; var NumberOfRecords: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetNumberOfEventLogRecords}
- function GetOldestEventLogRecord(hEventLog: HANDLE; var OldestRecord: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetOldestEventLogRecord}
- function OpenEventLogA(lpUNCServerName, lpSourceName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenEventLogA}
- function OpenEventLogW(lpUNCServerName, lpSourceName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenEventLogW}
- {$IFDEF UNICODE}
- function OpenEventLog(lpUNCServerName, lpSourceName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenEventLogA}
- {$ELSE}
- function OpenEventLog(lpUNCServerName, lpSourceName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenEventLogA}
- {$ENDIF}
- function RegisterEventSourceA(lpUNCServerName, lpSourceName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM RegisterEventSourceA}
- function RegisterEventSourceW(lpUNCServerName, lpSourceName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM RegisterEventSourceW}
- {$IFDEF UNICODE}
- function RegisterEventSource(lpUNCServerName, lpSourceName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM RegisterEventSourceA}
- {$ELSE}
- function RegisterEventSource(lpUNCServerName, lpSourceName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM RegisterEventSourceA}
- {$ENDIF}
- function OpenBackupEventLogA(lpUNCServerName, lpFileName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenBackupEventLogA}
- function OpenBackupEventLogW(lpUNCServerName, lpFileName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenBackupEventLogW}
- {$IFDEF UNICODE}
- function OpenBackupEventLog(lpUNCServerName, lpFileName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenBackupEventLogA}
- {$ELSE}
- function OpenBackupEventLog(lpUNCServerName, lpFileName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenBackupEventLogA}
- {$ENDIF}
- function ReadEventLogA(hEventLog: HANDLE; dwReadFlags, dwRecordOffset: DWORD;
- lpBuffer: LPVOID; nNumberOfBytesToRead: DWORD;
- var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM ReadEventLogA}
- function ReadEventLogW(hEventLog: HANDLE; dwReadFlags, dwRecordOffset: DWORD;
- lpBuffer: LPVOID; nNumberOfBytesToRead: DWORD;
- var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM ReadEventLogW}
- {$IFDEF UNICODE}
- function ReadEventLog(hEventLog: HANDLE; dwReadFlags, dwRecordOffset: DWORD;
- lpBuffer: LPVOID; nNumberOfBytesToRead: DWORD;
- var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM ReadEventLog}
- {$ELSE}
- function ReadEventLog(hEventLog: HANDLE; dwReadFlags, dwRecordOffset: DWORD;
- lpBuffer: LPVOID; nNumberOfBytesToRead: DWORD;
- var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM ReadEventLog}
- {$ENDIF}
- function ReportEventA(hEventLog: HANDLE; wType, wCategory: WORD; dwEventID: DWORD;
- lpUserSid: PSID; wNumStrings: WORD; dwDataSize: DWORD; lpStrings: LPCSTR;
- lpRawData: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReportEventA}
- function ReportEventW(hEventLog: HANDLE; wType, wCategory: WORD; dwEventID: DWORD;
- lpUserSid: PSID; wNumStrings: WORD; dwDataSize: DWORD; lpStrings: LPCWSTR;
- lpRawData: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReportEventW}
- {$IFDEF UNICODE}
- function ReportEvent(hEventLog: HANDLE; wType, wCategory: WORD; dwEventID: DWORD;
- lpUserSid: PSID; wNumStrings: WORD; dwDataSize: DWORD; lpStrings: LPCWSTR;
- lpRawData: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReportEvent}
- {$ELSE}
- function ReportEvent(hEventLog: HANDLE; wType, wCategory: WORD; dwEventID: DWORD;
- lpUserSid: PSID; wNumStrings: WORD; dwDataSize: DWORD; lpStrings: LPCSTR;
- lpRawData: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM ReportEvent}
- {$ENDIF}
- const
- EVENTLOG_FULL_INFO = 0;
- {$EXTERNALSYM EVENTLOG_FULL_INFO}
- type
- LPEVENTLOG_FULL_INFORMATION = ^EVENTLOG_FULL_INFORMATION;
- {$EXTERNALSYM LPEVENTLOG_FULL_INFORMATION}
- _EVENTLOG_FULL_INFORMATION = record
- dwFull: DWORD;
- end;
- {$EXTERNALSYM _EVENTLOG_FULL_INFORMATION}
- EVENTLOG_FULL_INFORMATION = _EVENTLOG_FULL_INFORMATION;
- {$EXTERNALSYM EVENTLOG_FULL_INFORMATION}
- TEventlogFullInformation = EVENTLOG_FULL_INFORMATION;
- PEventlogFullInformation = LPEVENTLOG_FULL_INFORMATION;
- function GetEventLogInformation(hEventLog: HANDLE; dwInfoLevel: DWORD;
- lpBuffer: LPVOID; cbBufSize: DWORD; var pcbBytesNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetEventLogInformation}
- //
- // Security APIs
- //
- function DuplicateToken(ExistingTokenHandle: HANDLE;
- ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL; DuplicateTokenHandle: PHANDLE): BOOL; stdcall;
- {$EXTERNALSYM DuplicateToken}
- function GetKernelObjectSecurity(Handle: HANDLE;
- RequestedInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR; nLength: DWORD;
- var lpnLengthNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetKernelObjectSecurity}
- function ImpersonateNamedPipeClient(hNamedPipe: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM ImpersonateNamedPipeClient}
- function ImpersonateSelf(ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL): BOOL; stdcall;
- {$EXTERNALSYM ImpersonateSelf}
- function RevertToSelf : BOOL; stdcall;
- {$EXTERNALSYM RevertToSelf}
- function SetThreadToken(Thread: PHANDLE; Token: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM SetThreadToken}
- function AccessCheck(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ClientToken: HANDLE; DesiredAccess: DWORD; const GenericMapping: GENERIC_MAPPING;
- var PrivilegeSet: PRIVILEGE_SET; var PrivilegeSetLength,
- GrantedAccess: DWORD; var AccessStatus: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheck}
- function AccessCheckByType(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; ClientToken: HANDLE; DesiredAccess: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; var PrivilegeSet: PRIVILEGE_SET;
- var PrivilegeSetLength, GrantedAccess: DWORD; var AccessStatus: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByType}
- function AccessCheckByTypeResultList(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; ClientToken: HANDLE; DesiredAccess: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; var PrivilegeSet: PRIVILEGE_SET;
- var PrivilegeSetLength, GrantedAccessList: DWORD;
- var AccessStatusList: DWORD): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultList}
- function OpenProcessToken(ProcessHandle: HANDLE; DesiredAccess: DWORD;
- var TokenHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM OpenProcessToken}
- function OpenThreadToken(ThreadHandle: HANDLE; DesiredAccess: DWORD;
- OpenAsSelf: BOOL; var TokenHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM OpenThreadToken}
- function GetTokenInformation(TokenHandle: HANDLE;
- TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: LPVOID;
- TokenInformationLength: DWORD; var ReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetTokenInformation}
- function SetTokenInformation(TokenHandle: HANDLE;
- TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: LPVOID;
- TokenInformationLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetTokenInformation}
- function AdjustTokenPrivileges(TokenHandle: HANDLE; DisableAllPrivileges: BOOL;
- NewState: PTOKEN_PRIVILEGES; BufferLength: DWORD;
- PreviousState: PTOKEN_PRIVILEGES; ReturnLength: LPDWORD): BOOL; stdcall;
- {$EXTERNALSYM AdjustTokenPrivileges}
- function AdjustTokenGroups(TokenHandle: HANDLE; ResetToDefault: BOOL;
- NewState: PTOKEN_GROUPS; BufferLength: DWORD; PreviousState: PTOKEN_GROUPS;
- ReturnLength: PDWORD): BOOL; stdcall;
- {$EXTERNALSYM AdjustTokenGroups}
- function PrivilegeCheck(ClientToken: HANDLE;
- RequiredPrivileges: PPRIVILEGE_SET; var pfResult: BOOL): BOOL; stdcall;
- {$EXTERNALSYM PrivilegeCheck}
- function AccessCheckAndAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- DesiredAccess: DWORD; const GenericMapping: GENERIC_MAPPING;
- ObjectCreation: BOOL; var GrantedAccess: DWORD;
- var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckAndAuditAlarmA}
- function AccessCheckAndAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPWSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- DesiredAccess: DWORD; const GenericMapping: GENERIC_MAPPING;
- ObjectCreation: BOOL; var GrantedAccess: DWORD;
- var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckAndAuditAlarmW}
- {$IFDEF UNICODE}
- function AccessCheckAndAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPWSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- DesiredAccess: DWORD; const GenericMapping: GENERIC_MAPPING;
- ObjectCreation: BOOL; var GrantedAccess: DWORD;
- var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckAndAuditAlarmA}
- {$ELSE}
- function AccessCheckAndAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- DesiredAccess: DWORD; const GenericMapping: GENERIC_MAPPING;
- ObjectCreation: BOOL; var GrantedAccess: DWORD;
- var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckAndAuditAlarmA}
- {$ENDIF}
- function AccessCheckByTypeAndAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName: LPCSTR; ObjectName: LPCSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE;
- Flags: DWORD; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOL; GrantedAccess: LPDWORD;
- AccessStatus: LPBOOL; pfGenerateOnClose: LPBOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeAndAuditAlarmA}
- function AccessCheckByTypeAndAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName: LPCWSTR; ObjectName: LPCWSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE;
- Flags: DWORD; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOL; GrantedAccess: LPDWORD;
- AccessStatus: LPBOOL; pfGenerateOnClose: LPBOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeAndAuditAlarmW}
- {$IFDEF UNICODE}
- function AccessCheckByTypeAndAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPCWSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE;
- Flags: DWORD; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess: DWORD; var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeAndAuditAlarmA}
- {$ELSE}
- function AccessCheckByTypeAndAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPCSTR; SecurityDescriptor: PSECURITY_DESCRIPTOR;
- PrincipalSelfSid: PSID; DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE;
- Flags: DWORD; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess: DWORD; var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeAndAuditAlarmA}
- {$ENDIF}
- function AccessCheckByTypeResultListAndAuditAlarmA(SubsystemName: LPCSTR;
- HandleId: LPVOID; ObjectTypeName, ObjectName: LPCSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmA}
- function AccessCheckByTypeResultListAndAuditAlarmW(SubsystemName: LPCWSTR;
- HandleId: LPVOID; ObjectTypeName, ObjectName: LPCWSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmW}
- {$IFDEF UNICODE}
- function AccessCheckByTypeResultListAndAuditAlarm(SubsystemName: LPCWSTR;
- HandleId: LPVOID; ObjectTypeName, ObjectName: LPCWSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmA}
- {$ELSE}
- function AccessCheckByTypeResultListAndAuditAlarm(SubsystemName: LPCSTR;
- HandleId: LPVOID; ObjectTypeName, ObjectName: LPCSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmA}
- {$ENDIF}
- function AccessCheckByTypeResultListAndAuditAlarmByHandleA(SubsystemName: LPCSTR;
- HandleId: LPVOID; ClientToken: HANDLE; ObjectTypeName, ObjectName: LPCSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmByHandleA}
- function AccessCheckByTypeResultListAndAuditAlarmByHandleW(SubsystemName: LPCWSTR;
- HandleId: LPVOID; ClientToken: HANDLE; ObjectTypeName, ObjectName: LPCWSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmByHandleW}
- {$IFDEF UNICODE}
- function AccessCheckByTypeResultListAndAuditAlarmByHandle(SubsystemName: LPCWSTR;
- HandleId: LPVOID; ClientToken: HANDLE; ObjectTypeName, ObjectName: LPCWSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmByHandle}
- {$ELSE}
- function AccessCheckByTypeResultListAndAuditAlarmByHandle(SubsystemName: LPCSTR;
- HandleId: LPVOID; ClientToken: HANDLE; ObjectTypeName, ObjectName: LPCSTR;
- SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
- DesiredAccess: DWORD; AuditType: AUDIT_EVENT_TYPE; Flags: DWORD;
- ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: DWORD;
- const GenericMapping: GENERIC_MAPPING; ObjectCreation: BOOL;
- var GrantedAccess, AccessStatusList: DWORD; var pfGenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AccessCheckByTypeResultListAndAuditAlarmByHandleA}
- {$ENDIF}
- function ObjectOpenAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName: LPSTR; ObjectName: LPSTR; pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ClientToken: HANDLE; DesiredAccess, GrantedAccess: DWORD;
- Privileges: PPRIVILEGE_SET; ObjectCreation: BOOL; AccessGranted: BOOL;
- var GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectOpenAuditAlarmA}
- function ObjectOpenAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName, ObjectName: LPWSTR; pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ClientToken: HANDLE; DesiredAccess: DWORD; GrantedAccess: DWORD;
- Privileges: PPRIVILEGE_SET; ObjectCreation: BOOL; AccessGranted: BOOL;
- var GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectOpenAuditAlarmW}
- {$IFDEF UNICODE}
- function ObjectOpenAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ObjectTypeName: LPWSTR; ObjectName: LPWSTR; pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ClientToken: HANDLE; DesiredAccess: DWORD; GrantedAccess: DWORD;
- Privileges: PPRIVILEGE_SET; ObjectCreation: BOOL; AccessGranted: BOOL;
- var GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectOpenAuditAlarmA}
- {$ELSE}
- function ObjectOpenAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- ObjectTypeName: LPSTR; ObjectName: LPSTR; pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ClientToken: HANDLE; DesiredAccess: DWORD; GrantedAccess: DWORD;
- Privileges: PPRIVILEGE_SET; ObjectCreation: BOOL; AccessGranted: BOOL;
- var GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectOpenAuditAlarmA}
- {$ENDIF}
- function ObjectPrivilegeAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- ClientToken: HANDLE; DesiredAccess: DWORD; const Privileges: PRIVILEGE_SET;
- AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectPrivilegeAuditAlarmA}
- function ObjectPrivilegeAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ClientToken: HANDLE; DesiredAccess: DWORD; const Privileges: PRIVILEGE_SET;
- AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectPrivilegeAuditAlarmW}
- {$IFDEF UNICODE}
- function ObjectPrivilegeAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- ClientToken: HANDLE; DesiredAccess: DWORD; const Privileges: PRIVILEGE_SET;
- AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectPrivilegeAuditAlarmA}
- {$ELSE}
- function ObjectPrivilegeAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- ClientToken: HANDLE; DesiredAccess: DWORD; const Privileges: PRIVILEGE_SET;
- AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectPrivilegeAuditAlarmA}
- {$ENDIF}
- function ObjectCloseAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectCloseAuditAlarmA}
- function ObjectCloseAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectCloseAuditAlarmW}
- {$IFDEF UNICODE}
- function ObjectCloseAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectCloseAuditAlarmA}
- {$ELSE}
- function ObjectCloseAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectCloseAuditAlarmA}
- {$ENDIF}
- function ObjectDeleteAuditAlarmA(SubsystemName: LPCSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectDeleteAuditAlarmA}
- function ObjectDeleteAuditAlarmW(SubsystemName: LPCWSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectDeleteAuditAlarmW}
- {$IFDEF UNICODE}
- function ObjectDeleteAuditAlarm(SubsystemName: LPCWSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectDeleteAuditAlarmA}
- {$ELSE}
- function ObjectDeleteAuditAlarm(SubsystemName: LPCSTR; HandleId: LPVOID;
- GenerateOnClose: BOOL): BOOL; stdcall;
- {$EXTERNALSYM ObjectDeleteAuditAlarmA}
- {$ENDIF}
- function PrivilegedServiceAuditAlarmA(SubsystemName, ServiceName: LPCSTR;
- ClientToken: HANDLE; const Privileges: PRIVILEGE_SET; AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM PrivilegedServiceAuditAlarmA}
- function PrivilegedServiceAuditAlarmW(SubsystemName, ServiceName: LPCWSTR;
- ClientToken: HANDLE; const Privileges: PRIVILEGE_SET; AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM PrivilegedServiceAuditAlarmW}
- {$IFDEF UNICODE}
- function PrivilegedServiceAuditAlarm(SubsystemName, ServiceName: LPCWSTR;
- ClientToken: HANDLE; const Privileges: PRIVILEGE_SET; AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM PrivilegedServiceAuditAlarmA}
- {$ELSE}
- function PrivilegedServiceAuditAlarm(SubsystemName, ServiceName: LPCSTR;
- ClientToken: HANDLE; const Privileges: PRIVILEGE_SET; AccessGranted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM PrivilegedServiceAuditAlarmA}
- {$ENDIF}
- function IsWellKnownSid(pSid: PSID; WellKnownSidType: WELL_KNOWN_SID_TYPE): BOOL; stdcall;
- {$EXTERNALSYM IsWellKnownSid}
- function CreateWellKnownSid(WellKnownSidType: WELL_KNOWN_SID_TYPE; DomainSid: PSID;
- pSid: PSID; var cbSid: DWORD): BOOL; stdcall;
- {$EXTERNALSYM CreateWellKnownSid}
- function EqualDomainSid(pSid1, pSid2: PSID; pfEqual: PBOOL): BOOL; stdcall;
- {$EXTERNALSYM EqualDomainSid}
- function GetWindowsAccountDomainSid(pSid, ppDomainSid: PSID; var cbSid: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetWindowsAccountDomainSid}
- function IsValidSid(pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM IsValidSid}
- function EqualSid(pSid1, pSid2: PSID): BOOL; stdcall;
- {$EXTERNALSYM EqualSid}
- function EqualPrefixSid(pSid1, pSid2: PSID): BOOL; stdcall;
- {$EXTERNALSYM EqualPrefixSid}
- function GetSidLengthRequired(nSubAuthorityCount: UCHAR): DWORD; stdcall;
- {$EXTERNALSYM GetSidLengthRequired}
- function AllocateAndInitializeSid(pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY;
- SubAuthorityCount: BYTE; nSubAuthority0, nSubAuthority1, nSubAuthority2,
- nSubAuthority3, nSubAuthority4, nSubAuthority5, nSubAuthority6,
- nSubAuthority7: DWORD; var pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AllocateAndInitializeSid}
- function FreeSid(pSid: PSID): PVOID; stdcall;
- {$EXTERNALSYM FreeSid}
- function InitializeSid(Sid: PSID; pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY;
- nSubAuthorityCount: BYTE): BOOL; stdcall;
- {$EXTERNALSYM InitializeSid}
- function GetSidIdentifierAuthority(pSid: PSID): PSID_IDENTIFIER_AUTHORITY; stdcall;
- {$EXTERNALSYM GetSidIdentifierAuthority}
- function GetSidSubAuthority(pSid: PSID; nSubAuthority: DWORD): PDWORD; stdcall;
- {$EXTERNALSYM GetSidSubAuthority}
- function GetSidSubAuthorityCount(pSid: PSID): PUCHAR; stdcall;
- {$EXTERNALSYM GetSidSubAuthorityCount}
- function GetLengthSid(pSid: PSID): DWORD; stdcall;
- {$EXTERNALSYM GetLengthSid}
- function CopySid(nDestinationSidLength: DWORD; pDestinationSid: PSID;
- pSourceSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM CopySid}
- function AreAllAccessesGranted(GrantedAccess, DesiredAccess: DWORD): BOOL; stdcall;
- {$EXTERNALSYM AreAllAccessesGranted}
- function AreAnyAccessesGranted(GrantedAccess, DesiredAccess: DWORD): BOOL; stdcall;
- {$EXTERNALSYM AreAnyAccessesGranted}
- procedure MapGenericMask(var AccessMask: DWORD; var GenericMapping: GENERIC_MAPPING); stdcall;
- {$EXTERNALSYM MapGenericMask}
- function IsValidAcl(pAcl: PACL): BOOL; stdcall;
- {$EXTERNALSYM IsValidAcl}
- function InitializeAcl(pAcl: PACL; nAclLength: DWORD; dwAclRevision: DWORD): BOOL; stdcall;
- {$EXTERNALSYM InitializeAcl}
- function GetAclInformation(pAcl: PACL; pAclInformation: LPVOID;
- nAclInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): BOOL; stdcall;
- {$EXTERNALSYM GetAclInformation}
- function SetAclInformation(pAcl: PACL; pAclInformation: LPVOID;
- nAclInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): BOOL; stdcall;
- {$EXTERNALSYM SetAclInformation}
- function AddAce(pAcl: PACL; dwAceRevision: DWORD; dwStartingAceIndex: DWORD;
- pAceList: LPVOID; nAceListLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM AddAce}
- function DeleteAce(pAcl: PACL; dwAceIndex: DWORD): BOOL; stdcall;
- {$EXTERNALSYM DeleteAce}
- function GetAce(pAcl: PACL; dwAceIndex: DWORD; var pAce: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM GetAce}
- function AddAccessAllowedAce(pAcl: PACL; dwAceRevision, AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessAllowedAce}
- function AddAccessAllowedAceEx(pAcl: PACL; dwAceRevision, AceFlags,
- AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessAllowedAceEx}
- function AddAccessDeniedAce(pAcl: PACL; dwAceRevision, AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessDeniedAce}
- function AddAccessDeniedAceEx(pAcl: PACL; dwAceRevision, AceFlags: DWORD;
- AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessDeniedAceEx}
- function AddAuditAccessAce(pAcl: PACL; dwAceRevision, dwAccessMask: DWORD;
- pSid: PSID; bAuditSuccess, bAuditFailure: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AddAuditAccessAce}
- function AddAuditAccessAceEx(pAcl: PACL; dwAceRevision, AceFlags,
- dwAccessMask: DWORD; pSid: PSID; bAuditSuccess, bAuditFailure: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AddAuditAccessAceEx}
- function AddAccessAllowedObjectAce(pAcl: PACL; dwAceRevision, AceFlags,
- AccessMask: DWORD; ObjectTypeGuid, InheritedObjectTypeGuid: LPGUID; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessAllowedObjectAce}
- function AddAccessDeniedObjectAce(pAcl: PACL; dwAceRevision, AceFlags,
- AccessMask: DWORD; ObjectTypeGuid, InheritedObjectTypeGuid: LPGUID; pSid: PSID): BOOL; stdcall;
- {$EXTERNALSYM AddAccessDeniedObjectAce}
- function AddAuditAccessObjectAce(pAcl: PACL; dwAceRevision, AceFlags,
- AccessMask: DWORD; ObjectTypeGuid, InheritedObjectTypeGuid: LPGUID; pSid: PSID;
- bAuditSuccess, bAuditFailure: BOOL): BOOL; stdcall;
- {$EXTERNALSYM AddAuditAccessObjectAce}
- function FindFirstFreeAce(pAcl: PACL; var pAce: LPVOID): BOOL; stdcall;
- {$EXTERNALSYM FindFirstFreeAce}
- function InitializeSecurityDescriptor(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- dwRevision: DWORD): BOOL; stdcall;
- {$EXTERNALSYM InitializeSecurityDescriptor}
- function IsValidSecurityDescriptor(pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM IsValidSecurityDescriptor}
- function GetSecurityDescriptorLength(pSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorLength}
- function GetSecurityDescriptorControl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorControl}
- function SetSecurityDescriptorControl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- ControlBitsOfInterest, ControlBitsToSet: SECURITY_DESCRIPTOR_CONTROL): BOOL; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorControl}
- function SetSecurityDescriptorDacl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- bDaclPresent: BOOL; pDacl: PACL; bDaclDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorDacl}
- function GetSecurityDescriptorDacl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var lpbDaclPresent: BOOL; var pDacl: PACL; var lpbDaclDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorDacl}
- function SetSecurityDescriptorSacl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- bSaclPresent: BOOL; pSacl: PACL; bSaclDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorSacl}
- function GetSecurityDescriptorSacl(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var lpbSaclPresent: BOOL; var pSacl: PACL; var lpbSaclDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorSacl}
- function SetSecurityDescriptorOwner(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- pOwner: PSID; bOwnerDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorOwner}
- function GetSecurityDescriptorOwner(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var pOwner: PSID; lpbOwnerDefaulted: PBOOL): BOOL; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorOwner}
- function SetSecurityDescriptorGroup(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- pGroup: PSID; bGroupDefaulted: BOOL): BOOL; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorGroup}
- function GetSecurityDescriptorGroup(pSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var pGroup: PSID; lpbGroupDefaulted: PBOOL): BOOL; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorGroup}
- function SetSecurityDescriptorRMControl(SecurityDescriptor: PSECURITY_DESCRIPTOR;
- RMControl: PUCHAR): DWORD; stdcall;
- {$EXTERNALSYM SetSecurityDescriptorRMControl}
- function GetSecurityDescriptorRMControl(SecurityDescriptor: PSECURITY_DESCRIPTOR;
- var RMControl: UCHAR): DWORD; stdcall;
- {$EXTERNALSYM GetSecurityDescriptorRMControl}
- function CreatePrivateObjectSecurity(ParentDescriptor, CreatorDescriptor: PSECURITY_DESCRIPTOR;
- var NewDescriptor: PSECURITY_DESCRIPTOR; IsDirectoryObject: BOOL; Token: HANDLE;
- const GenericMapping: GENERIC_MAPPING): BOOL; stdcall;
- {$EXTERNALSYM CreatePrivateObjectSecurity}
- function ConvertToAutoInheritPrivateObjectSecurity(ParentDescriptor,
- CurrentSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var NewSecurityDescriptor: PSECURITY_DESCRIPTOR; ObjectType: LPGUID;
- IsDirectoryObject: ByteBool; const GenericMapping: GENERIC_MAPPING): BOOL; stdcall;
- {$EXTERNALSYM ConvertToAutoInheritPrivateObjectSecurity}
- function CreatePrivateObjectSecurityEx(ParentDescriptor,
- CreatorDescriptor: PSECURITY_DESCRIPTOR;
- var NewDescriptor: PSECURITY_DESCRIPTOR; ObjectType: LPGUID;
- IsContainerObject: BOOL; AutoInheritFlags: ULONG; Token: HANDLE;
- const GenericMapping: GENERIC_MAPPING): BOOL; stdcall;
- {$EXTERNALSYM CreatePrivateObjectSecurityEx}
- function SetPrivateObjectSecurity(SecurityInformation: SECURITY_INFORMATION;
- ModificationDescriptor: PSECURITY_DESCRIPTOR;
- var ObjectsSecurityDescriptor: PSECURITY_DESCRIPTOR;
- const GenericMapping: GENERIC_MAPPING; Token: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM SetPrivateObjectSecurity}
- function SetPrivateObjectSecurityEx(SecurityInformation: SECURITY_INFORMATION;
- ModificationDescriptor: PSECURITY_DESCRIPTOR;
- var ObjectsSecurityDescriptor: PSECURITY_DESCRIPTOR; AutoInheritFlags: ULONG;
- const GenericMapping: GENERIC_MAPPING; Token: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM SetPrivateObjectSecurityEx}
- function GetPrivateObjectSecurity(ObjectDescriptor: PSECURITY_DESCRIPTOR;
- SecurityInformation: SECURITY_INFORMATION;
- ResultantDescriptor: PSECURITY_DESCRIPTOR; DescriptorLength: DWORD;
- var ReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetPrivateObjectSecurity}
- function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM DestroyPrivateObjectSecurity}
- function MakeSelfRelativeSD(pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR;
- pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR; var lpdwBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MakeSelfRelativeSD}
- function MakeAbsoluteSD(pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR;
- pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var lpdwAbsoluteSecurityDescriptorSize: DWORD; pDacl: PACL;
- var lpdwDaclSize: DWORD; pSacl: PACL; var lpdwSaclSize: DWORD; pOwner: PSID;
- var lpdwOwnerSize: DWORD; pPrimaryGroup: PSID; var lpdwPrimaryGroupSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MakeAbsoluteSD}
- function MakeAbsoluteSD2(pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR;
- var lpdwBufferSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM MakeAbsoluteSD2}
- function SetFileSecurityA(lpFileName: LPCSTR; SecurityInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM SetFileSecurityA}
- function SetFileSecurityW(lpFileName: LPCWSTR; SecurityInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM SetFileSecurityW}
- {$IFDEF UNICODE}
- function SetFileSecurity(lpFileName: LPCWSTR; SecurityInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM SetFileSecurityA}
- {$ELSE}
- function SetFileSecurity(lpFileName: LPCSTR; SecurityInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM SetFileSecurityA}
- {$ENDIF}
- function GetFileSecurityA(lpFileName: LPCSTR; RequestedInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR; nLength: DWORD;
- var lpnLengthNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetFileSecurityA}
- function GetFileSecurityW(lpFileName: LPCWSTR; RequestedInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR; nLength: DWORD;
- var lpnLengthNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetFileSecurityW}
- {$IFDEF UNICODE}
- function GetFileSecurity(lpFileName: LPCWSTR; RequestedInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR; nLength: DWORD;
- var lpnLengthNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetFileSecurityA}
- {$ELSE}
- function GetFileSecurity(lpFileName: LPCSTR; RequestedInformation: SECURITY_INFORMATION;
- pSecurityDescriptor: PSECURITY_DESCRIPTOR; nLength: DWORD;
- var lpnLengthNeeded: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetFileSecurityA}
- {$ENDIF}
- function SetKernelObjectSecurity(Handle: HANDLE; SecurityInformation: SECURITY_INFORMATION;
- SecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL; stdcall;
- {$EXTERNALSYM SetKernelObjectSecurity}
- function FindFirstChangeNotificationA(lpPathName: LPCSTR; bWatchSubtree: Cardinal;
- dwNotifyFilter: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstChangeNotificationA}
- function FindFirstChangeNotificationW(lpPathName: LPCWSTR; bWatchSubtree: Cardinal;
- dwNotifyFilter: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstChangeNotificationW}
- {$IFDEF UNICODE}
- function FindFirstChangeNotification(lpPathName: LPCWSTR; bWatchSubtree: Cardinal;
- dwNotifyFilter: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstChangeNotification}
- {$ELSE}
- function FindFirstChangeNotification(lpPathName: LPCSTR; bWatchSubtree: Cardinal;
- dwNotifyFilter: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstChangeNotification}
- {$ENDIF}
- function FindNextChangeNotification(hChangeHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM FindNextChangeNotification}
- function FindCloseChangeNotification(hChangeHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM FindCloseChangeNotification}
- function ReadDirectoryChangesW(hDirectory: HANDLE; lpBuffer: LPVOID;
- nBufferLength: DWORD; bWatchSubtree: BOOL; dwNotifyFilter: DWORD;
- lpBytesReturned: LPDWORD; lpOverlapped: LPOVERLAPPED;
- lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): BOOL; stdcall;
- {$EXTERNALSYM ReadDirectoryChangesW}
- function VirtualLock(lpAddress: LPVOID; dwSize: SIZE_T): BOOL; stdcall;
- {$EXTERNALSYM VirtualLock}
- function VirtualUnlock(lpAddress: LPVOID; dwSize: SIZE_T): BOOL; stdcall;
- {$EXTERNALSYM VirtualUnlock}
- function MapViewOfFileEx(hFileMappingObject: HANDLE; dwDesiredAccess: DWORD;
- dwFileOffsetHigh: DWORD; dwFileOffsetLow: DWORD; dwNumberOfBytesToMap: SIZE_T;
- lpBaseAddress: LPVOID): LPVOID; stdcall;
- {$EXTERNALSYM MapViewOfFileEx}
- function SetPriorityClass(hProcess: HANDLE; dwPriorityClass: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetPriorityClass}
- function GetPriorityClass(hProcess: HANDLE): DWORD; stdcall;
- {$EXTERNALSYM GetPriorityClass}
- function IsBadReadPtr(lp: LPVOID; ucb: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadReadPtr}
- function IsBadWritePtr(lp: LPVOID; ucb: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadWritePtr}
- function IsBadHugeReadPtr(lp: LPVOID; ucb: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadHugeReadPtr}
- function IsBadHugeWritePtr(lp: LPVOID; ucb: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadHugeWritePtr}
- function IsBadCodePtr(lpfn: FARPROC): BOOL; stdcall;
- {$EXTERNALSYM IsBadCodePtr}
- function IsBadStringPtrA(lpsz: LPCSTR; ucchMax: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadStringPtrA}
- function IsBadStringPtrW(lpsz: LPCWSTR; ucchMax: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadStringPtrW}
- {$IFDEF UNICODE}
- function IsBadStringPtr(lpsz: LPCWSTR; ucchMax: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadStringPtr}
- {$ELSE}
- function IsBadStringPtr(lpsz: LPCSTR; ucchMax: UINT_PTR): BOOL; stdcall;
- {$EXTERNALSYM IsBadStringPtr}
- {$ENDIF}
- function LookupAccountSidA(lpSystemName: LPCSTR; Sid: PSID; Name: LPSTR;
- var cbName: DWORD; ReferencedDomainName: LPSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountSidA}
- function LookupAccountSidW(lpSystemName: LPCWSTR; Sid: PSID; Name: LPWSTR;
- var cbName: DWORD; ReferencedDomainName: LPWSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountSidW}
- {$IFDEF UNICODE}
- function LookupAccountSid(lpSystemName: LPCWSTR; Sid: PSID; Name: LPWSTR;
- var cbName: DWORD; ReferencedDomainName: LPWSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountSid}
- {$ELSE}
- function LookupAccountSid(lpSystemName: LPCSTR; Sid: PSID; Name: LPSTR;
- var cbName: DWORD; ReferencedDomainName: LPSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountSid}
- {$ENDIF}
- function LookupAccountNameA(lpSystemName, lpAccountName: LPCSTR; Sid: PSID;
- var cbSid: DWORD; ReferencedDomainName: LPSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountNameA}
- function LookupAccountNameW(lpSystemName, lpAccountName: LPCWSTR; Sid: PSID;
- var cbSid: DWORD; ReferencedDomainName: LPWSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountNameW}
- {$IFDEF UNICODE}
- function LookupAccountName(lpSystemName: LPCWSTR; lpAccountName: LPCWSTR; Sid: PSID;
- var cbSid: DWORD; ReferencedDomainName: LPWSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountName}
- {$ELSE}
- function LookupAccountName(lpSystemName: LPCSTR; lpAccountName: LPCSTR; Sid: PSID;
- var cbSid: DWORD; ReferencedDomainName: LPSTR; var cbReferencedDomainName: DWORD;
- var peUse: SID_NAME_USE): BOOL; stdcall;
- {$EXTERNALSYM LookupAccountName}
- {$ENDIF}
- function LookupPrivilegeValueA(lpSystemName, lpName: LPCSTR; var lpLuid: LUID): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeValueA}
- function LookupPrivilegeValueW(lpSystemName, lpName: LPCWSTR; var lpLuid: LUID): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeValueW}
- {$IFDEF UNICODE}
- function LookupPrivilegeValue(lpSystemName, lpName: LPCWSTR; var lpLuid: LUID): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeValue}
- {$ELSE}
- function LookupPrivilegeValue(lpSystemName, lpName: LPCSTR; var lpLuid: LUID): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeValue}
- {$ENDIF}
- function LookupPrivilegeNameA(lpSystemName: LPCSTR; const lpLuid: LUID;
- lpName: LPSTR; var cbName: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeNameA}
- function LookupPrivilegeNameW(lpSystemName: LPCWSTR; const lpLuid: LUID;
- lpName: LPWSTR; var cbName: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeNameW}
- {$IFDEF UNICODE}
- function LookupPrivilegeName(lpSystemName: LPCWSTR; const lpLuid: LUID;
- lpName: LPWSTR; var cbName: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeName}
- {$ELSE}
- function LookupPrivilegeName(lpSystemName: LPCSTR; const lpLuid: LUID;
- lpName: LPSTR; var cbName: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeName}
- {$ENDIF}
- function LookupPrivilegeDisplayNameA(lpSystemName, lpName: LPCSTR;
- lpDisplayName: LPSTR; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeDisplayNameA}
- function LookupPrivilegeDisplayNameW(lpSystemName, lpName: LPCWSTR;
- lpDisplayName: LPWSTR; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeDisplayNameW}
- {$IFDEF UNICODE}
- function LookupPrivilegeDisplayName(lpSystemName, lpName: LPCWSTR;
- lpDisplayName: LPWSTR; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeDisplayName}
- {$ELSE}
- function LookupPrivilegeDisplayName(lpSystemName, lpName: LPCSTR;
- lpDisplayName: LPSTR; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
- {$EXTERNALSYM LookupPrivilegeDisplayName}
- {$ENDIF}
- function AllocateLocallyUniqueId(var Luid: LUID): BOOL; stdcall;
- {$EXTERNALSYM AllocateLocallyUniqueId}
- function BuildCommDCBA(lpDef: LPCSTR; var lpDCB: DCB): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBA}
- function BuildCommDCBW(lpDef: LPCWSTR; var lpDCB: DCB): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBW}
- {$IFDEF UNICODE}
- function BuildCommDCB(lpDef: LPCWSTR; var lpDCB: DCB): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCB}
- {$ELSE}
- function BuildCommDCB(lpDef: LPCSTR; var lpDCB: DCB): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCB}
- {$ENDIF}
- function BuildCommDCBAndTimeoutsA(lpDef: LPCSTR; var lpDCB: DCB;
- var lpCommTimeouts: COMMTIMEOUTS): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBAndTimeoutsA}
- function BuildCommDCBAndTimeoutsW(lpDef: LPCWSTR; var lpDCB: DCB;
- var lpCommTimeouts: COMMTIMEOUTS): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBAndTimeoutsW}
- {$IFDEF UNICODE}
- function BuildCommDCBAndTimeouts(lpDef: LPCWSTR; var lpDCB: DCB;
- var lpCommTimeouts: COMMTIMEOUTS): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBAndTimeouts}
- {$ELSE}
- function BuildCommDCBAndTimeouts(lpDef: LPCSTR; var lpDCB: DCB;
- var lpCommTimeouts: COMMTIMEOUTS): BOOL; stdcall;
- {$EXTERNALSYM BuildCommDCBAndTimeouts}
- {$ENDIF}
- function CommConfigDialogA(lpszName: LPCSTR; hWnd: HWND; var lpCC: COMMCONFIG): BOOL; stdcall;
- {$EXTERNALSYM CommConfigDialogA}
- function CommConfigDialogW(lpszName: LPCWSTR; hWnd: HWND; var lpCC: COMMCONFIG): BOOL; stdcall;
- {$EXTERNALSYM CommConfigDialogW}
- {$IFDEF UNICODE}
- function CommConfigDialog(lpszName: LPCWSTR; hWnd: HWND; var lpCC: COMMCONFIG): BOOL; stdcall;
- {$EXTERNALSYM CommConfigDialog}
- {$ELSE}
- function CommConfigDialog(lpszName: LPCSTR; hWnd: HWND; var lpCC: COMMCONFIG): BOOL; stdcall;
- {$EXTERNALSYM CommConfigDialog}
- {$ENDIF}
- function GetDefaultCommConfigA(lpszName: LPCSTR; var lpCC: COMMCONFIG;
- var lpdwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetDefaultCommConfigA}
- function GetDefaultCommConfigW(lpszName: LPCWSTR; var lpCC: COMMCONFIG;
- var lpdwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetDefaultCommConfigW}
- {$IFDEF UNICODE}
- function GetDefaultCommConfig(lpszName: LPCWSTR; var lpCC: COMMCONFIG;
- var lpdwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetDefaultCommConfig}
- {$ELSE}
- function GetDefaultCommConfig(lpszName: LPCSTR; var lpCC: COMMCONFIG;
- var lpdwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetDefaultCommConfig}
- {$ENDIF}
- function SetDefaultCommConfigA(lpszName: LPCSTR; const lpCC: COMMCONFIG;
- dwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetDefaultCommConfigA}
- function SetDefaultCommConfigW(lpszName: LPCWSTR; const lpCC: COMMCONFIG;
- dwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetDefaultCommConfigW}
- {$IFDEF UNICODE}
- function SetDefaultCommConfig(lpszName: LPCWSTR; const lpCC: COMMCONFIG;
- dwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetDefaultCommConfig}
- {$ELSE}
- function SetDefaultCommConfig(lpszName: LPCSTR; const lpCC: COMMCONFIG;
- dwSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetDefaultCommConfig}
- {$ENDIF}
- const
- MAX_COMPUTERNAME_LENGTH = 15;
- {$EXTERNALSYM MAX_COMPUTERNAME_LENGTH}
- function GetComputerNameA(lpBuffer: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameA}
- function GetComputerNameW(lpBuffer: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameW}
- {$IFDEF UNICODE}
- function GetComputerName(lpBuffer: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameA}
- {$ELSE}
- function GetComputerName(lpBuffer: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameA}
- {$ENDIF}
- function SetComputerNameA(lpComputerName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameA}
- function SetComputerNameW(lpComputerName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameW}
- {$IFDEF UNICODE}
- function SetComputerName(lpComputerName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameA}
- {$ELSE}
- function SetComputerName(lpComputerName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameA}
- {$ENDIF}
- type
- _COMPUTER_NAME_FORMAT = (
- ComputerNameNetBIOS,
- ComputerNameDnsHostname,
- ComputerNameDnsDomain,
- ComputerNameDnsFullyQualified,
- ComputerNamePhysicalNetBIOS,
- ComputerNamePhysicalDnsHostname,
- ComputerNamePhysicalDnsDomain,
- ComputerNamePhysicalDnsFullyQualified,
- ComputerNameMax);
- {$EXTERNALSYM _COMPUTER_NAME_FORMAT}
- COMPUTER_NAME_FORMAT = _COMPUTER_NAME_FORMAT;
- {$EXTERNALSYM COMPUTER_NAME_FORMAT}
- TComputerNameFormat = COMPUTER_NAME_FORMAT;
- function GetComputerNameExA(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPSTR;
- var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameExA}
- function GetComputerNameExW(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPWSTR;
- var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameExW}
- {$IFDEF UNICODE}
- function GetComputerNameEx(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPWSTR;
- varnSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameExA}
- {$ELSE}
- function GetComputerNameEx(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPSTR;
- var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetComputerNameExA}
- {$ENDIF}
- function SetComputerNameExA(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameExA}
- function SetComputerNameExW(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameExW}
- {$IFDEF UNICODE}
- function SetComputerNameEx(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameExA}
- {$ELSE}
- function SetComputerNameEx(NameType: COMPUTER_NAME_FORMAT; lpBuffer: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetComputerNameExA}
- {$ENDIF}
- function AddLocalAlternateComputerNameA(lpDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM AddLocalAlternateComputerNameA}
- function AddLocalAlternateComputerNameW(lpDnsFQHostname: LPCWSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM AddLocalAlternateComputerNameW}
- {$IFDEF UNICODE}
- function AddLocalAlternateComputerName(lpDnsFQHostname: LPCWSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM AddLocalAlternateComputerName}
- {$ELSE}
- function AddLocalAlternateComputerName(lpDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM AddLocalAlternateComputerName}
- {$ENDIF}
- function RemoveLocalAlternateComputerNameA(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM RemoveLocalAlternateComputerNameA}
- function RemoveLocalAlternateComputerNameW(lpAltDnsFQHostname: LPCWSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM RemoveLocalAlternateComputerNameW}
- {$IFDEF UNICODE}
- function RemoveLocalAlternateComputerName(lpAltDnsFQHostname: LPCWSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM RemoveLocalAlternateComputerName}
- {$ELSE}
- function RemoveLocalAlternateComputerName(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM RemoveLocalAlternateComputerName}
- {$ENDIF}
- function SetLocalPrimaryComputerNameA(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM SetLocalPrimaryComputerNameA}
- function SetLocalPrimaryComputerNameW(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM SetLocalPrimaryComputerNameW}
- {$IFDEF UNICODE}
- function SetLocalPrimaryComputerName(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM SetLocalPrimaryComputerName}
- {$ELSE}
- function SetLocalPrimaryComputerName(lpAltDnsFQHostname: LPCSTR; ulFlags: ULONG): DWORD; stdcall;
- {$EXTERNALSYM SetLocalPrimaryComputerName}
- {$ENDIF}
- type
- _COMPUTER_NAME_TYPE = (
- PrimaryComputerName,
- AlternateComputerNames,
- AllComputerNames,
- ComputerNameTypeMax);
- {$EXTERNALSYM _COMPUTER_NAME_TYPE}
- COMPUTER_NAME_TYPE = _COMPUTER_NAME_TYPE;
- {$EXTERNALSYM COMPUTER_NAME_TYPE}
- TComputerNameType = COMPUTER_NAME_TYPE;
- function EnumerateLocalComputerNamesA(NameType: COMPUTER_NAME_TYPE; ulFlags: ULONG;
- lpDnsFQHostname: LPSTR; var nSize: DWORD): DWORD; stdcall;
- {$EXTERNALSYM EnumerateLocalComputerNamesA}
- function EnumerateLocalComputerNamesW(NameType: COMPUTER_NAME_TYPE; ulFlags: ULONG;
- lpDnsFQHostname: LPWSTR; var nSize: DWORD): DWORD; stdcall;
- {$EXTERNALSYM EnumerateLocalComputerNamesW}
- {$IFDEF UNICODE}
- function EnumerateLocalComputerNames(NameType: COMPUTER_NAME_TYPE; ulFlags: ULONG;
- lpDnsFQHostname: LPWSTR; var nSize: DWORD): DWORD; stdcall;
- {$EXTERNALSYM EnumerateLocalComputerNames}
- {$ELSE}
- function EnumerateLocalComputerNames(NameType: COMPUTER_NAME_TYPE; ulFlags: ULONG;
- lpDnsFQHostname: LPSTR; var nSize: DWORD): DWORD; stdcall;
- {$EXTERNALSYM EnumerateLocalComputerNames}
- {$ENDIF}
- function DnsHostnameToComputerNameA(Hostname, ComputerName: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM DnsHostnameToComputerNameA}
- function DnsHostnameToComputerNameW(Hostname, ComputerName: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM DnsHostnameToComputerNameW}
- {$IFDEF UNICODE}
- function DnsHostnameToComputerName(Hostname, ComputerName: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM DnsHostnameToComputerNameA}
- {$ELSE}
- function DnsHostnameToComputerName(Hostname, ComputerName: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM DnsHostnameToComputerNameA}
- {$ENDIF}
- function GetUserNameA(lpBuffer: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetUserNameA}
- function GetUserNameW(lpBuffer: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetUserNameW}
- {$IFDEF UNICODE}
- function GetUserName(lpBuffer: LPWSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetUserNameA}
- {$ELSE}
- function GetUserName(lpBuffer: LPSTR; var nSize: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetUserNameA}
- {$ENDIF}
- //
- // Logon Support APIs
- //
- const
- LOGON32_LOGON_INTERACTIVE = 2;
- {$EXTERNALSYM LOGON32_LOGON_INTERACTIVE}
- LOGON32_LOGON_NETWORK = 3;
- {$EXTERNALSYM LOGON32_LOGON_NETWORK}
- LOGON32_LOGON_BATCH = 4;
- {$EXTERNALSYM LOGON32_LOGON_BATCH}
- LOGON32_LOGON_SERVICE = 5;
- {$EXTERNALSYM LOGON32_LOGON_SERVICE}
- LOGON32_LOGON_UNLOCK = 7;
- {$EXTERNALSYM LOGON32_LOGON_UNLOCK}
- LOGON32_LOGON_NETWORK_CLEARTEXT = 8;
- {$EXTERNALSYM LOGON32_LOGON_NETWORK_CLEARTEXT}
- LOGON32_LOGON_NEW_CREDENTIALS = 9;
- {$EXTERNALSYM LOGON32_LOGON_NEW_CREDENTIALS}
- LOGON32_PROVIDER_DEFAULT = 0;
- {$EXTERNALSYM LOGON32_PROVIDER_DEFAULT}
- LOGON32_PROVIDER_WINNT35 = 1;
- {$EXTERNALSYM LOGON32_PROVIDER_WINNT35}
- LOGON32_PROVIDER_WINNT40 = 2;
- {$EXTERNALSYM LOGON32_PROVIDER_WINNT40}
- LOGON32_PROVIDER_WINNT50 = 3;
- {$EXTERNALSYM LOGON32_PROVIDER_WINNT50}
- function LogonUserA(lpszUsername, lpszDomain, lpszPassword: LPCSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM LogonUserA}
- function LogonUserW(lpszUsername, lpszDomain, lpszPassword: LPCWSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM LogonUserW}
- {$IFDEF UNICODE}
- function LogonUser(lpszUsername, lpszDomain, lpszPassword: LPCWSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM LogonUserA}
- {$ELSE}
- function LogonUser(lpszUsername, lpszDomain, lpszPassword: LPCSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM LogonUserA}
- {$ENDIF}
- function LogonUserExA(lpszUsername, lpszDomain, lpszPassword: LPCSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE; ppLogonSid: PPSID;
- ppProfileBuffer: PPVOID; pdwProfileLength: LPDWORD; pQuotaLimits: PQUOTA_LIMITS): BOOL; stdcall;
- {$EXTERNALSYM LogonUserExA}
- function LogonUserExW(lpszUsername, lpszDomain, lpszPassword: LPCWSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE; ppLogonSid: PPSID;
- ppProfileBuffer: PPVOID; pdwProfileLength: LPDWORD; pQuotaLimits: PQUOTA_LIMITS): BOOL; stdcall;
- {$EXTERNALSYM LogonUserExW}
- {$IFDEF UNICODE}
- function LogonUserEx(lpszUsername, lpszDomain, lpszPassword: LPCWSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE; ppLogonSid: PPSID;
- ppProfileBuffer: PPVOID; pdwProfileLength: LPDWORD; pQuotaLimits: PQUOTA_LIMITS): BOOL; stdcall;
- {$EXTERNALSYM LogonUserEx}
- {$ELSE}
- function LogonUserEx(lpszUsername, lpszDomain, lpszPassword: LPCSTR;
- dwLogonType, dwLogonProvider: DWORD; var phToken: HANDLE; ppLogonSid: PPSID;
- ppProfileBuffer: PPVOID; pdwProfileLength: LPDWORD; pQuotaLimits: PQUOTA_LIMITS): BOOL; stdcall;
- {$EXTERNALSYM LogonUserEx}
- {$ENDIF}
- function ImpersonateLoggedOnUser(hToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM ImpersonateLoggedOnUser}
- function CreateProcessAsUserA(hToken: HANDLE; lpApplicationName: LPCSTR;
- lpCommandLine: LPSTR; lpProcessAttributes: LPSECURITY_ATTRIBUTES;
- lpThreadAttributes: LPSECURITY_ATTRIBUTES; bInheritHandles: BOOL;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCSTR;
- const lpStartupInfo: STARTUPINFOA; var lpProcessInformation: PROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessAsUserA}
- function CreateProcessAsUserW(hToken: HANDLE; lpApplicationName: LPCWSTR;
- lpCommandLine: LPWSTR; lpProcessAttributes: LPSECURITY_ATTRIBUTES;
- lpThreadAttributes: LPSECURITY_ATTRIBUTES; bInheritHandles: BOOL;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCWSTR;
- const lpStartupInfo: STARTUPINFOW; var lpProcessInformation: PROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessAsUserW}
- {$IFDEF UNICODE}
- function CreateProcessAsUser(hToken: HANDLE; lpApplicationName: LPCWSTR;
- lpCommandLine: LPWSTR; lpProcessAttributes: LPSECURITY_ATTRIBUTES;
- lpThreadAttributes: LPSECURITY_ATTRIBUTES; bInheritHandles: BOOL;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCWSTR;
- const lpStartupInfo: STARTUPINFOW; var lpProcessInformation: PROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessAsUserA}
- {$ELSE}
- function CreateProcessAsUser(hToken: HANDLE; lpApplicationName: LPCSTR;
- lpCommandLine: LPSTR; lpProcessAttributes: LPSECURITY_ATTRIBUTES;
- lpThreadAttributes: LPSECURITY_ATTRIBUTES; bInheritHandles: BOOL;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCSTR;
- const lpStartupInfo: STARTUPINFOA; var lpProcessInformation: PROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessAsUserA}
- {$ENDIF}
- //
- // LogonFlags
- //
- const
- LOGON_WITH_PROFILE = $00000001;
- {$EXTERNALSYM LOGON_WITH_PROFILE}
- LOGON_NETCREDENTIALS_ONLY = $00000002;
- {$EXTERNALSYM LOGON_NETCREDENTIALS_ONLY}
- LOGON_ZERO_PASSWORD_BUFFER = DWORD($80000000);
- {$EXTERNALSYM LOGON_ZERO_PASSWORD_BUFFER}
- function CreateProcessWithLogonW(lpUsername, lpDomain, lpPassword: LPCWSTR;
- dwLogonFlags: DWORD; lpApplicationName: LPCWSTR; lpCommandLine: LPWSTR;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCWSTR;
- const lpStartupInfo: STARTUPINFOW; var lpProcessInformation: PROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessWithLogonW}
- function CreateProcessWithTokenW(hToken: HANDLE; dwLogonFlags: DWORD; lpApplicationName: LPCWSTR; lpCommandLine: LPWSTR;
- dwCreationFlags: DWORD; lpEnvironment: LPVOID; lpCurrentDirectory: LPCWSTR; lpStartupInfo: LPSTARTUPINFOW;
- lpProcessInformation: LPPROCESS_INFORMATION): BOOL; stdcall;
- {$EXTERNALSYM CreateProcessWithTokenW}
- function ImpersonateAnonymousToken(ThreadHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM ImpersonateAnonymousToken}
- function DuplicateTokenEx(hExistingToken: HANDLE; dwDesiredAccess: DWORD;
- lpTokenAttributes: LPSECURITY_ATTRIBUTES; ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL;
- TokenType: TOKEN_TYPE; var phNewToken: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM DuplicateTokenEx}
- function CreateRestrictedToken(ExistingTokenHandle: HANDLE; Flags: DWORD;
- DisableSidCount: DWORD; SidsToDisable: PSID_AND_ATTRIBUTES;
- DeletePrivilegeCount: DWORD; PrivilegesToDelete: PLUID_AND_ATTRIBUTES;
- RestrictedSidCount: DWORD; SidsToRestrict: PSID_AND_ATTRIBUTES;
- var NewTokenHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM CreateRestrictedToken}
- function IsTokenRestricted(TokenHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM IsTokenRestricted}
- function CheckTokenMembership(TokenHandle: HANDLE; SidToCheck: PSID; var IsMember: BOOL): BOOL; stdcall;
- {$EXTERNALSYM CheckTokenMembership}
- function IsTokenUntrusted(TokenHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM IsTokenUntrusted}
- //
- // Thread pool API's
- //
- type
- WAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC;
- {$EXTERNALSYM WAITORTIMERCALLBACK}
- TWaitOrTimerCallback = WAITORTIMERCALLBACKFUNC;
- function RegisterWaitForSingleObject(var phNewWaitObject: HANDLE; hObject: HANDLE;
- Callback: WAITORTIMERCALLBACK; Context: PVOID; dwMilliseconds, dwFlags: ULONG): BOOL; stdcall;
- {$EXTERNALSYM RegisterWaitForSingleObject}
- function RegisterWaitForSingleObjectEx(hObject: HANDLE;
- Callback: WAITORTIMERCALLBACK; Context: PVOID; dwMilliseconds, dwFlags: ULONG): HANDLE; stdcall;
- {$EXTERNALSYM RegisterWaitForSingleObjectEx}
- function UnregisterWait(WaitHandle: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM UnregisterWait}
- function UnregisterWaitEx(WaitHandle, CompletionEvent: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM UnregisterWaitEx}
- function QueueUserWorkItem(Function_: LPTHREAD_START_ROUTINE; Context: PVOID;
- Flags: ULONG): BOOL; stdcall;
- {$EXTERNALSYM QueueUserWorkItem}
- function BindIoCompletionCallback(FileHandle: HANDLE;
- Function_: LPOVERLAPPED_COMPLETION_ROUTINE; Flags: ULONG): BOOL; stdcall;
- {$EXTERNALSYM BindIoCompletionCallback}
- function CreateTimerQueue: HANDLE; stdcall;
- {$EXTERNALSYM CreateTimerQueue}
- function CreateTimerQueueTimer(var phNewTimer: HANDLE; TimerQueue: HANDLE;
- Callback: WAITORTIMERCALLBACK; Parameter: PVOID; DueTime, Period: DWORD;
- Flags: ULONG): BOOL; stdcall;
- {$EXTERNALSYM CreateTimerQueueTimer}
- function ChangeTimerQueueTimer(TimerQueue, Timer: HANDLE; DueTime, Period: ULONG): BOOL; stdcall;
- {$EXTERNALSYM ChangeTimerQueueTimer}
- function DeleteTimerQueueTimer(TimerQueue, Timer, CompletionEvent: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM DeleteTimerQueueTimer}
- function DeleteTimerQueueEx(TimerQueue, CompletionEvent: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM DeleteTimerQueueEx}
- function SetTimerQueueTimer(TimerQueue, Callback: WAITORTIMERCALLBACK;
- Parameter: PVOID; DueTime, Period: DWORD; PreferIo: BOOL): HANDLE; stdcall;
- {$EXTERNALSYM SetTimerQueueTimer}
- function CancelTimerQueueTimer(TimerQueue, Timer: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM CancelTimerQueueTimer}
- function DeleteTimerQueue(TimerQueue: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM DeleteTimerQueue}
- //
- // Plug-and-Play API's
- //
- const
- HW_PROFILE_GUIDLEN = 39; // 36-characters plus NULL terminator
- {$EXTERNALSYM HW_PROFILE_GUIDLEN}
- MAX_PROFILE_LEN = 80;
- {$EXTERNALSYM MAX_PROFILE_LEN}
- DOCKINFO_UNDOCKED = ($1);
- {$EXTERNALSYM DOCKINFO_UNDOCKED}
- DOCKINFO_DOCKED = ($2);
- {$EXTERNALSYM DOCKINFO_DOCKED}
- DOCKINFO_USER_SUPPLIED = ($4);
- {$EXTERNALSYM DOCKINFO_USER_SUPPLIED}
- DOCKINFO_USER_UNDOCKED = (DOCKINFO_USER_SUPPLIED or DOCKINFO_UNDOCKED);
- {$EXTERNALSYM DOCKINFO_USER_UNDOCKED}
- DOCKINFO_USER_DOCKED = (DOCKINFO_USER_SUPPLIED or DOCKINFO_DOCKED);
- {$EXTERNALSYM DOCKINFO_USER_DOCKED}
- type
- LPHW_PROFILE_INFOA = ^HW_PROFILE_INFOA;
- {$EXTERNALSYM LPHW_PROFILE_INFOA}
- tagHW_PROFILE_INFOA = record
- dwDockInfo: DWORD;
- szHwProfileGuid: array [0..HW_PROFILE_GUIDLEN - 1] of CHAR;
- szHwProfileName: array [0..MAX_PROFILE_LEN - 1] of CHAR;
- end;
- {$EXTERNALSYM tagHW_PROFILE_INFOA}
- HW_PROFILE_INFOA = tagHW_PROFILE_INFOA;
- {$EXTERNALSYM HW_PROFILE_INFOA}
- THWProfileInfoA = HW_PROFILE_INFOA;
- PHWProfileInfoA = LPHW_PROFILE_INFOA;
- LPHW_PROFILE_INFOW = ^HW_PROFILE_INFOW;
- {$EXTERNALSYM LPHW_PROFILE_INFOW}
- tagHW_PROFILE_INFOW = record
- dwDockInfo: DWORD;
- szHwProfileGuid: array [0..HW_PROFILE_GUIDLEN - 1] of WCHAR;
- szHwProfileName: array [0..MAX_PROFILE_LEN - 1] of WCHAR;
- end;
- {$EXTERNALSYM tagHW_PROFILE_INFOW}
- HW_PROFILE_INFOW = tagHW_PROFILE_INFOW;
- {$EXTERNALSYM HW_PROFILE_INFOW}
- THWProfileInfoW = HW_PROFILE_INFOW;
- PHWProfileInfoW = LPHW_PROFILE_INFOW;
- {$IFDEF UNICODE}
- HW_PROFILE_INFO = HW_PROFILE_INFOW;
- {$EXTERNALSYM HW_PROFILE_INFO}
- LPHW_PROFILE_INFO = LPHW_PROFILE_INFOW;
- {$EXTERNALSYM LPHW_PROFILE_INFO}
- THWProfileInfo = THWProfileInfoW;
- PHWProfileInfo = PHWProfileInfoW;
- {$ELSE}
- HW_PROFILE_INFO = HW_PROFILE_INFOA;
- {$EXTERNALSYM HW_PROFILE_INFO}
- LPHW_PROFILE_INFO = LPHW_PROFILE_INFOA;
- {$EXTERNALSYM LPHW_PROFILE_INFO}
- THWProfileInfo = THWProfileInfoA;
- PHWProfileInfo = PHWProfileInfoA;
- {$ENDIF}
- function GetCurrentHwProfileA(var lpHwProfileInfo: HW_PROFILE_INFOA): BOOL; stdcall;
- {$EXTERNALSYM GetCurrentHwProfileA}
- function GetCurrentHwProfileW(var lpHwProfileInfo: HW_PROFILE_INFOW): BOOL; stdcall;
- {$EXTERNALSYM GetCurrentHwProfileW}
- {$IFDEF UNICODE}
- function GetCurrentHwProfile(var lpHwProfileInfo: HW_PROFILE_INFOW): BOOL; stdcall;
- {$EXTERNALSYM GetCurrentHwProfileA}
- {$ELSE}
- function GetCurrentHwProfile(var lpHwProfileInfo: HW_PROFILE_INFOA): BOOL; stdcall;
- {$EXTERNALSYM GetCurrentHwProfileA}
- {$ENDIF}
- //
- // Performance counter API's
- //
- function QueryPerformanceCounter(var lpPerformanceCount: LARGE_INTEGER): BOOL; stdcall;
- {$EXTERNALSYM QueryPerformanceCounter}
- function QueryPerformanceFrequency(var lpFrequency: LARGE_INTEGER): BOOL; stdcall;
- {$EXTERNALSYM QueryPerformanceFrequency}
- function GetVersionExA(lpVersionInformation: LPOSVERSIONINFOA): BOOL; stdcall;
- {$EXTERNALSYM GetVersionExA}
- function GetVersionExW(lpVersionInformation: LPOSVERSIONINFOW): BOOL; stdcall;
- {$EXTERNALSYM GetVersionExW}
- {$IFDEF UNICODE}
- function GetVersionEx(lpVersionInformation: LPOSVERSIONINFOW): BOOL; stdcall;
- {$EXTERNALSYM GetVersionEx}
- {$ELSE}
- function GetVersionEx(lpVersionInformation: LPOSVERSIONINFOA): BOOL; stdcall;
- {$EXTERNALSYM GetVersionEx}
- {$ENDIF}
- function VerifyVersionInfoA(var lpVersionInformation: OSVERSIONINFOEXA;
- dwTypeMask: DWORD; dwlConditionMask: DWORDLONG): BOOL; stdcall;
- {$EXTERNALSYM VerifyVersionInfoA}
- function VerifyVersionInfoW(var lpVersionInformation: OSVERSIONINFOEXW;
- dwTypeMask: DWORD; dwlConditionMask: DWORDLONG): BOOL; stdcall;
- {$EXTERNALSYM VerifyVersionInfoW}
- {$IFDEF UNICODE}
- function VerifyVersionInfo(var lpVersionInformation: OSVERSIONINFOEXW;
- dwTypeMask: DWORD; dwlConditionMask: DWORDLONG): BOOL; stdcall;
- {$EXTERNALSYM VerifyVersionInfo}
- {$ELSE}
- function VerifyVersionInfo(var lpVersionInformation: OSVERSIONINFOEXA;
- dwTypeMask: DWORD; dwlConditionMask: DWORDLONG): BOOL; stdcall;
- {$EXTERNALSYM VerifyVersionInfo}
- {$ENDIF}
- // DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
- // API functions.
- //
- // #include <winerror.h>
- // Abnormal termination codes
- const
- TC_NORMAL = 0;
- {$EXTERNALSYM TC_NORMAL}
- TC_HARDERR = 1;
- {$EXTERNALSYM TC_HARDERR}
- TC_GP_TRAP = 2;
- {$EXTERNALSYM TC_GP_TRAP}
- TC_SIGNAL = 3;
- {$EXTERNALSYM TC_SIGNAL}
- //
- // Power Management APIs
- //
- AC_LINE_OFFLINE = $00;
- {$EXTERNALSYM AC_LINE_OFFLINE}
- AC_LINE_ONLINE = $01;
- {$EXTERNALSYM AC_LINE_ONLINE}
- AC_LINE_BACKUP_POWER = $02;
- {$EXTERNALSYM AC_LINE_BACKUP_POWER}
- AC_LINE_UNKNOWN = $FF;
- {$EXTERNALSYM AC_LINE_UNKNOWN}
- BATTERY_FLAG_HIGH = $01;
- {$EXTERNALSYM BATTERY_FLAG_HIGH}
- BATTERY_FLAG_LOW = $02;
- {$EXTERNALSYM BATTERY_FLAG_LOW}
- BATTERY_FLAG_CRITICAL = $04;
- {$EXTERNALSYM BATTERY_FLAG_CRITICAL}
- BATTERY_FLAG_CHARGING = $08;
- {$EXTERNALSYM BATTERY_FLAG_CHARGING}
- BATTERY_FLAG_NO_BATTERY = $80;
- {$EXTERNALSYM BATTERY_FLAG_NO_BATTERY}
- BATTERY_FLAG_UNKNOWN = $FF;
- {$EXTERNALSYM BATTERY_FLAG_UNKNOWN}
- BATTERY_PERCENTAGE_UNKNOWN = $FF;
- {$EXTERNALSYM BATTERY_PERCENTAGE_UNKNOWN}
- BATTERY_LIFE_UNKNOWN = DWORD($FFFFFFFF);
- {$EXTERNALSYM BATTERY_LIFE_UNKNOWN}
- type
- LPSYSTEM_POWER_STATUS = ^SYSTEM_POWER_STATUS;
- {$EXTERNALSYM LPSYSTEM_POWER_STATUS}
- _SYSTEM_POWER_STATUS = record
- ACLineStatus: BYTE;
- BatteryFlag: BYTE;
- BatteryLifePercent: BYTE;
- Reserved1: BYTE;
- BatteryLifeTime: DWORD;
- BatteryFullLifeTime: DWORD;
- end;
- {$EXTERNALSYM _SYSTEM_POWER_STATUS}
- SYSTEM_POWER_STATUS = _SYSTEM_POWER_STATUS;
- {$EXTERNALSYM SYSTEM_POWER_STATUS}
- TSystemPowerStatus = SYSTEM_POWER_STATUS;
- PSystemPowerStatus = LPSYSTEM_POWER_STATUS;
- function GetSystemPowerStatus(var lpSystemPowerStatus: SYSTEM_POWER_STATUS): BOOL; stdcall;
- {$EXTERNALSYM GetSystemPowerStatus}
- function SetSystemPowerState(fSuspend, fForce: BOOL): BOOL; stdcall;
- {$EXTERNALSYM SetSystemPowerState}
- //
- // Very Large Memory API Subset
- //
- function AllocateUserPhysicalPages(hProcess: HANDLE; var NumberOfPages: ULONG_PTR;
- PageArray: PULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM AllocateUserPhysicalPages}
- function FreeUserPhysicalPages(hProcess: HANDLE; var NumberOfPages: ULONG_PTR;
- PageArray: PULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM FreeUserPhysicalPages}
- function MapUserPhysicalPages(VirtualAddress: PVOID; NumberOfPages: ULONG_PTR;
- PageArray: PULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM MapUserPhysicalPages}
- function MapUserPhysicalPagesScatter(VirtualAddresses: PVOID; NumberOfPages: ULONG_PTR;
- PageArray: PULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM MapUserPhysicalPagesScatter}
- function CreateJobObjectA(lpJobAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM CreateJobObjectA}
- function CreateJobObjectW(lpJobAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM CreateJobObjectW}
- {$IFDEF UNICODE}
- function CreateJobObject(lpJobAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM CreateJobObject}
- {$ELSE}
- function CreateJobObject(lpJobAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM CreateJobObject}
- {$ENDIF}
- function OpenJobObjectA(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenJobObjectA}
- function OpenJobObjectW(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenJobObjectW}
- {$IFDEF UNICODE}
- function OpenJobObject(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: LPCWSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenJobObject}
- {$ELSE}
- function OpenJobObject(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: LPCSTR): HANDLE; stdcall;
- {$EXTERNALSYM OpenJobObject}
- {$ENDIF}
- function AssignProcessToJobObject(hJob, hProcess: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM AssignProcessToJobObject}
- function TerminateJobObject(hJob: HANDLE; uExitCode: UINT): BOOL; stdcall;
- {$EXTERNALSYM TerminateJobObject}
- function QueryInformationJobObject(hJob: HANDLE; JobObjectInformationClass: JOBOBJECTINFOCLASS;
- lpJobObjectInformation: LPVOID; cbJobObjectInformationLength: DWORD;
- lpReturnLength: LPDWORD): BOOL; stdcall;
- {$EXTERNALSYM QueryInformationJobObject}
- function SetInformationJobObject(hJob: HANDLE; JobObjectInformationClass: JOBOBJECTINFOCLASS;
- lpJobObjectInformation: LPVOID; cbJobObjectInformationLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM SetInformationJobObject}
- function IsProcessInJob(ProcessHandle, JobHandle: HANDLE; var Result_: BOOL): BOOL; stdcall;
- {$EXTERNALSYM IsProcessInJob}
- function CreateJobSet(NumJob: ULONG; UserJobSet: PJOB_SET_ARRAY; Flags: ULONG): BOOL; stdcall;
- {$EXTERNALSYM CreateJobSet}
- function AddVectoredExceptionHandler(FirstHandler: ULONG;
- VectoredHandler: PVECTORED_EXCEPTION_HANDLER): PVOID; stdcall;
- {$EXTERNALSYM AddVectoredExceptionHandler}
- function RemoveVectoredExceptionHandler(VectoredHandlerHandle: PVOID): ULONG; stdcall;
- {$EXTERNALSYM RemoveVectoredExceptionHandler}
- //
- // New Volume Mount Point API.
- //
- function FindFirstVolumeA(lpszVolumeName: LPSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeA}
- function FindFirstVolumeW(lpszVolumeName: LPWSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeW}
- {$IFDEF UNICODE}
- function FindFirstVolume(lpszVolumeName: LPWSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolume}
- {$ELSE}
- function FindFirstVolume(lpszVolumeName: LPSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolume}
- {$ENDIF}
- function FindNextVolumeA(hFindVolume: HANDLE; lpszVolumeName: LPSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeA}
- function FindNextVolumeW(hFindVolume: HANDLE; lpszVolumeName: LPWSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeW}
- {$IFDEF UNICODE}
- function FindNextVolume(hFindVolume: HANDLE; lpszVolumeName: LPWSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolume}
- {$ELSE}
- function FindNextVolume(hFindVolume: HANDLE; lpszVolumeName: LPSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolume}
- {$ENDIF}
- function FindVolumeClose(hFindVolume: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM FindVolumeClose}
- function FindFirstVolumeMountPointA(lpszRootPathName: LPCSTR;
- lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeMountPointA}
- function FindFirstVolumeMountPointW(lpszRootPathName: LPCWSTR;
- lpszVolumeMountPoint: LPWSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeMountPointW}
- {$IFDEF UNICODE}
- function FindFirstVolumeMountPoint(lpszRootPathName: LPCWSTR;
- lpszVolumeMountPoint: LPWSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeMountPoint}
- {$ELSE}
- function FindFirstVolumeMountPoint(lpszRootPathName: LPCSTR;
- lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): HANDLE; stdcall;
- {$EXTERNALSYM FindFirstVolumeMountPoint}
- {$ENDIF}
- function FindNextVolumeMountPointA(hFindVolumeMountPoint: HANDLE;
- lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeMountPointA}
- function FindNextVolumeMountPointW(hFindVolumeMountPoint: HANDLE;
- lpszVolumeMountPoint: LPWSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeMountPointW}
- {$IFDEF UNICODE}
- function FindNextVolumeMountPoint(hFindVolumeMountPoint: HANDLE;
- lpszVolumeMountPoint: LPWSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeMountPoint}
- {$ELSE}
- function FindNextVolumeMountPoint(hFindVolumeMountPoint: HANDLE;
- lpszVolumeMountPoint: LPSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM FindNextVolumeMountPoint}
- {$ENDIF}
- function FindVolumeMountPointClose(hFindVolumeMountPoint: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM FindVolumeMountPointClose}
- function SetVolumeMountPointA(lpszVolumeMountPoint, lpszVolumeName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeMountPointA}
- function SetVolumeMountPointW(lpszVolumeMountPoint, lpszVolumeName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeMountPointW}
- {$IFDEF UNICODE}
- function SetVolumeMountPoint(lpszVolumeMountPoint, lpszVolumeName: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeMountPoint}
- {$ELSE}
- function SetVolumeMountPoint(lpszVolumeMountPoint, lpszVolumeName: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM SetVolumeMountPoint}
- {$ENDIF}
- function DeleteVolumeMountPointA(lpszVolumeMountPoint: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteVolumeMountPointA}
- function DeleteVolumeMountPointW(lpszVolumeMountPoint: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteVolumeMountPointW}
- {$IFDEF UNICODE}
- function DeleteVolumeMountPoint(lpszVolumeMountPoint: LPCWSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteVolumeMountPoint}
- {$ELSE}
- function DeleteVolumeMountPoint(lpszVolumeMountPoint: LPCSTR): BOOL; stdcall;
- {$EXTERNALSYM DeleteVolumeMountPoint}
- {$ENDIF}
- function GetVolumeNameForVolumeMountPointA(lpszVolumeMountPoint: LPCSTR;
- lpszVolumeName: LPSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeNameForVolumeMountPointA}
- function GetVolumeNameForVolumeMountPointW(lpszVolumeMountPoint: LPCWSTR;
- lpszVolumeName: LPWSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeNameForVolumeMountPointW}
- {$IFDEF UNICODE}
- function GetVolumeNameForVolumeMountPoint(lpszVolumeMountPoint: LPCWSTR;
- lpszVolumeName: LPWSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeNameForVolumeMountPoint}
- {$ELSE}
- function GetVolumeNameForVolumeMountPoint(lpszVolumeMountPoint: LPCSTR;
- lpszVolumeName: LPSTR; cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumeNameForVolumeMountPoint}
- {$ENDIF}
- function GetVolumePathNameA(lpszFileName: LPCSTR; lpszVolumePathName: LPSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNameA}
- function GetVolumePathNameW(lpszFileName: LPCWSTR; lpszVolumePathName: LPWSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNameW}
- {$IFDEF UNICODE}
- function GetVolumePathName(lpszFileName: LPCWSTR; lpszVolumePathName: LPWSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathName}
- {$ELSE}
- function GetVolumePathName(lpszFileName: LPCSTR; lpszVolumePathName: LPSTR;
- cchBufferLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathName}
- {$ENDIF}
- function GetVolumePathNamesForVolumeNameA(lpszVolumeName, lpszVolumePathNames: LPCSTR;
- cchBufferLength: DWORD; var lpcchReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNamesForVolumeNameA}
- function GetVolumePathNamesForVolumeNameW(lpszVolumeName, lpszVolumePathNames: LPCWSTR;
- cchBufferLength: DWORD; var lpcchReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNamesForVolumeNameW}
- {$IFDEF UNICODE}
- function GetVolumePathNamesForVolumeName(lpszVolumeName, lpszVolumePathNames: LPCWSTR;
- cchBufferLength: DWORD; var lpcchReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNamesForVolumeName}
- {$ELSE}
- function GetVolumePathNamesForVolumeName(lpszVolumeName, lpszVolumePathNames: LPCSTR;
- cchBufferLength: DWORD; var lpcchReturnLength: DWORD): BOOL; stdcall;
- {$EXTERNALSYM GetVolumePathNamesForVolumeName}
- {$ENDIF}
- const
- ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID = ($00000001);
- {$EXTERNALSYM ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID}
- ACTCTX_FLAG_LANGID_VALID = ($00000002);
- {$EXTERNALSYM ACTCTX_FLAG_LANGID_VALID}
- ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = ($00000004);
- {$EXTERNALSYM ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID}
- ACTCTX_FLAG_RESOURCE_NAME_VALID = ($00000008);
- {$EXTERNALSYM ACTCTX_FLAG_RESOURCE_NAME_VALID}
- ACTCTX_FLAG_SET_PROCESS_DEFAULT = ($00000010);
- {$EXTERNALSYM ACTCTX_FLAG_SET_PROCESS_DEFAULT}
- ACTCTX_FLAG_APPLICATION_NAME_VALID = ($00000020);
- {$EXTERNALSYM ACTCTX_FLAG_APPLICATION_NAME_VALID}
- ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF = ($00000040);
- {$EXTERNALSYM ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF}
- ACTCTX_FLAG_HMODULE_VALID = ($00000080);
- {$EXTERNALSYM ACTCTX_FLAG_HMODULE_VALID}
- type
- tagACTCTXA = record
- cbSize: ULONG;
- dwFlags: DWORD;
- lpSource: LPCSTR;
- wProcessorArchitecture: USHORT;
- wLangId: LANGID;
- lpAssemblyDirectory: LPCSTR;
- lpResourceName: LPCSTR;
- lpApplicationName: LPCSTR;
- hModule: HMODULE;
- end;
- {$EXTERNALSYM tagACTCTXA}
- ACTCTXA = tagACTCTXA;
- {$EXTERNALSYM ACTCTXA}
- PACTCTXA = ^ACTCTXA;
- {$EXTERNALSYM PACTCTXA}
- TActCtxA = ACTCTXA;
- tagACTCTXW = record
- cbSize: ULONG;
- dwFlags: DWORD;
- lpSource: LPCWSTR;
- wProcessorArchitecture: USHORT;
- wLangId: LANGID;
- lpAssemblyDirectory: LPCWSTR;
- lpResourceName: LPCWSTR;
- lpApplicationName: LPCWSTR;
- hModule: HMODULE;
- end;
- {$EXTERNALSYM tagACTCTXW}
- ACTCTXW = tagACTCTXW;
- {$EXTERNALSYM ACTCTXW}
- PACTCTXW = ^ACTCTXW;
- {$EXTERNALSYM PACTCTXW}
- TActCtxW = ACTCTXW;
- {$IFDEF UNICODE}
- ACTCTX = ACTCTXW;
- {$EXTERNALSYM ACTCTX}
- PACTCTX = PACTCTXW;
- {$EXTERNALSYM PACTCTX}
- TActCtx = TActCtxW;
- {$ELSE}
- ACTCTX = ACTCTXA;
- {$EXTERNALSYM ACTCTX}
- PACTCTX = PACTCTXA;
- {$EXTERNALSYM PACTCTX}
- TActCtx = TActCtxA;
- {$ENDIF}
- function CreateActCtxA(var pActCtx: ACTCTXA): HANDLE; stdcall;
- {$EXTERNALSYM CreateActCtxA}
- function CreateActCtxW(var pActCtx: ACTCTXW): HANDLE; stdcall;
- {$EXTERNALSYM CreateActCtxW}
- {$IFDEF UNICODE}
- function CreateActCtx(var pActCtx: ACTCTXW): HANDLE; stdcall;
- {$EXTERNALSYM CreateActCtx}
- {$ELSE}
- function CreateActCtx(var pActCtx: ACTCTXA): HANDLE; stdcall;
- {$EXTERNALSYM CreateActCtx}
- {$ENDIF}
- procedure AddRefActCtx(hActCtx: HANDLE); stdcall;
- {$EXTERNALSYM AddRefActCtx}
- procedure ReleaseActCtx(hActCtx: HANDLE); stdcall;
- {$EXTERNALSYM ReleaseActCtx}
- function ZombifyActCtx(hActCtx: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM ZombifyActCtx}
- function ActivateActCtx(hActCtx: HANDLE; var lpCookie: ULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM ActivateActCtx}
- const
- DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION = ($00000001);
- {$EXTERNALSYM DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION}
- function DeactivateActCtx(dwFlags: DWORD; ulCookie: ULONG_PTR): BOOL; stdcall;
- {$EXTERNALSYM DeactivateActCtx}
- function GetCurrentActCtx(var lphActCtx: HANDLE): BOOL; stdcall;
- {$EXTERNALSYM GetCurrentActCtx}
- type
- tagACTCTX_SECTION_KEYED_DATA_2600 = record
- cbSize: ULONG;
- ulDataFormatVersion: ULONG;
- lpData: PVOID;
- ulLength: ULONG;
- lpSectionGlobalData: PVOID;
- ulSectionGlobalDataLength: ULONG;
- lpSectionBase: PVOID;
- ulSectionTotalLength: ULONG;
- hActCtx: HANDLE;
- ulAssemblyRosterIndex: ULONG;
- end;
- {$EXTERNALSYM tagACTCTX_SECTION_KEYED_DATA_2600}
- ACTCTX_SECTION_KEYED_DATA_2600 = tagACTCTX_SECTION_KEYED_DATA_2600;
- {$EXTERNALSYM ACTCTX_SECTION_KEYED_DATA_2600}
- PACTCTX_SECTION_KEYED_DATA_2600 = ^ACTCTX_SECTION_KEYED_DATA_2600;
- {$EXTERNALSYM PACTCTX_SECTION_KEYED_DATA_2600}
- PCACTCTX_SECTION_KEYED_DATA_2600 = ^ACTCTX_SECTION_KEYED_DATA_2600;
- {$EXTERNALSYM PCACTCTX_SECTION_KEYED_DATA_2600}
- TActCtxSectionKeyedData2600 = ACTCTX_SECTION_KEYED_DATA_2600;
- PActCtxSectionKeyedData2600 = PACTCTX_SECTION_KEYED_DATA_2600;
- tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = record
- lpInformation: PVOID;
- lpSectionBase: PVOID;
- ulSectionLength: ULONG;
- lpSectionGlobalDataBase: PVOID;
- ulSectionGlobalDataLength: ULONG;
- end;
- {$EXTERNALSYM tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA}
- ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- {$EXTERNALSYM ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA}
- PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = ^ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- {$EXTERNALSYM PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA}
- PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = ^ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- {$EXTERNALSYM PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA}
- TActCtxSectionKeyedDataAssemblyMetadata = ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- PActCtxSectionKeyedDataAssemblyMetadata = PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- tagACTCTX_SECTION_KEYED_DATA = record
- cbSize: ULONG;
- ulDataFormatVersion: ULONG;
- lpData: PVOID;
- ulLength: ULONG;
- lpSectionGlobalData: PVOID;
- ulSectionGlobalDataLength: ULONG;
- lpSectionBase: PVOID;
- ulSectionTotalLength: ULONG;
- hActCtx: HANDLE;
- ulAssemblyRosterIndex: ULONG;
- // 2600 stops here
- ulFlags: ULONG;
- AssemblyMetadata: ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
- end;
- {$EXTERNALSYM tagACTCTX_SECTION_KEYED_DATA}
- ACTCTX_SECTION_KEYED_DATA = tagACTCTX_SECTION_KEYED_DATA;
- {$EXTERNALSYM ACTCTX_SECTION_KEYED_DATA}
- PACTCTX_SECTION_KEYED_DATA = ^ACTCTX_SECTION_KEYED_DATA;
- {$EXTERNALSYM PACTCTX_SECTION_KEYED_DATA}
- PCACTCTX_SECTION_KEYED_DATA = ^ACTCTX_SECTION_KEYED_DATA;
- {$EXTERNALSYM PCACTCTX_SECTION_KEYED_DATA}
- TActCtxSectionKeyedData = ACTCTX_SECTION_KEYED_DATA;
- PActCtxSectionKeyedData = PACTCTX_SECTION_KEYED_DATA;
- const
- FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX = ($00000001);
- {$EXTERNALSYM FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX}
- FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS = ($00000002);
- {$EXTERNALSYM FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS}
- FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA = ($00000004);
- {$EXTERNALSYM FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA}
- function FindActCtxSectionStringA(dwFlags: DWORD; const lpExtensionGuid: TGUID;
- ulSectionId: ULONG; lpStringToFind: LPCSTR; ReturnedData: PACTCTX_SECTION_KEYED_DATA): BOOL; stdcall;
- {$EXTERNALSYM FindActCtxSectionStringA}
- function FindActCtxSectionStringW(dwFlags: DWORD; const lpExtensionGuid: TGUID;
- ulSectionId: ULONG; lpStringToFind: LPCWSTR; ReturnedData: PACTCTX_SECTION_KEYED_DATA): BOOL; stdcall;
- {$EXTERNALSYM FindActCtxSectionStringW}
- {$IFDEF UNICODE}
- function FindActCtxSectionString(dwFlags: DWORD; const lpExtensionGuid: TGUID;
- ulSectionId: ULONG; lpStringToFind: LPCWSTR; ReturnedData: PACTCTX_SECTION_KEYED_DATA): BOOL; stdcall;
- {$EXTERNALSYM FindActCtxSectionString}
- {$ELSE}
- function FindActCtxSectionString(dwFlags: DWORD; const lpExtensionGuid: TGUID;
- ulSectionId: ULONG; lpStringToFind: LPCSTR; ReturnedData: PACTCTX_SECTION_KEYED_DATA): BOOL; stdcall;
- {$EXTERNALSYM FindActCtxSectionString}
- {$ENDIF}
- function FindActCtxSectionGuid(dwFlags: DWORD; const lpExtensionGuid: TGUID;
- ulSectionId: ULONG; const lpGuidToFind: TGUID; ReturnedData: PACTCTX_SECTION_KEYED_DATA): BOOL; stdcall;
- {$EXTERNALSYM FindActCtxSectionGuid}
- type
- _ACTIVATION_CONTEXT_BASIC_INFORMATION = record
- hActCtx: HANDLE;
- dwFlags: DWORD;
- end;
- {$EXTERNALSYM _ACTIVATION_CONTEXT_BASIC_INFORMATION}
- ACTIVATION_CONTEXT_BASIC_INFORMATION = _ACTIVATION_CONTEXT_BASIC_INFORMATION;
- {$EXTERNALSYM ACTIVATION_CONTEXT_BASIC_INFORMATION}
- PACTIVATION_CONTEXT_BASIC_INFORMATION = ^ACTIVATION_CONTEXT_BASIC_INFORMATION;
- {$EXTERNALSYM PACTIVATION_CONTEXT_BASIC_INFORMATION}
- TActivationContextBasicInformation = ACTIVATION_CONTEXT_BASIC_INFORMATION;
- PActivationContextBasicInformation = PACTIVATION_CONTEXT_BASIC_INFORMATION;
- PCACTIVATION_CONTEXT_BASIC_INFORMATION = ^_ACTIVATION_CONTEXT_BASIC_INFORMATION;
- {$EXTERNALSYM PCACTIVATION_CONTEXT_BASIC_INFORMATION}
- const
- ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED = 1;
- {$EXTERNALSYM ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED}
- QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX = ($00000004);
- {$EXTERNALSYM QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX}
- QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE = ($00000008);
- {$EXTERNALSYM QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE}
- QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS = ($00000010);
- {$EXTERNALSYM QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS}
- QUERY_ACTCTX_FLAG_NO_ADDREF = ($80000000);
- {$EXTERNALSYM QUERY_ACTCTX_FLAG_NO_ADDREF}
- //
- // switch (ulInfoClass)
- //
- // case ActivationContextBasicInformation:
- // pvSubInstance == NULL
- // pvBuffer is of type PACTIVATION_CONTEXT_BASIC_INFORMATION
- //
- // case ActivationContextDetailedInformation:
- // pvSubInstance == NULL
- // pvBuffer is of type PACTIVATION_CONTEXT_DETAILED_INFORMATION
- //
- // case AssemblyDetailedInformationInActivationContext:
- // pvSubInstance is of type PULONG
- // *pvSubInstance < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
- // pvBuffer is of type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
- //
- // case FileInformationInAssemblyOfAssemblyInActivationContext:
- // pvSubInstance is of type PACTIVATION_CONTEXT_QUERY_INDEX
- // pvSubInstance->ulAssemblyIndex < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCount
- // pvSubInstance->ulFileIndexInAssembly < ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION::ulFileCount
- // pvBuffer is of type PASSEMBLY_FILE_DETAILED_INFORMATION
- //
- // String are placed after the structs.
- //
- function QueryActCtxW(dwFlags: DWORD; hActCtx: HANDLE; pvSubInstance: PVOID;
- ulInfoClass: ULONG; pvBuffer: PVOID; cbBuffer: SIZE_T;
- pcbWrittenOrRequired: PSIZE_T): BOOL; stdcall;
- {$EXTERNALSYM QueryActCtxW}
- type
- PQUERYACTCTXW_FUNC = function (dwFlags: DWORD; hActCtx: HANDLE;
- pvSubInstance: PVOID; ulInfoClass: ULONG; pvBuffer: PVOID; cbBuffer: SIZE_T;
- pcbWrittenOrRequired: PSIZE_T): BOOL; stdcall;
- {$EXTERNALSYM PQUERYACTCTXW_FUNC}
- function ProcessIdToSessionId(dwProcessId: DWORD; var pSessionId: DWORD): BOOL; stdcall;
- {$EXTERNALSYM ProcessIdToSessionId}
- function WTSGetActiveConsoleSessionId: DWORD; stdcall;
- {$EXTERNALSYM WTSGetActiveConsoleSessionId}
- function IsWow64Process(hProcess: HANDLE; var Wow64Process: BOOL): BOOL; stdcall;
- {$EXTERNALSYM IsWow64Process}
- function GetLogicalProcessorInformation(Buffer: PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; ReturnedLength: PDWORD): BOOL; stdcall;
- {$EXTERNALSYM GetLogicalProcessorInformation}
- //
- // NUMA Information routines.
- //
- function GetNumaHighestNodeNumber(var HighestNodeNumber: ULONG): BOOL; stdcall;
- {$EXTERNALSYM GetNumaHighestNodeNumber}
- function GetNumaProcessorNode(Processor: UCHAR; var NodeNumber: UCHAR): BOOL; stdcall;
- {$EXTERNALSYM GetNumaProcessorNode}
- function GetNumaNodeProcessorMask(Node: UCHAR; ProcessorMask: ULONGLONG): BOOL; stdcall;
- {$EXTERNALSYM GetNumaNodeProcessorMask}
- function GetNumaAvailableMemoryNode(Node: UCHAR; var AvailableBytes: ULONGLONG): BOOL; stdcall;
- {$EXTERNALSYM GetNumaAvailableMemoryNode}
- implementation
- const
- kernel32 = 'kernel32.dll';
- advapi32 = 'advapi32.dll';
- procedure MoveMemory(Destination, Source: PVOID; Length: SIZE_T);
- begin
- Move(Source^, Destination^, Length);
- end;
- procedure CopyMemory(Destination, Source: PVOID; Length: SIZE_T);
- begin
- Move(Source^, Destination^, Length);
- end;
- procedure FillMemory(Destination: PVOID; Length: SIZE_T; Fill: BYTE);
- begin
- FillChar(Destination^, Length, Fill);
- end;
- procedure ZeroMemory(Destination: PVOID; Length: SIZE_T);
- begin
- FillChar(Destination^, Length, 0);
- end;
- function FreeModule(hLibModule: HMODULE): BOOL;
- begin
- Result := FreeLibrary(hLibModule);
- end;
- function MakeProcInstance(lpProc: FARPROC; hInstance: HINSTANCE): FARPROC;
- begin
- Result := lpProc;
- end;
- procedure FreeProcInstance(lpProc: FARPROC);
- begin
- { nothing }
- end;
- function GlobalLRUNewest(h: HANDLE): HANDLE;
- begin
- Result := H;
- end;
- function GlobalLRUOldest(h: HANDLE): HANDLE;
- begin
- Result := H;
- end;
- function GlobalDiscard(h: HANDLE): HANDLE;
- begin
- Result := GlobalReAlloc(h, 0, GMEM_MOVEABLE);
- end;
- function LocalDiscard(h: HLOCAL): HLOCAL;
- begin
- Result := LocalReAlloc(h, 0, LMEM_MOVEABLE);
- end;
- function GetFreeSpace(w: WORD): DWORD;
- begin
- Result := $100000;
- end;
- function InterlockedExchangePointer(var Target: PVOID; Value: PVOID): PVOID;
- begin
- Result := PVOID(InterlockedExchange(LONG(Target), LONG(Value)));
- end;
- function InterlockedCompareExchangePointer(var Destination: PVOID; Exchange, Comperand: PVOID): PVOID;
- begin
- Result := PVOID(InterlockedCompareExchange(LONG(Destination), LONG(Exchange), LONG(Comperand)));
- end;
- function UnlockResource(hResData: HANDLE): BOOL;
- begin
- Result := False;
- end;
- function HasOverlappedIoCompleted(const lpOverlapped: OVERLAPPED): BOOL;
- begin
- Result := lpOverlapped.Internal <> STATUS_PENDING;
- end;
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedIncrement: Pointer;
- function InterlockedIncrement;
- begin
- GetProcedureAddress(_InterlockedIncrement, kernel32, 'InterlockedIncrement');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedIncrement]
- end;
- end;
- {$ELSE}
- function InterlockedIncrement; external kernel32 name 'InterlockedIncrement';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedDecrement: Pointer;
- function InterlockedDecrement;
- begin
- GetProcedureAddress(_InterlockedDecrement, kernel32, 'InterlockedDecrement');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedDecrement]
- end;
- end;
- {$ELSE}
- function InterlockedDecrement; external kernel32 name 'InterlockedDecrement';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedExchange: Pointer;
- function InterlockedExchange;
- begin
- GetProcedureAddress(_InterlockedExchange, kernel32, 'InterlockedExchange');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedExchange]
- end;
- end;
- {$ELSE}
- function InterlockedExchange; external kernel32 name 'InterlockedExchange';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedExchangeAdd: Pointer;
- function InterlockedExchangeAdd;
- begin
- GetProcedureAddress(_InterlockedExchangeAdd, kernel32, 'InterlockedExchangeAdd');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedExchangeAdd]
- end;
- end;
- {$ELSE}
- function InterlockedExchangeAdd; external kernel32 name 'InterlockedExchangeAdd';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedCompareExchange: Pointer;
- function InterlockedCompareExchange;
- begin
- GetProcedureAddress(_InterlockedCompareExchange, kernel32, 'InterlockedCompareExchange');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedCompareExchange]
- end;
- end;
- {$ELSE}
- function InterlockedCompareExchange; external kernel32 name 'InterlockedCompareExchange';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InitializeSListHead: Pointer;
- procedure InitializeSListHead;
- begin
- GetProcedureAddress(_InitializeSListHead, kernel32, 'InitializeSListHead');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InitializeSListHead]
- end;
- end;
- {$ELSE}
- procedure InitializeSListHead; external kernel32 name 'InitializeSListHead';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedPopEntrySList: Pointer;
- function InterlockedPopEntrySList;
- begin
- GetProcedureAddress(_InterlockedPopEntrySList, kernel32, 'InterlockedPopEntrySList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedPopEntrySList]
- end;
- end;
- {$ELSE}
- function InterlockedPopEntrySList; external kernel32 name 'InterlockedPopEntrySList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedPushEntrySList: Pointer;
- function InterlockedPushEntrySList;
- begin
- GetProcedureAddress(_InterlockedPushEntrySList, kernel32, 'InterlockedPushEntrySList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedPushEntrySList]
- end;
- end;
- {$ELSE}
- function InterlockedPushEntrySList; external kernel32 name 'InterlockedPushEntrySList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _InterlockedFlushSList: Pointer;
- function InterlockedFlushSList;
- begin
- GetProcedureAddress(_InterlockedFlushSList, kernel32, 'InterlockedFlushSList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_InterlockedFlushSList]
- end;
- end;
- {$ELSE}
- function InterlockedFlushSList; external kernel32 name 'InterlockedFlushSList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _QueryDepthSList: Pointer;
- function QueryDepthSList;
- begin
- GetProcedureAddress(_QueryDepthSList, kernel32, 'QueryDepthSList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_QueryDepthSList]
- end;
- end;
- {$ELSE}
- function QueryDepthSList; external kernel32 name 'QueryDepthSList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeResource: Pointer;
- function FreeResource;
- begin
- GetProcedureAddress(_FreeResource, kernel32, 'FreeResource');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeResource]
- end;
- end;
- {$ELSE}
- function FreeResource; external kernel32 name 'FreeResource';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LockResource: Pointer;
- function LockResource;
- begin
- GetProcedureAddress(_LockResource, kernel32, 'LockResource');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LockResource]
- end;
- end;
- {$ELSE}
- function LockResource; external kernel32 name 'LockResource';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeLibrary: Pointer;
- function FreeLibrary;
- begin
- GetProcedureAddress(_FreeLibrary, kernel32, 'FreeLibrary');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeLibrary]
- end;
- end;
- {$ELSE}
- function FreeLibrary; external kernel32 name 'FreeLibrary';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeLibraryAndExitThread: Pointer;
- procedure FreeLibraryAndExitThread;
- begin
- GetProcedureAddress(_FreeLibraryAndExitThread, kernel32, 'FreeLibraryAndExitThread');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeLibraryAndExitThread]
- end;
- end;
- {$ELSE}
- procedure FreeLibraryAndExitThread; external kernel32 name 'FreeLibraryAndExitThread';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _DisableThreadLibraryCalls: Pointer;
- function DisableThreadLibraryCalls;
- begin
- GetProcedureAddress(_DisableThreadLibraryCalls, kernel32, 'DisableThreadLibraryCalls');
- asm
- mov esp, ebp
- pop ebp
- jmp [_DisableThreadLibraryCalls]
- end;
- end;
- {$ELSE}
- function DisableThreadLibraryCalls; external kernel32 name 'DisableThreadLibraryCalls';
- {$ENDIF DYNAMIC_LINK}
- // MVB TODO Dynamic linking for GetProcAddress doesn't make much sense, does it? Same for LoadLibrary.
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcAddress: Pointer;
- function GetProcAddress;
- begin
- GetProcedureAddress(_GetProcAddress, kernel32, 'GetProcAddress');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcAddress]
- end;
- end;
- {$ELSE}
- function GetProcAddress; external kernel32 name 'GetProcAddress';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetVersion: Pointer;
- function GetVersion;
- begin
- GetProcedureAddress(_GetVersion, kernel32, 'GetVersion');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetVersion]
- end;
- end;
- {$ELSE}
- function GetVersion; external kernel32 name 'GetVersion';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalAlloc: Pointer;
- function GlobalAlloc;
- begin
- GetProcedureAddress(_GlobalAlloc, kernel32, 'GlobalAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalAlloc]
- end;
- end;
- {$ELSE}
- function GlobalAlloc; external kernel32 name 'GlobalAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalReAlloc: Pointer;
- function GlobalReAlloc;
- begin
- GetProcedureAddress(_GlobalReAlloc, kernel32, 'GlobalReAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalReAlloc]
- end;
- end;
- {$ELSE}
- function GlobalReAlloc; external kernel32 name 'GlobalReAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalSize: Pointer;
- function GlobalSize;
- begin
- GetProcedureAddress(_GlobalSize, kernel32, 'GlobalSize');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalSize]
- end;
- end;
- {$ELSE}
- function GlobalSize; external kernel32 name 'GlobalSize';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalFlags: Pointer;
- function GlobalFlags;
- begin
- GetProcedureAddress(_GlobalFlags, kernel32, 'GlobalFlags');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalFlags]
- end;
- end;
- {$ELSE}
- function GlobalFlags; external kernel32 name 'GlobalFlags';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalLock: Pointer;
- function GlobalLock;
- begin
- GetProcedureAddress(_GlobalLock, kernel32, 'GlobalLock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalLock]
- end;
- end;
- {$ELSE}
- function GlobalLock; external kernel32 name 'GlobalLock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalHandle: Pointer;
- function GlobalHandle;
- begin
- GetProcedureAddress(_GlobalHandle, kernel32, 'GlobalHandle');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalHandle]
- end;
- end;
- {$ELSE}
- function GlobalHandle; external kernel32 name 'GlobalHandle';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalUnlock: Pointer;
- function GlobalUnlock;
- begin
- GetProcedureAddress(_GlobalUnlock, kernel32, 'GlobalUnlock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalUnlock]
- end;
- end;
- {$ELSE}
- function GlobalUnlock; external kernel32 name 'GlobalUnlock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalFree: Pointer;
- function GlobalFree;
- begin
- GetProcedureAddress(_GlobalFree, kernel32, 'GlobalFree');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalFree]
- end;
- end;
- {$ELSE}
- function GlobalFree; external kernel32 name 'GlobalFree';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalCompact: Pointer;
- function GlobalCompact;
- begin
- GetProcedureAddress(_GlobalCompact, kernel32, 'GlobalCompact');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalCompact]
- end;
- end;
- {$ELSE}
- function GlobalCompact; external kernel32 name 'GlobalCompact';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalFix: Pointer;
- procedure GlobalFix;
- begin
- GetProcedureAddress(_GlobalFix, kernel32, 'GlobalFix');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalFix]
- end;
- end;
- {$ELSE}
- procedure GlobalFix; external kernel32 name 'GlobalFix';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalUnfix: Pointer;
- procedure GlobalUnfix;
- begin
- GetProcedureAddress(_GlobalUnfix, kernel32, 'GlobalUnfix');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalUnfix]
- end;
- end;
- {$ELSE}
- procedure GlobalUnfix; external kernel32 name 'GlobalUnfix';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalWire: Pointer;
- function GlobalWire;
- begin
- GetProcedureAddress(_GlobalWire, kernel32, 'GlobalWire');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalWire]
- end;
- end;
- {$ELSE}
- function GlobalWire; external kernel32 name 'GlobalWire';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalUnWire: Pointer;
- function GlobalUnWire;
- begin
- GetProcedureAddress(_GlobalUnWire, kernel32, 'GlobalUnWire');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalUnWire]
- end;
- end;
- {$ELSE}
- function GlobalUnWire; external kernel32 name 'GlobalUnWire';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalMemoryStatus: Pointer;
- procedure GlobalMemoryStatus;
- begin
- GetProcedureAddress(_GlobalMemoryStatus, kernel32, 'GlobalMemoryStatus');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalMemoryStatus]
- end;
- end;
- {$ELSE}
- procedure GlobalMemoryStatus; external kernel32 name 'GlobalMemoryStatus';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GlobalMemoryStatusEx: Pointer;
- function GlobalMemoryStatusEx;
- begin
- GetProcedureAddress(_GlobalMemoryStatusEx, kernel32, 'GlobalMemoryStatusEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GlobalMemoryStatusEx]
- end;
- end;
- {$ELSE}
- function GlobalMemoryStatusEx; external kernel32 name 'GlobalMemoryStatusEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalAlloc: Pointer;
- function LocalAlloc;
- begin
- GetProcedureAddress(_LocalAlloc, kernel32, 'LocalAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalAlloc]
- end;
- end;
- {$ELSE}
- function LocalAlloc; external kernel32 name 'LocalAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalReAlloc: Pointer;
- function LocalReAlloc;
- begin
- GetProcedureAddress(_LocalReAlloc, kernel32, 'LocalReAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalReAlloc]
- end;
- end;
- {$ELSE}
- function LocalReAlloc; external kernel32 name 'LocalReAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalLock: Pointer;
- function LocalLock;
- begin
- GetProcedureAddress(_LocalLock, kernel32, 'LocalLock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalLock]
- end;
- end;
- {$ELSE}
- function LocalLock; external kernel32 name 'LocalLock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalHandle: Pointer;
- function LocalHandle;
- begin
- GetProcedureAddress(_LocalHandle, kernel32, 'LocalHandle');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalHandle]
- end;
- end;
- {$ELSE}
- function LocalHandle; external kernel32 name 'LocalHandle';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalUnlock: Pointer;
- function LocalUnlock;
- begin
- GetProcedureAddress(_LocalUnlock, kernel32, 'LocalUnlock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalUnlock]
- end;
- end;
- {$ELSE}
- function LocalUnlock; external kernel32 name 'LocalUnlock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalSize: Pointer;
- function LocalSize;
- begin
- GetProcedureAddress(_LocalSize, kernel32, 'LocalSize');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalSize]
- end;
- end;
- {$ELSE}
- function LocalSize; external kernel32 name 'LocalSize';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalFlags: Pointer;
- function LocalFlags;
- begin
- GetProcedureAddress(_LocalFlags, kernel32, 'LocalFlags');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalFlags]
- end;
- end;
- {$ELSE}
- function LocalFlags; external kernel32 name 'LocalFlags';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalFree: Pointer;
- function LocalFree;
- begin
- GetProcedureAddress(_LocalFree, kernel32, 'LocalFree');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalFree]
- end;
- end;
- {$ELSE}
- function LocalFree; external kernel32 name 'LocalFree';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalShrink: Pointer;
- function LocalShrink;
- begin
- GetProcedureAddress(_LocalShrink, kernel32, 'LocalShrink');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalShrink]
- end;
- end;
- {$ELSE}
- function LocalShrink; external kernel32 name 'LocalShrink';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LocalCompact: Pointer;
- function LocalCompact;
- begin
- GetProcedureAddress(_LocalCompact, kernel32, 'LocalCompact');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LocalCompact]
- end;
- end;
- {$ELSE}
- function LocalCompact; external kernel32 name 'LocalCompact';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FlushInstructionCache: Pointer;
- function FlushInstructionCache;
- begin
- GetProcedureAddress(_FlushInstructionCache, kernel32, 'FlushInstructionCache');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FlushInstructionCache]
- end;
- end;
- {$ELSE}
- function FlushInstructionCache; external kernel32 name 'FlushInstructionCache';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualAlloc: Pointer;
- function VirtualAlloc;
- begin
- GetProcedureAddress(_VirtualAlloc, kernel32, 'VirtualAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualAlloc]
- end;
- end;
- {$ELSE}
- function VirtualAlloc; external kernel32 name 'VirtualAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualFree: Pointer;
- function VirtualFree;
- begin
- GetProcedureAddress(_VirtualFree, kernel32, 'VirtualFree');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualFree]
- end;
- end;
- {$ELSE}
- function VirtualFree; external kernel32 name 'VirtualFree';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualProtect: Pointer;
- function VirtualProtect;
- begin
- GetProcedureAddress(_VirtualProtect, kernel32, 'VirtualProtect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualProtect]
- end;
- end;
- {$ELSE}
- function VirtualProtect; external kernel32 name 'VirtualProtect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualQuery: Pointer;
- function VirtualQuery;
- begin
- GetProcedureAddress(_VirtualQuery, kernel32, 'VirtualQuery');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualQuery]
- end;
- end;
- {$ELSE}
- function VirtualQuery; external kernel32 name 'VirtualQuery';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualAllocEx: Pointer;
- function VirtualAllocEx;
- begin
- GetProcedureAddress(_VirtualAllocEx, kernel32, 'VirtualAllocEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualAllocEx]
- end;
- end;
- {$ELSE}
- function VirtualAllocEx; external kernel32 name 'VirtualAllocEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetWriteWatch: Pointer;
- function GetWriteWatch;
- begin
- GetProcedureAddress(_GetWriteWatch, kernel32, 'GetWriteWatch');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetWriteWatch]
- end;
- end;
- {$ELSE}
- function GetWriteWatch; external kernel32 name 'GetWriteWatch';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _ResetWriteWatch: Pointer;
- function ResetWriteWatch;
- begin
- GetProcedureAddress(_ResetWriteWatch, kernel32, 'ResetWriteWatch');
- asm
- mov esp, ebp
- pop ebp
- jmp [_ResetWriteWatch]
- end;
- end;
- {$ELSE}
- function ResetWriteWatch; external kernel32 name 'ResetWriteWatch';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetLargePageMinimum: Pointer;
- function GetLargePageMinimum;
- begin
- GetProcedureAddress(_GetLargePageMinimum, kernel32, 'GetLargePageMinimum');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetLargePageMinimum]
- end;
- end;
- {$ELSE}
- function GetLargePageMinimum; external kernel32 name 'GetLargePageMinimum';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualFreeEx: Pointer;
- function VirtualFreeEx;
- begin
- GetProcedureAddress(_VirtualFreeEx, kernel32, 'VirtualFreeEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualFreeEx]
- end;
- end;
- {$ELSE}
- function VirtualFreeEx; external kernel32 name 'VirtualFreeEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualProtectEx: Pointer;
- function VirtualProtectEx;
- begin
- GetProcedureAddress(_VirtualProtectEx, kernel32, 'VirtualProtectEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualProtectEx]
- end;
- end;
- {$ELSE}
- function VirtualProtectEx; external kernel32 name 'VirtualProtectEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VirtualQueryEx: Pointer;
- function VirtualQueryEx;
- begin
- GetProcedureAddress(_VirtualQueryEx, kernel32, 'VirtualQueryEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VirtualQueryEx]
- end;
- end;
- {$ELSE}
- function VirtualQueryEx; external kernel32 name 'VirtualQueryEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapCreate: Pointer;
- function HeapCreate;
- begin
- GetProcedureAddress(_HeapCreate, kernel32, 'HeapCreate');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapCreate]
- end;
- end;
- {$ELSE}
- function HeapCreate; external kernel32 name 'HeapCreate';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapDestroy: Pointer;
- function HeapDestroy;
- begin
- GetProcedureAddress(_HeapDestroy, kernel32, 'HeapDestroy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapDestroy]
- end;
- end;
- {$ELSE}
- function HeapDestroy; external kernel32 name 'HeapDestroy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapAlloc: Pointer;
- function HeapAlloc;
- begin
- GetProcedureAddress(_HeapAlloc, kernel32, 'HeapAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapAlloc]
- end;
- end;
- {$ELSE}
- function HeapAlloc; external kernel32 name 'HeapAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapReAlloc: Pointer;
- function HeapReAlloc;
- begin
- GetProcedureAddress(_HeapReAlloc, kernel32, 'HeapReAlloc');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapReAlloc]
- end;
- end;
- {$ELSE}
- function HeapReAlloc; external kernel32 name 'HeapReAlloc';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapFree: Pointer;
- function HeapFree;
- begin
- GetProcedureAddress(_HeapFree, kernel32, 'HeapFree');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapFree]
- end;
- end;
- {$ELSE}
- function HeapFree; external kernel32 name 'HeapFree';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapSize: Pointer;
- function HeapSize;
- begin
- GetProcedureAddress(_HeapSize, kernel32, 'HeapSize');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapSize]
- end;
- end;
- {$ELSE}
- function HeapSize; external kernel32 name 'HeapSize';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapValidate: Pointer;
- function HeapValidate;
- begin
- GetProcedureAddress(_HeapValidate, kernel32, 'HeapValidate');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapValidate]
- end;
- end;
- {$ELSE}
- function HeapValidate; external kernel32 name 'HeapValidate';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapCompact: Pointer;
- function HeapCompact;
- begin
- GetProcedureAddress(_HeapCompact, kernel32, 'HeapCompact');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapCompact]
- end;
- end;
- {$ELSE}
- function HeapCompact; external kernel32 name 'HeapCompact';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessHeap: Pointer;
- function GetProcessHeap;
- begin
- GetProcedureAddress(_GetProcessHeap, kernel32, 'GetProcessHeap');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessHeap]
- end;
- end;
- {$ELSE}
- function GetProcessHeap; external kernel32 name 'GetProcessHeap';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessHeaps: Pointer;
- function GetProcessHeaps;
- begin
- GetProcedureAddress(_GetProcessHeaps, kernel32, 'GetProcessHeaps');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessHeaps]
- end;
- end;
- {$ELSE}
- function GetProcessHeaps; external kernel32 name 'GetProcessHeaps';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapLock: Pointer;
- function HeapLock;
- begin
- GetProcedureAddress(_HeapLock, kernel32, 'HeapLock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapLock]
- end;
- end;
- {$ELSE}
- function HeapLock; external kernel32 name 'HeapLock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapUnlock: Pointer;
- function HeapUnlock;
- begin
- GetProcedureAddress(_HeapUnlock, kernel32, 'HeapUnlock');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapUnlock]
- end;
- end;
- {$ELSE}
- function HeapUnlock; external kernel32 name 'HeapUnlock';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapWalk: Pointer;
- function HeapWalk;
- begin
- GetProcedureAddress(_HeapWalk, kernel32, 'HeapWalk');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapWalk]
- end;
- end;
- {$ELSE}
- function HeapWalk; external kernel32 name 'HeapWalk';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapSetInformation: Pointer;
- function HeapSetInformation;
- begin
- GetProcedureAddress(_HeapSetInformation, kernel32, 'HeapSetInformation');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapSetInformation]
- end;
- end;
- {$ELSE}
- function HeapSetInformation; external kernel32 name 'HeapSetInformation';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _HeapQueryInformation: Pointer;
- function HeapQueryInformation;
- begin
- GetProcedureAddress(_HeapQueryInformation, kernel32, 'HeapQueryInformation');
- asm
- mov esp, ebp
- pop ebp
- jmp [_HeapQueryInformation]
- end;
- end;
- {$ELSE}
- function HeapQueryInformation; external kernel32 name 'HeapQueryInformation';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetBinaryTypeA: Pointer;
- function GetBinaryTypeA;
- begin
- GetProcedureAddress(_GetBinaryTypeA, kernel32, 'GetBinaryTypeA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetBinaryTypeA]
- end;
- end;
- {$ELSE}
- function GetBinaryTypeA; external kernel32 name 'GetBinaryTypeA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetBinaryTypeW: Pointer;
- function GetBinaryTypeW;
- begin
- GetProcedureAddress(_GetBinaryTypeW, kernel32, 'GetBinaryTypeW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetBinaryTypeW]
- end;
- end;
- {$ELSE}
- function GetBinaryTypeW; external kernel32 name 'GetBinaryTypeW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetBinaryType: Pointer;
- function GetBinaryType;
- begin
- GetProcedureAddress(_GetBinaryType, kernel32, 'GetBinaryTypeW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetBinaryType]
- end;
- end;
- {$ELSE}
- function GetBinaryType; external kernel32 name 'GetBinaryTypeW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetBinaryType: Pointer;
- function GetBinaryType;
- begin
- GetProcedureAddress(_GetBinaryType, kernel32, 'GetBinaryTypeA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetBinaryType]
- end;
- end;
- {$ELSE}
- function GetBinaryType; external kernel32 name 'GetBinaryTypeA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetShortPathNameA: Pointer;
- function GetShortPathNameA;
- begin
- GetProcedureAddress(_GetShortPathNameA, kernel32, 'GetShortPathNameA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetShortPathNameA]
- end;
- end;
- {$ELSE}
- function GetShortPathNameA; external kernel32 name 'GetShortPathNameA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetShortPathNameW: Pointer;
- function GetShortPathNameW;
- begin
- GetProcedureAddress(_GetShortPathNameW, kernel32, 'GetShortPathNameW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetShortPathNameW]
- end;
- end;
- {$ELSE}
- function GetShortPathNameW; external kernel32 name 'GetShortPathNameW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetShortPathName: Pointer;
- function GetShortPathName;
- begin
- GetProcedureAddress(_GetShortPathName, kernel32, 'GetShortPathNameW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetShortPathName]
- end;
- end;
- {$ELSE}
- function GetShortPathName; external kernel32 name 'GetShortPathNameW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetShortPathName: Pointer;
- function GetShortPathName;
- begin
- GetProcedureAddress(_GetShortPathName, kernel32, 'GetShortPathNameA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetShortPathName]
- end;
- end;
- {$ELSE}
- function GetShortPathName; external kernel32 name 'GetShortPathNameA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetLongPathNameA: Pointer;
- function GetLongPathNameA;
- begin
- GetProcedureAddress(_GetLongPathNameA, kernel32, 'GetLongPathNameA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetLongPathNameA]
- end;
- end;
- {$ELSE}
- function GetLongPathNameA; external kernel32 name 'GetLongPathNameA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetLongPathNameW: Pointer;
- function GetLongPathNameW;
- begin
- GetProcedureAddress(_GetLongPathNameW, kernel32, 'GetLongPathNameW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetLongPathNameW]
- end;
- end;
- {$ELSE}
- function GetLongPathNameW; external kernel32 name 'GetLongPathNameW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetLongPathName: Pointer;
- function GetLongPathName;
- begin
- GetProcedureAddress(_GetLongPathName, kernel32, 'GetLongPathNameW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetLongPathName]
- end;
- end;
- {$ELSE}
- function GetLongPathName; external kernel32 name 'GetLongPathNameW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetLongPathName: Pointer;
- function GetLongPathName;
- begin
- GetProcedureAddress(_GetLongPathName, kernel32, 'GetLongPathNameA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetLongPathName]
- end;
- end;
- {$ELSE}
- function GetLongPathName; external kernel32 name 'GetLongPathNameA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessAffinityMask: Pointer;
- function GetProcessAffinityMask;
- begin
- GetProcedureAddress(_GetProcessAffinityMask, kernel32, 'GetProcessAffinityMask');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessAffinityMask]
- end;
- end;
- {$ELSE}
- function GetProcessAffinityMask; external kernel32 name 'GetProcessAffinityMask';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _SetProcessAffinityMask: Pointer;
- function SetProcessAffinityMask;
- begin
- GetProcedureAddress(_SetProcessAffinityMask, kernel32, 'SetProcessAffinityMask');
- asm
- mov esp, ebp
- pop ebp
- jmp [_SetProcessAffinityMask]
- end;
- end;
- {$ELSE}
- function SetProcessAffinityMask; external kernel32 name 'SetProcessAffinityMask';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessTimes: Pointer;
- function GetProcessTimes;
- begin
- GetProcedureAddress(_GetProcessTimes, kernel32, 'GetProcessTimes');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessTimes]
- end;
- end;
- {$ELSE}
- function GetProcessTimes; external kernel32 name 'GetProcessTimes';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessIoCounters: Pointer;
- function GetProcessIoCounters;
- begin
- GetProcedureAddress(_GetProcessIoCounters, kernel32, 'GetProcessIoCounters');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessIoCounters]
- end;
- end;
- {$ELSE}
- function GetProcessIoCounters; external kernel32 name 'GetProcessIoCounters';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetProcessWorkingSetSize: Pointer;
- function GetProcessWorkingSetSize;
- begin
- GetProcedureAddress(_GetProcessWorkingSetSize, kernel32, 'GetProcessWorkingSetSize');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetProcessWorkingSetSize]
- end;
- end;
- {$ELSE}
- function GetProcessWorkingSetSize; external kernel32 name 'GetProcessWorkingSetSize';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _SetProcessWorkingSetSize: Pointer;
- function SetProcessWorkingSetSize;
- begin
- GetProcedureAddress(_SetProcessWorkingSetSize, kernel32, 'SetProcessWorkingSetSize');
- asm
- mov esp, ebp
- pop ebp
- jmp [_SetProcessWorkingSetSize]
- end;
- end;
- {$ELSE}
- function SetProcessWorkingSetSize; external kernel32 name 'SetProcessWorkingSetSize';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _OpenProcess: Pointer;
- function OpenProcess;
- begin
- GetProcedureAddress(_OpenProcess, kernel32, 'OpenProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_OpenProcess]
- end;
- end;
- {$ELSE}
- function OpenProcess; external kernel32 name 'OpenProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetCurrentProcess: Pointer;
- function GetCurrentProcess;
- begin
- GetProcedureAddress(_GetCurrentProcess, kernel32, 'GetCurrentProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetCurrentProcess]
- end;
- end;
- {$ELSE}
- function GetCurrentProcess; external kernel32 name 'GetCurrentProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetCurrentProcessId: Pointer;
- function GetCurrentProcessId;
- begin
- GetProcedureAddress(_GetCurrentProcessId, kernel32, 'GetCurrentProcessId');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetCurrentProcessId]
- end;
- end;
- {$ELSE}
- function GetCurrentProcessId; external kernel32 name 'GetCurrentProcessId';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _ExitProcess: Pointer;
- procedure ExitProcess;
- begin
- GetProcedureAddress(_ExitProcess, kernel32, 'ExitProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_ExitProcess]
- end;
- end;
- {$ELSE}
- procedure ExitProcess; external kernel32 name 'ExitProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _TerminateProcess: Pointer;
- function TerminateProcess;
- begin
- GetProcedureAddress(_TerminateProcess, kernel32, 'TerminateProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_TerminateProcess]
- end;
- end;
- {$ELSE}
- function TerminateProcess; external kernel32 name 'TerminateProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetExitCodeProcess: Pointer;
- function GetExitCodeProcess;
- begin
- GetProcedureAddress(_GetExitCodeProcess, kernel32, 'GetExitCodeProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetExitCodeProcess]
- end;
- end;
- {$ELSE}
- function GetExitCodeProcess; external kernel32 name 'GetExitCodeProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FatalExit: Pointer;
- procedure FatalExit;
- begin
- GetProcedureAddress(_FatalExit, kernel32, 'FatalExit');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FatalExit]
- end;
- end;
- {$ELSE}
- procedure FatalExit; external kernel32 name 'FatalExit';
- {$ENDIF DYNAMIC_LINK}
- {$IFNDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetEnvironmentStrings: Pointer;
- function GetEnvironmentStrings;
- begin
- GetProcedureAddress(_GetEnvironmentStrings, kernel32, 'GetEnvironmentStringsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetEnvironmentStrings]
- end;
- end;
- {$ELSE}
- function GetEnvironmentStrings; external kernel32 name 'GetEnvironmentStringsA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetEnvironmentStringsW: Pointer;
- function GetEnvironmentStringsW;
- begin
- GetProcedureAddress(_GetEnvironmentStringsW, kernel32, 'GetEnvironmentStringsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetEnvironmentStringsW]
- end;
- end;
- {$ELSE}
- function GetEnvironmentStringsW; external kernel32 name 'GetEnvironmentStringsW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetEnvironmentStrings: Pointer;
- function GetEnvironmentStrings;
- begin
- GetProcedureAddress(_GetEnvironmentStrings, kernel32, 'GetEnvironmentStringsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetEnvironmentStrings]
- end;
- end;
- {$ELSE}
- function GetEnvironmentStrings; external kernel32 name 'GetEnvironmentStringsW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _GetEnvironmentStringsA: Pointer;
- function GetEnvironmentStringsA;
- begin
- GetProcedureAddress(_GetEnvironmentStringsA, kernel32, 'GetEnvironmentStringsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_GetEnvironmentStringsA]
- end;
- end;
- {$ELSE}
- function GetEnvironmentStringsA; external kernel32 name 'GetEnvironmentStringsA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeEnvironmentStringsA: Pointer;
- function FreeEnvironmentStringsA;
- begin
- GetProcedureAddress(_FreeEnvironmentStringsA, kernel32, 'FreeEnvironmentStringsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeEnvironmentStringsA]
- end;
- end;
- {$ELSE}
- function FreeEnvironmentStringsA; external kernel32 name 'FreeEnvironmentStringsA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeEnvironmentStringsW: Pointer;
- function FreeEnvironmentStringsW;
- begin
- GetProcedureAddress(_FreeEnvironmentStringsW, kernel32, 'FreeEnvironmentStringsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeEnvironmentStringsW]
- end;
- end;
- {$ELSE}
- function FreeEnvironmentStringsW; external kernel32 name 'FreeEnvironmentStringsW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeEnvironmentStrings: Pointer;
- function FreeEnvironmentStrings;
- begin
- GetProcedureAddress(_FreeEnvironmentStrings, kernel32, 'FreeEnvironmentStringsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeEnvironmentStrings]
- end;
- end;
- {$ELSE}
- function FreeEnvironmentStrings; external kernel32 name 'FreeEnvironmentStringsW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _FreeEnvironmentStrings: Pointer;
- function FreeEnvironmentStrings;
- begin
- GetProcedureAddress(_FreeEnvironmentStrings, kernel32, 'FreeEnvironmentStringsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_FreeEnvironmentStrings]
- end;
- end;
- {$ELSE}
- function FreeEnvironmentStrings; external kernel32 name 'FreeEnvironmentStringsA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _RaiseException: Pointer;
- procedure RaiseException;
- begin
- GetProcedureAddress(_RaiseException, kernel32, 'RaiseException');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RaiseException]
- end;
- end;
- {$ELSE}
- procedure RaiseException; external kernel32 name 'RaiseException';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _UnhandledExceptionFilter: Pointer;
- function UnhandledExceptionFilter;
- begin
- GetProcedureAddress(_UnhandledExceptionFilter, kernel32, 'UnhandledExceptionFilter');
- asm
- mov esp, ebp
- pop ebp
- jmp [_UnhandledExceptionFilter]
- end;
- end;
- {$ELSE}
- function UnhandledExceptionFilter; external kernel32 name 'UnhandledExceptionFilter';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _SetUnhandledExceptionFilter: Pointer;
- function SetUnhandledExceptionFilter;
- begin
- GetProcedureAddress(_SetUnhandledExceptionFilter, kernel32, 'SetUnhandledExceptionFilter');
- asm
- mov esp, ebp
- pop ebp
- jmp [_SetUnhandledExceptionFilter]
- end;
- end;
- {$ELSE}
- function SetUnhandledExceptionFilter; external kernel32 name 'SetUnhandledExceptionFilter';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _CreateFiber: Pointer;
- function CreateFiber;
- begin
- GetProcedureAddress(_CreateFiber, kernel32, 'CreateFiber');
- asm
- mov esp, ebp
- pop ebp
- jmp [_CreateFiber]