JwaWinNT.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:336k
源码类别:
Windows编程
开发平台:
Delphi
- TImgLineNoType = record
- case Integer of
- 0: (SymbolTableIndex: DWORD); // Symbol table index of function name if Linenumber is 0.
- 1: (VirtualAddress: DWORD); // Virtual address of line number.
- end;
- PIMAGE_LINENUMBER = ^IMAGE_LINENUMBER;
- {$EXTERNALSYM PIMAGE_LINENUMBER}
- _IMAGE_LINENUMBER = record
- Type_: TImgLineNoType;
- Linenumber: WORD; // Line number.
- end;
- {$EXTERNALSYM _IMAGE_LINENUMBER}
- IMAGE_LINENUMBER = _IMAGE_LINENUMBER;
- {$EXTERNALSYM IMAGE_LINENUMBER}
- TImageLineNumber = IMAGE_LINENUMBER;
- PImageLineNumber = PIMAGE_LINENUMBER;
- const
- IMAGE_SIZEOF_LINENUMBER = 6;
- {$EXTERNALSYM IMAGE_SIZEOF_LINENUMBER}
- // #include "poppack.h" // Back to 4 byte packing
- //
- // Based relocation format.
- //
- type
- PIMAGE_BASE_RELOCATION = ^IMAGE_BASE_RELOCATION;
- {$EXTERNALSYM PIMAGE_BASE_RELOCATION}
- _IMAGE_BASE_RELOCATION = record
- VirtualAddress: DWORD;
- SizeOfBlock: DWORD;
- // WORD TypeOffset[1];
- end;
- {$EXTERNALSYM _IMAGE_BASE_RELOCATION}
- IMAGE_BASE_RELOCATION = _IMAGE_BASE_RELOCATION;
- {$EXTERNALSYM IMAGE_BASE_RELOCATION}
- TImageBaseRelocation = IMAGE_BASE_RELOCATION;
- PImageBaseRelocation = PIMAGE_BASE_RELOCATION;
- const
- IMAGE_SIZEOF_BASE_RELOCATION = 8;
- {$EXTERNALSYM IMAGE_SIZEOF_BASE_RELOCATION}
- //
- // Based relocation types.
- //
- IMAGE_REL_BASED_ABSOLUTE = 0;
- {$EXTERNALSYM IMAGE_REL_BASED_ABSOLUTE}
- IMAGE_REL_BASED_HIGH = 1;
- {$EXTERNALSYM IMAGE_REL_BASED_HIGH}
- IMAGE_REL_BASED_LOW = 2;
- {$EXTERNALSYM IMAGE_REL_BASED_LOW}
- IMAGE_REL_BASED_HIGHLOW = 3;
- {$EXTERNALSYM IMAGE_REL_BASED_HIGHLOW}
- IMAGE_REL_BASED_HIGHADJ = 4;
- {$EXTERNALSYM IMAGE_REL_BASED_HIGHADJ}
- IMAGE_REL_BASED_MIPS_JMPADDR = 5;
- {$EXTERNALSYM IMAGE_REL_BASED_MIPS_JMPADDR}
- IMAGE_REL_BASED_MIPS_JMPADDR16 = 9;
- {$EXTERNALSYM IMAGE_REL_BASED_MIPS_JMPADDR16}
- IMAGE_REL_BASED_IA64_IMM64 = 9;
- {$EXTERNALSYM IMAGE_REL_BASED_IA64_IMM64}
- IMAGE_REL_BASED_DIR64 = 10;
- {$EXTERNALSYM IMAGE_REL_BASED_DIR64}
- //
- // Archive format.
- //
- IMAGE_ARCHIVE_START_SIZE = 8;
- {$EXTERNALSYM IMAGE_ARCHIVE_START_SIZE}
- IMAGE_ARCHIVE_START = '!<arch>n';
- {$EXTERNALSYM IMAGE_ARCHIVE_START}
- IMAGE_ARCHIVE_END = '`n';
- {$EXTERNALSYM IMAGE_ARCHIVE_END}
- IMAGE_ARCHIVE_PAD = 'n';
- {$EXTERNALSYM IMAGE_ARCHIVE_PAD}
- IMAGE_ARCHIVE_LINKER_MEMBER = '/ ';
- {$EXTERNALSYM IMAGE_ARCHIVE_LINKER_MEMBER}
- IMAGE_ARCHIVE_LONGNAMES_MEMBER = '// ';
- {$EXTERNALSYM IMAGE_ARCHIVE_LONGNAMES_MEMBER}
- type
- PIMAGE_ARCHIVE_MEMBER_HEADER = ^IMAGE_ARCHIVE_MEMBER_HEADER;
- {$EXTERNALSYM PIMAGE_ARCHIVE_MEMBER_HEADER}
- _IMAGE_ARCHIVE_MEMBER_HEADER = record
- Name: array [0..15] of Byte; // File member name - `/' terminated.
- Date: array [0..11] of Byte; // File member date - decimal.
- UserID: array [0..5] of Byte; // File member user id - decimal.
- GroupID: array [0..5] of Byte; // File member group id - decimal.
- Mode: array [0..7] of Byte; // File member mode - octal.
- Size: array [0..9] of Byte; // File member size - decimal.
- EndHeader: array [0..1] of Byte; // String to end header.
- end;
- {$EXTERNALSYM _IMAGE_ARCHIVE_MEMBER_HEADER}
- IMAGE_ARCHIVE_MEMBER_HEADER = _IMAGE_ARCHIVE_MEMBER_HEADER;
- {$EXTERNALSYM IMAGE_ARCHIVE_MEMBER_HEADER}
- TImageArchiveMemberHeader = IMAGE_ARCHIVE_MEMBER_HEADER;
- PImageArchiveMemberHeader = PIMAGE_ARCHIVE_MEMBER_HEADER;
- const
- IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR = 60;
- {$EXTERNALSYM IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR}
- //
- // DLL support.
- //
- //
- // Export Format
- //
- type
- PIMAGE_EXPORT_DIRECTORY = ^IMAGE_EXPORT_DIRECTORY;
- {$EXTERNALSYM PIMAGE_EXPORT_DIRECTORY}
- _IMAGE_EXPORT_DIRECTORY = record
- Characteristics: DWORD;
- TimeDateStamp: DWORD;
- MajorVersion: Word;
- MinorVersion: Word;
- Name: DWORD;
- Base: DWORD;
- NumberOfFunctions: DWORD;
- NumberOfNames: DWORD;
- AddressOfFunctions: DWORD; // RVA from base of image
- AddressOfNames: DWORD; // RVA from base of image
- AddressOfNameOrdinals: DWORD; // RVA from base of image
- end;
- {$EXTERNALSYM _IMAGE_EXPORT_DIRECTORY}
- IMAGE_EXPORT_DIRECTORY = _IMAGE_EXPORT_DIRECTORY;
- {$EXTERNALSYM IMAGE_EXPORT_DIRECTORY}
- TImageExportDirectory = IMAGE_EXPORT_DIRECTORY;
- PImageExportDirectory = PIMAGE_EXPORT_DIRECTORY;
- //
- // Import Format
- //
- PIMAGE_IMPORT_BY_NAME = ^IMAGE_IMPORT_BY_NAME;
- {$EXTERNALSYM PIMAGE_IMPORT_BY_NAME}
- _IMAGE_IMPORT_BY_NAME = record
- Hint: Word;
- Name: array [0..0] of Byte;
- end;
- {$EXTERNALSYM _IMAGE_IMPORT_BY_NAME}
- IMAGE_IMPORT_BY_NAME = _IMAGE_IMPORT_BY_NAME;
- {$EXTERNALSYM IMAGE_IMPORT_BY_NAME}
- TImageImportByName = IMAGE_IMPORT_BY_NAME;
- PImageImportByName = PIMAGE_IMPORT_BY_NAME;
- // #include "pshpack8.h" // Use align 8 for the 64-bit IAT.
- PIMAGE_THUNK_DATA64 = ^IMAGE_THUNK_DATA64;
- {$EXTERNALSYM PIMAGE_THUNK_DATA64}
- _IMAGE_THUNK_DATA64 = record
- case Integer of
- 0: (ForwarderString: ULONGLONG); // PBYTE
- 1: (Function_: ULONGLONG); // PDWORD
- 2: (Ordinal: ULONGLONG);
- 3: (AddressOfData: ULONGLONG); // PIMAGE_IMPORT_BY_NAME
- end;
- {$EXTERNALSYM _IMAGE_THUNK_DATA64}
- IMAGE_THUNK_DATA64 = _IMAGE_THUNK_DATA64;
- {$EXTERNALSYM IMAGE_THUNK_DATA64}
- TImageThunkData64 = IMAGE_THUNK_DATA64;
- PImageThunkData64 = PIMAGE_THUNK_DATA64;
- // #include "poppack.h" // Back to 4 byte packing
- PIMAGE_THUNK_DATA32 = ^IMAGE_THUNK_DATA32;
- {$EXTERNALSYM PIMAGE_THUNK_DATA32}
- _IMAGE_THUNK_DATA32 = record
- case Integer of
- 0: (ForwarderString: DWORD); // PBYTE
- 1: (Function_: DWORD); // PDWORD
- 2: (Ordinal: DWORD);
- 3: (AddressOfData: DWORD); // PIMAGE_IMPORT_BY_NAME
- end;
- {$EXTERNALSYM _IMAGE_THUNK_DATA32}
- IMAGE_THUNK_DATA32 = _IMAGE_THUNK_DATA32;
- {$EXTERNALSYM IMAGE_THUNK_DATA32}
- TImageThunkData32 = IMAGE_THUNK_DATA32;
- PImageThunkData32 = PIMAGE_THUNK_DATA32;
- const
- IMAGE_ORDINAL_FLAG64 = ULONGLONG($8000000000000000);
- {$EXTERNALSYM IMAGE_ORDINAL_FLAG64}
- IMAGE_ORDINAL_FLAG32 = DWORD($80000000);
- {$EXTERNALSYM IMAGE_ORDINAL_FLAG32}
- function IMAGE_ORDINAL64(Ordinal: ULONGLONG): ULONGLONG;
- {$EXTERNALSYM IMAGE_ORDINAL64}
- function IMAGE_ORDINAL32(Ordinal: DWORD): DWORD;
- {$EXTERNALSYM IMAGE_ORDINAL32}
- function IMAGE_SNAP_BY_ORDINAL64(Ordinal: ULONGLONG): Boolean;
- {$EXTERNALSYM IMAGE_SNAP_BY_ORDINAL64}
- function IMAGE_SNAP_BY_ORDINAL32(Ordinal: DWORD): Boolean;
- {$EXTERNALSYM IMAGE_SNAP_BY_ORDINAL32}
- //
- // Thread Local Storage
- //
- type
- PIMAGE_TLS_CALLBACK = procedure (DllHandle: Pointer; Reason: DWORD; Reserved: Pointer); stdcall;
- {$EXTERNALSYM PIMAGE_TLS_CALLBACK}
- TImageTlsCallback = PIMAGE_TLS_CALLBACK;
- PIMAGE_TLS_DIRECTORY64 = ^IMAGE_TLS_DIRECTORY64;
- {$EXTERNALSYM PIMAGE_TLS_DIRECTORY64}
- _IMAGE_TLS_DIRECTORY64 = record
- StartAddressOfRawData: ULONGLONG;
- EndAddressOfRawData: ULONGLONG;
- AddressOfIndex: ULONGLONG; // PDWORD
- AddressOfCallBacks: ULONGLONG; // PIMAGE_TLS_CALLBACK *;
- SizeOfZeroFill: DWORD;
- Characteristics: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_TLS_DIRECTORY64}
- IMAGE_TLS_DIRECTORY64 = _IMAGE_TLS_DIRECTORY64;
- {$EXTERNALSYM IMAGE_TLS_DIRECTORY64}
- TImageTlsDirectory64 = IMAGE_TLS_DIRECTORY64;
- PImageTlsDirectory64 = PIMAGE_TLS_DIRECTORY64;
- PIMAGE_TLS_DIRECTORY32 = ^IMAGE_TLS_DIRECTORY32;
- {$EXTERNALSYM PIMAGE_TLS_DIRECTORY32}
- _IMAGE_TLS_DIRECTORY32 = record
- StartAddressOfRawData: DWORD;
- EndAddressOfRawData: DWORD;
- AddressOfIndex: DWORD; // PDWORD
- AddressOfCallBacks: DWORD; // PIMAGE_TLS_CALLBACK *
- SizeOfZeroFill: DWORD;
- Characteristics: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_TLS_DIRECTORY32}
- IMAGE_TLS_DIRECTORY32 = _IMAGE_TLS_DIRECTORY32;
- {$EXTERNALSYM IMAGE_TLS_DIRECTORY32}
- TImageTlsDirectory32 = IMAGE_TLS_DIRECTORY32;
- PImageTlsDirectory32 = PIMAGE_TLS_DIRECTORY32;
- const
- IMAGE_ORDINAL_FLAG = IMAGE_ORDINAL_FLAG32;
- {$EXTERNALSYM IMAGE_ORDINAL_FLAG}
- function IMAGE_ORDINAL(Ordinal: DWORD): DWORD;
- type
- IMAGE_THUNK_DATA = IMAGE_THUNK_DATA32;
- {$EXTERNALSYM IMAGE_THUNK_DATA}
- PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA32;
- {$EXTERNALSYM PIMAGE_THUNK_DATA}
- TImageThunkData = TImageThunkData32;
- PImageThunkData = PImageThunkData32;
- function IMAGE_SNAP_BY_ORDINAL(Ordinal: DWORD): Boolean;
- {$EXTERNALSYM IMAGE_SNAP_BY_ORDINAL}
- type
- IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY32;
- {$EXTERNALSYM IMAGE_TLS_DIRECTORY}
- PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY32;
- {$EXTERNALSYM PIMAGE_TLS_DIRECTORY}
- TImageTlsDirectory = TImageTlsDirectory32;
- PImageTlsDirectory = PImageTlsDirectory32;
- TIIDUnion = record
- case Integer of
- 0: (Characteristics: DWORD); // 0 for terminating null import descriptor
- 1: (OriginalFirstThunk: DWORD); // RVA to original unbound IAT (PIMAGE_THUNK_DATA)
- end;
- PIMAGE_IMPORT_DESCRIPTOR = ^IMAGE_IMPORT_DESCRIPTOR;
- {$EXTERNALSYM PIMAGE_IMPORT_DESCRIPTOR}
- _IMAGE_IMPORT_DESCRIPTOR = record
- Union: TIIDUnion;
- TimeDateStamp: DWORD; // 0 if not bound,
- // -1 if bound, and real datetime stamp
- // in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND)
- // O.W. date/time stamp of DLL bound to (Old BIND)
- ForwarderChain: DWORD; // -1 if no forwarders
- Name: DWORD;
- FirstThunk: DWORD; // RVA to IAT (if bound this IAT has actual addresses)
- end;
- {$EXTERNALSYM _IMAGE_IMPORT_DESCRIPTOR}
- IMAGE_IMPORT_DESCRIPTOR = _IMAGE_IMPORT_DESCRIPTOR;
- {$EXTERNALSYM IMAGE_IMPORT_DESCRIPTOR}
- TImageImportDecriptor = IMAGE_IMPORT_DESCRIPTOR;
- PImageImportDecriptor = PIMAGE_IMPORT_DESCRIPTOR;
- //
- // New format import descriptors pointed to by DataDirectory[ IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT ]
- //
- type
- PIMAGE_BOUND_IMPORT_DESCRIPTOR = ^IMAGE_BOUND_IMPORT_DESCRIPTOR;
- {$EXTERNALSYM PIMAGE_BOUND_IMPORT_DESCRIPTOR}
- _IMAGE_BOUND_IMPORT_DESCRIPTOR = record
- TimeDateStamp: DWORD;
- OffsetModuleName: Word;
- NumberOfModuleForwarderRefs: Word;
- // Array of zero or more IMAGE_BOUND_FORWARDER_REF follows
- end;
- {$EXTERNALSYM _IMAGE_BOUND_IMPORT_DESCRIPTOR}
- IMAGE_BOUND_IMPORT_DESCRIPTOR = _IMAGE_BOUND_IMPORT_DESCRIPTOR;
- {$EXTERNALSYM IMAGE_BOUND_IMPORT_DESCRIPTOR}
- TImageBoundImportDescriptor = IMAGE_BOUND_IMPORT_DESCRIPTOR;
- PImageBoundImportDescriptor = PIMAGE_BOUND_IMPORT_DESCRIPTOR;
- PIMAGE_BOUND_FORWARDER_REF = ^IMAGE_BOUND_FORWARDER_REF;
- {$EXTERNALSYM PIMAGE_BOUND_FORWARDER_REF}
- _IMAGE_BOUND_FORWARDER_REF = record
- TimeDateStamp: DWORD;
- OffsetModuleName: Word;
- Reserved: Word;
- end;
- {$EXTERNALSYM _IMAGE_BOUND_FORWARDER_REF}
- IMAGE_BOUND_FORWARDER_REF = _IMAGE_BOUND_FORWARDER_REF;
- {$EXTERNALSYM IMAGE_BOUND_FORWARDER_REF}
- TImageBoundForwarderRef = IMAGE_BOUND_FORWARDER_REF;
- PImageBoundForwarderRef = PIMAGE_BOUND_FORWARDER_REF;
- //
- // Resource Format.
- //
- //
- // Resource directory consists of two counts, following by a variable length
- // array of directory entries. The first count is the number of entries at
- // beginning of the array that have actual names associated with each entry.
- // The entries are in ascending order, case insensitive strings. The second
- // count is the number of entries that immediately follow the named entries.
- // This second count identifies the number of entries that have 16-bit integer
- // Ids as their name. These entries are also sorted in ascending order.
- //
- // This structure allows fast lookup by either name or number, but for any
- // given resource entry only one form of lookup is supported, not both.
- // This is consistant with the syntax of the .RC file and the .RES file.
- //
- PIMAGE_RESOURCE_DIRECTORY = ^IMAGE_RESOURCE_DIRECTORY;
- {$EXTERNALSYM PIMAGE_RESOURCE_DIRECTORY}
- _IMAGE_RESOURCE_DIRECTORY = record
- Characteristics: DWORD;
- TimeDateStamp: DWORD;
- MajorVersion: Word;
- MinorVersion: Word;
- NumberOfNamedEntries: Word;
- NumberOfIdEntries: Word;
- // IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[];
- end;
- {$EXTERNALSYM _IMAGE_RESOURCE_DIRECTORY}
- IMAGE_RESOURCE_DIRECTORY = _IMAGE_RESOURCE_DIRECTORY;
- {$EXTERNALSYM IMAGE_RESOURCE_DIRECTORY}
- TImageResourceDirectory = IMAGE_RESOURCE_DIRECTORY;
- PImageResourceDirectory = PIMAGE_RESOURCE_DIRECTORY;
- const
- IMAGE_RESOURCE_NAME_IS_STRING = DWORD($80000000);
- {$EXTERNALSYM IMAGE_RESOURCE_NAME_IS_STRING}
- IMAGE_RESOURCE_DATA_IS_DIRECTORY = DWORD($80000000);
- {$EXTERNALSYM IMAGE_RESOURCE_DATA_IS_DIRECTORY}
- //
- // Each directory contains the 32-bit Name of the entry and an offset,
- // relative to the beginning of the resource directory of the data associated
- // with this directory entry. If the name of the entry is an actual text
- // string instead of an integer Id, then the high order bit of the name field
- // is set to one and the low order 31-bits are an offset, relative to the
- // beginning of the resource directory of the string, which is of type
- // IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the
- // low-order 16-bits are the integer Id that identify this resource directory
- // entry. If the directory entry is yet another resource directory (i.e. a
- // subdirectory), then the high order bit of the offset field will be
- // set to indicate this. Otherwise the high bit is clear and the offset
- // field points to a resource data entry.
- //
- type
- TIRDEName = record
- case Integer of
- 0: (
- NameOffset: DWORD); // 0..30: NameOffset; 31: NameIsString
- 1: (
- Name: DWORD);
- 2: (
- Id: WORD);
- end;
- TIRDEDirectory = record
- case Integer of
- 0: (
- OffsetToData: DWORD);
- 1: (
- OffsetToDirectory: DWORD); // 0..30: OffsetToDirectory; 31: DataIsDirectory
- end;
- PIMAGE_RESOURCE_DIRECTORY_ENTRY = ^IMAGE_RESOURCE_DIRECTORY_ENTRY;
- {$EXTERNALSYM PIMAGE_RESOURCE_DIRECTORY_ENTRY}
- _IMAGE_RESOURCE_DIRECTORY_ENTRY = record
- Name: TIRDEName;
- Directory: TIRDEDirectory;
- end;
- {$EXTERNALSYM _IMAGE_RESOURCE_DIRECTORY_ENTRY}
- IMAGE_RESOURCE_DIRECTORY_ENTRY = _IMAGE_RESOURCE_DIRECTORY_ENTRY;
- {$EXTERNALSYM IMAGE_RESOURCE_DIRECTORY_ENTRY}
- TImageResourceDirectoryEntry = IMAGE_RESOURCE_DIRECTORY_ENTRY;
- PImageResourceDirectoryEntry = PIMAGE_RESOURCE_DIRECTORY_ENTRY;
- //
- // For resource directory entries that have actual string names, the Name
- // field of the directory entry points to an object of the following type.
- // All of these string objects are stored together after the last resource
- // directory entry and before the first resource data object. This minimizes
- // the impact of these variable length objects on the alignment of the fixed
- // size directory entry objects.
- //
- type
- PIMAGE_RESOURCE_DIRECTORY_STRING = ^IMAGE_RESOURCE_DIRECTORY_STRING;
- {$EXTERNALSYM PIMAGE_RESOURCE_DIRECTORY_STRING}
- _IMAGE_RESOURCE_DIRECTORY_STRING = record
- Length: Word;
- NameString: array [0..0] of CHAR;
- end;
- {$EXTERNALSYM _IMAGE_RESOURCE_DIRECTORY_STRING}
- IMAGE_RESOURCE_DIRECTORY_STRING = _IMAGE_RESOURCE_DIRECTORY_STRING;
- {$EXTERNALSYM IMAGE_RESOURCE_DIRECTORY_STRING}
- TImageResourceDirectoryString = IMAGE_RESOURCE_DIRECTORY_STRING;
- PImageResourceDirectoryString = PIMAGE_RESOURCE_DIRECTORY_STRING;
- PIMAGE_RESOURCE_DIR_STRING_U = ^IMAGE_RESOURCE_DIR_STRING_U;
- {$EXTERNALSYM PIMAGE_RESOURCE_DIR_STRING_U}
- _IMAGE_RESOURCE_DIR_STRING_U = record
- Length: Word;
- NameString: array [0..0] of WCHAR;
- end;
- {$EXTERNALSYM _IMAGE_RESOURCE_DIR_STRING_U}
- IMAGE_RESOURCE_DIR_STRING_U = _IMAGE_RESOURCE_DIR_STRING_U;
- {$EXTERNALSYM IMAGE_RESOURCE_DIR_STRING_U}
- TImageResourceDirStringU = IMAGE_RESOURCE_DIR_STRING_U;
- PImageResourceDirStringU = PIMAGE_RESOURCE_DIR_STRING_U;
- //
- // Each resource data entry describes a leaf node in the resource directory
- // tree. It contains an offset, relative to the beginning of the resource
- // directory of the data for the resource, a size field that gives the number
- // of bytes of data at that offset, a CodePage that should be used when
- // decoding code point values within the resource data. Typically for new
- // applications the code page would be the unicode code page.
- //
- PIMAGE_RESOURCE_DATA_ENTRY = ^IMAGE_RESOURCE_DATA_ENTRY;
- {$EXTERNALSYM PIMAGE_RESOURCE_DATA_ENTRY}
- _IMAGE_RESOURCE_DATA_ENTRY = record
- OffsetToData: DWORD;
- Size: DWORD;
- CodePage: DWORD;
- Reserved: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_RESOURCE_DATA_ENTRY}
- IMAGE_RESOURCE_DATA_ENTRY = _IMAGE_RESOURCE_DATA_ENTRY;
- {$EXTERNALSYM IMAGE_RESOURCE_DATA_ENTRY}
- TImageResourceDataEntry = IMAGE_RESOURCE_DATA_ENTRY;
- PImageResourceDataEntry = PIMAGE_RESOURCE_DATA_ENTRY;
- //
- // Load Configuration Directory Entry
- //
- type
- PIMAGE_LOAD_CONFIG_DIRECTORY32 = ^IMAGE_LOAD_CONFIG_DIRECTORY32;
- {$EXTERNALSYM PIMAGE_LOAD_CONFIG_DIRECTORY32}
- IMAGE_LOAD_CONFIG_DIRECTORY32 = record
- Characteristics: DWORD;
- TimeDateStamp: DWORD;
- MajorVersion: WORD;
- MinorVersion: WORD;
- GlobalFlagsClear: DWORD;
- GlobalFlagsSet: DWORD;
- CriticalSectionDefaultTimeout: DWORD;
- DeCommitFreeBlockThreshold: DWORD;
- DeCommitTotalFreeThreshold: DWORD;
- LockPrefixTable: DWORD; // VA
- MaximumAllocationSize: DWORD;
- VirtualMemoryThreshold: DWORD;
- ProcessHeapFlags: DWORD;
- ProcessAffinityMask: DWORD;
- CSDVersion: WORD;
- Reserved1: WORD;
- EditList: DWORD; // VA
- Reserved: array [0..0] of DWORD;
- end;
- {$EXTERNALSYM IMAGE_LOAD_CONFIG_DIRECTORY32}
- TImageLoadConfigDirectory32 = IMAGE_LOAD_CONFIG_DIRECTORY32;
- PImageLoadConfigDirectory32 = PIMAGE_LOAD_CONFIG_DIRECTORY32;
- PIMAGE_LOAD_CONFIG_DIRECTORY64 = ^IMAGE_LOAD_CONFIG_DIRECTORY64;
- {$EXTERNALSYM PIMAGE_LOAD_CONFIG_DIRECTORY64}
- IMAGE_LOAD_CONFIG_DIRECTORY64 = record
- Characteristics: DWORD;
- TimeDateStamp: DWORD;
- MajorVersion: WORD;
- MinorVersion: WORD;
- GlobalFlagsClear: DWORD;
- GlobalFlagsSet: DWORD;
- CriticalSectionDefaultTimeout: DWORD;
- DeCommitFreeBlockThreshold: ULONGLONG;
- DeCommitTotalFreeThreshold: ULONGLONG;
- LockPrefixTable: ULONGLONG; // VA
- MaximumAllocationSize: ULONGLONG;
- VirtualMemoryThreshold: ULONGLONG;
- ProcessAffinityMask: ULONGLONG;
- ProcessHeapFlags: DWORD;
- CSDVersion: WORD;
- Reserved1: WORD;
- EditList: ULONGLONG; // VA
- Reserved: array [0..1] of DWORD;
- end;
- {$EXTERNALSYM IMAGE_LOAD_CONFIG_DIRECTORY64}
- TImageLoadConfigDirectory64 = IMAGE_LOAD_CONFIG_DIRECTORY64;
- PImageLoadConfigDirectory64 = PIMAGE_LOAD_CONFIG_DIRECTORY64;
- IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY32;
- {$EXTERNALSYM IMAGE_LOAD_CONFIG_DIRECTORY}
- PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY32;
- {$EXTERNALSYM PIMAGE_LOAD_CONFIG_DIRECTORY}
- TImageLoadConfigDirectory = TImageLoadConfigDirectory32;
- PImageLoadConfigDirectory = PImageLoadConfigDirectory32;
- //
- // WIN CE Exception table format
- //
- //
- // Function table entry format. Function table is pointed to by the
- // IMAGE_DIRECTORY_ENTRY_EXCEPTION directory entry.
- //
- type
- PIMAGE_CE_RUNTIME_FUNCTION_ENTRY = ^IMAGE_CE_RUNTIME_FUNCTION_ENTRY;
- {$EXTERNALSYM PIMAGE_CE_RUNTIME_FUNCTION_ENTRY}
- _IMAGE_CE_RUNTIME_FUNCTION_ENTRY = record
- FuncStart: DWORD;
- Flags: DWORD;
- //DWORD PrologLen : 8;
- //DWORD FuncLen : 22;
- //DWORD ThirtyTwoBit : 1;
- //DWORD ExceptionFlag : 1;
- end;
- {$EXTERNALSYM _IMAGE_CE_RUNTIME_FUNCTION_ENTRY}
- IMAGE_CE_RUNTIME_FUNCTION_ENTRY = _IMAGE_CE_RUNTIME_FUNCTION_ENTRY;
- {$EXTERNALSYM IMAGE_CE_RUNTIME_FUNCTION_ENTRY}
- TImageCERuntimeFunctionEntry = IMAGE_CE_RUNTIME_FUNCTION_ENTRY;
- PImageCERuntimeFunctionEntry = PIMAGE_CE_RUNTIME_FUNCTION_ENTRY;
- //
- // Debug Format
- //
- type
- PIMAGE_DEBUG_DIRECTORY = ^IMAGE_DEBUG_DIRECTORY;
- {$EXTERNALSYM PIMAGE_DEBUG_DIRECTORY}
- _IMAGE_DEBUG_DIRECTORY = record
- Characteristics: DWORD;
- TimeDateStamp: DWORD;
- MajorVersion: Word;
- MinorVersion: Word;
- Type_: DWORD;
- SizeOfData: DWORD;
- AddressOfRawData: DWORD;
- PointerToRawData: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_DEBUG_DIRECTORY}
- IMAGE_DEBUG_DIRECTORY = _IMAGE_DEBUG_DIRECTORY;
- {$EXTERNALSYM IMAGE_DEBUG_DIRECTORY}
- TImageDebugDirectory = IMAGE_DEBUG_DIRECTORY;
- PImageDebugDirectory = PIMAGE_DEBUG_DIRECTORY;
- const
- IMAGE_DEBUG_TYPE_UNKNOWN = 0;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_UNKNOWN}
- IMAGE_DEBUG_TYPE_COFF = 1;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_COFF}
- IMAGE_DEBUG_TYPE_CODEVIEW = 2;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_CODEVIEW}
- IMAGE_DEBUG_TYPE_FPO = 3;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_FPO}
- IMAGE_DEBUG_TYPE_MISC = 4;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_MISC}
- IMAGE_DEBUG_TYPE_EXCEPTION = 5;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_EXCEPTION}
- IMAGE_DEBUG_TYPE_FIXUP = 6;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_FIXUP}
- IMAGE_DEBUG_TYPE_OMAP_TO_SRC = 7;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_OMAP_TO_SRC}
- IMAGE_DEBUG_TYPE_OMAP_FROM_SRC = 8;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_OMAP_FROM_SRC}
- IMAGE_DEBUG_TYPE_BORLAND = 9;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_BORLAND}
- IMAGE_DEBUG_TYPE_RESERVED10 = 10;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_RESERVED10}
- IMAGE_DEBUG_TYPE_CLSID = 11;
- {$EXTERNALSYM IMAGE_DEBUG_TYPE_CLSID}
- type
- PIMAGE_COFF_SYMBOLS_HEADER = ^IMAGE_COFF_SYMBOLS_HEADER;
- {$EXTERNALSYM PIMAGE_COFF_SYMBOLS_HEADER}
- _IMAGE_COFF_SYMBOLS_HEADER = record
- NumberOfSymbols: DWORD;
- LvaToFirstSymbol: DWORD;
- NumberOfLinenumbers: DWORD;
- LvaToFirstLinenumber: DWORD;
- RvaToFirstByteOfCode: DWORD;
- RvaToLastByteOfCode: DWORD;
- RvaToFirstByteOfData: DWORD;
- RvaToLastByteOfData: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_COFF_SYMBOLS_HEADER}
- IMAGE_COFF_SYMBOLS_HEADER = _IMAGE_COFF_SYMBOLS_HEADER;
- {$EXTERNALSYM IMAGE_COFF_SYMBOLS_HEADER}
- TImageCoffSymbolsHeader = IMAGE_COFF_SYMBOLS_HEADER;
- PImageCoffSymbolsHeader = PIMAGE_COFF_SYMBOLS_HEADER;
- const
- FRAME_FPO = 0;
- {$EXTERNALSYM FRAME_FPO}
- FRAME_TRAP = 1;
- {$EXTERNALSYM FRAME_TRAP}
- FRAME_TSS = 2;
- {$EXTERNALSYM FRAME_TSS}
- FRAME_NONFPO = 3;
- {$EXTERNALSYM FRAME_NONFPO}
- FPOFLAGS_PROLOG = $00FF; // # bytes in prolog
- FPOFLAGS_REGS = $0700; // # regs saved
- FPOFLAGS_HAS_SEH = $0800; // TRUE if SEH in func
- FPOFLAGS_USE_BP = $1000; // TRUE if EBP has been allocated
- FPOFLAGS_RESERVED = $2000; // reserved for future use
- FPOFLAGS_FRAME = $C000; // frame type
- type
- PFPO_DATA = ^FPO_DATA;
- {$EXTERNALSYM PFPO_DATA}
- _FPO_DATA = record
- ulOffStart: DWORD; // offset 1st byte of function code
- cbProcSize: DWORD; // # bytes in function
- cdwLocals: DWORD; // # bytes in locals/4
- cdwParams: WORD; // # bytes in params/4
- Flags: WORD;
- end;
- {$EXTERNALSYM _FPO_DATA}
- FPO_DATA = _FPO_DATA;
- {$EXTERNALSYM FPO_DATA}
- TFpoData = FPO_DATA;
- PFpoData = PFPO_DATA;
- const
- SIZEOF_RFPO_DATA = 16;
- {$EXTERNALSYM SIZEOF_RFPO_DATA}
- IMAGE_DEBUG_MISC_EXENAME = 1;
- {$EXTERNALSYM IMAGE_DEBUG_MISC_EXENAME}
- type
- PIMAGE_DEBUG_MISC = ^IMAGE_DEBUG_MISC;
- {$EXTERNALSYM PIMAGE_DEBUG_MISC}
- _IMAGE_DEBUG_MISC = record
- DataType: DWORD; // type of misc data, see defines
- Length: DWORD; // total length of record, rounded to four byte multiple.
- Unicode: ByteBool; // TRUE if data is unicode string
- Reserved: array [0..2] of Byte;
- Data: array [0..0] of Byte; // Actual data
- end;
- {$EXTERNALSYM _IMAGE_DEBUG_MISC}
- IMAGE_DEBUG_MISC = _IMAGE_DEBUG_MISC;
- {$EXTERNALSYM IMAGE_DEBUG_MISC}
- TImageDebugMisc = IMAGE_DEBUG_MISC;
- PImageDebugMisc = PIMAGE_DEBUG_MISC;
- //
- // Function table extracted from MIPS/ALPHA/IA64 images. Does not contain
- // information needed only for runtime support. Just those fields for
- // each entry needed by a debugger.
- //
- PIMAGE_FUNCTION_ENTRY = ^IMAGE_FUNCTION_ENTRY;
- {$EXTERNALSYM PIMAGE_FUNCTION_ENTRY}
- _IMAGE_FUNCTION_ENTRY = record
- StartingAddress: DWORD;
- EndingAddress: DWORD;
- EndOfPrologue: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_FUNCTION_ENTRY}
- IMAGE_FUNCTION_ENTRY = _IMAGE_FUNCTION_ENTRY;
- {$EXTERNALSYM IMAGE_FUNCTION_ENTRY}
- TImageFunctionEntry = IMAGE_FUNCTION_ENTRY;
- PImageFunctionEntry = PIMAGE_FUNCTION_ENTRY;
- PIMAGE_FUNCTION_ENTRY64 = ^IMAGE_FUNCTION_ENTRY64;
- {$EXTERNALSYM PIMAGE_FUNCTION_ENTRY64}
- _IMAGE_FUNCTION_ENTRY64 = record
- StartingAddress: ULONGLONG;
- EndingAddress: ULONGLONG;
- case Integer of
- 0: (EndOfPrologue: ULONGLONG);
- 1: (UnwindInfoAddress: ULONGLONG);
- end;
- {$EXTERNALSYM _IMAGE_FUNCTION_ENTRY64}
- IMAGE_FUNCTION_ENTRY64 = _IMAGE_FUNCTION_ENTRY64;
- {$EXTERNALSYM IMAGE_FUNCTION_ENTRY64}
- TImageFunctionEntry64 = IMAGE_FUNCTION_ENTRY64;
- PImageFunctionEntry64 = PIMAGE_FUNCTION_ENTRY64;
- //
- // Debugging information can be stripped from an image file and placed
- // in a separate .DBG file, whose file name part is the same as the
- // image file name part (e.g. symbols for CMD.EXE could be stripped
- // and placed in CMD.DBG). This is indicated by the IMAGE_FILE_DEBUG_STRIPPED
- // flag in the Characteristics field of the file header. The beginning of
- // the .DBG file contains the following structure which captures certain
- // information from the image file. This allows a debug to proceed even if
- // the original image file is not accessable. This header is followed by
- // zero of more IMAGE_SECTION_HEADER structures, followed by zero or more
- // IMAGE_DEBUG_DIRECTORY structures. The latter structures and those in
- // the image file contain file offsets relative to the beginning of the
- // .DBG file.
- //
- // If symbols have been stripped from an image, the IMAGE_DEBUG_MISC structure
- // is left in the image file, but not mapped. This allows a debugger to
- // compute the name of the .DBG file, from the name of the image in the
- // IMAGE_DEBUG_MISC structure.
- //
- PIMAGE_SEPARATE_DEBUG_HEADER = ^IMAGE_SEPARATE_DEBUG_HEADER;
- {$EXTERNALSYM PIMAGE_SEPARATE_DEBUG_HEADER}
- _IMAGE_SEPARATE_DEBUG_HEADER = record
- Signature: Word;
- Flags: Word;
- Machine: Word;
- Characteristics: Word;
- TimeDateStamp: DWORD;
- CheckSum: DWORD;
- ImageBase: DWORD;
- SizeOfImage: DWORD;
- NumberOfSections: DWORD;
- ExportedNamesSize: DWORD;
- DebugDirectorySize: DWORD;
- SectionAlignment: DWORD;
- Reserved: array [0..1] of DWORD;
- end;
- {$EXTERNALSYM _IMAGE_SEPARATE_DEBUG_HEADER}
- IMAGE_SEPARATE_DEBUG_HEADER = _IMAGE_SEPARATE_DEBUG_HEADER;
- {$EXTERNALSYM IMAGE_SEPARATE_DEBUG_HEADER}
- TImageSeparateDebugHeader = IMAGE_SEPARATE_DEBUG_HEADER;
- PImageSeparateDebugHeader = PIMAGE_SEPARATE_DEBUG_HEADER;
- _NON_PAGED_DEBUG_INFO = record
- Signature: WORD;
- Flags: WORD;
- Size: DWORD;
- Machine: WORD;
- Characteristics: WORD;
- TimeDateStamp: DWORD;
- CheckSum: DWORD;
- SizeOfImage: DWORD;
- ImageBase: ULONGLONG;
- //DebugDirectorySize
- //IMAGE_DEBUG_DIRECTORY
- end;
- {$EXTERNALSYM _NON_PAGED_DEBUG_INFO}
- NON_PAGED_DEBUG_INFO = _NON_PAGED_DEBUG_INFO;
- {$EXTERNALSYM NON_PAGED_DEBUG_INFO}
- PNON_PAGED_DEBUG_INFO = ^NON_PAGED_DEBUG_INFO;
- {$EXTERNALSYM PNON_PAGED_DEBUG_INFO}
- const
- IMAGE_SEPARATE_DEBUG_SIGNATURE = $4944;
- {$EXTERNALSYM IMAGE_SEPARATE_DEBUG_SIGNATURE}
- NON_PAGED_DEBUG_SIGNATURE = $494E;
- {$EXTERNALSYM NON_PAGED_DEBUG_SIGNATURE}
- IMAGE_SEPARATE_DEBUG_FLAGS_MASK = $8000;
- {$EXTERNALSYM IMAGE_SEPARATE_DEBUG_FLAGS_MASK}
- IMAGE_SEPARATE_DEBUG_MISMATCH = $8000; // when DBG was updated, the old checksum didn't match.
- {$EXTERNALSYM IMAGE_SEPARATE_DEBUG_MISMATCH}
- //
- // The .arch section is made up of headers, each describing an amask position/value
- // pointing to an array of IMAGE_ARCHITECTURE_ENTRY's. Each "array" (both the header
- // and entry arrays) are terminiated by a quadword of 0xffffffffL.
- //
- // NOTE: There may be quadwords of 0 sprinkled around and must be skipped.
- //
- const
- IAHMASK_VALUE = $00000001; // 1 -> code section depends on mask bit
- // 0 -> new instruction depends on mask bit
- IAHMASK_MBZ7 = $000000FE; // MBZ
- IAHMASK_SHIFT = $0000FF00; // Amask bit in question for this fixup
- IAHMASK_MBZ16 = DWORD($FFFF0000); // MBZ
- type
- PIMAGE_ARCHITECTURE_HEADER = ^IMAGE_ARCHITECTURE_HEADER;
- {$EXTERNALSYM PIMAGE_ARCHITECTURE_HEADER}
- _ImageArchitectureHeader = record
- Mask: DWORD;
- FirstEntryRVA: DWORD; // RVA into .arch section to array of ARCHITECTURE_ENTRY's
- end;
- {$EXTERNALSYM _ImageArchitectureHeader}
- IMAGE_ARCHITECTURE_HEADER = _ImageArchitectureHeader;
- {$EXTERNALSYM IMAGE_ARCHITECTURE_HEADER}
- TImageArchitectureHeader = IMAGE_ARCHITECTURE_HEADER;
- PImageArchitectureHeader = PIMAGE_ARCHITECTURE_HEADER;
- PIMAGE_ARCHITECTURE_ENTRY = ^IMAGE_ARCHITECTURE_ENTRY;
- {$EXTERNALSYM PIMAGE_ARCHITECTURE_ENTRY}
- _ImageArchitectureEntry = record
- FixupInstRVA: DWORD; // RVA of instruction to fixup
- NewInst: DWORD; // fixup instruction (see alphaops.h)
- end;
- {$EXTERNALSYM _ImageArchitectureEntry}
- IMAGE_ARCHITECTURE_ENTRY = _ImageArchitectureEntry;
- {$EXTERNALSYM IMAGE_ARCHITECTURE_ENTRY}
- TImageArchitectureEntry = IMAGE_ARCHITECTURE_ENTRY;
- PImageArchitectureEntry = PIMAGE_ARCHITECTURE_ENTRY;
- // #include "poppack.h" // Back to the initial value
- // The following structure defines the new import object. Note the values of the first two fields,
- // which must be set as stated in order to differentiate old and new import members.
- // Following this structure, the linker emits two null-terminated strings used to recreate the
- // import at the time of use. The first string is the import's name, the second is the dll's name.
- const
- IMPORT_OBJECT_HDR_SIG2 = $ffff;
- {$EXTERNALSYM IMPORT_OBJECT_HDR_SIG2}
- const
- IOHFLAGS_TYPE = $0003; // IMPORT_TYPE
- IAHFLAGS_NAMETYPE = $001C; // IMPORT_NAME_TYPE
- IAHFLAGS_RESERVED = $FFE0; // Reserved. Must be zero.
- type
- PImportObjectHeader = ^IMPORT_OBJECT_HEADER;
- IMPORT_OBJECT_HEADER = record
- Sig1: WORD; // Must be IMAGE_FILE_MACHINE_UNKNOWN
- Sig2: WORD; // Must be IMPORT_OBJECT_HDR_SIG2.
- Version: WORD;
- Machine: WORD;
- TimeDateStamp: DWORD; // Time/date stamp
- SizeOfData: DWORD; // particularly useful for incremental links
- OrdinalOrHint: record
- case Integer of
- 0: (Ordinal: WORD); // if grf & IMPORT_OBJECT_ORDINAL
- 1: (Flags: DWORD);
- end;
- Flags: WORD;
- //WORD Type : 2; // IMPORT_TYPE
- //WORD NameType : 3; // IMPORT_NAME_TYPE
- //WORD Reserved : 11; // Reserved. Must be zero.
- end;
- {$EXTERNALSYM IMPORT_OBJECT_HEADER}
- TImportObjectHeader = IMPORT_OBJECT_HEADER;
- IMPORT_OBJECT_TYPE = (IMPORT_OBJECT_CODE, IMPORT_OBJECT_DATA, IMPORT_OBJECT_CONST);
- {$EXTERNALSYM IMPORT_OBJECT_TYPE}
- TImportObjectType = IMPORT_OBJECT_TYPE;
- IMPORT_OBJECT_NAME_TYPE = (
- IMPORT_OBJECT_ORDINAL, // Import by ordinal
- IMPORT_OBJECT_NAME, // Import name == public symbol name.
- IMPORT_OBJECT_NAME_NO_PREFIX, // Import name == public symbol name skipping leading ?, @, or optionally _.
- IMPORT_OBJECT_NAME_UNDECORATE); // Import name == public symbol name skipping leading ?, @, or optionally _
- // and truncating at first @
- {$EXTERNALSYM IMPORT_OBJECT_NAME_TYPE}
- TImportObjectNameType = IMPORT_OBJECT_NAME_TYPE;
- ReplacesCorHdrNumericDefines = DWORD;
- {$EXTERNALSYM ReplacesCorHdrNumericDefines}
- const
- // COM+ Header entry point flags.
- COMIMAGE_FLAGS_ILONLY = $00000001;
- {$EXTERNALSYM COMIMAGE_FLAGS_ILONLY}
- COMIMAGE_FLAGS_32BITREQUIRED = $00000002;
- {$EXTERNALSYM COMIMAGE_FLAGS_32BITREQUIRED}
- COMIMAGE_FLAGS_IL_LIBRARY = $00000004;
- {$EXTERNALSYM COMIMAGE_FLAGS_IL_LIBRARY}
- COMIMAGE_FLAGS_STRONGNAMESIGNED = $00000008;
- {$EXTERNALSYM COMIMAGE_FLAGS_STRONGNAMESIGNED}
- COMIMAGE_FLAGS_TRACKDEBUGDATA = $00010000;
- {$EXTERNALSYM COMIMAGE_FLAGS_TRACKDEBUGDATA}
- // Version flags for image.
- COR_VERSION_MAJOR_V2 = 2;
- {$EXTERNALSYM COR_VERSION_MAJOR_V2}
- COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2;
- {$EXTERNALSYM COR_VERSION_MAJOR}
- COR_VERSION_MINOR = 0;
- {$EXTERNALSYM COR_VERSION_MINOR}
- COR_DELETED_NAME_LENGTH = 8;
- {$EXTERNALSYM COR_DELETED_NAME_LENGTH}
- COR_VTABLEGAP_NAME_LENGTH = 8;
- {$EXTERNALSYM COR_VTABLEGAP_NAME_LENGTH}
- // Maximum size of a NativeType descriptor.
- NATIVE_TYPE_MAX_CB = 1;
- {$EXTERNALSYM NATIVE_TYPE_MAX_CB}
- COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE= $FF;
- {$EXTERNALSYM COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE}
- // #defines for the MIH FLAGS
- IMAGE_COR_MIH_METHODRVA = $01;
- {$EXTERNALSYM IMAGE_COR_MIH_METHODRVA}
- IMAGE_COR_MIH_EHRVA = $02;
- {$EXTERNALSYM IMAGE_COR_MIH_EHRVA}
- IMAGE_COR_MIH_BASICBLOCK = $08;
- {$EXTERNALSYM IMAGE_COR_MIH_BASICBLOCK}
- // V-table constants
- COR_VTABLE_32BIT = $01; // V-table slots are 32-bits in size.
- {$EXTERNALSYM COR_VTABLE_32BIT}
- COR_VTABLE_64BIT = $02; // V-table slots are 64-bits in size.
- {$EXTERNALSYM COR_VTABLE_64BIT}
- COR_VTABLE_FROM_UNMANAGED = $04; // If set, transition from unmanaged.
- {$EXTERNALSYM COR_VTABLE_FROM_UNMANAGED}
- COR_VTABLE_CALL_MOST_DERIVED = $10; // Call most derived method described by
- {$EXTERNALSYM COR_VTABLE_CALL_MOST_DERIVED}
- // EATJ constants
- IMAGE_COR_EATJ_THUNK_SIZE = 32; // Size of a jump thunk reserved range.
- {$EXTERNALSYM IMAGE_COR_EATJ_THUNK_SIZE}
- // Max name lengths
- // Change to unlimited name lengths.
- MAX_CLASS_NAME = 1024;
- {$EXTERNALSYM MAX_CLASS_NAME}
- MAX_PACKAGE_NAME = 1024;
- {$EXTERNALSYM MAX_PACKAGE_NAME}
- // COM+ 2.0 header structure.
- type
- IMAGE_COR20_HEADER = record
- // Header versioning
- cb: DWORD;
- MajorRuntimeVersion: WORD;
- MinorRuntimeVersion: WORD;
- // Symbol table and startup information
- MetaData: IMAGE_DATA_DIRECTORY;
- Flags: DWORD;
- EntryPointToken: DWORD;
- // Binding information
- Resources: IMAGE_DATA_DIRECTORY;
- StrongNameSignature: IMAGE_DATA_DIRECTORY;
- // Regular fixup and binding information
- CodeManagerTable: IMAGE_DATA_DIRECTORY;
- VTableFixups: IMAGE_DATA_DIRECTORY;
- ExportAddressTableJumps: IMAGE_DATA_DIRECTORY;
- // Precompiled image info (internal use only - set to zero)
- ManagedNativeHeader: IMAGE_DATA_DIRECTORY;
- end;
- {$EXTERNALSYM IMAGE_COR20_HEADER}
- PIMAGE_COR20_HEADER = ^IMAGE_COR20_HEADER;
- {$EXTERNALSYM PIMAGE_COR20_HEADER}
- TImageCor20Header = IMAGE_COR20_HEADER;
- PImageCor20Header = PIMAGE_COR20_HEADER;
- //
- // End Image Format
- //
- type
- SLIST_ENTRY = SINGLE_LIST_ENTRY;
- {$EXTERNALSYM SLIST_ENTRY}
- _SLIST_ENTRY = _SINGLE_LIST_ENTRY;
- {$EXTERNALSYM _SLIST_ENTRY}
- PSLIST_ENTRY = PSINGLE_LIST_ENTRY;
- {$EXTERNALSYM PSLIST_ENTRY}
- TSListEntry = SLIST_ENTRY;
- PSListEntry = PSLIST_ENTRY;
- type
- _SLIST_HEADER = record
- case Integer of
- 0: (
- Alignment: ULONGLONG);
- 1: (
- Next: SLIST_ENTRY;
- Depth: WORD;
- Sequence: WORD);
- end;
- {$EXTERNALSYM _SLIST_HEADER}
- SLIST_HEADER = _SLIST_HEADER;
- {$EXTERNALSYM SLIST_HEADER}
- PSLIST_HEADER = ^SLIST_HEADER;
- {$EXTERNALSYM PSLIST_HEADER}
- TSListHeader = SLIST_HEADER;
- PSListHeader = PSLIST_HEADER;
- procedure RtlInitializeSListHead(ListHead: PSLIST_HEADER); stdcall;
- {$EXTERNALSYM RtlInitializeSListHead}
- function RtlFirstEntrySList(ListHead: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
- {$EXTERNALSYM RtlFirstEntrySList}
- function RtlInterlockedPopEntrySList(ListHead: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
- {$EXTERNALSYM RtlInterlockedPopEntrySList}
- function RtlInterlockedPushEntrySList(ListHead, ListEntry: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
- {$EXTERNALSYM RtlInterlockedPushEntrySList}
- function RtlInterlockedFlushSList(ListHead: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
- {$EXTERNALSYM RtlInterlockedFlushSList}
- function RtlQueryDepthSList(ListHead: PSLIST_HEADER): WORD; stdcall;
- {$EXTERNALSYM RtlQueryDepthSList}
- const
- HEAP_NO_SERIALIZE = $00000001;
- {$EXTERNALSYM HEAP_NO_SERIALIZE}
- HEAP_GROWABLE = $00000002;
- {$EXTERNALSYM HEAP_GROWABLE}
- HEAP_GENERATE_EXCEPTIONS = $00000004;
- {$EXTERNALSYM HEAP_GENERATE_EXCEPTIONS}
- HEAP_ZERO_MEMORY = $00000008;
- {$EXTERNALSYM HEAP_ZERO_MEMORY}
- HEAP_REALLOC_IN_PLACE_ONLY = $00000010;
- {$EXTERNALSYM HEAP_REALLOC_IN_PLACE_ONLY}
- HEAP_TAIL_CHECKING_ENABLED = $00000020;
- {$EXTERNALSYM HEAP_TAIL_CHECKING_ENABLED}
- HEAP_FREE_CHECKING_ENABLED = $00000040;
- {$EXTERNALSYM HEAP_FREE_CHECKING_ENABLED}
- HEAP_DISABLE_COALESCE_ON_FREE = $00000080;
- {$EXTERNALSYM HEAP_DISABLE_COALESCE_ON_FREE}
- HEAP_CREATE_ALIGN_16 = $00010000;
- {$EXTERNALSYM HEAP_CREATE_ALIGN_16}
- HEAP_CREATE_ENABLE_TRACING = $00020000;
- {$EXTERNALSYM HEAP_CREATE_ENABLE_TRACING}
- HEAP_MAXIMUM_TAG = $0FFF;
- {$EXTERNALSYM HEAP_MAXIMUM_TAG}
- HEAP_PSEUDO_TAG_FLAG = $8000;
- {$EXTERNALSYM HEAP_PSEUDO_TAG_FLAG}
- HEAP_TAG_SHIFT = 18;
- {$EXTERNALSYM HEAP_TAG_SHIFT}
- function HEAP_MAKE_TAG_FLAGS(b, o: DWORD): DWORD;
- {$EXTERNALSYM HEAP_MAKE_TAG_FLAGS}
- const
- IS_TEXT_UNICODE_ASCII16 = $0001;
- {$EXTERNALSYM IS_TEXT_UNICODE_ASCII16}
- IS_TEXT_UNICODE_REVERSE_ASCII16 = $0010;
- {$EXTERNALSYM IS_TEXT_UNICODE_REVERSE_ASCII16}
- IS_TEXT_UNICODE_STATISTICS = $0002;
- {$EXTERNALSYM IS_TEXT_UNICODE_STATISTICS}
- IS_TEXT_UNICODE_REVERSE_STATISTICS = $0020;
- {$EXTERNALSYM IS_TEXT_UNICODE_REVERSE_STATISTICS}
- IS_TEXT_UNICODE_CONTROLS = $0004;
- {$EXTERNALSYM IS_TEXT_UNICODE_CONTROLS}
- IS_TEXT_UNICODE_REVERSE_CONTROLS = $0040;
- {$EXTERNALSYM IS_TEXT_UNICODE_REVERSE_CONTROLS}
- IS_TEXT_UNICODE_SIGNATURE = $0008;
- {$EXTERNALSYM IS_TEXT_UNICODE_SIGNATURE}
- IS_TEXT_UNICODE_REVERSE_SIGNATURE = $0080;
- {$EXTERNALSYM IS_TEXT_UNICODE_REVERSE_SIGNATURE}
- IS_TEXT_UNICODE_ILLEGAL_CHARS = $0100;
- {$EXTERNALSYM IS_TEXT_UNICODE_ILLEGAL_CHARS}
- IS_TEXT_UNICODE_ODD_LENGTH = $0200;
- {$EXTERNALSYM IS_TEXT_UNICODE_ODD_LENGTH}
- IS_TEXT_UNICODE_DBCS_LEADBYTE = $0400;
- {$EXTERNALSYM IS_TEXT_UNICODE_DBCS_LEADBYTE}
- IS_TEXT_UNICODE_NULL_BYTES = $1000;
- {$EXTERNALSYM IS_TEXT_UNICODE_NULL_BYTES}
- IS_TEXT_UNICODE_UNICODE_MASK = $000F;
- {$EXTERNALSYM IS_TEXT_UNICODE_UNICODE_MASK}
- IS_TEXT_UNICODE_REVERSE_MASK = $00F0;
- {$EXTERNALSYM IS_TEXT_UNICODE_REVERSE_MASK}
- IS_TEXT_UNICODE_NOT_UNICODE_MASK = $0F00;
- {$EXTERNALSYM IS_TEXT_UNICODE_NOT_UNICODE_MASK}
- IS_TEXT_UNICODE_NOT_ASCII_MASK = $F000;
- {$EXTERNALSYM IS_TEXT_UNICODE_NOT_ASCII_MASK}
- COMPRESSION_FORMAT_NONE = ($0000);
- {$EXTERNALSYM COMPRESSION_FORMAT_NONE}
- COMPRESSION_FORMAT_DEFAULT = ($0001);
- {$EXTERNALSYM COMPRESSION_FORMAT_DEFAULT}
- COMPRESSION_FORMAT_LZNT1 = ($0002);
- {$EXTERNALSYM COMPRESSION_FORMAT_LZNT1}
- COMPRESSION_ENGINE_STANDARD = ($0000);
- {$EXTERNALSYM COMPRESSION_ENGINE_STANDARD}
- COMPRESSION_ENGINE_MAXIMUM = ($0100);
- {$EXTERNALSYM COMPRESSION_ENGINE_MAXIMUM}
- COMPRESSION_ENGINE_HIBER = ($0200);
- {$EXTERNALSYM COMPRESSION_ENGINE_HIBER}
- function RtlCompareMemory(const Source1, Source2: Pointer; Length: SIZE_T): SIZE_T; stdcall;
- {$EXTERNALSYM RtlCompareMemory}
- type
- PMESSAGE_RESOURCE_ENTRY = ^MESSAGE_RESOURCE_ENTRY;
- {$EXTERNALSYM PMESSAGE_RESOURCE_ENTRY}
- _MESSAGE_RESOURCE_ENTRY = record
- Length: Word;
- Flags: Word;
- Text: array [0..0] of Byte;
- end;
- {$EXTERNALSYM _MESSAGE_RESOURCE_ENTRY}
- MESSAGE_RESOURCE_ENTRY = _MESSAGE_RESOURCE_ENTRY;
- {$EXTERNALSYM MESSAGE_RESOURCE_ENTRY}
- TMessageResourceEntry = MESSAGE_RESOURCE_ENTRY;
- PMessageResourceEntry = PMESSAGE_RESOURCE_ENTRY;
- const
- MESSAGE_RESOURCE_UNICODE = $0001;
- {$EXTERNALSYM MESSAGE_RESOURCE_UNICODE}
- type
- PMESSAGE_RESOURCE_BLOCK = ^MESSAGE_RESOURCE_BLOCK;
- {$EXTERNALSYM PMESSAGE_RESOURCE_BLOCK}
- _MESSAGE_RESOURCE_BLOCK = record
- LowId: DWORD;
- HighId: DWORD;
- OffsetToEntries: DWORD;
- end;
- {$EXTERNALSYM _MESSAGE_RESOURCE_BLOCK}
- MESSAGE_RESOURCE_BLOCK = _MESSAGE_RESOURCE_BLOCK;
- {$EXTERNALSYM MESSAGE_RESOURCE_BLOCK}
- TMessageResourceBlock = MESSAGE_RESOURCE_BLOCK;
- PMessageResourceBlock = PMESSAGE_RESOURCE_BLOCK;
- PMESSAGE_RESOURCE_DATA = ^MESSAGE_RESOURCE_DATA;
- {$EXTERNALSYM PMESSAGE_RESOURCE_DATA}
- _MESSAGE_RESOURCE_DATA = record
- NumberOfBlocks: DWORD;
- Blocks: array [0..0] of MESSAGE_RESOURCE_BLOCK;
- end;
- {$EXTERNALSYM _MESSAGE_RESOURCE_DATA}
- MESSAGE_RESOURCE_DATA = _MESSAGE_RESOURCE_DATA;
- {$EXTERNALSYM MESSAGE_RESOURCE_DATA}
- TMessageResourceData = MESSAGE_RESOURCE_DATA;
- PMessageResourceData = PMESSAGE_RESOURCE_DATA;
- LPOSVERSIONINFOA = ^OSVERSIONINFOA;
- {$EXTERNALSYM LPOSVERSIONINFOA}
- _OSVERSIONINFOA = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array [0..127] of CHAR; // Maintenance string for PSS usage
- end;
- {$EXTERNALSYM _OSVERSIONINFOA}
- OSVERSIONINFOA = _OSVERSIONINFOA;
- {$EXTERNALSYM OSVERSIONINFOA}
- TOsVersionInfoA = OSVERSIONINFOA;
- POsVersionInfoA = LPOSVERSIONINFOA;
- LPOSVERSIONINFOW = ^OSVERSIONINFOW;
- {$EXTERNALSYM LPOSVERSIONINFOW}
- _OSVERSIONINFOW = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array [0..127] of WCHAR; // Maintenance string for PSS usage
- end;
- {$EXTERNALSYM _OSVERSIONINFOW}
- OSVERSIONINFOW = _OSVERSIONINFOW;
- {$EXTERNALSYM OSVERSIONINFOW}
- TOsVersionInfoW = OSVERSIONINFOW;
- POsVersionInfoW = LPOSVERSIONINFOW;
- {$IFDEF UNICODE}
- OSVERSIONINFO = OSVERSIONINFOW;
- {$EXTERNALSYM OSVERSIONINFO}
- POSVERSIONINFO = POSVERSIONINFOW;
- {$EXTERNALSYM POSVERSIONINFO}
- LPOSVERSIONINFO = LPOSVERSIONINFOW;
- {$EXTERNALSYM LPOSVERSIONINFO}
- TOSVersionInfo = TOSVersionInfoW;
- {$ELSE}
- OSVERSIONINFO = OSVERSIONINFOA;
- {$EXTERNALSYM OSVERSIONINFO}
- POSVERSIONINFO = POSVERSIONINFOA;
- {$EXTERNALSYM POSVERSIONINFO}
- LPOSVERSIONINFO = LPOSVERSIONINFOA;
- {$EXTERNALSYM LPOSVERSIONINFO}
- TOSVersionInfo = TOSVersionInfoA;
- {$ENDIF}
- type
- POSVERSIONINFOEXA = ^OSVERSIONINFOEXA;
- {$EXTERNALSYM POSVERSIONINFOEXA}
- _OSVERSIONINFOEXA = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array [0..127] of CHAR; // Maintenance string for PSS usage
- wServicePackMajor: WORD;
- wServicePackMinor: WORD;
- wSuiteMask: WORD;
- wProductType: BYTE;
- wReserved: BYTE;
- end;
- {$EXTERNALSYM _OSVERSIONINFOEXA}
- OSVERSIONINFOEXA = _OSVERSIONINFOEXA;
- {$EXTERNALSYM OSVERSIONINFOEXA}
- LPOSVERSIONINFOEXA = ^OSVERSIONINFOEXA;
- {$EXTERNALSYM LPOSVERSIONINFOEXA}
- TOSVersionInfoExA = _OSVERSIONINFOEXA;
- POSVERSIONINFOEXW = ^OSVERSIONINFOEXW;
- {$EXTERNALSYM POSVERSIONINFOEXW}
- _OSVERSIONINFOEXW = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array [0..127] of WCHAR; // Maintenance string for PSS usage
- wServicePackMajor: WORD;
- wServicePackMinor: WORD;
- wSuiteMask: WORD;
- wProductType: BYTE;
- wReserved: BYTE;
- end;
- {$EXTERNALSYM _OSVERSIONINFOEXW}
- OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
- {$EXTERNALSYM OSVERSIONINFOEXW}
- LPOSVERSIONINFOEXW = ^OSVERSIONINFOEXW;
- {$EXTERNALSYM LPOSVERSIONINFOEXW}
- RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
- {$EXTERNALSYM RTL_OSVERSIONINFOEXW}
- PRTL_OSVERSIONINFOEXW = ^RTL_OSVERSIONINFOEXW;
- {$EXTERNALSYM PRTL_OSVERSIONINFOEXW}
- TOSVersionInfoExW = _OSVERSIONINFOEXW;
- {$IFDEF UNICODE}
- OSVERSIONINFOEX = OSVERSIONINFOEXW;
- {$EXTERNALSYM OSVERSIONINFOEX}
- POSVERSIONINFOEX = POSVERSIONINFOEXW;
- {$EXTERNALSYM POSVERSIONINFOEX}
- LPOSVERSIONINFOEX = LPOSVERSIONINFOEXW;
- {$EXTERNALSYM LPOSVERSIONINFOEX}
- TOSVersionInfoEx = TOSVersionInfoExW;
- {$ELSE}
- OSVERSIONINFOEX = OSVERSIONINFOEXA;
- {$EXTERNALSYM OSVERSIONINFOEX}
- POSVERSIONINFOEX = POSVERSIONINFOEXA;
- {$EXTERNALSYM POSVERSIONINFOEX}
- LPOSVERSIONINFOEX = LPOSVERSIONINFOEXA;
- {$EXTERNALSYM LPOSVERSIONINFOEX}
- TOSVersionInfoEx = TOSVersionInfoExA;
- {$ENDIF}
- //
- // RtlVerifyVersionInfo() conditions
- //
- const
- VER_EQUAL = 1;
- {$EXTERNALSYM VER_EQUAL}
- VER_GREATER = 2;
- {$EXTERNALSYM VER_GREATER}
- VER_GREATER_EQUAL = 3;
- {$EXTERNALSYM VER_GREATER_EQUAL}
- VER_LESS = 4;
- {$EXTERNALSYM VER_LESS}
- VER_LESS_EQUAL = 5;
- {$EXTERNALSYM VER_LESS_EQUAL}
- VER_AND = 6;
- {$EXTERNALSYM VER_AND}
- VER_OR = 7;
- {$EXTERNALSYM VER_OR}
- VER_CONDITION_MASK = 7;
- {$EXTERNALSYM VER_CONDITION_MASK}
- VER_NUM_BITS_PER_CONDITION_MASK = 3;
- {$EXTERNALSYM VER_NUM_BITS_PER_CONDITION_MASK}
- //
- // RtlVerifyVersionInfo() type mask bits
- //
- VER_MINORVERSION = $0000001;
- {$EXTERNALSYM VER_MINORVERSION}
- VER_MAJORVERSION = $0000002;
- {$EXTERNALSYM VER_MAJORVERSION}
- VER_BUILDNUMBER = $0000004;
- {$EXTERNALSYM VER_BUILDNUMBER}
- VER_PLATFORMID = $0000008;
- {$EXTERNALSYM VER_PLATFORMID}
- VER_SERVICEPACKMINOR = $0000010;
- {$EXTERNALSYM VER_SERVICEPACKMINOR}
- VER_SERVICEPACKMAJOR = $0000020;
- {$EXTERNALSYM VER_SERVICEPACKMAJOR}
- VER_SUITENAME = $0000040;
- {$EXTERNALSYM VER_SUITENAME}
- VER_PRODUCT_TYPE = $0000080;
- {$EXTERNALSYM VER_PRODUCT_TYPE}
- //
- // RtlVerifyVersionInfo() os product type values
- //
- VER_NT_WORKSTATION = $0000001;
- {$EXTERNALSYM VER_NT_WORKSTATION}
- VER_NT_DOMAIN_CONTROLLER = $0000002;
- {$EXTERNALSYM VER_NT_DOMAIN_CONTROLLER}
- VER_NT_SERVER = $0000003;
- {$EXTERNALSYM VER_NT_SERVER}
- //
- // dwPlatformId defines:
- //
- VER_PLATFORM_WIN32s = 0;
- {$EXTERNALSYM VER_PLATFORM_WIN32s}
- VER_PLATFORM_WIN32_WINDOWS = 1;
- {$EXTERNALSYM VER_PLATFORM_WIN32_WINDOWS}
- VER_PLATFORM_WIN32_NT = 2;
- {$EXTERNALSYM VER_PLATFORM_WIN32_NT}
- //
- //
- // VerifyVersionInfo() macro to set the condition mask
- //
- // For documentation sakes here's the old version of the macro that got
- // changed to call an API
- // #define VER_SET_CONDITION(_m_,_t_,_c_) _m_=(_m_|(_c_<<(1<<_t_)))
- //
- procedure VER_SET_CONDITION(var Mask: DWORDLONG; TypeBitmask, ConditionMask: ULONG);
- {$EXTERNALSYM VER_SET_CONDITION}
- function VerSetConditionMask(ConditionMask: ULONGLONG; TypeMask: DWORD;
- Condition: BYTE): ULONGLONG; stdcall;
- {$EXTERNALSYM VerSetConditionMask}
- type
- PRTL_CRITICAL_SECTION_DEBUG = ^RTL_CRITICAL_SECTION_DEBUG;
- {$EXTERNALSYM PRTL_CRITICAL_SECTION_DEBUG}
- _RTL_CRITICAL_SECTION_DEBUG = record
- _Type: WORD;
- CreatorBackTraceIndex: WORD;
- CriticalSection: PRTL_CRITICAL_SECTION_DEBUG;
- ProcessLocksList: LIST_ENTRY;
- EntryCount: DWORD;
- ContentionCount: DWORD;
- Spare: array [0..1] of DWORD;
- end;
- {$EXTERNALSYM _RTL_CRITICAL_SECTION_DEBUG}
- RTL_CRITICAL_SECTION_DEBUG = _RTL_CRITICAL_SECTION_DEBUG;
- {$EXTERNALSYM RTL_CRITICAL_SECTION_DEBUG}
- TRtlCriticalSectionDebug = RTL_CRITICAL_SECTION_DEBUG;
- PRtlCriticalSectionDebug = PRTL_CRITICAL_SECTION_DEBUG;
- RTL_RESOURCE_DEBUG = _RTL_CRITICAL_SECTION_DEBUG;
- {$EXTERNALSYM RTL_RESOURCE_DEBUG}
- PRTL_RESOURCE_DEBUG = RTL_RESOURCE_DEBUG;
- {$EXTERNALSYM PRTL_RESOURCE_DEBUG}
- TRtlResourceDebug = RTL_CRITICAL_SECTION_DEBUG;
- PRtlResourceDebug = PRTL_CRITICAL_SECTION_DEBUG;
- const
- RTL_CRITSECT_TYPE = 0;
- {$EXTERNALSYM RTL_CRITSECT_TYPE}
- RTL_RESOURCE_TYPE = 1;
- {$EXTERNALSYM RTL_RESOURCE_TYPE}
- type
- PRTL_CRITICAL_SECTION = ^RTL_CRITICAL_SECTION;
- {$EXTERNALSYM PRTL_CRITICAL_SECTION}
- _RTL_CRITICAL_SECTION = record
- DebugInfo: PRTL_CRITICAL_SECTION_DEBUG;
- //
- // The following three fields control entering and exiting the critical
- // section for the resource
- //
- LockCount: LONG;
- RecursionCount: LONG;
- OwningThread: HANDLE; // from the thread's ClientId->UniqueThread
- LockSemaphore: HANDLE;
- SpinCount: ULONG_PTR; // force size on 64-bit systems when packed
- end;
- {$EXTERNALSYM _RTL_CRITICAL_SECTION}
- RTL_CRITICAL_SECTION = _RTL_CRITICAL_SECTION;
- {$EXTERNALSYM RTL_CRITICAL_SECTION}
- TRtlCriticalSection = RTL_CRITICAL_SECTION;
- PRtlCriticalSection = PRTL_CRITICAL_SECTION;
- RTL_VERIFIER_DLL_LOAD_CALLBACK = procedure (DllName: PWSTR; DllBase: PVOID; DllSize: SIZE_T;
- Reserved: PVOID); stdcall;
- {$EXTERNALSYM RTL_VERIFIER_DLL_LOAD_CALLBACK}
- RTL_VERIFIER_DLL_UNLOAD_CALLBACK = procedure (DllName: PWSTR; DllBase: PVOID; DllSize: SIZE_T;
- Reserved: PVOID); stdcall;
- {$EXTERNALSYM RTL_VERIFIER_DLL_UNLOAD_CALLBACK}
- PRTL_VERIFIER_THUNK_DESCRIPTOR = ^RTL_VERIFIER_THUNK_DESCRIPTOR;
- {$EXTERNALSYM PRTL_VERIFIER_THUNK_DESCRIPTOR}
- _RTL_VERIFIER_THUNK_DESCRIPTOR = record
- ThunkName: PCHAR;
- ThunkOldAddress: PVOID;
- ThunkNewAddress: PVOID;
- end;
- {$EXTERNALSYM _RTL_VERIFIER_THUNK_DESCRIPTOR}
- RTL_VERIFIER_THUNK_DESCRIPTOR = _RTL_VERIFIER_THUNK_DESCRIPTOR;
- {$EXTERNALSYM RTL_VERIFIER_THUNK_DESCRIPTOR}
- TRtlVerifierThunkDescriptor = RTL_VERIFIER_THUNK_DESCRIPTOR;
- PRtlVerifierThunkDescriptor = PRTL_VERIFIER_THUNK_DESCRIPTOR;
- PRTL_VERIFIER_DLL_DESCRIPTOR = ^RTL_VERIFIER_DLL_DESCRIPTOR;
- {$EXTERNALSYM PRTL_VERIFIER_DLL_DESCRIPTOR}
- _RTL_VERIFIER_DLL_DESCRIPTOR = record
- DllName: PWCHAR;
- DllFlags: DWORD;
- DllAddress: PVOID;
- DllThunks: PRTL_VERIFIER_THUNK_DESCRIPTOR;
- end;
- {$EXTERNALSYM _RTL_VERIFIER_DLL_DESCRIPTOR}
- RTL_VERIFIER_DLL_DESCRIPTOR = _RTL_VERIFIER_DLL_DESCRIPTOR;
- {$EXTERNALSYM RTL_VERIFIER_DLL_DESCRIPTOR}
- TRtlVerifierDllDescriptor = RTL_VERIFIER_DLL_DESCRIPTOR;
- PRtlVerifierDllDescriptor = PRTL_VERIFIER_DLL_DESCRIPTOR;
- PRTL_VERIFIER_PROVIDER_DESCRIPTOR = ^RTL_VERIFIER_PROVIDER_DESCRIPTOR;
- {$EXTERNALSYM PRTL_VERIFIER_PROVIDER_DESCRIPTOR}
- _RTL_VERIFIER_PROVIDER_DESCRIPTOR = record
- //
- // Filled by verifier provider DLL
- //
- Length: DWORD;
- ProviderDlls: PRTL_VERIFIER_DLL_DESCRIPTOR;
- ProviderDllLoadCallback: RTL_VERIFIER_DLL_LOAD_CALLBACK;
- ProviderDllUnloadCallback: RTL_VERIFIER_DLL_UNLOAD_CALLBACK;
- //
- // Filled by verifier engine
- //
- VerifierImage: PWSTR;
- VerifierFlags: DWORD;
- VerifierDebug: DWORD;
- RtlpGetStackTraceAddress: PVOID;
- RtlpDebugPageHeapCreate: PVOID;
- RtlpDebugPageHeapDestroy: PVOID;
- end;
- {$EXTERNALSYM _RTL_VERIFIER_PROVIDER_DESCRIPTOR}
- RTL_VERIFIER_PROVIDER_DESCRIPTOR = _RTL_VERIFIER_PROVIDER_DESCRIPTOR;
- {$EXTERNALSYM RTL_VERIFIER_PROVIDER_DESCRIPTOR}
- TRtlVerifierProviderDescriptor = RTL_VERIFIER_PROVIDER_DESCRIPTOR;
- PRtlVerifierProviderDescriptor = PRTL_VERIFIER_PROVIDER_DESCRIPTOR;
- //
- // Application verifier standard flags
- //
- const
- RTL_VRF_FLG_FULL_PAGE_HEAP = $00000001;
- RTL_VRF_FLG_LOCK_CHECKS = $00000002;
- RTL_VRF_FLG_HANDLE_CHECKS = $00000004;
- RTL_VRF_FLG_STACK_CHECKS = $00000008;
- RTL_VRF_FLG_APPCOMPAT_CHECKS = $00000010;
- RTL_VRF_FLG_TLS_CHECKS = $00000020;
- RTL_VRF_FLG_DIRTY_STACKS = $00000040;
- RTL_VRF_FLG_RPC_CHECKS = $00000080;
- RTL_VRF_FLG_COM_CHECKS = $00000100;
- RTL_VRF_FLG_DANGEROUS_APIS = $00000200;
- RTL_VRF_FLG_RACE_CHECKS = $00000400;
- RTL_VRF_FLG_DEADLOCK_CHECKS = $00000800;
- RTL_VRF_FLG_FIRST_CHANCE_EXCEPTION_CHECKS = $00001000;
- RTL_VRF_FLG_VIRTUAL_MEM_CHECKS = $00002000;
- RTL_VRF_FLG_ENABLE_LOGGING = $00004000;
- RTL_VRF_FLG_FAST_FILL_HEAP = $00008000;
- RTL_VRF_FLG_VIRTUAL_SPACE_TRACKING = $00010000;
- RTL_VRF_FLG_ENABLED_SYSTEM_WIDE = $00020000;
- RTL_VRF_FLG_MISCELLANEOUS_CHECKS = $00020000;
- //
- // Application verifier standard stop codes
- //
- APPLICATION_VERIFIER_INTERNAL_ERROR = DWORD($80000000);
- {$EXTERNALSYM APPLICATION_VERIFIER_INTERNAL_ERROR}
- APPLICATION_VERIFIER_INTERNAL_WARNING = $40000000;
- {$EXTERNALSYM APPLICATION_VERIFIER_INTERNAL_WARNING}
- APPLICATION_VERIFIER_NO_BREAK = $20000000;
- {$EXTERNALSYM APPLICATION_VERIFIER_NO_BREAK}
- APPLICATION_VERIFIER_CONTINUABLE_BREAK = $10000000;
- {$EXTERNALSYM APPLICATION_VERIFIER_CONTINUABLE_BREAK}
- APPLICATION_VERIFIER_UNKNOWN_ERROR = $0001;
- {$EXTERNALSYM APPLICATION_VERIFIER_UNKNOWN_ERROR}
- APPLICATION_VERIFIER_ACCESS_VIOLATION = $0002;
- {$EXTERNALSYM APPLICATION_VERIFIER_ACCESS_VIOLATION}
- APPLICATION_VERIFIER_UNSYNCHRONIZED_ACCESS = $0003;
- {$EXTERNALSYM APPLICATION_VERIFIER_UNSYNCHRONIZED_ACCESS}
- APPLICATION_VERIFIER_EXTREME_SIZE_REQUEST = $0004;
- {$EXTERNALSYM APPLICATION_VERIFIER_EXTREME_SIZE_REQUEST}
- APPLICATION_VERIFIER_BAD_HEAP_HANDLE = $0005;
- {$EXTERNALSYM APPLICATION_VERIFIER_BAD_HEAP_HANDLE}
- APPLICATION_VERIFIER_SWITCHED_HEAP_HANDLE = $0006;
- {$EXTERNALSYM APPLICATION_VERIFIER_SWITCHED_HEAP_HANDLE}
- APPLICATION_VERIFIER_DOUBLE_FREE = $0007;
- {$EXTERNALSYM APPLICATION_VERIFIER_DOUBLE_FREE}
- APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK = $0008;
- {$EXTERNALSYM APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK}
- APPLICATION_VERIFIER_DESTROY_PROCESS_HEAP = $0009;
- {$EXTERNALSYM APPLICATION_VERIFIER_DESTROY_PROCESS_HEAP}
- APPLICATION_VERIFIER_UNEXPECTED_EXCEPTION = $000A;
- {$EXTERNALSYM APPLICATION_VERIFIER_UNEXPECTED_EXCEPTION}
- APPLICATION_VERIFIER_STACK_OVERFLOW = $000B;
- {$EXTERNALSYM APPLICATION_VERIFIER_STACK_OVERFLOW}
- APPLICATION_VERIFIER_TERMINATE_THREAD_CALL = $0100;
- {$EXTERNALSYM APPLICATION_VERIFIER_TERMINATE_THREAD_CALL}
- APPLICATION_VERIFIER_EXIT_THREAD_OWNS_LOCK = $0200;
- {$EXTERNALSYM APPLICATION_VERIFIER_EXIT_THREAD_OWNS_LOCK}
- APPLICATION_VERIFIER_LOCK_IN_UNLOADED_DLL = $0201;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_IN_UNLOADED_DLL}
- APPLICATION_VERIFIER_LOCK_IN_FREED_HEAP = $0202;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_IN_FREED_HEAP}
- APPLICATION_VERIFIER_LOCK_DOUBLE_INITIALIZE = $0203;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_DOUBLE_INITIALIZE}
- APPLICATION_VERIFIER_LOCK_IN_FREED_MEMORY = $0204;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_IN_FREED_MEMORY}
- APPLICATION_VERIFIER_LOCK_CORRUPTED = $0205;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_CORRUPTED}
- APPLICATION_VERIFIER_LOCK_INVALID_OWNER = $0206;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_INVALID_OWNER}
- APPLICATION_VERIFIER_LOCK_INVALID_RECURSION_COUNT = $0207;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_INVALID_RECURSION_COUNT}
- APPLICATION_VERIFIER_LOCK_INVALID_LOCK_COUNT = $0208;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_INVALID_LOCK_COUNT}
- APPLICATION_VERIFIER_LOCK_OVER_RELEASED = $0209;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_OVER_RELEASED}
- APPLICATION_VERIFIER_LOCK_NOT_INITIALIZED = $0210;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_NOT_INITIALIZED}
- APPLICATION_VERIFIER_LOCK_ALREADY_INITIALIZED = $0211;
- {$EXTERNALSYM APPLICATION_VERIFIER_LOCK_ALREADY_INITIALIZED}
- APPLICATION_VERIFIER_INVALID_HANDLE = $0300;
- {$EXTERNALSYM APPLICATION_VERIFIER_INVALID_HANDLE}
- APPLICATION_VERIFIER_INVALID_TLS_VALUE = $0301;
- {$EXTERNALSYM APPLICATION_VERIFIER_INVALID_TLS_VALUE}
- APPLICATION_VERIFIER_INCORRECT_WAIT_CALL = $0302;
- {$EXTERNALSYM APPLICATION_VERIFIER_INCORRECT_WAIT_CALL}
- APPLICATION_VERIFIER_NULL_HANDLE = $0303;
- {$EXTERNALSYM APPLICATION_VERIFIER_NULL_HANDLE}
- APPLICATION_VERIFIER_WAIT_IN_DLLMAIN = $0304;
- {$EXTERNALSYM APPLICATION_VERIFIER_WAIT_IN_DLLMAIN}
- APPLICATION_VERIFIER_COM_ERROR = $0400;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_ERROR}
- APPLICATION_VERIFIER_COM_API_IN_DLLMAIN = $0401;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_API_IN_DLLMAIN}
- APPLICATION_VERIFIER_COM_UNHANDLED_EXCEPTION = $0402;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_UNHANDLED_EXCEPTION}
- APPLICATION_VERIFIER_COM_UNBALANCED_COINIT = $0403;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_UNBALANCED_COINIT}
- APPLICATION_VERIFIER_COM_UNBALANCED_OLEINIT = $0404;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_UNBALANCED_OLEINIT}
- APPLICATION_VERIFIER_COM_UNBALANCED_SWC = $0405;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_UNBALANCED_SWC}
- APPLICATION_VERIFIER_COM_NULL_DACL = $0406;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_NULL_DACL}
- APPLICATION_VERIFIER_COM_UNSAFE_IMPERSONATION = $0407;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_UNSAFE_IMPERSONATION}
- APPLICATION_VERIFIER_COM_SMUGGLED_WRAPPER = $0408;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_SMUGGLED_WRAPPER}
- APPLICATION_VERIFIER_COM_SMUGGLED_PROXY = $0409;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_SMUGGLED_PROXY}
- APPLICATION_VERIFIER_COM_CF_SUCCESS_WITH_NULL = $040A;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_CF_SUCCESS_WITH_NULL}
- APPLICATION_VERIFIER_COM_GCO_SUCCESS_WITH_NULL = $040B;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_GCO_SUCCESS_WITH_NULL}
- APPLICATION_VERIFIER_COM_OBJECT_IN_FREED_MEMORY = $040C;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_OBJECT_IN_FREED_MEMORY}
- APPLICATION_VERIFIER_COM_OBJECT_IN_UNLOADED_DLL = $040D;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_OBJECT_IN_UNLOADED_DLL}
- APPLICATION_VERIFIER_COM_VTBL_IN_FREED_MEMORY = $040E;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_VTBL_IN_FREED_MEMORY}
- APPLICATION_VERIFIER_COM_VTBL_IN_UNLOADED_DLL = $040F;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_VTBL_IN_UNLOADED_DLL}
- APPLICATION_VERIFIER_COM_HOLDING_LOCKS_ON_CALL = $0410;
- {$EXTERNALSYM APPLICATION_VERIFIER_COM_HOLDING_LOCKS_ON_CALL}
- APPLICATION_VERIFIER_RPC_ERROR = $0500;
- {$EXTERNALSYM APPLICATION_VERIFIER_RPC_ERROR}
- APPLICATION_VERIFIER_INVALID_FREEMEM = $0600;
- {$EXTERNALSYM APPLICATION_VERIFIER_INVALID_FREEMEM}
- APPLICATION_VERIFIER_INVALID_ALLOCMEM = $0601;
- {$EXTERNALSYM APPLICATION_VERIFIER_INVALID_ALLOCMEM}
- APPLICATION_VERIFIER_INVALID_MAPVIEW = $0602;
- {$EXTERNALSYM APPLICATION_VERIFIER_INVALID_MAPVIEW}
- (* TODO
- #define VERIFIER_STOP(Code, Msg, P1, S1, P2, S2, P3, S3, P4, S4) {
- RtlApplicationVerifierStop ((Code),
- (Msg),
- (ULONG_PTR)(P1),(S1),
- (ULONG_PTR)(P2),(S2),
- (ULONG_PTR)(P3),(S3),
- (ULONG_PTR)(P4),(S4));
- }
- VOID NTAPI
- RtlApplicationVerifierStop (
- ULONG_PTR Code,
- PCHAR Message,
- ULONG_PTR Param1, PCHAR Description1,
- ULONG_PTR Param2, PCHAR Description2,
- ULONG_PTR Param3, PCHAR Description3,
- ULONG_PTR Param4, PCHAR Description4
- );
- *)
- type
- PVECTORED_EXCEPTION_HANDLER = function (ExceptionInfo: PEXCEPTION_POINTERS): LONG; stdcall;
- {$EXTERNALSYM PVECTORED_EXCEPTION_HANDLER}
- PVectoredExceptionHandler = PVECTORED_EXCEPTION_HANDLER;
- const
- SEF_DACL_AUTO_INHERIT = $01;
- {$EXTERNALSYM SEF_DACL_AUTO_INHERIT}
- SEF_SACL_AUTO_INHERIT = $02;
- {$EXTERNALSYM SEF_SACL_AUTO_INHERIT}
- SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT = $04;
- {$EXTERNALSYM SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT}
- SEF_AVOID_PRIVILEGE_CHECK = $08;
- {$EXTERNALSYM SEF_AVOID_PRIVILEGE_CHECK}
- SEF_AVOID_OWNER_CHECK = $10;
- {$EXTERNALSYM SEF_AVOID_OWNER_CHECK}
- SEF_DEFAULT_OWNER_FROM_PARENT = $20;
- {$EXTERNALSYM SEF_DEFAULT_OWNER_FROM_PARENT}
- SEF_DEFAULT_GROUP_FROM_PARENT = $40;
- {$EXTERNALSYM SEF_DEFAULT_GROUP_FROM_PARENT}
- type
- _HEAP_INFORMATION_CLASS = (HeapCompatibilityInformation);
- {$EXTERNALSYM _HEAP_INFORMATION_CLASS}
- HEAP_INFORMATION_CLASS = _HEAP_INFORMATION_CLASS;
- {$EXTERNALSYM HEAP_INFORMATION_CLASS}
- THeapInformationClass = HEAP_INFORMATION_CLASS;
- { TODO
- DWORD NTAPI
- RtlSetHeapInformation (
- IN PVOID HeapHandle,
- IN HEAP_INFORMATION_CLASS HeapInformationClass,
- IN PVOID HeapInformation OPTIONAL,
- IN SIZE_T HeapInformationLength OPTIONAL
- );
- DWORD NTAPI
- RtlQueryHeapInformation (
- IN PVOID HeapHandle,
- IN HEAP_INFORMATION_CLASS HeapInformationClass,
- OUT PVOID HeapInformation OPTIONAL,
- IN SIZE_T HeapInformationLength OPTIONAL,
- OUT PSIZE_T ReturnLength OPTIONAL
- );
- //
- // Multiple alloc-free APIS
- //
- DWORD
- NTAPI
- RtlMultipleAllocateHeap (
- IN PVOID HeapHandle,
- IN DWORD Flags,
- IN SIZE_T Size,
- IN DWORD Count,
- OUT PVOID * Array
- );
- DWORD
- NTAPI
- RtlMultipleFreeHeap (
- IN PVOID HeapHandle,
- IN DWORD Flags,
- IN DWORD Count,
- OUT PVOID * Array
- );
- }
- const
- WT_EXECUTEDEFAULT = $00000000;
- {$EXTERNALSYM WT_EXECUTEDEFAULT}
- WT_EXECUTEINIOTHREAD = $00000001;
- {$EXTERNALSYM WT_EXECUTEINIOTHREAD}
- WT_EXECUTEINUITHREAD = $00000002;
- {$EXTERNALSYM WT_EXECUTEINUITHREAD}
- WT_EXECUTEINWAITTHREAD = $00000004;
- {$EXTERNALSYM WT_EXECUTEINWAITTHREAD}
- WT_EXECUTEONLYONCE = $00000008;
- {$EXTERNALSYM WT_EXECUTEONLYONCE}
- WT_EXECUTEINTIMERTHREAD = $00000020;
- {$EXTERNALSYM WT_EXECUTEINTIMERTHREAD}
- WT_EXECUTELONGFUNCTION = $00000010;
- {$EXTERNALSYM WT_EXECUTELONGFUNCTION}
- WT_EXECUTEINPERSISTENTIOTHREAD = $00000040;
- {$EXTERNALSYM WT_EXECUTEINPERSISTENTIOTHREAD}
- WT_EXECUTEINPERSISTENTTHREAD = $00000080;
- {$EXTERNALSYM WT_EXECUTEINPERSISTENTTHREAD}
- WT_TRANSFER_IMPERSONATION = $00000100;
- {$EXTERNALSYM WT_TRANSFER_IMPERSONATION}
- function WT_SET_MAX_THREADPOOL_THREADS(var Flags: DWORD; Limit: DWORD): DWORD;
- {$EXTERNALSYM WT_SET_MAX_THREADPOOL_THREADS}
- type
- WAITORTIMERCALLBACKFUNC = procedure (P: PVOID; B: ByteBool); stdcall;
- {$EXTERNALSYM WAITORTIMERCALLBACKFUNC}
- WORKERCALLBACKFUNC = procedure (P: PVOID); stdcall;
- {$EXTERNALSYM WORKERCALLBACKFUNC}
- APC_CALLBACK_FUNCTION = procedure (D: DWORD; P1, P2: PVOID); stdcall;
- {$EXTERNALSYM APC_CALLBACK_FUNCTION}
- const
- WT_EXECUTEINLONGTHREAD = $00000010;
- {$EXTERNALSYM WT_EXECUTEINLONGTHREAD}
- WT_EXECUTEDELETEWAIT = $00000008;
- {$EXTERNALSYM WT_EXECUTEDELETEWAIT}
- type
- _ACTIVATION_CONTEXT_INFO_CLASS = DWORD;
- {$EXTERNALSYM _ACTIVATION_CONTEXT_INFO_CLASS}
- ACTIVATION_CONTEXT_INFO_CLASS = _ACTIVATION_CONTEXT_INFO_CLASS;
- {$EXTERNALSYM ACTIVATION_CONTEXT_INFO_CLASS}
- TActivationContextInfoClass = ACTIVATION_CONTEXT_INFO_CLASS;
- const
- ActivationContextBasicInformation = 1;
- {$EXTERNALSYM ActivationContextBasicInformation}
- ActivationContextDetailedInformation = 2;
- {$EXTERNALSYM ActivationContextDetailedInformation}
- AssemblyDetailedInformationInActivationContxt = 3;
- {$EXTERNALSYM AssemblyDetailedInformationInActivationContxt}
- FileInformationInAssemblyOfAssemblyInActivationContxt = 4;
- {$EXTERNALSYM FileInformationInAssemblyOfAssemblyInActivationContxt}
- MaxActivationContextInfoClass = 5;
- {$EXTERNALSYM MaxActivationContextInfoClass}
- type
- PACTIVATION_CONTEXT_QUERY_INDEX = ^ACTIVATION_CONTEXT_QUERY_INDEX;
- {$EXTERNALSYM PACTIVATION_CONTEXT_QUERY_INDEX}
- _ACTIVATION_CONTEXT_QUERY_INDEX = record
- ulAssemblyIndex: DWORD;
- ulFileIndexInAssembly: DWORD;
- end;
- {$EXTERNALSYM _ACTIVATION_CONTEXT_QUERY_INDEX}
- ACTIVATION_CONTEXT_QUERY_INDEX = _ACTIVATION_CONTEXT_QUERY_INDEX;
- {$EXTERNALSYM ACTIVATION_CONTEXT_QUERY_INDEX}
- TActivationContextQueryIndex = ACTIVATION_CONTEXT_QUERY_INDEX;
- PActivationContextQueryIndex = PACTIVATION_CONTEXT_QUERY_INDEX;
- const
- ACTIVATION_CONTEXT_PATH_TYPE_NONE = (1);
- {$EXTERNALSYM ACTIVATION_CONTEXT_PATH_TYPE_NONE}
- ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE = (2);
- {$EXTERNALSYM ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE}
- ACTIVATION_CONTEXT_PATH_TYPE_URL = (3);
- {$EXTERNALSYM ACTIVATION_CONTEXT_PATH_TYPE_URL}
- ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF = (4);
- {$EXTERNALSYM ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF}
- type
- PASSEMBLY_FILE_DETAILED_INFORMATION = ^ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION;
- {$EXTERNALSYM PASSEMBLY_FILE_DETAILED_INFORMATION}
- _ASSEMBLY_FILE_DETAILED_INFORMATION = record
- ulFlags: DWORD;
- ulFilenameLength: DWORD;
- ulPathLength: DWORD;
- lpFileName: LPCWSTR;
- lpFilePath: LPCWSTR;
- end;
- {$EXTERNALSYM _ASSEMBLY_FILE_DETAILED_INFORMATION}
- ASSEMBLY_FILE_DETAILED_INFORMATION = _ASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION}
- PCASSEMBLY_FILE_DETAILED_INFORMATION = PASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM PCASSEMBLY_FILE_DETAILED_INFORMATION}
- TAssemblyFileDetailedInformation = ASSEMBLY_FILE_DETAILED_INFORMATION;
- PAssemblyFileDetailedInformation = PASSEMBLY_FILE_DETAILED_INFORMATION;
- //
- // compatibility with old names
- // The new names use "file" consistently.
- //
- _ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = _ASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM _ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION}
- ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = ASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION}
- PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION}
- PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PCASSEMBLY_FILE_DETAILED_INFORMATION;
- {$EXTERNALSYM PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION}
- TAssemblyDllRedirectionDetailedInformation = TAssemblyFileDetailedInformation;
- PAssemblyDllRedirectionDetailedInformation = PAssemblyFileDetailedInformation;
- PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = ^ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
- {$EXTERNALSYM PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION}
- _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = record
- ulFlags: DWORD;
- ulEncodedAssemblyIdentityLength: DWORD; // in bytes
- ulManifestPathType: DWORD; // ACTIVATION_CONTEXT_PATH_TYPE_*
- ulManifestPathLength: DWORD; // in bytes
- liManifestLastWriteTime: LARGE_INTEGER; // FILETIME
- ulPolicyPathType: DWORD; // ACTIVATION_CONTEXT_PATH_TYPE_*
- ulPolicyPathLength: DWORD; // in bytes
- liPolicyLastWriteTime: LARGE_INTEGER; // FILETIME
- ulMetadataSatelliteRosterIndex: DWORD;
- ulManifestVersionMajor: DWORD; // 1
- ulManifestVersionMinor: DWORD; // 0
- ulPolicyVersionMajor: DWORD; // 0
- ulPolicyVersionMinor: DWORD; // 0
- ulAssemblyDirectoryNameLength: DWORD; // in bytes
- lpAssemblyEncodedAssemblyIdentity: LPCWSTR;
- lpAssemblyManifestPath: LPCWSTR;
- lpAssemblyPolicyPath: LPCWSTR;
- lpAssemblyDirectoryName: LPCWSTR;
- ulFileCount: DWORD;
- end;
- {$EXTERNALSYM _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION}
- ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
- {$EXTERNALSYM ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION}
- TActivationContextAssemblyDetailedInformation = ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
- PActivationContextAssemblyDetailedInformation = PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION;
- PACTIVATION_CONTEXT_DETAILED_INFORMATION = ^ACTIVATION_CONTEXT_DETAILED_INFORMATION;
- {$EXTERNALSYM PACTIVATION_CONTEXT_DETAILED_INFORMATION}
- _ACTIVATION_CONTEXT_DETAILED_INFORMATION = record
- dwFlags: DWORD;
- ulFormatVersion: DWORD;
- ulAssemblyCount: DWORD;
- ulRootManifestPathType: DWORD;
- ulRootManifestPathChars: DWORD;
- ulRootConfigurationPathType: DWORD;
- ulRootConfigurationPathChars: DWORD;
- ulAppDirPathType: DWORD;
- ulAppDirPathChars: DWORD;
- lpRootManifestPath: LPCWSTR;
- lpRootConfigurationPath: LPCWSTR;
- lpAppDirPath: LPCWSTR;
- end;
- {$EXTERNALSYM _ACTIVATION_CONTEXT_DETAILED_INFORMATION}
- ACTIVATION_CONTEXT_DETAILED_INFORMATION = _ACTIVATION_CONTEXT_DETAILED_INFORMATION;
- {$EXTERNALSYM ACTIVATION_CONTEXT_DETAILED_INFORMATION}
- TActivationContextDetailedInformation = ACTIVATION_CONTEXT_DETAILED_INFORMATION;
- PActivationContextDetailedInformation = PACTIVATION_CONTEXT_DETAILED_INFORMATION;
- const
- DLL_PROCESS_ATTACH = 1;
- {$EXTERNALSYM DLL_PROCESS_ATTACH}
- DLL_THREAD_ATTACH = 2;
- {$EXTERNALSYM DLL_THREAD_ATTACH}
- DLL_THREAD_DETACH = 3;
- {$EXTERNALSYM DLL_THREAD_DETACH}
- DLL_PROCESS_DETACH = 0;
- {$EXTERNALSYM DLL_PROCESS_DETACH}
- DLL_PROCESS_VERIFIER = 4;
- {$EXTERNALSYM DLL_PROCESS_VERIFIER}
- //
- // Defines for the READ flags for Eventlogging
- //
- EVENTLOG_SEQUENTIAL_READ = $0001;
- {$EXTERNALSYM EVENTLOG_SEQUENTIAL_READ}
- EVENTLOG_SEEK_READ = $0002;
- {$EXTERNALSYM EVENTLOG_SEEK_READ}
- EVENTLOG_FORWARDS_READ = $0004;
- {$EXTERNALSYM EVENTLOG_FORWARDS_READ}
- EVENTLOG_BACKWARDS_READ = $0008;
- {$EXTERNALSYM EVENTLOG_BACKWARDS_READ}
- //
- // The types of events that can be logged.
- //
- EVENTLOG_SUCCESS = $0000;
- {$EXTERNALSYM EVENTLOG_SUCCESS}
- EVENTLOG_ERROR_TYPE = $0001;
- {$EXTERNALSYM EVENTLOG_ERROR_TYPE}
- EVENTLOG_WARNING_TYPE = $0002;
- {$EXTERNALSYM EVENTLOG_WARNING_TYPE}
- EVENTLOG_INFORMATION_TYPE = $0004;
- {$EXTERNALSYM EVENTLOG_INFORMATION_TYPE}
- EVENTLOG_AUDIT_SUCCESS = $0008;
- {$EXTERNALSYM EVENTLOG_AUDIT_SUCCESS}
- EVENTLOG_AUDIT_FAILURE = $0010;
- {$EXTERNALSYM EVENTLOG_AUDIT_FAILURE}
- //
- // Defines for the WRITE flags used by Auditing for paired events
- // These are not implemented in Product 1
- //
- EVENTLOG_START_PAIRED_EVENT = $0001;
- {$EXTERNALSYM EVENTLOG_START_PAIRED_EVENT}
- EVENTLOG_END_PAIRED_EVENT = $0002;
- {$EXTERNALSYM EVENTLOG_END_PAIRED_EVENT}
- EVENTLOG_END_ALL_PAIRED_EVENTS = $0004;
- {$EXTERNALSYM EVENTLOG_END_ALL_PAIRED_EVENTS}
- EVENTLOG_PAIRED_EVENT_ACTIVE = $0008;
- {$EXTERNALSYM EVENTLOG_PAIRED_EVENT_ACTIVE}
- EVENTLOG_PAIRED_EVENT_INACTIVE = $0010;
- {$EXTERNALSYM EVENTLOG_PAIRED_EVENT_INACTIVE}
- //
- // Structure that defines the header of the Eventlog record. This is the
- // fixed-sized portion before all the variable-length strings, binary
- // data and pad bytes.
- //
- // TimeGenerated is the time it was generated at the client.
- // TimeWritten is the time it was put into the log at the server end.
- //
- type
- PEventlogrecord = ^EVENTLOGRECORD;
- _EVENTLOGRECORD = record
- Length: DWORD; // Length of full record
- Reserved: DWORD; // Used by the service
- RecordNumber: DWORD; // Absolute record number
- TimeGenerated: DWORD; // Seconds since 1-1-1970
- TimeWritten: DWORD; // Seconds since 1-1-1970
- EventID: DWORD;
- EventType: Word;
- NumStrings: Word;
- EventCategory: Word;
- ReservedFlags: Word; // For use with paired events (auditing)
- ClosingRecordNumber: DWORD; // For use with paired events (auditing)
- StringOffset: DWORD; // Offset from beginning of record
- UserSidLength: DWORD;
- UserSidOffset: DWORD;
- DataLength: DWORD;
- DataOffset: DWORD; // Offset from beginning of record
- //
- // Then follow:
- //
- // WCHAR SourceName[]
- // WCHAR Computername[]
- // SID UserSid
- // WCHAR Strings[]
- // BYTE Data[]
- // CHAR Pad[]
- // DWORD Length;
- //
- end;
- {$EXTERNALSYM _EVENTLOGRECORD}
- EVENTLOGRECORD = _EVENTLOGRECORD;
- {$EXTERNALSYM EVENTLOGRECORD}
- TEventlogrecord = EVENTLOGRECORD;
- const
- MAXLOGICALLOGNAMESIZE = 256;
- {$EXTERNALSYM MAXLOGICALLOGNAMESIZE}
- type
- PEventsForLogFile = ^EVENTSFORLOGFILE;
- _EVENTSFORLOGFILE = record
- ulSize: DWORD;
- szLogicalLogFile: array [0..MAXLOGICALLOGNAMESIZE - 1] of WCHAR; // name of the logical file-security/application/system
- ulNumRecords: DWORD;
- pEventLogRecords: array [0..0] of EVENTLOGRECORD;
- end;
- {$EXTERNALSYM _EVENTSFORLOGFILE}
- EVENTSFORLOGFILE = _EVENTSFORLOGFILE;
- {$EXTERNALSYM EVENTSFORLOGFILE}
- TEventsForLogFile = EVENTSFORLOGFILE;
- PPackedEventInfo = ^PACKEDEVENTINFO;
- _PACKEDEVENTINFO = record
- ulSize: DWORD; // total size of the structure
- ulNumEventsForLogFile: DWORD; // number of EventsForLogFile structure that follow
- ulOffsets: array [0..0] of DWORD; // the offsets from the start of this structure to the EVENTSFORLOGFILE structure
- end;
- {$EXTERNALSYM _PACKEDEVENTINFO}
- PACKEDEVENTINFO = _PACKEDEVENTINFO;
- {$EXTERNALSYM PACKEDEVENTINFO}
- TPackedEventInfo = PACKEDEVENTINFO;
- //
- // Registry Specific Access Rights.
- //
- const
- KEY_QUERY_VALUE = ($0001);
- {$EXTERNALSYM KEY_QUERY_VALUE}
- KEY_SET_VALUE = ($0002);
- {$EXTERNALSYM KEY_SET_VALUE}
- KEY_CREATE_SUB_KEY = ($0004);
- {$EXTERNALSYM KEY_CREATE_SUB_KEY}
- KEY_ENUMERATE_SUB_KEYS = ($0008);
- {$EXTERNALSYM KEY_ENUMERATE_SUB_KEYS}
- KEY_NOTIFY = ($0010);
- {$EXTERNALSYM KEY_NOTIFY}
- KEY_CREATE_LINK = ($0020);
- {$EXTERNALSYM KEY_CREATE_LINK}
- KEY_WOW64_32KEY = ($0200);
- {$EXTERNALSYM KEY_WOW64_32KEY}
- KEY_WOW64_64KEY = ($0100);
- {$EXTERNALSYM KEY_WOW64_64KEY}
- KEY_WOW64_RES = ($0300);
- {$EXTERNALSYM KEY_WOW64_RES}
- KEY_READ = STANDARD_RIGHTS_READ or KEY_QUERY_VALUE or KEY_ENUMERATE_SUB_KEYS or
- KEY_NOTIFY and (not SYNCHRONIZE);
- {$EXTERNALSYM KEY_READ}
- KEY_WRITE = STANDARD_RIGHTS_WRITE or KEY_SET_VALUE or KEY_CREATE_SUB_KEY and
- (not SYNCHRONIZE);
- {$EXTERNALSYM KEY_WRITE}
- KEY_EXECUTE = KEY_READ and (not SYNCHRONIZE);
- {$EXTERNALSYM KEY_EXECUTE}
- KEY_ALL_ACCESS = STANDARD_RIGHTS_ALL or KEY_QUERY_VALUE or KEY_SET_VALUE or
- KEY_CREATE_SUB_KEY or KEY_ENUMERATE_SUB_KEYS or KEY_NOTIFY or
- KEY_CREATE_LINK and (not SYNCHRONIZE);
- {$EXTERNALSYM KEY_ALL_ACCESS}
- //
- // Open/Create Options
- //
- REG_OPTION_RESERVED = ($00000000); // Parameter is reserved
- {$EXTERNALSYM REG_OPTION_RESERVED}
- REG_OPTION_NON_VOLATILE = ($00000000); // Key is preserved when system is rebooted
- {$EXTERNALSYM REG_OPTION_NON_VOLATILE}
- REG_OPTION_VOLATILE = ($00000001); // Key is not preserved when system is rebooted
- {$EXTERNALSYM REG_OPTION_VOLATILE}
- REG_OPTION_CREATE_LINK = ($00000002); // Created key is a symbolic link
- {$EXTERNALSYM REG_OPTION_CREATE_LINK}
- REG_OPTION_BACKUP_RESTORE = ($00000004); // open for backup or restore
- {$EXTERNALSYM REG_OPTION_BACKUP_RESTORE}
- // special access rules
- // privilege required
- REG_OPTION_OPEN_LINK = ($00000008); // Open symbolic link
- {$EXTERNALSYM REG_OPTION_OPEN_LINK}
- REG_LEGAL_OPTION = REG_OPTION_RESERVED or REG_OPTION_NON_VOLATILE or
- REG_OPTION_VOLATILE or REG_OPTION_CREATE_LINK or REG_OPTION_BACKUP_RESTORE or
- REG_OPTION_OPEN_LINK;
- {$EXTERNALSYM REG_LEGAL_OPTION}
- //
- // Key creation/open disposition
- //
- REG_CREATED_NEW_KEY = ($00000001); // New Registry Key created
- {$EXTERNALSYM REG_CREATED_NEW_KEY}
- REG_OPENED_EXISTING_KEY = ($00000002); // Existing Key opened
- {$EXTERNALSYM REG_OPENED_EXISTING_KEY}
- //
- // hive format to be used by Reg(Nt)SaveKeyEx
- //
- REG_STANDARD_FORMAT = 1;
- {$EXTERNALSYM REG_STANDARD_FORMAT}
- REG_LATEST_FORMAT = 2;
- {$EXTERNALSYM REG_LATEST_FORMAT}
- REG_NO_COMPRESSION = 4;
- {$EXTERNALSYM REG_NO_COMPRESSION}
- //
- // Key restore flags
- //
- REG_WHOLE_HIVE_VOLATILE = ($00000001); // Restore whole hive volatile
- {$EXTERNALSYM REG_WHOLE_HIVE_VOLATILE}
- REG_REFRESH_HIVE = ($00000002); // Unwind changes to last flush
- {$EXTERNALSYM REG_REFRESH_HIVE}
- REG_NO_LAZY_FLUSH = ($00000004); // Never lazy flush this hive
- {$EXTERNALSYM REG_NO_LAZY_FLUSH}
- REG_FORCE_RESTORE = ($00000008); // Force the restore process even when we have open handles on subkeys
- {$EXTERNALSYM REG_FORCE_RESTORE}
- // end_ntddk end_wdm end_nthal
- //
- // Notify filter values
- //
- REG_NOTIFY_CHANGE_NAME = ($00000001); // Create or delete (child)
- {$EXTERNALSYM REG_NOTIFY_CHANGE_NAME}
- REG_NOTIFY_CHANGE_ATTRIBUTES = ($00000002);
- {$EXTERNALSYM REG_NOTIFY_CHANGE_ATTRIBUTES}
- REG_NOTIFY_CHANGE_LAST_SET = ($00000004); // time stamp
- {$EXTERNALSYM REG_NOTIFY_CHANGE_LAST_SET}
- REG_NOTIFY_CHANGE_SECURITY = ($00000008);
- {$EXTERNALSYM REG_NOTIFY_CHANGE_SECURITY}
- REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME or REG_NOTIFY_CHANGE_ATTRIBUTES or
- REG_NOTIFY_CHANGE_LAST_SET or REG_NOTIFY_CHANGE_SECURITY;
- {$EXTERNALSYM REG_LEGAL_CHANGE_FILTER}
- //
- //
- // Predefined Value Types.
- //
- REG_NONE = ( 0 ); // No value type
- {$EXTERNALSYM REG_NONE}
- REG_SZ = ( 1 ); // Unicode nul terminated string
- {$EXTERNALSYM REG_SZ}
- REG_EXPAND_SZ = ( 2 ); // Unicode nul terminated string
- {$EXTERNALSYM REG_EXPAND_SZ}
- // (with environment variable references)
- REG_BINARY = ( 3 ); // Free form binary
- {$EXTERNALSYM REG_BINARY}
- REG_DWORD = ( 4 ); // 32-bit number
- {$EXTERNALSYM REG_DWORD}
- REG_DWORD_LITTLE_ENDIAN = ( 4 ); // 32-bit number (same as REG_DWORD)
- {$EXTERNALSYM REG_DWORD_LITTLE_ENDIAN}
- REG_DWORD_BIG_ENDIAN = ( 5 ); // 32-bit number
- {$EXTERNALSYM REG_DWORD_BIG_ENDIAN}
- REG_LINK = ( 6 ); // Symbolic Link (unicode)
- {$EXTERNALSYM REG_LINK}
- REG_MULTI_SZ = ( 7 ); // Multiple Unicode strings
- {$EXTERNALSYM REG_MULTI_SZ}
- REG_RESOURCE_LIST = ( 8 ); // Resource list in the resource map
- {$EXTERNALSYM REG_RESOURCE_LIST}
- REG_FULL_RESOURCE_DESCRIPTOR = ( 9 ); // Resource list in the hardware description
- {$EXTERNALSYM REG_FULL_RESOURCE_DESCRIPTOR}
- REG_RESOURCE_REQUIREMENTS_LIST = ( 10 );
- {$EXTERNALSYM REG_RESOURCE_REQUIREMENTS_LIST}
- REG_QWORD = ( 11 ); // 64-bit number
- {$EXTERNALSYM REG_QWORD}
- REG_QWORD_LITTLE_ENDIAN = ( 11 ); // 64-bit number (same as REG_QWORD)
- {$EXTERNALSYM REG_QWORD_LITTLE_ENDIAN}
- //
- // Service Types (Bit Mask)
- //
- SERVICE_KERNEL_DRIVER = $00000001;
- {$EXTERNALSYM SERVICE_KERNEL_DRIVER}
- SERVICE_FILE_SYSTEM_DRIVER = $00000002;
- {$EXTERNALSYM SERVICE_FILE_SYSTEM_DRIVER}
- SERVICE_ADAPTER = $00000004;
- {$EXTERNALSYM SERVICE_ADAPTER}
- SERVICE_RECOGNIZER_DRIVER = $00000008;
- {$EXTERNALSYM SERVICE_RECOGNIZER_DRIVER}
- SERVICE_DRIVER = SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER or
- SERVICE_RECOGNIZER_DRIVER;
- {$EXTERNALSYM SERVICE_DRIVER}
- SERVICE_WIN32_OWN_PROCESS = $00000010;
- {$EXTERNALSYM SERVICE_WIN32_OWN_PROCESS}
- SERVICE_WIN32_SHARE_PROCESS = $00000020;
- {$EXTERNALSYM SERVICE_WIN32_SHARE_PROCESS}
- SERVICE_WIN32 = SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS;
- {$EXTERNALSYM SERVICE_WIN32}
- SERVICE_INTERACTIVE_PROCESS = $00000100;
- {$EXTERNALSYM SERVICE_INTERACTIVE_PROCESS}
- SERVICE_TYPE_ALL = SERVICE_WIN32 or SERVICE_ADAPTER or SERVICE_DRIVER or
- SERVICE_INTERACTIVE_PROCESS;
- {$EXTERNALSYM SERVICE_TYPE_ALL}
- //
- // Start Type
- //
- SERVICE_BOOT_START = $00000000;
- {$EXTERNALSYM SERVICE_BOOT_START}
- SERVICE_SYSTEM_START = $00000001;
- {$EXTERNALSYM SERVICE_SYSTEM_START}
- SERVICE_AUTO_START = $00000002;
- {$EXTERNALSYM SERVICE_AUTO_START}
- SERVICE_DEMAND_START = $00000003;
- {$EXTERNALSYM SERVICE_DEMAND_START}
- SERVICE_DISABLED = $00000004;
- {$EXTERNALSYM SERVICE_DISABLED}
- //
- // Error control type
- //
- SERVICE_ERROR_IGNORE = $00000000;
- {$EXTERNALSYM SERVICE_ERROR_IGNORE}
- SERVICE_ERROR_NORMAL = $00000001;
- {$EXTERNALSYM SERVICE_ERROR_NORMAL}
- SERVICE_ERROR_SEVERE = $00000002;
- {$EXTERNALSYM SERVICE_ERROR_SEVERE}
- SERVICE_ERROR_CRITICAL = $00000003;
- {$EXTERNALSYM SERVICE_ERROR_CRITICAL}
- //
- // Define the registry driver node enumerations
- //
- const
- //SERVICE_NODE_TYPE
- DriverType = SERVICE_KERNEL_DRIVER;
- FileSystemType = SERVICE_FILE_SYSTEM_DRIVER;
- Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS;
- Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS;
- AdapterType = SERVICE_ADAPTER;
- RecognizerType = SERVICE_RECOGNIZER_DRIVER;
- //SERVICE_LOAD_TYPE
- BootLoad = SERVICE_BOOT_START;
- SystemLoad = SERVICE_SYSTEM_START;
- AutoLoad = SERVICE_AUTO_START;
- DemandLoad = SERVICE_DEMAND_START;
- DisableLoad = SERVICE_DISABLED;
- //SERVICE_ERROR_TYPE
- IgnoreError = SERVICE_ERROR_IGNORE;
- NormalError = SERVICE_ERROR_NORMAL;
- SevereError = SERVICE_ERROR_SEVERE;
- CriticalError = SERVICE_ERROR_CRITICAL;
- //
- // IOCTL_TAPE_ERASE definitions
- //
- type
- SERVICE_NODE_TYPE = DWORD;
- {$EXTERNALSYM SERVICE_NODE_TYPE}
- TServiceNodeType = SERVICE_NODE_TYPE;
- SERVICE_LOAD_TYPE = DWORD;
- {$EXTERNALSYM SERVICE_LOAD_TYPE}
- TServiceLoadType = SERVICE_LOAD_TYPE;
- SERVICE_ERROR_TYPE = DWORD;
- {$EXTERNALSYM SERVICE_ERROR_TYPE}
- TServiceErrorType = SERVICE_ERROR_TYPE;
- const
- TAPE_ERASE_SHORT = 0;
- {$EXTERNALSYM TAPE_ERASE_SHORT}
- TAPE_ERASE_LONG = 1;
- {$EXTERNALSYM TAPE_ERASE_LONG}
- type
- PTAPE_ERASE = ^TAPE_ERASE;
- {$EXTERNALSYM PTAPE_ERASE}
- _TAPE_ERASE = record
- Type_: DWORD;
- Immediate: ByteBool;
- end;
- {$EXTERNALSYM _TAPE_ERASE}
- TAPE_ERASE = _TAPE_ERASE;
- {$EXTERNALSYM TAPE_ERASE}
- TTapeErase = TAPE_ERASE;
- PTapeErase = PTAPE_ERASE;
- //
- // IOCTL_TAPE_PREPARE definitions
- //
- const
- TAPE_LOAD = 0;
- {$EXTERNALSYM TAPE_LOAD}
- TAPE_UNLOAD = 1;
- {$EXTERNALSYM TAPE_UNLOAD}
- TAPE_TENSION = 2;
- {$EXTERNALSYM TAPE_TENSION}
- TAPE_LOCK = 3;
- {$EXTERNALSYM TAPE_LOCK}
- TAPE_UNLOCK = 4;
- {$EXTERNALSYM TAPE_UNLOCK}
- TAPE_FORMAT = 5;
- {$EXTERNALSYM TAPE_FORMAT}
- type
- PTAPE_PREPARE = ^TAPE_PREPARE;
- {$EXTERNALSYM PTAPE_PREPARE}
- _TAPE_PREPARE = record
- Operation: DWORD;
- Immediate: ByteBool;
- end;
- {$EXTERNALSYM _TAPE_PREPARE}
- TAPE_PREPARE = _TAPE_PREPARE;
- {$EXTERNALSYM TAPE_PREPARE}
- TTapePrepare = TAPE_PREPARE;
- PTapePrepare = PTAPE_PREPARE;
- //
- // IOCTL_TAPE_WRITE_MARKS definitions
- //
- const
- TAPE_SETMARKS = 0;
- {$EXTERNALSYM TAPE_SETMARKS}
- TAPE_FILEMARKS = 1;
- {$EXTERNALSYM TAPE_FILEMARKS}
- TAPE_SHORT_FILEMARKS = 2;
- {$EXTERNALSYM TAPE_SHORT_FILEMARKS}
- TAPE_LONG_FILEMARKS = 3;
- {$EXTERNALSYM TAPE_LONG_FILEMARKS}
- type
- PTAPE_WRITE_MARKS = ^TAPE_WRITE_MARKS;
- {$EXTERNALSYM PTAPE_WRITE_MARKS}
- _TAPE_WRITE_MARKS = record
- Type_: DWORD;
- Count: DWORD;
- Immediate: ByteBool;
- end;
- {$EXTERNALSYM _TAPE_WRITE_MARKS}
- TAPE_WRITE_MARKS = _TAPE_WRITE_MARKS;
- {$EXTERNALSYM TAPE_WRITE_MARKS}
- TTapeWriteMarks = TAPE_WRITE_MARKS;
- PTapeWriteMarks = PTAPE_WRITE_MARKS;
- //
- // IOCTL_TAPE_GET_POSITION definitions
- //
- const
- TAPE_ABSOLUTE_POSITION = 0;
- {$EXTERNALSYM TAPE_ABSOLUTE_POSITION}
- TAPE_LOGICAL_POSITION = 1;
- {$EXTERNALSYM TAPE_LOGICAL_POSITION}
- TAPE_PSEUDO_LOGICAL_POSITION = 2;
- {$EXTERNALSYM TAPE_PSEUDO_LOGICAL_POSITION}
- type
- PTAPE_GET_POSITION = ^TAPE_GET_POSITION;
- {$EXTERNALSYM PTAPE_GET_POSITION}
- _TAPE_GET_POSITION = record
- Type_: DWORD;
- Partition: DWORD;
- Offset: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _TAPE_GET_POSITION}
- TAPE_GET_POSITION = _TAPE_GET_POSITION;
- {$EXTERNALSYM TAPE_GET_POSITION}
- TTapeGetPosition = TAPE_GET_POSITION;
- PTapeGetPosition = PTAPE_GET_POSITION;
- //
- // IOCTL_TAPE_SET_POSITION definitions
- //
- const
- TAPE_REWIND = 0;
- {$EXTERNALSYM TAPE_REWIND}
- TAPE_ABSOLUTE_BLOCK = 1;
- {$EXTERNALSYM TAPE_ABSOLUTE_BLOCK}
- TAPE_LOGICAL_BLOCK = 2;
- {$EXTERNALSYM TAPE_LOGICAL_BLOCK}
- TAPE_PSEUDO_LOGICAL_BLOCK = 3;
- {$EXTERNALSYM TAPE_PSEUDO_LOGICAL_BLOCK}
- TAPE_SPACE_END_OF_DATA = 4;
- {$EXTERNALSYM TAPE_SPACE_END_OF_DATA}
- TAPE_SPACE_RELATIVE_BLOCKS = 5;
- {$EXTERNALSYM TAPE_SPACE_RELATIVE_BLOCKS}
- TAPE_SPACE_FILEMARKS = 6;
- {$EXTERNALSYM TAPE_SPACE_FILEMARKS}
- TAPE_SPACE_SEQUENTIAL_FMKS = 7;
- {$EXTERNALSYM TAPE_SPACE_SEQUENTIAL_FMKS}
- TAPE_SPACE_SETMARKS = 8;
- {$EXTERNALSYM TAPE_SPACE_SETMARKS}
- TAPE_SPACE_SEQUENTIAL_SMKS = 9;
- {$EXTERNALSYM TAPE_SPACE_SEQUENTIAL_SMKS}
- type
- PTAPE_SET_POSITION = ^TAPE_SET_POSITION;
- {$EXTERNALSYM PTAPE_SET_POSITION}
- _TAPE_SET_POSITION = record
- Method: DWORD;
- Partition: DWORD;
- Offset: LARGE_INTEGER;
- Immediate: ByteBool;
- end;
- {$EXTERNALSYM _TAPE_SET_POSITION}
- TAPE_SET_POSITION = _TAPE_SET_POSITION;
- {$EXTERNALSYM TAPE_SET_POSITION}
- TTapeSetPosition = TAPE_SET_POSITION;
- PTapeSetPosition = PTAPE_SET_POSITION;
- //
- // IOCTL_TAPE_GET_DRIVE_PARAMS definitions
- //
- //
- // Definitions for FeaturesLow parameter
- //
- const
- TAPE_DRIVE_FIXED = $00000001;
- {$EXTERNALSYM TAPE_DRIVE_FIXED}
- TAPE_DRIVE_SELECT = $00000002;
- {$EXTERNALSYM TAPE_DRIVE_SELECT}
- TAPE_DRIVE_INITIATOR = $00000004;
- {$EXTERNALSYM TAPE_DRIVE_INITIATOR}
- TAPE_DRIVE_ERASE_SHORT = $00000010;
- {$EXTERNALSYM TAPE_DRIVE_ERASE_SHORT}
- TAPE_DRIVE_ERASE_LONG = $00000020;
- {$EXTERNALSYM TAPE_DRIVE_ERASE_LONG}
- TAPE_DRIVE_ERASE_BOP_ONLY = $00000040;
- {$EXTERNALSYM TAPE_DRIVE_ERASE_BOP_ONLY}
- TAPE_DRIVE_ERASE_IMMEDIATE = $00000080;
- {$EXTERNALSYM TAPE_DRIVE_ERASE_IMMEDIATE}
- TAPE_DRIVE_TAPE_CAPACITY = $00000100;
- {$EXTERNALSYM TAPE_DRIVE_TAPE_CAPACITY}
- TAPE_DRIVE_TAPE_REMAINING = $00000200;
- {$EXTERNALSYM TAPE_DRIVE_TAPE_REMAINING}
- TAPE_DRIVE_FIXED_BLOCK = $00000400;
- {$EXTERNALSYM TAPE_DRIVE_FIXED_BLOCK}
- TAPE_DRIVE_VARIABLE_BLOCK = $00000800;
- {$EXTERNALSYM TAPE_DRIVE_VARIABLE_BLOCK}
- TAPE_DRIVE_WRITE_PROTECT = $00001000;
- {$EXTERNALSYM TAPE_DRIVE_WRITE_PROTECT}
- TAPE_DRIVE_EOT_WZ_SIZE = $00002000;
- {$EXTERNALSYM TAPE_DRIVE_EOT_WZ_SIZE}
- TAPE_DRIVE_ECC = $00010000;
- {$EXTERNALSYM TAPE_DRIVE_ECC}
- TAPE_DRIVE_COMPRESSION = $00020000;
- {$EXTERNALSYM TAPE_DRIVE_COMPRESSION}
- TAPE_DRIVE_PADDING = $00040000;
- {$EXTERNALSYM TAPE_DRIVE_PADDING}
- TAPE_DRIVE_REPORT_SMKS = $00080000;
- {$EXTERNALSYM TAPE_DRIVE_REPORT_SMKS}
- TAPE_DRIVE_GET_ABSOLUTE_BLK = $00100000;
- {$EXTERNALSYM TAPE_DRIVE_GET_ABSOLUTE_BLK}
- TAPE_DRIVE_GET_LOGICAL_BLK = $00200000;
- {$EXTERNALSYM TAPE_DRIVE_GET_LOGICAL_BLK}
- TAPE_DRIVE_SET_EOT_WZ_SIZE = $00400000;
- {$EXTERNALSYM TAPE_DRIVE_SET_EOT_WZ_SIZE}
- TAPE_DRIVE_EJECT_MEDIA = $01000000;
- {$EXTERNALSYM TAPE_DRIVE_EJECT_MEDIA}
- TAPE_DRIVE_CLEAN_REQUESTS = $02000000;
- {$EXTERNALSYM TAPE_DRIVE_CLEAN_REQUESTS}
- TAPE_DRIVE_SET_CMP_BOP_ONLY = $04000000;
- {$EXTERNALSYM TAPE_DRIVE_SET_CMP_BOP_ONLY}
- TAPE_DRIVE_RESERVED_BIT = DWORD($80000000); // don't use this bit!
- {$EXTERNALSYM TAPE_DRIVE_RESERVED_BIT}
- // //can't be a low features bit!
- // //reserved; high features only
- //
- // Definitions for FeaturesHigh parameter
- //
- TAPE_DRIVE_LOAD_UNLOAD = DWORD($80000001);
- {$EXTERNALSYM TAPE_DRIVE_LOAD_UNLOAD}
- TAPE_DRIVE_TENSION = DWORD($80000002);
- {$EXTERNALSYM TAPE_DRIVE_TENSION}
- TAPE_DRIVE_LOCK_UNLOCK = DWORD($80000004);
- {$EXTERNALSYM TAPE_DRIVE_LOCK_UNLOCK}
- TAPE_DRIVE_REWIND_IMMEDIATE = DWORD($80000008);
- {$EXTERNALSYM TAPE_DRIVE_REWIND_IMMEDIATE}
- TAPE_DRIVE_SET_BLOCK_SIZE = DWORD($80000010);
- {$EXTERNALSYM TAPE_DRIVE_SET_BLOCK_SIZE}
- TAPE_DRIVE_LOAD_UNLD_IMMED = DWORD($80000020);
- {$EXTERNALSYM TAPE_DRIVE_LOAD_UNLD_IMMED}
- TAPE_DRIVE_TENSION_IMMED = DWORD($80000040);
- {$EXTERNALSYM TAPE_DRIVE_TENSION_IMMED}
- TAPE_DRIVE_LOCK_UNLK_IMMED = DWORD($80000080);
- {$EXTERNALSYM TAPE_DRIVE_LOCK_UNLK_IMMED}
- TAPE_DRIVE_SET_ECC = DWORD($80000100);
- {$EXTERNALSYM TAPE_DRIVE_SET_ECC}
- TAPE_DRIVE_SET_COMPRESSION = DWORD($80000200);
- {$EXTERNALSYM TAPE_DRIVE_SET_COMPRESSION}
- TAPE_DRIVE_SET_PADDING = DWORD($80000400);
- {$EXTERNALSYM TAPE_DRIVE_SET_PADDING}
- TAPE_DRIVE_SET_REPORT_SMKS = DWORD($80000800);
- {$EXTERNALSYM TAPE_DRIVE_SET_REPORT_SMKS}
- TAPE_DRIVE_ABSOLUTE_BLK = DWORD($80001000);
- {$EXTERNALSYM TAPE_DRIVE_ABSOLUTE_BLK}
- TAPE_DRIVE_ABS_BLK_IMMED = DWORD($80002000);
- {$EXTERNALSYM TAPE_DRIVE_ABS_BLK_IMMED}
- TAPE_DRIVE_LOGICAL_BLK = DWORD($80004000);
- {$EXTERNALSYM TAPE_DRIVE_LOGICAL_BLK}
- TAPE_DRIVE_LOG_BLK_IMMED = DWORD($80008000);
- {$EXTERNALSYM TAPE_DRIVE_LOG_BLK_IMMED}
- TAPE_DRIVE_END_OF_DATA = DWORD($80010000);
- {$EXTERNALSYM TAPE_DRIVE_END_OF_DATA}
- TAPE_DRIVE_RELATIVE_BLKS = DWORD($80020000);
- {$EXTERNALSYM TAPE_DRIVE_RELATIVE_BLKS}
- TAPE_DRIVE_FILEMARKS = DWORD($80040000);
- {$EXTERNALSYM TAPE_DRIVE_FILEMARKS}
- TAPE_DRIVE_SEQUENTIAL_FMKS = DWORD($80080000);
- {$EXTERNALSYM TAPE_DRIVE_SEQUENTIAL_FMKS}
- TAPE_DRIVE_SETMARKS = DWORD($80100000);
- {$EXTERNALSYM TAPE_DRIVE_SETMARKS}
- TAPE_DRIVE_SEQUENTIAL_SMKS = DWORD($80200000);
- {$EXTERNALSYM TAPE_DRIVE_SEQUENTIAL_SMKS}
- TAPE_DRIVE_REVERSE_POSITION = DWORD($80400000);
- {$EXTERNALSYM TAPE_DRIVE_REVERSE_POSITION}
- TAPE_DRIVE_SPACE_IMMEDIATE = DWORD($80800000);
- {$EXTERNALSYM TAPE_DRIVE_SPACE_IMMEDIATE}
- TAPE_DRIVE_WRITE_SETMARKS = DWORD($81000000);
- {$EXTERNALSYM TAPE_DRIVE_WRITE_SETMARKS}
- TAPE_DRIVE_WRITE_FILEMARKS = DWORD($82000000);
- {$EXTERNALSYM TAPE_DRIVE_WRITE_FILEMARKS}
- TAPE_DRIVE_WRITE_SHORT_FMKS = DWORD($84000000);
- {$EXTERNALSYM TAPE_DRIVE_WRITE_SHORT_FMKS}
- TAPE_DRIVE_WRITE_LONG_FMKS = DWORD($88000000);
- {$EXTERNALSYM TAPE_DRIVE_WRITE_LONG_FMKS}
- TAPE_DRIVE_WRITE_MARK_IMMED = DWORD($90000000);
- {$EXTERNALSYM TAPE_DRIVE_WRITE_MARK_IMMED}
- TAPE_DRIVE_FORMAT = DWORD($A0000000);
- {$EXTERNALSYM TAPE_DRIVE_FORMAT}
- TAPE_DRIVE_FORMAT_IMMEDIATE = DWORD($C0000000);
- {$EXTERNALSYM TAPE_DRIVE_FORMAT_IMMEDIATE}
- TAPE_DRIVE_HIGH_FEATURES = DWORD($80000000); // mask for high features flag
- {$EXTERNALSYM TAPE_DRIVE_HIGH_FEATURES}
- type
- PTAPE_GET_DRIVE_PARAMETERS = ^TAPE_GET_DRIVE_PARAMETERS;
- {$EXTERNALSYM PTAPE_GET_DRIVE_PARAMETERS}
- _TAPE_GET_DRIVE_PARAMETERS = record
- ECC: ByteBool;
- Compression: ByteBool;
- DataPadding: ByteBool;
- ReportSetmarks: ByteBool;
- DefaultBlockSize: DWORD;
- MaximumBlockSize: DWORD;
- MinimumBlockSize: DWORD;
- MaximumPartitionCount: DWORD;
- FeaturesLow: DWORD;
- FeaturesHigh: DWORD;
- EOTWarningZoneSize: DWORD;
- end;
- {$EXTERNALSYM _TAPE_GET_DRIVE_PARAMETERS}
- TAPE_GET_DRIVE_PARAMETERS = _TAPE_GET_DRIVE_PARAMETERS;
- {$EXTERNALSYM TAPE_GET_DRIVE_PARAMETERS}
- TTapeGetDriveParameters = TAPE_GET_DRIVE_PARAMETERS;
- PTapeGetDriveParameters = PTAPE_GET_DRIVE_PARAMETERS;
- //
- // IOCTL_TAPE_SET_DRIVE_PARAMETERS definitions
- //
- PTAPE_SET_DRIVE_PARAMETERS = ^TAPE_SET_DRIVE_PARAMETERS;
- {$EXTERNALSYM PTAPE_SET_DRIVE_PARAMETERS}
- _TAPE_SET_DRIVE_PARAMETERS = record
- ECC: ByteBool;
- Compression: ByteBool;
- DataPadding: ByteBool;
- ReportSetmarks: ByteBool;
- EOTWarningZoneSize: DWORD;
- end;
- {$EXTERNALSYM _TAPE_SET_DRIVE_PARAMETERS}
- TAPE_SET_DRIVE_PARAMETERS = _TAPE_SET_DRIVE_PARAMETERS;
- {$EXTERNALSYM TAPE_SET_DRIVE_PARAMETERS}
- TTapeSetDriveParameters = TAPE_SET_DRIVE_PARAMETERS;
- PTapeSetDriveParameters = PTAPE_SET_DRIVE_PARAMETERS;
- //
- // IOCTL_TAPE_GET_MEDIA_PARAMETERS definitions
- //
- PTAPE_GET_MEDIA_PARAMETERS = ^TAPE_GET_MEDIA_PARAMETERS;
- {$EXTERNALSYM PTAPE_GET_MEDIA_PARAMETERS}
- _TAPE_GET_MEDIA_PARAMETERS = record
- Capacity: LARGE_INTEGER;
- Remaining: LARGE_INTEGER;
- BlockSize: DWORD;
- PartitionCount: DWORD;
- WriteProtected: ByteBool;
- end;
- {$EXTERNALSYM _TAPE_GET_MEDIA_PARAMETERS}
- TAPE_GET_MEDIA_PARAMETERS = _TAPE_GET_MEDIA_PARAMETERS;
- {$EXTERNALSYM TAPE_GET_MEDIA_PARAMETERS}
- TTapeGetMediaParameters = TAPE_GET_MEDIA_PARAMETERS;
- PTapeGetMediaParameters = PTAPE_GET_MEDIA_PARAMETERS;
- //
- // IOCTL_TAPE_SET_MEDIA_PARAMETERS definitions
- //
- PTAPE_SET_MEDIA_PARAMETERS = ^TAPE_SET_MEDIA_PARAMETERS;
- {$EXTERNALSYM PTAPE_SET_MEDIA_PARAMETERS}
- _TAPE_SET_MEDIA_PARAMETERS = record
- BlockSize: DWORD;
- end;
- {$EXTERNALSYM _TAPE_SET_MEDIA_PARAMETERS}
- TAPE_SET_MEDIA_PARAMETERS = _TAPE_SET_MEDIA_PARAMETERS;
- {$EXTERNALSYM TAPE_SET_MEDIA_PARAMETERS}
- TTapeSetMediaParameters = TAPE_SET_MEDIA_PARAMETERS;
- PTapeSetMediaParameters = PTAPE_SET_MEDIA_PARAMETERS;
- //
- // IOCTL_TAPE_CREATE_PARTITION definitions
- //
- const
- TAPE_FIXED_PARTITIONS = 0;
- {$EXTERNALSYM TAPE_FIXED_PARTITIONS}
- TAPE_SELECT_PARTITIONS = 1;
- {$EXTERNALSYM TAPE_SELECT_PARTITIONS}
- TAPE_INITIATOR_PARTITIONS = 2;
- {$EXTERNALSYM TAPE_INITIATOR_PARTITIONS}
- type
- PTAPE_CREATE_PARTITION = ^TAPE_CREATE_PARTITION;
- {$EXTERNALSYM PTAPE_CREATE_PARTITION}
- _TAPE_CREATE_PARTITION = record
- Method: DWORD;
- Count: DWORD;
- Size: DWORD;
- end;
- {$EXTERNALSYM _TAPE_CREATE_PARTITION}
- TAPE_CREATE_PARTITION = _TAPE_CREATE_PARTITION;
- {$EXTERNALSYM TAPE_CREATE_PARTITION}
- TTapeCreatePartition = TAPE_CREATE_PARTITION;
- PTapeCreatePartition = PTAPE_CREATE_PARTITION;
- //
- // WMI Methods
- //
- const
- TAPE_QUERY_DRIVE_PARAMETERS = 0;
- {$EXTERNALSYM TAPE_QUERY_DRIVE_PARAMETERS}
- TAPE_QUERY_MEDIA_CAPACITY = 1;
- {$EXTERNALSYM TAPE_QUERY_MEDIA_CAPACITY}
- TAPE_CHECK_FOR_DRIVE_PROBLEM = 2;
- {$EXTERNALSYM TAPE_CHECK_FOR_DRIVE_PROBLEM}
- TAPE_QUERY_IO_ERROR_DATA = 3;
- {$EXTERNALSYM TAPE_QUERY_IO_ERROR_DATA}
- TAPE_QUERY_DEVICE_ERROR_DATA = 4;
- {$EXTERNALSYM TAPE_QUERY_DEVICE_ERROR_DATA}
- type
- _TAPE_WMI_OPERATIONS = record
- Method: DWORD;
- DataBufferSize: DWORD;
- DataBuffer: PVOID;
- end;
- {$EXTERNALSYM _TAPE_WMI_OPERATIONS}
- TAPE_WMI_OPERATIONS = _TAPE_WMI_OPERATIONS;
- {$EXTERNALSYM TAPE_WMI_OPERATIONS}
- PTAPE_WMI_OPERATIONS = ^TAPE_WMI_OPERATIONS;
- {$EXTERNALSYM PTAPE_WMI_OPERATIONS}
- TTapeWMIOperations = TAPE_WMI_OPERATIONS;
- PTapeWMIOperations = PTAPE_WMI_OPERATIONS;
- //
- // Type of drive errors
- //
- _TAPE_DRIVE_PROBLEM_TYPE = (
- TapeDriveProblemNone, TapeDriveReadWriteWarning,
- TapeDriveReadWriteError, TapeDriveReadWarning,
- TapeDriveWriteWarning, TapeDriveReadError,
- TapeDriveWriteError, TapeDriveHardwareError,
- TapeDriveUnsupportedMedia, TapeDriveScsiConnectionError,
- TapeDriveTimetoClean, TapeDriveCleanDriveNow,
- TapeDriveMediaLifeExpired, TapeDriveSnappedTape);
- {$EXTERNALSYM _TAPE_DRIVE_PROBLEM_TYPE}
- TAPE_DRIVE_PROBLEM_TYPE = _TAPE_DRIVE_PROBLEM_TYPE;
- TTapeDriveProblemType = TAPE_DRIVE_PROBLEM_TYPE;
- const
- ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION = (1);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION}
- ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION = (2);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION = (3);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION = (4);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION = (5);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION = (6);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION = (7);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION}
- ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE = (8);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE}
- ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES = (9);
- {$EXTERNALSYM ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES}
- implementation
- const
- ntdll = 'ntdll.dll';
- kernel32 = 'kernel32.dll';
- function WT_SET_MAX_THREADPOOL_THREADS(var Flags: DWORD; Limit: DWORD): DWORD;
- begin
- Flags := Flags or (Limit shl 16);
- Result := Flags;
- end;
- function VALID_IMPERSONATION_LEVEL(L: TSecurityImpersonationLevel): BOOL;
- begin
- Result := (L >= SECURITY_MIN_IMPERSONATION_LEVEL) and (L <= SECURITY_MAX_IMPERSONATION_LEVEL);
- end;
- {
- function VALID_TOKEN_AUDIT_POLICY_ELEMENT(P: TOKEN_AUDIT_POLICY_ELEMENT): BOOL;
- begin
- Result := ((P.PolicyMask and (not VALID_AUDIT_POLICY_BITS) = 0) and (P.Category <= AuditEventMaxType);
- // ((((P).PolicyMask & ~VALID_AUDIT_POLICY_BITS) == 0) &&
- // ((P).Category <= AuditEventMaxType))
- end;
- }
- function PER_USER_AUDITING_POLICY_SIZE(p: PTOKEN_AUDIT_POLICY): DWORD;
- begin
- Result := SizeOf(TOKEN_AUDIT_POLICY);
- if p^.PolicyCount > ANYSIZE_ARRAY then
- Result := Result + SizeOf(TOKEN_AUDIT_POLICY_ELEMENT) * (P^.PolicyCount - ANYSIZE_ARRAY);
- // ( sizeof(TOKEN_AUDIT_POLICY) + (((p)->PolicyCount > ANYSIZE_ARRAY) ? (sizeof(TOKEN_AUDIT_POLICY_ELEMENT) * ((p)->PolicyCount - ANYSIZE_ARRAY)) : 0) )
- end;
- function PER_USER_AUDITING_POLICY_SIZE_BY_COUNT(C: DWORD): DWORD;
- begin
- Result := SizeOf(TOKEN_AUDIT_POLICY);
- if C > ANYSIZE_ARRAY then
- Result := Result + SizeOf(TOKEN_AUDIT_POLICY_ELEMENT) * (C - ANYSIZE_ARRAY);
- // ( sizeof(TOKEN_AUDIT_POLICY) + (((C) > ANYSIZE_ARRAY) ? (sizeof(TOKEN_AUDIT_POLICY_ELEMENT) * ((C) - ANYSIZE_ARRAY)) : 0) )
- end;
- function NtCurrentTeb: PNT_TIB;
- asm
- MOV EAX, FS:[0]
- end;
- function GetFiberData: PVOID;
- asm
- MOV EAX, FS:[$10]
- MOV EAX, [EAX]
- end;
- function GetCurrentFiber: PVOID;
- asm
- MOV EAX, FS:[$10]
- end;
- function Int32x32To64(a, b: LONG): LONGLONG;
- begin
- Result := a * b;
- end;
- function UInt32x32To64(a, b: DWORD): ULONGLONG;
- begin
- Result := a * b;
- end;
- function MAKELANGID(PrimaryLang, SubLang: USHORT): WORD;
- begin
- Result := (SubLang shl 10) or PrimaryLang;
- end;
- function PRIMARYLANGID(LangId: WORD): WORD;
- begin
- Result := LangId and $3FF;
- end;
- function SUBLANGID(LangId: WORD): WORD;
- begin
- Result := LangId shr 10;
- end;
- function MAKELCID(LangId, SortId: WORD): DWORD;
- begin
- Result := (DWORD(SortId) shl 16) or DWORD(LangId);
- end;
- function MAKESORTLCID(LangId, SortId, SortVersion: WORD): DWORD;
- begin
- Result := MAKELCID(LangId, SortId) or (SortVersion shl 20);
- end;
- function LANGIDFROMLCID(LocaleId: LCID): WORD;
- begin
- Result := WORD(LocaleId);
- end;
- function SORTIDFROMLCID(LocaleId: LCID): WORD;
- begin
- Result := WORD((DWORD(LocaleId) shr 16) and $F);
- end;
- function SORTVERSIONFROMLCID(LocaleId: LCID): WORD;
- begin
- Result := WORD((DWORD(LocaleId) shr 20) and $F);
- end;
- function LANG_SYSTEM_DEFAULT: WORD;
- begin
- Result := MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT);
- end;
- function LANG_USER_DEFAULT: WORD;
- begin
- Result := MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
- end;
- function LOCALE_SYSTEM_DEFAULT: DWORD;
- begin
- Result := MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT);
- end;
- function LOCALE_USER_DEFAULT: DWORD;
- begin
- Result := MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT);
- end;
- function LOCALE_NEUTRAL: DWORD;
- begin
- Result := MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT);
- end;
- function LOCALE_INVARIANT: DWORD;
- begin
- Result := MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT);
- end;
- function IsReparseTagMicrosoft(Tag: ULONG): Boolean;
- begin
- Result := (Tag and ULONG($80000000)) <> 0;
- end;
- function IsReparseTagHighLatency(Tag: ULONG): Boolean;
- begin
- Result := (Tag and ULONG($40000000)) <> 0;
- end;
- function IsReparseTagNameSurrogate(Tag: ULONG): Boolean;
- begin
- Result := (Tag and ULONG($20000000)) <> 0;
- end;
- function BTYPE(x: DWORD): DWORD;
- begin
- Result := x and N_BTMASK;
- end;
- function ISPTR(x: DWORD): Boolean;
- begin
- Result := (x and N_TMASK) = (IMAGE_SYM_DTYPE_POINTER shl N_BTSHFT);
- end;
- function ISFCN(x: DWORD): Boolean;
- begin
- Result := (x and N_TMASK) = (IMAGE_SYM_DTYPE_FUNCTION shl N_BTSHFT);
- end;
- function ISARY(x: DWORD): Boolean;
- begin
- Result := (x and N_TMASK) = (IMAGE_SYM_DTYPE_ARRAY shl N_BTSHFT);
- end;
- function ISTAG(x: DWORD): Boolean;
- begin
- Result := (x = IMAGE_SYM_CLASS_STRUCT_TAG) or (x = IMAGE_SYM_CLASS_UNION_TAG) or
- (x = IMAGE_SYM_CLASS_ENUM_TAG);
- end;
- function IMAGE_ORDINAL64(Ordinal: ULONGLONG): ULONGLONG;
- begin
- Result := (Ordinal and $ffff);
- end;
- function IMAGE_ORDINAL32(Ordinal: DWORD): DWORD;
- begin
- Result := (Ordinal and $ffff);
- end;
- function IMAGE_ORDINAL(Ordinal: DWORD): DWORD;
- begin
- Result := (Ordinal and $ffff);
- end;
- function IMAGE_SNAP_BY_ORDINAL64(Ordinal: ULONGLONG): Boolean;
- begin
- Result := ((Ordinal and IMAGE_ORDINAL_FLAG64) <> 0);
- end;
- function IMAGE_SNAP_BY_ORDINAL32(Ordinal: DWORD): Boolean;
- begin
- Result := ((Ordinal and IMAGE_ORDINAL_FLAG32) <> 0);
- end;
- function IMAGE_SNAP_BY_ORDINAL(Ordinal: DWORD): Boolean;
- begin
- Result := ((Ordinal and IMAGE_ORDINAL_FLAG32) <> 0);
- end;
- function HEAP_MAKE_TAG_FLAGS(b, o: DWORD): DWORD;
- begin
- Result := b + (o shl 18);
- end;
- procedure VER_SET_CONDITION(var Mask: DWORDLONG; TypeBitmask, ConditionMask: ULONG);
- begin
- Mask := VerSetConditionMask(Mask, TypeBitmask, ConditionMask);
- end;
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlCompareMemory: Pointer;
- function RtlCompareMemory;
- begin
- GetProcedureAddress(_RtlCompareMemory, ntdll, 'RtlCompareMemory');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlCompareMemory]
- end;
- end;
- {$ELSE}
- function RtlCompareMemory; external ntdll name 'RtlCompareMemory';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _VerSetConditionMask: Pointer;
- function VerSetConditionMask;
- begin
- GetProcedureAddress(_VerSetConditionMask, kernel32, 'VerSetConditionMask');
- asm
- mov esp, ebp
- pop ebp
- jmp [_VerSetConditionMask]
- end;
- end;
- {$ELSE}
- function VerSetConditionMask; external kernel32 name 'VerSetConditionMask';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlInitializeSListHead: Pointer;
- procedure RtlInitializeSListHead;
- begin
- GetProcedureAddress(_RtlInitializeSListHead, 'ntdll.dll', 'RtlInitializeSListHead');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlInitializeSListHead]
- end;
- end;
- {$ELSE}
- procedure RtlInitializeSListHead; external 'ntdll.dll' name 'RtlInitializeSListHead';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlFirstEntrySList: Pointer;
- function RtlFirstEntrySList;
- begin
- GetProcedureAddress(_RtlFirstEntrySList, 'ntdll.dll', 'RtlFirstEntrySList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlFirstEntrySList]
- end;
- end;
- {$ELSE}
- function RtlFirstEntrySList; external 'ntdll.dll' name 'RtlFirstEntrySList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlInterlockedPopEntrySList: Pointer;
- function RtlInterlockedPopEntrySList;
- begin
- GetProcedureAddress(_RtlInterlockedPopEntrySList, 'ntdll.dll', 'RtlInterlockedPopEntrySList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlInterlockedPopEntrySList]
- end;
- end;
- {$ELSE}
- function RtlInterlockedPopEntrySList; external 'ntdll.dll' name 'RtlInterlockedPopEntrySList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlInterlockedPushEntrySList: Pointer;
- function RtlInterlockedPushEntrySList;
- begin
- GetProcedureAddress(_RtlInterlockedPushEntrySList, 'ntdll.dll', 'RtlInterlockedPushEntrySList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlInterlockedPushEntrySList]
- end;
- end;
- {$ELSE}
- function RtlInterlockedPushEntrySList; external 'ntdll.dll' name 'RtlInterlockedPushEntrySList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlInterlockedFlushSList: Pointer;
- function RtlInterlockedFlushSList;
- begin
- GetProcedureAddress(_RtlInterlockedFlushSList, 'ntdll.dll', 'RtlInterlockedFlushSList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlInterlockedFlushSList]
- end;
- end;
- {$ELSE}
- function RtlInterlockedFlushSList; external 'ntdll.dll' name 'RtlInterlockedFlushSList';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _RtlQueryDepthSList: Pointer;
- function RtlQueryDepthSList;
- begin
- GetProcedureAddress(_RtlQueryDepthSList, 'ntdll.dll', 'RtlQueryDepthSList');
- asm
- mov esp, ebp
- pop ebp
- jmp [_RtlQueryDepthSList]
- end;
- end;
- {$ELSE}
- function RtlQueryDepthSList; external 'ntdll.dll' name 'RtlQueryDepthSList';
- {$ENDIF DYNAMIC_LINK}
- end.