JwaWinNT.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:336k
源码类别:
Windows编程
开发平台:
Delphi
- // struct // WinNT fields
- // {
- unknown1: DWORD; // 1Ch
- processID: DWORD; // 20h
- threadID: DWORD; // 24h
- unknown2: DWORD; // 28h
- // } WINNT;
- //} TIB_UNION2;
- pvTLSArray: PVOID; // (PPVOID!) 2Ch Thread Local Storage array
- //union // 30h (NT/Win95 differences)
- //{
- // struct // Win95 fields
- // {
- // PVOID* pProcess; // 30h Pointer to owning process database
- // } WIN95;
- //} TIB_UNION3;
- end;
- {$EXTERNALSYM _NT_TIB}
- NT_TIB = _NT_TIB;
- {$EXTERNALSYM NT_TIB}
- TNtTib = NT_TIB;
- PNtTib = ^TNtTib;
- //
- // 32 and 64 bit specific version for wow64 and the debugger
- //
- PNT_TIB32 = ^NT_TIB32;
- {$EXTERNALSYM PNT_TIB32}
- _NT_TIB32 = record
- ExceptionList: DWORD;
- StackBase: DWORD;
- StackLimit: DWORD;
- SubSystemTib: DWORD;
- Union: record
- case Integer of
- 0: (FiberData: DWORD);
- 1: (Version: DWORD);
- end;
- ArbitraryUserPointer: DWORD;
- Self: DWORD;
- end;
- {$EXTERNALSYM _NT_TIB32}
- NT_TIB32 = _NT_TIB32;
- {$EXTERNALSYM NT_TIB32}
- TNtTib32 = NT_TIB32;
- PNtTib32 = ^TNtTib32;
- PNT_TIB64 = ^NT_TIB64;
- {$EXTERNALSYM PNT_TIB64}
- _NT_TIB64 = record
- ExceptionList: DWORD64;
- StackBase: DWORD64;
- StackLimit: DWORD64;
- SubSystemTib: DWORD64;
- Union: record
- case Integer of
- 0: (FiberData: DWORD64);
- 1: (Version: DWORD);
- end;
- ArbitraryUserPointer: DWORD64;
- Self: DWORD64;
- end;
- {$EXTERNALSYM _NT_TIB64}
- NT_TIB64 = _NT_TIB64;
- {$EXTERNALSYM NT_TIB64}
- TNtTib64 = NT_TIB64;
- PNtTib64 = ^TNtTib64;
- //
- // Define function to return the current Thread Environment Block
- //
- function NtCurrentTeb: PNT_TIB;
- {$EXTERNALSYM NtCurrentTeb}
- const
- THREAD_BASE_PRIORITY_LOWRT = 15; // value that gets a thread to LowRealtime-1
- {$EXTERNALSYM THREAD_BASE_PRIORITY_LOWRT}
- THREAD_BASE_PRIORITY_MAX = 2; // maximum thread base priority boost
- {$EXTERNALSYM THREAD_BASE_PRIORITY_MAX}
- THREAD_BASE_PRIORITY_MIN = DWORD(-2); // minimum thread base priority boost
- {$EXTERNALSYM THREAD_BASE_PRIORITY_MIN}
- THREAD_BASE_PRIORITY_IDLE = DWORD(-15); // value that gets a thread to idle
- {$EXTERNALSYM THREAD_BASE_PRIORITY_IDLE}
- type
- PQUOTA_LIMITS = ^QUOTA_LIMITS;
- {$EXTERNALSYM PQUOTA_LIMITS}
- _QUOTA_LIMITS = record
- PagedPoolLimit: SIZE_T;
- NonPagedPoolLimit: SIZE_T;
- MinimumWorkingSetSize: SIZE_T;
- MaximumWorkingSetSize: SIZE_T;
- PagefileLimit: SIZE_T;
- TimeLimit: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _QUOTA_LIMITS}
- QUOTA_LIMITS = _QUOTA_LIMITS;
- {$EXTERNALSYM QUOTA_LIMITS}
- TQuotaLimits = QUOTA_LIMITS;
- PQuotaLimits = PQUOTA_LIMITS;
- const
- QUOTA_LIMITS_HARDWS_ENABLE = $00000001;
- {$EXTERNALSYM QUOTA_LIMITS_HARDWS_ENABLE}
- QUOTA_LIMITS_HARDWS_DISABLE = $00000002;
- {$EXTERNALSYM QUOTA_LIMITS_HARDWS_DISABLE}
- type
- _QUOTA_LIMITS_EX = record
- PagedPoolLimit: SIZE_T;
- NonPagedPoolLimit: SIZE_T;
- MinimumWorkingSetSize: SIZE_T;
- MaximumWorkingSetSize: SIZE_T;
- PagefileLimit: SIZE_T;
- TimeLimit: LARGE_INTEGER;
- Reserved1: SIZE_T;
- Reserved2: SIZE_T;
- Reserved3: SIZE_T;
- Reserved4: SIZE_T;
- Flags: DWORD;
- Reserved5: DWORD;
- end;
- {$EXTERNALSYM _QUOTA_LIMITS_EX}
- QUOTA_LIMITS_EX = _QUOTA_LIMITS_EX;
- {$EXTERNALSYM QUOTA_LIMITS_EX}
- PQUOTA_LIMITS_EX = ^QUOTA_LIMITS_EX;
- {$EXTERNALSYM PQUOTA_LIMITS_EX}
- TQuotaLimitsEx = QUOTA_LIMITS_EX;
- PQuotaLimitsEx = PQUOTA_LIMITS_EX;
- PIO_COUNTERS = ^IO_COUNTERS;
- {$EXTERNALSYM PIO_COUNTERS}
- _IO_COUNTERS = record
- ReadOperationCount: Int64;
- WriteOperationCount: Int64;
- OtherOperationCount: Int64;
- ReadTransferCount: Int64;
- WriteTransferCount: Int64;
- OtherTransferCount: Int64;
- end;
- {$EXTERNALSYM _IO_COUNTERS}
- IO_COUNTERS = _IO_COUNTERS;
- {$EXTERNALSYM IO_COUNTERS}
- TIoCounters = IO_COUNTERS;
- PIoCounters = PIO_COUNTERS;
- PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION = ^JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION}
- _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = record
- TotalUserTime: LARGE_INTEGER;
- TotalKernelTime: LARGE_INTEGER;
- ThisPeriodTotalUserTime: LARGE_INTEGER;
- ThisPeriodTotalKernelTime: LARGE_INTEGER;
- TotalPageFaultCount: DWORD;
- TotalProcesses: DWORD;
- ActiveProcesses: DWORD;
- TotalTerminatedProcesses: DWORD;
- end;
- {$EXTERNALSYM _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION}
- JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_BASIC_ACCOUNTING_INFORMATION}
- TJobObjectBasicAccountingInformation = JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
- PJobObjectBasicAccountingInformation = PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
- PJOBOBJECT_BASIC_LIMIT_INFORMATION = ^JOBOBJECT_BASIC_LIMIT_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_BASIC_LIMIT_INFORMATION}
- _JOBOBJECT_BASIC_LIMIT_INFORMATION = record
- PerProcessUserTimeLimit: LARGE_INTEGER;
- PerJobUserTimeLimit: LARGE_INTEGER;
- LimitFlags: DWORD;
- MinimumWorkingSetSize: SIZE_T;
- MaximumWorkingSetSize: SIZE_T;
- ActiveProcessLimit: DWORD;
- Affinity: ULONG_PTR;
- PriorityClass: DWORD;
- SchedulingClass: DWORD;
- end;
- {$EXTERNALSYM _JOBOBJECT_BASIC_LIMIT_INFORMATION}
- JOBOBJECT_BASIC_LIMIT_INFORMATION = _JOBOBJECT_BASIC_LIMIT_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_BASIC_LIMIT_INFORMATION}
- TJobObjectBasicLimitInformation = JOBOBJECT_BASIC_LIMIT_INFORMATION;
- PJobObjectBasicLimitInformation = PJOBOBJECT_BASIC_LIMIT_INFORMATION;
- PJOBOBJECT_EXTENDED_LIMIT_INFORMATION = ^JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_EXTENDED_LIMIT_INFORMATION}
- _JOBOBJECT_EXTENDED_LIMIT_INFORMATION = record
- BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION;
- IoInfo: IO_COUNTERS;
- ProcessMemoryLimit: SIZE_T;
- JobMemoryLimit: SIZE_T;
- PeakProcessMemoryUsed: SIZE_T;
- PeakJobMemoryUsed: SIZE_T;
- end;
- {$EXTERNALSYM _JOBOBJECT_EXTENDED_LIMIT_INFORMATION}
- JOBOBJECT_EXTENDED_LIMIT_INFORMATION = _JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_EXTENDED_LIMIT_INFORMATION}
- TJobObjectExtendedLimitInformation = JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
- PJobObjectExtendedLimitInformation = PJOBOBJECT_EXTENDED_LIMIT_INFORMATION;
- PJOBOBJECT_BASIC_PROCESS_ID_LIST = ^JOBOBJECT_BASIC_PROCESS_ID_LIST;
- {$EXTERNALSYM PJOBOBJECT_BASIC_PROCESS_ID_LIST}
- _JOBOBJECT_BASIC_PROCESS_ID_LIST = record
- NumberOfAssignedProcesses: DWORD;
- NumberOfProcessIdsInList: DWORD;
- ProcessIdList: array [0..0] of ULONG_PTR;
- end;
- {$EXTERNALSYM _JOBOBJECT_BASIC_PROCESS_ID_LIST}
- JOBOBJECT_BASIC_PROCESS_ID_LIST = _JOBOBJECT_BASIC_PROCESS_ID_LIST;
- {$EXTERNALSYM JOBOBJECT_BASIC_PROCESS_ID_LIST}
- TJobObjectBasicProcessIdList = JOBOBJECT_BASIC_PROCESS_ID_LIST;
- PJobObjectBasicProcessIdList = PJOBOBJECT_BASIC_PROCESS_ID_LIST;
- PJOBOBJECT_BASIC_UI_RESTRICTIONS = ^JOBOBJECT_BASIC_UI_RESTRICTIONS;
- {$EXTERNALSYM PJOBOBJECT_BASIC_UI_RESTRICTIONS}
- _JOBOBJECT_BASIC_UI_RESTRICTIONS = record
- UIRestrictionsClass: DWORD;
- end;
- {$EXTERNALSYM _JOBOBJECT_BASIC_UI_RESTRICTIONS}
- JOBOBJECT_BASIC_UI_RESTRICTIONS = _JOBOBJECT_BASIC_UI_RESTRICTIONS;
- {$EXTERNALSYM JOBOBJECT_BASIC_UI_RESTRICTIONS}
- TJobObjectBasicUiRestrictions = JOBOBJECT_BASIC_UI_RESTRICTIONS;
- PJobObjectBasicUiRestrictions = PJOBOBJECT_BASIC_UI_RESTRICTIONS;
- PJOBOBJECT_SECURITY_LIMIT_INFORMATION = ^JOBOBJECT_SECURITY_LIMIT_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_SECURITY_LIMIT_INFORMATION}
- _JOBOBJECT_SECURITY_LIMIT_INFORMATION = record
- SecurityLimitFlags : DWORD;
- JobToken : THandle;
- SidsToDisable : PTOKEN_GROUPS;
- PrivilegesToDelete : PTOKEN_PRIVILEGES;
- RestrictedSids : PTOKEN_GROUPS;
- end;
- {$EXTERNALSYM _JOBOBJECT_SECURITY_LIMIT_INFORMATION}
- JOBOBJECT_SECURITY_LIMIT_INFORMATION = _JOBOBJECT_SECURITY_LIMIT_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_SECURITY_LIMIT_INFORMATION}
- TJobObjectSecurityLimitInformation = JOBOBJECT_SECURITY_LIMIT_INFORMATION;
- PJobObjectSecurityLimitInformation = PJOBOBJECT_SECURITY_LIMIT_INFORMATION;
- PJOBOBJECT_END_OF_JOB_TIME_INFORMATION = ^JOBOBJECT_END_OF_JOB_TIME_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_END_OF_JOB_TIME_INFORMATION}
- _JOBOBJECT_END_OF_JOB_TIME_INFORMATION = record
- EndOfJobTimeAction: DWORD;
- end;
- {$EXTERNALSYM _JOBOBJECT_END_OF_JOB_TIME_INFORMATION}
- JOBOBJECT_END_OF_JOB_TIME_INFORMATION = _JOBOBJECT_END_OF_JOB_TIME_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_END_OF_JOB_TIME_INFORMATION}
- TJobObjectEndOfJobTimeInformation = JOBOBJECT_END_OF_JOB_TIME_INFORMATION;
- PJobObjectEndOfJobTimeInformation = PJOBOBJECT_END_OF_JOB_TIME_INFORMATION;
- PJOBOBJECT_ASSOCIATE_COMPLETION_PORT = ^JOBOBJECT_ASSOCIATE_COMPLETION_PORT;
- {$EXTERNALSYM PJOBOBJECT_ASSOCIATE_COMPLETION_PORT}
- _JOBOBJECT_ASSOCIATE_COMPLETION_PORT = record
- CompletionKey: Pointer;
- CompletionPort: THandle;
- end;
- {$EXTERNALSYM _JOBOBJECT_ASSOCIATE_COMPLETION_PORT}
- JOBOBJECT_ASSOCIATE_COMPLETION_PORT = _JOBOBJECT_ASSOCIATE_COMPLETION_PORT;
- {$EXTERNALSYM JOBOBJECT_ASSOCIATE_COMPLETION_PORT}
- TJobObjectAssociateCompletionPort = JOBOBJECT_ASSOCIATE_COMPLETION_PORT;
- PJobObjectAssociateCompletionPort = PJOBOBJECT_ASSOCIATE_COMPLETION_PORT;
- PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = ^JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION}
- _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = record
- BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
- IoInfo: IO_COUNTERS;
- end;
- {$EXTERNALSYM _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION}
- JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION}
- TJobObjectBasicAndIoAccountingInformation = JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
- PJobObjectBasicAndIoAccountingInformation = PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;
- _JOBOBJECT_JOBSET_INFORMATION = record
- MemberLevel: DWORD;
- end;
- {$EXTERNALSYM _JOBOBJECT_JOBSET_INFORMATION}
- JOBOBJECT_JOBSET_INFORMATION = _JOBOBJECT_JOBSET_INFORMATION;
- {$EXTERNALSYM JOBOBJECT_JOBSET_INFORMATION}
- PJOBOBJECT_JOBSET_INFORMATION = ^JOBOBJECT_JOBSET_INFORMATION;
- {$EXTERNALSYM PJOBOBJECT_JOBSET_INFORMATION}
- TJobObjectSetInformation = JOBOBJECT_JOBSET_INFORMATION;
- PJobObjectSetInformation = PJOBOBJECT_JOBSET_INFORMATION;
- const
- JOB_OBJECT_TERMINATE_AT_END_OF_JOB = 0;
- {$EXTERNALSYM JOB_OBJECT_TERMINATE_AT_END_OF_JOB}
- JOB_OBJECT_POST_AT_END_OF_JOB = 1;
- {$EXTERNALSYM JOB_OBJECT_POST_AT_END_OF_JOB}
- //
- // Completion Port Messages for job objects
- //
- // These values are returned via the lpNumberOfBytesTransferred parameter
- //
- JOB_OBJECT_MSG_END_OF_JOB_TIME = 1;
- {$EXTERNALSYM JOB_OBJECT_MSG_END_OF_JOB_TIME}
- JOB_OBJECT_MSG_END_OF_PROCESS_TIME = 2;
- {$EXTERNALSYM JOB_OBJECT_MSG_END_OF_PROCESS_TIME}
- JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT = 3;
- {$EXTERNALSYM JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT}
- JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO = 4;
- {$EXTERNALSYM JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO}
- JOB_OBJECT_MSG_NEW_PROCESS = 6;
- {$EXTERNALSYM JOB_OBJECT_MSG_NEW_PROCESS}
- JOB_OBJECT_MSG_EXIT_PROCESS = 7;
- {$EXTERNALSYM JOB_OBJECT_MSG_EXIT_PROCESS}
- JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS = 8;
- {$EXTERNALSYM JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS}
- JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT = 9;
- {$EXTERNALSYM JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT}
- JOB_OBJECT_MSG_JOB_MEMORY_LIMIT = 10;
- {$EXTERNALSYM JOB_OBJECT_MSG_JOB_MEMORY_LIMIT}
- //
- // Basic Limits
- //
- JOB_OBJECT_LIMIT_WORKINGSET = $00000001;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_WORKINGSET}
- JOB_OBJECT_LIMIT_PROCESS_TIME = $00000002;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_PROCESS_TIME}
- JOB_OBJECT_LIMIT_JOB_TIME = $00000004;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_JOB_TIME}
- JOB_OBJECT_LIMIT_ACTIVE_PROCESS = $00000008;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_ACTIVE_PROCESS}
- JOB_OBJECT_LIMIT_AFFINITY = $00000010;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_AFFINITY}
- JOB_OBJECT_LIMIT_PRIORITY_CLASS = $00000020;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_PRIORITY_CLASS}
- JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME = $00000040;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME}
- JOB_OBJECT_LIMIT_SCHEDULING_CLASS = $00000080;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_SCHEDULING_CLASS}
- //
- // Extended Limits
- //
- JOB_OBJECT_LIMIT_PROCESS_MEMORY = $00000100;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_PROCESS_MEMORY}
- JOB_OBJECT_LIMIT_JOB_MEMORY = $00000200;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_JOB_MEMORY}
- JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = $00000400;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION}
- JOB_OBJECT_LIMIT_BREAKAWAY_OK = $00000800;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_BREAKAWAY_OK}
- JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK = $00001000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK}
- JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = $00002000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE}
- JOB_OBJECT_LIMIT_RESERVED2 = $00004000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_RESERVED2}
- JOB_OBJECT_LIMIT_RESERVED3 = $00008000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_RESERVED3}
- JOB_OBJECT_LIMIT_RESERVED4 = $00010000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_RESERVED4}
- JOB_OBJECT_LIMIT_RESERVED5 = $00020000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_RESERVED5}
- JOB_OBJECT_LIMIT_RESERVED6 = $00040000;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_RESERVED6}
- JOB_OBJECT_LIMIT_VALID_FLAGS = $0007ffff;
- {$EXTERNALSYM JOB_OBJECT_LIMIT_VALID_FLAGS}
- JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS = $000000ff;
- {$EXTERNALSYM JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS}
- JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS = $00003fff;
- {$EXTERNALSYM JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS}
- JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS = $0007ffff;
- {$EXTERNALSYM JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS}
- //
- // UI restrictions for jobs
- //
- JOB_OBJECT_UILIMIT_NONE = $00000000;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_NONE}
- JOB_OBJECT_UILIMIT_HANDLES = $00000001;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_HANDLES}
- JOB_OBJECT_UILIMIT_READCLIPBOARD = $00000002;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_READCLIPBOARD}
- JOB_OBJECT_UILIMIT_WRITECLIPBOARD = $00000004;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_WRITECLIPBOARD}
- JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = $00000008;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS}
- JOB_OBJECT_UILIMIT_DISPLAYSETTINGS = $00000010;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_DISPLAYSETTINGS}
- JOB_OBJECT_UILIMIT_GLOBALATOMS = $00000020;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_GLOBALATOMS}
- JOB_OBJECT_UILIMIT_DESKTOP = $00000040;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_DESKTOP}
- JOB_OBJECT_UILIMIT_EXITWINDOWS = $00000080;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_EXITWINDOWS}
- JOB_OBJECT_UILIMIT_ALL = $000000FF;
- {$EXTERNALSYM JOB_OBJECT_UILIMIT_ALL}
- JOB_OBJECT_UI_VALID_FLAGS = $000000FF;
- {$EXTERNALSYM JOB_OBJECT_UI_VALID_FLAGS}
- JOB_OBJECT_SECURITY_NO_ADMIN = $00000001;
- {$EXTERNALSYM JOB_OBJECT_SECURITY_NO_ADMIN}
- JOB_OBJECT_SECURITY_RESTRICTED_TOKEN = $00000002;
- {$EXTERNALSYM JOB_OBJECT_SECURITY_RESTRICTED_TOKEN}
- JOB_OBJECT_SECURITY_ONLY_TOKEN = $00000004;
- {$EXTERNALSYM JOB_OBJECT_SECURITY_ONLY_TOKEN}
- JOB_OBJECT_SECURITY_FILTER_TOKENS = $00000008;
- {$EXTERNALSYM JOB_OBJECT_SECURITY_FILTER_TOKENS}
- JOB_OBJECT_SECURITY_VALID_FLAGS = $0000000f;
- {$EXTERNALSYM JOB_OBJECT_SECURITY_VALID_FLAGS}
- type
- _JOBOBJECTINFOCLASS = (
- JobObjectInfoClassPadding0,
- JobObjectBasicAccountingInformation,
- JobObjectBasicLimitInformation,
- JobObjectBasicProcessIdList,
- JobObjectBasicUIRestrictions,
- JobObjectSecurityLimitInformation,
- JobObjectEndOfJobTimeInformation,
- JobObjectAssociateCompletionPortInformation,
- JobObjectBasicAndIoAccountingInformation,
- JobObjectExtendedLimitInformation,
- JobObjectJobSetInformation,
- MaxJobObjectInfoClass);
- {$EXTERNALSYM _JOBOBJECTINFOCLASS}
- JOBOBJECTINFOCLASS = _JOBOBJECTINFOCLASS;
- {$EXTERNALSYM JOBOBJECTINFOCLASS}
- TJobObjectInfoClass = JOBOBJECTINFOCLASS;
- const
- EVENT_MODIFY_STATE = $0002;
- {$EXTERNALSYM EVENT_MODIFY_STATE}
- EVENT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3);
- {$EXTERNALSYM EVENT_ALL_ACCESS}
- MUTANT_QUERY_STATE = $0001;
- {$EXTERNALSYM MUTANT_QUERY_STATE}
- MUTANT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or MUTANT_QUERY_STATE);
- {$EXTERNALSYM MUTANT_ALL_ACCESS}
- SEMAPHORE_MODIFY_STATE = $0002;
- {$EXTERNALSYM SEMAPHORE_MODIFY_STATE}
- SEMAPHORE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3);
- {$EXTERNALSYM SEMAPHORE_ALL_ACCESS}
- //
- // Timer Specific Access Rights.
- //
- TIMER_QUERY_STATE = $0001;
- {$EXTERNALSYM TIMER_QUERY_STATE}
- TIMER_MODIFY_STATE = $0002;
- {$EXTERNALSYM TIMER_MODIFY_STATE}
- TIMER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or TIMER_QUERY_STATE or TIMER_MODIFY_STATE);
- {$EXTERNALSYM TIMER_ALL_ACCESS}
- TIME_ZONE_ID_UNKNOWN = 0;
- {$EXTERNALSYM TIME_ZONE_ID_UNKNOWN}
- TIME_ZONE_ID_STANDARD = 1;
- {$EXTERNALSYM TIME_ZONE_ID_STANDARD}
- TIME_ZONE_ID_DAYLIGHT = 2;
- {$EXTERNALSYM TIME_ZONE_ID_DAYLIGHT}
- type
- _LOGICAL_PROCESSOR_RELATIONSHIP = (RelationProcessorCore, RelationNumaNode);
- {$EXTERNALSYM _LOGICAL_PROCESSOR_RELATIONSHIP}
- LOGICAL_PROCESSOR_RELATIONSHIP = _LOGICAL_PROCESSOR_RELATIONSHIP;
- {$EXTERNALSYM LOGICAL_PROCESSOR_RELATIONSHIP}
- TLogicalProcessorRelationship = LOGICAL_PROCESSOR_RELATIONSHIP;
- const
- LTP_PC_SMT = $1;
- {$EXTERNALSYM LTP_PC_SMT}
- type
- _SYSTEM_LOGICAL_PROCESSOR_INFORMATION = record
- ProcessorMask: ULONG_PTR;
- Relationship: LOGICAL_PROCESSOR_RELATIONSHIP;
- case Integer of
- 0: (Flags: BYTE); // ProcessorCore
- 1: (NodeNumber: DWORD); // NumaNode
- 2: (Reserved: array [0..1] of ULONGLONG);
- end;
- {$EXTERNALSYM _SYSTEM_LOGICAL_PROCESSOR_INFORMATION}
- SYSTEM_LOGICAL_PROCESSOR_INFORMATION = _SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
- {$EXTERNALSYM SYSTEM_LOGICAL_PROCESSOR_INFORMATION}
- PSYSTEM_LOGICAL_PROCESSOR_INFORMATION = ^SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
- TSystemLogicalProcessorInformation = SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
- PSystemLogicalProcessorInformation = PSYSTEM_LOGICAL_PROCESSOR_INFORMATION;
- const
- PROCESSOR_INTEL_386 = 386;
- {$EXTERNALSYM PROCESSOR_INTEL_386}
- PROCESSOR_INTEL_486 = 486;
- {$EXTERNALSYM PROCESSOR_INTEL_486}
- PROCESSOR_INTEL_PENTIUM = 586;
- {$EXTERNALSYM PROCESSOR_INTEL_PENTIUM}
- PROCESSOR_INTEL_IA64 = 2200;
- {$EXTERNALSYM PROCESSOR_INTEL_IA64}
- PROCESSOR_AMD_X8664 = 8664;
- {$EXTERNALSYM PROCESSOR_AMD_X8664}
- PROCESSOR_MIPS_R4000 = 4000; // incl R4101 & R3910 for Windows CE
- {$EXTERNALSYM PROCESSOR_MIPS_R4000}
- PROCESSOR_ALPHA_21064 = 21064;
- {$EXTERNALSYM PROCESSOR_ALPHA_21064}
- PROCESSOR_PPC_601 = 601;
- {$EXTERNALSYM PROCESSOR_PPC_601}
- PROCESSOR_PPC_603 = 603;
- {$EXTERNALSYM PROCESSOR_PPC_603}
- PROCESSOR_PPC_604 = 604;
- {$EXTERNALSYM PROCESSOR_PPC_604}
- PROCESSOR_PPC_620 = 620;
- {$EXTERNALSYM PROCESSOR_PPC_620}
- PROCESSOR_HITACHI_SH3 = 10003; // Windows CE
- {$EXTERNALSYM PROCESSOR_HITACHI_SH3}
- PROCESSOR_HITACHI_SH3E = 10004; // Windows CE
- {$EXTERNALSYM PROCESSOR_HITACHI_SH3E}
- PROCESSOR_HITACHI_SH4 = 10005; // Windows CE
- {$EXTERNALSYM PROCESSOR_HITACHI_SH4}
- PROCESSOR_MOTOROLA_821 = 821; // Windows CE
- {$EXTERNALSYM PROCESSOR_MOTOROLA_821}
- PROCESSOR_SHx_SH3 = 103; // Windows CE
- {$EXTERNALSYM PROCESSOR_SHx_SH3}
- PROCESSOR_SHx_SH4 = 104; // Windows CE
- {$EXTERNALSYM PROCESSOR_SHx_SH4}
- PROCESSOR_STRONGARM = 2577; // Windows CE - 0xA11
- {$EXTERNALSYM PROCESSOR_STRONGARM}
- PROCESSOR_ARM720 = 1824; // Windows CE - 0x720
- {$EXTERNALSYM PROCESSOR_ARM720}
- PROCESSOR_ARM820 = 2080; // Windows CE - 0x820
- {$EXTERNALSYM PROCESSOR_ARM820}
- PROCESSOR_ARM920 = 2336; // Windows CE - 0x920
- {$EXTERNALSYM PROCESSOR_ARM920}
- PROCESSOR_ARM_7TDMI = 70001; // Windows CE
- {$EXTERNALSYM PROCESSOR_ARM_7TDMI}
- PROCESSOR_OPTIL = $494f; // MSIL
- {$EXTERNALSYM PROCESSOR_OPTIL}
- PROCESSOR_ARCHITECTURE_INTEL = 0;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_INTEL}
- PROCESSOR_ARCHITECTURE_MIPS = 1;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_MIPS}
- PROCESSOR_ARCHITECTURE_ALPHA = 2;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_ALPHA}
- PROCESSOR_ARCHITECTURE_PPC = 3;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_PPC}
- PROCESSOR_ARCHITECTURE_SHX = 4;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_SHX}
- PROCESSOR_ARCHITECTURE_ARM = 5;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_ARM}
- PROCESSOR_ARCHITECTURE_IA64 = 6;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_IA64}
- PROCESSOR_ARCHITECTURE_ALPHA64 = 7;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_ALPHA64}
- PROCESSOR_ARCHITECTURE_MSIL = 8;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_MSIL}
- PROCESSOR_ARCHITECTURE_AMD64 = 9;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_AMD64}
- PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_IA32_ON_WIN64}
- PROCESSOR_ARCHITECTURE_UNKNOWN = $FFFF;
- {$EXTERNALSYM PROCESSOR_ARCHITECTURE_UNKNOWN}
- PF_FLOATING_POINT_PRECISION_ERRATA = 0;
- {$EXTERNALSYM PF_FLOATING_POINT_PRECISION_ERRATA}
- PF_FLOATING_POINT_EMULATED = 1;
- {$EXTERNALSYM PF_FLOATING_POINT_EMULATED}
- PF_COMPARE_EXCHANGE_DOUBLE = 2;
- {$EXTERNALSYM PF_COMPARE_EXCHANGE_DOUBLE}
- PF_MMX_INSTRUCTIONS_AVAILABLE = 3;
- {$EXTERNALSYM PF_MMX_INSTRUCTIONS_AVAILABLE}
- PF_PPC_MOVEMEM_64BIT_OK = 4;
- {$EXTERNALSYM PF_PPC_MOVEMEM_64BIT_OK}
- PF_ALPHA_BYTE_INSTRUCTIONS = 5;
- {$EXTERNALSYM PF_ALPHA_BYTE_INSTRUCTIONS}
- PF_XMMI_INSTRUCTIONS_AVAILABLE = 6;
- {$EXTERNALSYM PF_XMMI_INSTRUCTIONS_AVAILABLE}
- PF_3DNOW_INSTRUCTIONS_AVAILABLE = 7;
- {$EXTERNALSYM PF_3DNOW_INSTRUCTIONS_AVAILABLE}
- PF_RDTSC_INSTRUCTION_AVAILABLE = 8;
- {$EXTERNALSYM PF_RDTSC_INSTRUCTION_AVAILABLE}
- PF_PAE_ENABLED = 9;
- {$EXTERNALSYM PF_PAE_ENABLED}
- PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10;
- {$EXTERNALSYM PF_XMMI64_INSTRUCTIONS_AVAILABLE}
- type
- PMEMORY_BASIC_INFORMATION = ^MEMORY_BASIC_INFORMATION;
- {$EXTERNALSYM PMEMORY_BASIC_INFORMATION}
- _MEMORY_BASIC_INFORMATION = record
- BaseAddress: Pointer;
- AllocationBase: Pointer;
- AllocationProtect: DWORD;
- RegionSize: SIZE_T;
- State: DWORD;
- Protect: DWORD;
- Type_: DWORD;
- end;
- {$EXTERNALSYM _MEMORY_BASIC_INFORMATION}
- MEMORY_BASIC_INFORMATION = _MEMORY_BASIC_INFORMATION;
- {$EXTERNALSYM MEMORY_BASIC_INFORMATION}
- TMemoryBasicInformation = MEMORY_BASIC_INFORMATION;
- PMemoryBasicInformation = PMEMORY_BASIC_INFORMATION;
- PMEMORY_BASIC_INFORMATION32 = ^MEMORY_BASIC_INFORMATION32;
- {$EXTERNALSYM PMEMORY_BASIC_INFORMATION32}
- _MEMORY_BASIC_INFORMATION32 = record
- BaseAddress: DWORD;
- AllocationBase: DWORD;
- AllocationProtect: DWORD;
- RegionSize: DWORD;
- State: DWORD;
- Protect: DWORD;
- Type_: DWORD;
- end;
- {$EXTERNALSYM _MEMORY_BASIC_INFORMATION32}
- MEMORY_BASIC_INFORMATION32 = _MEMORY_BASIC_INFORMATION32;
- {$EXTERNALSYM MEMORY_BASIC_INFORMATION32}
- TMemoryBasicInformation32 = MEMORY_BASIC_INFORMATION32;
- PMemoryBasicInformation32 = PMEMORY_BASIC_INFORMATION32;
- PMEMORY_BASIC_INFORMATION64 = ^MEMORY_BASIC_INFORMATION64;
- {$EXTERNALSYM PMEMORY_BASIC_INFORMATION64}
- _MEMORY_BASIC_INFORMATION64 = record
- BaseAddress: ULONGLONG;
- AllocationBase: ULONGLONG;
- AllocationProtect: DWORD;
- __alignment1: DWORD;
- RegionSize: ULONGLONG;
- State: DWORD;
- Protect: DWORD;
- Type_: DWORD;
- __alignment2: DWORD;
- end;
- {$EXTERNALSYM _MEMORY_BASIC_INFORMATION64}
- MEMORY_BASIC_INFORMATION64 = _MEMORY_BASIC_INFORMATION64;
- {$EXTERNALSYM MEMORY_BASIC_INFORMATION64}
- TMemoryBasicInformation64 = MEMORY_BASIC_INFORMATION64;
- PMemoryBasicInformation64 = PMEMORY_BASIC_INFORMATION64;
- const
- SECTION_QUERY = $0001;
- {$EXTERNALSYM SECTION_QUERY}
- SECTION_MAP_WRITE = $0002;
- {$EXTERNALSYM SECTION_MAP_WRITE}
- SECTION_MAP_READ = $0004;
- {$EXTERNALSYM SECTION_MAP_READ}
- SECTION_MAP_EXECUTE = $0008;
- {$EXTERNALSYM SECTION_MAP_EXECUTE}
- SECTION_EXTEND_SIZE = $0010;
- {$EXTERNALSYM SECTION_EXTEND_SIZE}
- SECTION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SECTION_QUERY or
- SECTION_MAP_WRITE or SECTION_MAP_READ or SECTION_MAP_EXECUTE or
- SECTION_EXTEND_SIZE);
- {$EXTERNALSYM SECTION_ALL_ACCESS}
- PAGE_NOACCESS = $01;
- {$EXTERNALSYM PAGE_NOACCESS}
- PAGE_READONLY = $02;
- {$EXTERNALSYM PAGE_READONLY}
- PAGE_READWRITE = $04;
- {$EXTERNALSYM PAGE_READWRITE}
- PAGE_WRITECOPY = $08;
- {$EXTERNALSYM PAGE_WRITECOPY}
- PAGE_EXECUTE = $10;
- {$EXTERNALSYM PAGE_EXECUTE}
- PAGE_EXECUTE_READ = $20;
- {$EXTERNALSYM PAGE_EXECUTE_READ}
- PAGE_EXECUTE_READWRITE = $40;
- {$EXTERNALSYM PAGE_EXECUTE_READWRITE}
- PAGE_EXECUTE_WRITECOPY = $80;
- {$EXTERNALSYM PAGE_EXECUTE_WRITECOPY}
- PAGE_GUARD = $100;
- {$EXTERNALSYM PAGE_GUARD}
- PAGE_NOCACHE = $200;
- {$EXTERNALSYM PAGE_NOCACHE}
- PAGE_WRITECOMBINE = $400;
- {$EXTERNALSYM PAGE_WRITECOMBINE}
- MEM_COMMIT = $1000;
- {$EXTERNALSYM MEM_COMMIT}
- MEM_RESERVE = $2000;
- {$EXTERNALSYM MEM_RESERVE}
- MEM_DECOMMIT = $4000;
- {$EXTERNALSYM MEM_DECOMMIT}
- MEM_RELEASE = $8000;
- {$EXTERNALSYM MEM_RELEASE}
- MEM_FREE = $10000;
- {$EXTERNALSYM MEM_FREE}
- MEM_PRIVATE = $20000;
- {$EXTERNALSYM MEM_PRIVATE}
- MEM_MAPPED = $40000;
- {$EXTERNALSYM MEM_MAPPED}
- MEM_RESET = $80000;
- {$EXTERNALSYM MEM_RESET}
- MEM_TOP_DOWN = $100000;
- {$EXTERNALSYM MEM_TOP_DOWN}
- MEM_WRITE_WATCH = $200000;
- {$EXTERNALSYM MEM_WRITE_WATCH}
- MEM_PHYSICAL = $400000;
- {$EXTERNALSYM MEM_PHYSICAL}
- MEM_LARGE_PAGES = $20000000;
- {$EXTERNALSYM MEM_LARGE_PAGES}
- MEM_4MB_PAGES = DWORD($80000000);
- {$EXTERNALSYM MEM_4MB_PAGES}
- SEC_FILE = $800000;
- {$EXTERNALSYM SEC_FILE}
- SEC_IMAGE = $1000000;
- {$EXTERNALSYM SEC_IMAGE}
- SEC_RESERVE = $4000000;
- {$EXTERNALSYM SEC_RESERVE}
- SEC_COMMIT = DWORD($8000000);
- {$EXTERNALSYM SEC_COMMIT}
- SEC_NOCACHE = $10000000;
- {$EXTERNALSYM SEC_NOCACHE}
- MEM_IMAGE = SEC_IMAGE;
- {$EXTERNALSYM MEM_IMAGE}
- WRITE_WATCH_FLAG_RESET = $01;
- {$EXTERNALSYM WRITE_WATCH_FLAG_RESET}
- //
- // Define access rights to files and directories
- //
- //
- // The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
- // devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
- // constants *MUST* always be in sync.
- // The values are redefined in devioctl.h because they must be available to
- // both DOS and NT.
- //
- FILE_READ_DATA = ($0001); // file & pipe
- {$EXTERNALSYM FILE_READ_DATA}
- FILE_LIST_DIRECTORY = ($0001); // directory
- {$EXTERNALSYM FILE_LIST_DIRECTORY}
- FILE_WRITE_DATA = ($0002); // file & pipe
- {$EXTERNALSYM FILE_WRITE_DATA}
- FILE_ADD_FILE = ($0002); // directory
- {$EXTERNALSYM FILE_ADD_FILE}
- FILE_APPEND_DATA = ($0004); // file
- {$EXTERNALSYM FILE_APPEND_DATA}
- FILE_ADD_SUBDIRECTORY = ($0004); // directory
- {$EXTERNALSYM FILE_ADD_SUBDIRECTORY}
- FILE_CREATE_PIPE_INSTANCE = ($0004); // named pipe
- {$EXTERNALSYM FILE_CREATE_PIPE_INSTANCE}
- FILE_READ_EA = ($0008); // file & directory
- {$EXTERNALSYM FILE_READ_EA}
- FILE_WRITE_EA = ($0010); // file & directory
- {$EXTERNALSYM FILE_WRITE_EA}
- FILE_EXECUTE = ($0020); // file
- {$EXTERNALSYM FILE_EXECUTE}
- FILE_TRAVERSE = ($0020); // directory
- {$EXTERNALSYM FILE_TRAVERSE}
- FILE_DELETE_CHILD = ($0040); // directory
- {$EXTERNALSYM FILE_DELETE_CHILD}
- FILE_READ_ATTRIBUTES = ($0080); // all
- {$EXTERNALSYM FILE_READ_ATTRIBUTES}
- FILE_WRITE_ATTRIBUTES = ($0100); // all
- {$EXTERNALSYM FILE_WRITE_ATTRIBUTES}
- FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1FF);
- {$EXTERNALSYM FILE_ALL_ACCESS}
- FILE_GENERIC_READ = (STANDARD_RIGHTS_READ or FILE_READ_DATA or
- FILE_READ_ATTRIBUTES or FILE_READ_EA or SYNCHRONIZE);
- {$EXTERNALSYM FILE_GENERIC_READ}
- FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE or FILE_WRITE_DATA or
- FILE_WRITE_ATTRIBUTES or FILE_WRITE_EA or FILE_APPEND_DATA or SYNCHRONIZE);
- {$EXTERNALSYM FILE_GENERIC_WRITE}
- FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE or FILE_READ_ATTRIBUTES or
- FILE_EXECUTE or SYNCHRONIZE);
- {$EXTERNALSYM FILE_GENERIC_EXECUTE}
- FILE_SHARE_READ = $00000001;
- {$EXTERNALSYM FILE_SHARE_READ}
- FILE_SHARE_WRITE = $00000002;
- {$EXTERNALSYM FILE_SHARE_WRITE}
- FILE_SHARE_DELETE = $00000004;
- {$EXTERNALSYM FILE_SHARE_DELETE}
- FILE_ATTRIBUTE_READONLY = $00000001;
- {$EXTERNALSYM FILE_ATTRIBUTE_READONLY}
- FILE_ATTRIBUTE_HIDDEN = $00000002;
- {$EXTERNALSYM FILE_ATTRIBUTE_HIDDEN}
- FILE_ATTRIBUTE_SYSTEM = $00000004;
- {$EXTERNALSYM FILE_ATTRIBUTE_SYSTEM}
- FILE_ATTRIBUTE_DIRECTORY = $00000010;
- {$EXTERNALSYM FILE_ATTRIBUTE_DIRECTORY}
- FILE_ATTRIBUTE_ARCHIVE = $00000020;
- {$EXTERNALSYM FILE_ATTRIBUTE_ARCHIVE}
- FILE_ATTRIBUTE_DEVICE = $00000040;
- {$EXTERNALSYM FILE_ATTRIBUTE_DEVICE}
- FILE_ATTRIBUTE_NORMAL = $00000080;
- {$EXTERNALSYM FILE_ATTRIBUTE_NORMAL}
- FILE_ATTRIBUTE_TEMPORARY = $00000100;
- {$EXTERNALSYM FILE_ATTRIBUTE_TEMPORARY}
- FILE_ATTRIBUTE_SPARSE_FILE = $00000200;
- {$EXTERNALSYM FILE_ATTRIBUTE_SPARSE_FILE}
- FILE_ATTRIBUTE_REPARSE_POINT = $00000400;
- {$EXTERNALSYM FILE_ATTRIBUTE_REPARSE_POINT}
- FILE_ATTRIBUTE_COMPRESSED = $00000800;
- {$EXTERNALSYM FILE_ATTRIBUTE_COMPRESSED}
- FILE_ATTRIBUTE_OFFLINE = $00001000;
- {$EXTERNALSYM FILE_ATTRIBUTE_OFFLINE}
- FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = $00002000;
- {$EXTERNALSYM FILE_ATTRIBUTE_NOT_CONTENT_INDEXED}
- FILE_ATTRIBUTE_ENCRYPTED = $00004000;
- {$EXTERNALSYM FILE_ATTRIBUTE_ENCRYPTED}
- FILE_NOTIFY_CHANGE_FILE_NAME = $00000001;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_FILE_NAME}
- FILE_NOTIFY_CHANGE_DIR_NAME = $00000002;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_DIR_NAME}
- FILE_NOTIFY_CHANGE_ATTRIBUTES = $00000004;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_ATTRIBUTES}
- FILE_NOTIFY_CHANGE_SIZE = $00000008;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_SIZE}
- FILE_NOTIFY_CHANGE_LAST_WRITE = $00000010;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_LAST_WRITE}
- FILE_NOTIFY_CHANGE_LAST_ACCESS = $00000020;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_LAST_ACCESS}
- FILE_NOTIFY_CHANGE_CREATION = $00000040;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_CREATION}
- FILE_NOTIFY_CHANGE_SECURITY = $00000100;
- {$EXTERNALSYM FILE_NOTIFY_CHANGE_SECURITY}
- FILE_ACTION_ADDED = $00000001;
- {$EXTERNALSYM FILE_ACTION_ADDED}
- FILE_ACTION_REMOVED = $00000002;
- {$EXTERNALSYM FILE_ACTION_REMOVED}
- FILE_ACTION_MODIFIED = $00000003;
- {$EXTERNALSYM FILE_ACTION_MODIFIED}
- FILE_ACTION_RENAMED_OLD_NAME = $00000004;
- {$EXTERNALSYM FILE_ACTION_RENAMED_OLD_NAME}
- FILE_ACTION_RENAMED_NEW_NAME = $00000005;
- {$EXTERNALSYM FILE_ACTION_RENAMED_NEW_NAME}
- MAILSLOT_NO_MESSAGE = DWORD(-1);
- {$EXTERNALSYM MAILSLOT_NO_MESSAGE}
- MAILSLOT_WAIT_FOREVER = DWORD(-1);
- {$EXTERNALSYM MAILSLOT_WAIT_FOREVER}
- FILE_CASE_SENSITIVE_SEARCH = $00000001;
- {$EXTERNALSYM FILE_CASE_SENSITIVE_SEARCH}
- FILE_CASE_PRESERVED_NAMES = $00000002;
- {$EXTERNALSYM FILE_CASE_PRESERVED_NAMES}
- FILE_UNICODE_ON_DISK = $00000004;
- {$EXTERNALSYM FILE_UNICODE_ON_DISK}
- FILE_PERSISTENT_ACLS = $00000008;
- {$EXTERNALSYM FILE_PERSISTENT_ACLS}
- FILE_FILE_COMPRESSION = $00000010;
- {$EXTERNALSYM FILE_FILE_COMPRESSION}
- FILE_VOLUME_QUOTAS = $00000020;
- {$EXTERNALSYM FILE_VOLUME_QUOTAS}
- FILE_SUPPORTS_SPARSE_FILES = $00000040;
- {$EXTERNALSYM FILE_SUPPORTS_SPARSE_FILES}
- FILE_SUPPORTS_REPARSE_POINTS = $00000080;
- {$EXTERNALSYM FILE_SUPPORTS_REPARSE_POINTS}
- FILE_SUPPORTS_REMOTE_STORAGE = $00000100;
- {$EXTERNALSYM FILE_SUPPORTS_REMOTE_STORAGE}
- FILE_VOLUME_IS_COMPRESSED = $00008000;
- {$EXTERNALSYM FILE_VOLUME_IS_COMPRESSED}
- FILE_SUPPORTS_OBJECT_IDS = $00010000;
- {$EXTERNALSYM FILE_SUPPORTS_OBJECT_IDS}
- FILE_SUPPORTS_ENCRYPTION = $00020000;
- {$EXTERNALSYM FILE_SUPPORTS_ENCRYPTION}
- FILE_NAMED_STREAMS = $00040000;
- {$EXTERNALSYM FILE_NAMED_STREAMS}
- FILE_READ_ONLY_VOLUME = $00080000;
- {$EXTERNALSYM FILE_READ_ONLY_VOLUME}
- //
- // Define the file notification information structure
- //
- type
- PFILE_NOTIFY_INFORMATION = ^FILE_NOTIFY_INFORMATION;
- {$EXTERNALSYM PFILE_NOTIFY_INFORMATION}
- _FILE_NOTIFY_INFORMATION = record
- NextEntryOffset: DWORD;
- Action: DWORD;
- FileNameLength: DWORD;
- FileName: array [0..0] of WCHAR;
- end;
- {$EXTERNALSYM _FILE_NOTIFY_INFORMATION}
- FILE_NOTIFY_INFORMATION = _FILE_NOTIFY_INFORMATION;
- {$EXTERNALSYM FILE_NOTIFY_INFORMATION}
- TFileNotifyInformation = FILE_NOTIFY_INFORMATION;
- PFileNotifyInformation = PFILE_NOTIFY_INFORMATION;
- //
- // Define segement buffer structure for scatter/gather read/write.
- //
- type
- PFILE_SEGMENT_ELEMENT = ^FILE_SEGMENT_ELEMENT;
- {$EXTERNALSYM PFILE_SEGMENT_ELEMENT}
- _FILE_SEGMENT_ELEMENT = record
- case Integer of
- 0: (Buffer: PVOID64);
- 1: (Alignment: ULONGLONG);
- end;
- {$EXTERNALSYM _FILE_SEGMENT_ELEMENT}
- FILE_SEGMENT_ELEMENT = _FILE_SEGMENT_ELEMENT;
- {$EXTERNALSYM FILE_SEGMENT_ELEMENT}
- TFileSegmentElement = FILE_SEGMENT_ELEMENT;
- PFileSegmentElement = PFILE_SEGMENT_ELEMENT;
- //
- // The reparse GUID structure is used by all 3rd party layered drivers to
- // store data in a reparse point. For non-Microsoft tags, The GUID field
- // cannot be GUID_NULL.
- // The constraints on reparse tags are defined below.
- // Microsoft tags can also be used with this format of the reparse point buffer.
- //
- TGenericReparseBuffer = record
- DataBuffer: array [0..0] of BYTE;
- end;
- PREPARSE_GUID_DATA_BUFFER = ^REPARSE_GUID_DATA_BUFFER;
- {$EXTERNALSYM PREPARSE_GUID_DATA_BUFFER}
- _REPARSE_GUID_DATA_BUFFER = record
- ReparseTag: DWORD;
- ReparseDataLength: WORD;
- Reserved: WORD;
- ReparseGuid: GUID;
- GenericReparseBuffer: TGenericReparseBuffer;
- end;
- {$EXTERNALSYM _REPARSE_GUID_DATA_BUFFER}
- REPARSE_GUID_DATA_BUFFER = _REPARSE_GUID_DATA_BUFFER;
- {$EXTERNALSYM REPARSE_GUID_DATA_BUFFER}
- TReparseGuidDataBuffer = REPARSE_GUID_DATA_BUFFER;
- PReparseGuidDataBuffer = PREPARSE_GUID_DATA_BUFFER;
- const
- REPARSE_GUID_DATA_BUFFER_HEADER_SIZE = 24;
- {$EXTERNALSYM REPARSE_GUID_DATA_BUFFER_HEADER_SIZE}
- //
- // Maximum allowed size of the reparse data.
- //
- const
- MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024;
- {$EXTERNALSYM MAXIMUM_REPARSE_DATA_BUFFER_SIZE}
- //
- // Predefined reparse tags.
- // These tags need to avoid conflicting with IO_REMOUNT defined in ntosincio.h
- //
- IO_REPARSE_TAG_RESERVED_ZERO = (0);
- {$EXTERNALSYM IO_REPARSE_TAG_RESERVED_ZERO}
- IO_REPARSE_TAG_RESERVED_ONE = (1);
- {$EXTERNALSYM IO_REPARSE_TAG_RESERVED_ONE}
- //
- // The value of the following constant needs to satisfy the following conditions:
- // (1) Be at least as large as the largest of the reserved tags.
- // (2) Be strictly smaller than all the tags in use.
- //
- IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE;
- {$EXTERNALSYM IO_REPARSE_TAG_RESERVED_RANGE}
- //
- // The reparse tags are a DWORD. The 32 bits are laid out as follows:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +-+-+-+-+-----------------------+-------------------------------+
- // |M|R|N|R| Reserved bits | Reparse Tag Value |
- // +-+-+-+-+-----------------------+-------------------------------+
- //
- // M is the Microsoft bit. When set to 1, it denotes a tag owned by Microsoft.
- // All ISVs must use a tag with a 0 in this position.
- // Note: If a Microsoft tag is used by non-Microsoft software, the
- // behavior is not defined.
- //
- // R is reserved. Must be zero for non-Microsoft tags.
- //
- // N is name surrogate. When set to 1, the file represents another named
- // entity in the system.
- //
- // The M and N bits are OR-able.
- // The following macros check for the M and N bit values:
- //
- //
- // Macro to determine whether a reparse point tag corresponds to a tag
- // owned by Microsoft.
- //
- function IsReparseTagMicrosoft(Tag: ULONG): Boolean;
- {$EXTERNALSYM IsReparseTagMicrosoft}
- //
- // Macro to determine whether a reparse point tag corresponds to a file
- // that is to be displayed with the slow icon overlay.
- //
- function IsReparseTagHighLatency(Tag: ULONG): Boolean;
- {$EXTERNALSYM IsReparseTagHighLatency}
- //
- // Macro to determine whether a reparse point tag is a name surrogate
- //
- function IsReparseTagNameSurrogate(Tag: ULONG): Boolean;
- {$EXTERNALSYM IsReparseTagNameSurrogate}
- const
- IO_REPARSE_TAG_MOUNT_POINT = DWORD($A0000003);
- {$EXTERNALSYM IO_REPARSE_TAG_MOUNT_POINT}
- IO_REPARSE_TAG_HSM = DWORD($C0000004);
- {$EXTERNALSYM IO_REPARSE_TAG_HSM}
- IO_REPARSE_TAG_SIS = DWORD($80000007);
- {$EXTERNALSYM IO_REPARSE_TAG_SIS}
- IO_REPARSE_TAG_DFS = DWORD($8000000A);
- {$EXTERNALSYM IO_REPARSE_TAG_DFS}
- IO_REPARSE_TAG_FILTER_MANAGER = DWORD($8000000B);
- {$EXTERNALSYM IO_REPARSE_TAG_FILTER_MANAGER}
- IO_COMPLETION_MODIFY_STATE = $0002;
- {$EXTERNALSYM IO_COMPLETION_MODIFY_STATE}
- IO_COMPLETION_ALL_ACCESS = DWORD(STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3);
- {$EXTERNALSYM IO_COMPLETION_ALL_ACCESS}
- DUPLICATE_CLOSE_SOURCE = $00000001;
- {$EXTERNALSYM DUPLICATE_CLOSE_SOURCE}
- DUPLICATE_SAME_ACCESS = $00000002;
- {$EXTERNALSYM DUPLICATE_SAME_ACCESS}
- type
- _SYSTEM_POWER_STATE = (
- PowerSystemUnspecified,
- PowerSystemWorking,
- PowerSystemSleeping1,
- PowerSystemSleeping2,
- PowerSystemSleeping3,
- PowerSystemHibernate,
- PowerSystemShutdown,
- PowerSystemMaximum);
- {$EXTERNALSYM _SYSTEM_POWER_STATE}
- SYSTEM_POWER_STATE = _SYSTEM_POWER_STATE;
- {$EXTERNALSYM SYSTEM_POWER_STATE}
- PSYSTEM_POWER_STATE = ^SYSTEM_POWER_STATE;
- {$EXTERNALSYM PSYSTEM_POWER_STATE}
- TSystemPowerState = SYSTEM_POWER_STATE;
- PSystemPowerState = PSYSTEM_POWER_STATE;
- const
- POWER_SYSTEM_MAXIMUM = 7;
- {$EXTERNALSYM POWER_SYSTEM_MAXIMUM}
- type
- POWER_ACTION = (
- PowerActionNone,
- PowerActionReserved,
- PowerActionSleep,
- PowerActionHibernate,
- PowerActionShutdown,
- PowerActionShutdownReset,
- PowerActionShutdownOff,
- PowerActionWarmEject);
- {$EXTERNALSYM POWER_ACTION}
- PPOWER_ACTION = ^POWER_ACTION;
- {$EXTERNALSYM PPOWER_ACTION}
- TPowerAction = POWER_ACTION;
- PPowerAction = PPOWER_ACTION;
- _DEVICE_POWER_STATE = (
- PowerDeviceUnspecified,
- PowerDeviceD0,
- PowerDeviceD1,
- PowerDeviceD2,
- PowerDeviceD3,
- PowerDeviceMaximum);
- {$EXTERNALSYM _DEVICE_POWER_STATE}
- DEVICE_POWER_STATE = _DEVICE_POWER_STATE;
- {$EXTERNALSYM DEVICE_POWER_STATE}
- PDEVICE_POWER_STATE = ^DEVICE_POWER_STATE;
- {$EXTERNALSYM PDEVICE_POWER_STATE}
- TDevicePowerState = DEVICE_POWER_STATE;
- PDevicePowerState = PDEVICE_POWER_STATE;
- const
- ES_SYSTEM_REQUIRED = DWORD($00000001);
- {$EXTERNALSYM ES_SYSTEM_REQUIRED}
- ES_DISPLAY_REQUIRED = DWORD($00000002);
- {$EXTERNALSYM ES_DISPLAY_REQUIRED}
- ES_USER_PRESENT = DWORD($00000004);
- {$EXTERNALSYM ES_USER_PRESENT}
- ES_CONTINUOUS = DWORD($80000000);
- {$EXTERNALSYM ES_CONTINUOUS}
- type
- EXECUTION_STATE = DWORD;
- {$EXTERNALSYM EXECUTION_STATE}
- LATENCY_TIME = (LT_DONT_CARE, LT_LOWEST_LATENCY);
- {$EXTERNALSYM LATENCY_TIME}
- TLatencyTime = LATENCY_TIME;
- //-----------------------------------------------------------------------------
- // Device Power Information
- // Accessable via CM_Get_DevInst_Registry_Property_Ex(CM_DRP_DEVICE_POWER_DATA)
- //-----------------------------------------------------------------------------
- const
- PDCAP_D0_SUPPORTED = $00000001;
- {$EXTERNALSYM PDCAP_D0_SUPPORTED}
- PDCAP_D1_SUPPORTED = $00000002;
- {$EXTERNALSYM PDCAP_D1_SUPPORTED}
- PDCAP_D2_SUPPORTED = $00000004;
- {$EXTERNALSYM PDCAP_D2_SUPPORTED}
- PDCAP_D3_SUPPORTED = $00000008;
- {$EXTERNALSYM PDCAP_D3_SUPPORTED}
- PDCAP_WAKE_FROM_D0_SUPPORTED = $00000010;
- {$EXTERNALSYM PDCAP_WAKE_FROM_D0_SUPPORTED}
- PDCAP_WAKE_FROM_D1_SUPPORTED = $00000020;
- {$EXTERNALSYM PDCAP_WAKE_FROM_D1_SUPPORTED}
- PDCAP_WAKE_FROM_D2_SUPPORTED = $00000040;
- {$EXTERNALSYM PDCAP_WAKE_FROM_D2_SUPPORTED}
- PDCAP_WAKE_FROM_D3_SUPPORTED = $00000080;
- {$EXTERNALSYM PDCAP_WAKE_FROM_D3_SUPPORTED}
- PDCAP_WARM_EJECT_SUPPORTED = $00000100;
- {$EXTERNALSYM PDCAP_WARM_EJECT_SUPPORTED}
- type
- CM_Power_Data_s = record
- PD_Size: DWORD;
- PD_MostRecentPowerState: DEVICE_POWER_STATE;
- PD_Capabilities: DWORD;
- PD_D1Latency: DWORD;
- PD_D2Latency: DWORD;
- PD_D3Latency: DWORD;
- PD_PowerStateMapping: array [0..POWER_SYSTEM_MAXIMUM - 1] of DEVICE_POWER_STATE;
- PD_DeepestSystemWake: SYSTEM_POWER_STATE;
- end;
- {$EXTERNALSYM CM_Power_Data_s}
- CM_POWER_DATA = CM_Power_Data_s;
- {$EXTERNALSYM CM_POWER_DATA}
- PCM_POWER_DATA = ^CM_POWER_DATA;
- {$EXTERNALSYM PCM_POWER_DATA}
- TCmPowerData = CM_POWER_DATA;
- PCmPowerData = PCM_POWER_DATA;
- POWER_INFORMATION_LEVEL = (
- SystemPowerPolicyAc,
- SystemPowerPolicyDc,
- VerifySystemPolicyAc,
- VerifySystemPolicyDc,
- SystemPowerCapabilities,
- SystemBatteryState,
- SystemPowerStateHandler,
- ProcessorStateHandler,
- SystemPowerPolicyCurrent,
- AdministratorPowerPolicy,
- SystemReserveHiberFile,
- ProcessorInformation,
- SystemPowerInformation,
- ProcessorStateHandler2,
- LastWakeTime, // Compare with KeQueryInterruptTime()
- LastSleepTime, // Compare with KeQueryInterruptTime()
- SystemExecutionState,
- SystemPowerStateNotifyHandler,
- ProcessorPowerPolicyAc,
- ProcessorPowerPolicyDc,
- VerifyProcessorPowerPolicyAc,
- VerifyProcessorPowerPolicyDc,
- ProcessorPowerPolicyCurrent,
- SystemPowerStateLogging,
- SystemPowerLoggingEntry);
- {$EXTERNALSYM POWER_INFORMATION_LEVEL}
- TPowerInformationLevel = POWER_INFORMATION_LEVEL;
- //
- // System power manager capabilities
- //
- BATTERY_REPORTING_SCALE = record
- Granularity: DWORD;
- Capacity: DWORD;
- end;
- {$EXTERNALSYM BATTERY_REPORTING_SCALE}
- PBATTERY_REPORTING_SCALE = ^BATTERY_REPORTING_SCALE;
- {$EXTERNALSYM PBATTERY_REPORTING_SCALE}
- TBatteryReportingScale = BATTERY_REPORTING_SCALE;
- PBatteryReportingScale = PBATTERY_REPORTING_SCALE;
- // Power Policy Management interfaces
- //
- PPOWER_ACTION_POLICY = ^POWER_ACTION_POLICY;
- {$EXTERNALSYM PPOWER_ACTION_POLICY}
- POWER_ACTION_POLICY = record
- Action: POWER_ACTION;
- Flags: DWORD;
- EventCode: DWORD;
- end;
- {$EXTERNALSYM POWER_ACTION_POLICY}
- TPowerActionPolicy = POWER_ACTION_POLICY;
- PPowerActionPolicy = PPOWER_ACTION_POLICY;
- // POWER_ACTION_POLICY->Flags:
- const
- POWER_ACTION_QUERY_ALLOWED = $00000001;
- {$EXTERNALSYM POWER_ACTION_QUERY_ALLOWED}
- POWER_ACTION_UI_ALLOWED = $00000002;
- {$EXTERNALSYM POWER_ACTION_UI_ALLOWED}
- POWER_ACTION_OVERRIDE_APPS = $00000004;
- {$EXTERNALSYM POWER_ACTION_OVERRIDE_APPS}
- POWER_ACTION_LIGHTEST_FIRST = $10000000;
- {$EXTERNALSYM POWER_ACTION_LIGHTEST_FIRST}
- POWER_ACTION_LOCK_CONSOLE = $20000000;
- {$EXTERNALSYM POWER_ACTION_LOCK_CONSOLE}
- POWER_ACTION_DISABLE_WAKES = $40000000;
- {$EXTERNALSYM POWER_ACTION_DISABLE_WAKES}
- POWER_ACTION_CRITICAL = DWORD($80000000);
- {$EXTERNALSYM POWER_ACTION_CRITICAL}
- // POWER_ACTION_POLICY->EventCode flags
- POWER_LEVEL_USER_NOTIFY_TEXT = $00000001;
- {$EXTERNALSYM POWER_LEVEL_USER_NOTIFY_TEXT}
- POWER_LEVEL_USER_NOTIFY_SOUND = $00000002;
- {$EXTERNALSYM POWER_LEVEL_USER_NOTIFY_SOUND}
- POWER_LEVEL_USER_NOTIFY_EXEC = $00000004;
- {$EXTERNALSYM POWER_LEVEL_USER_NOTIFY_EXEC}
- POWER_USER_NOTIFY_BUTTON = $00000008;
- {$EXTERNALSYM POWER_USER_NOTIFY_BUTTON}
- POWER_USER_NOTIFY_SHUTDOWN = $00000010;
- {$EXTERNALSYM POWER_USER_NOTIFY_SHUTDOWN}
- POWER_FORCE_TRIGGER_RESET = DWORD($80000000);
- {$EXTERNALSYM POWER_FORCE_TRIGGER_RESET}
- // system battery drain policies
- type
- PSYSTEM_POWER_LEVEL = ^SYSTEM_POWER_LEVEL;
- {$EXTERNALSYM PSYSTEM_POWER_LEVEL}
- SYSTEM_POWER_LEVEL = record
- Enable: BOOLEAN;
- Spare: array [0..3 - 1] of BYTE;
- BatteryLevel: DWORD;
- PowerPolicy: POWER_ACTION_POLICY;
- MinSystemState: SYSTEM_POWER_STATE;
- end;
- {$EXTERNALSYM SYSTEM_POWER_LEVEL}
- TSystemPowerLevel = SYSTEM_POWER_LEVEL;
- PSystemPowerLevel = PSYSTEM_POWER_LEVEL;
- // Discharge policy constants
- const
- NUM_DISCHARGE_POLICIES = 4;
- {$EXTERNALSYM NUM_DISCHARGE_POLICIES}
- DISCHARGE_POLICY_CRITICAL = 0;
- {$EXTERNALSYM DISCHARGE_POLICY_CRITICAL}
- DISCHARGE_POLICY_LOW = 1;
- {$EXTERNALSYM DISCHARGE_POLICY_LOW}
- //
- // Throttling policies
- //
- PO_THROTTLE_NONE = 0;
- {$EXTERNALSYM PO_THROTTLE_NONE}
- PO_THROTTLE_CONSTANT = 1;
- {$EXTERNALSYM PO_THROTTLE_CONSTANT}
- PO_THROTTLE_DEGRADE = 2;
- {$EXTERNALSYM PO_THROTTLE_DEGRADE}
- PO_THROTTLE_ADAPTIVE = 3;
- {$EXTERNALSYM PO_THROTTLE_ADAPTIVE}
- PO_THROTTLE_MAXIMUM = 4; // not a policy, just a limit
- {$EXTERNALSYM PO_THROTTLE_MAXIMUM}
- // system power policies
- type
- PSYSTEM_POWER_POLICY = ^SYSTEM_POWER_POLICY;
- {$EXTERNALSYM PSYSTEM_POWER_POLICY}
- _SYSTEM_POWER_POLICY = record
- Revision: DWORD; // 1
- // events
- PowerButton: POWER_ACTION_POLICY;
- SleepButton: POWER_ACTION_POLICY;
- LidClose: POWER_ACTION_POLICY;
- LidOpenWake: SYSTEM_POWER_STATE;
- Reserved: DWORD;
- // "system idle" detection
- Idle: POWER_ACTION_POLICY;
- IdleTimeout: DWORD;
- IdleSensitivity: BYTE;
- // dynamic throttling policy
- // PO_THROTTLE_NONE, PO_THROTTLE_CONSTANT, PO_THROTTLE_DEGRADE, or PO_THROTTLE_ADAPTIVE
- DynamicThrottle: BYTE;
- Spare2: array [0..1] of BYTE;
- // meaning of power action "sleep"
- MinSleep: SYSTEM_POWER_STATE;
- MaxSleep: SYSTEM_POWER_STATE;
- ReducedLatencySleep: SYSTEM_POWER_STATE;
- WinLogonFlags: DWORD;
- // parameters for dozing
- Spare3: DWORD;
- DozeS4Timeout: DWORD;
- // battery policies
- BroadcastCapacityResolution: DWORD;
- DischargePolicy: array [0..NUM_DISCHARGE_POLICIES - 1] of SYSTEM_POWER_LEVEL;
- // video policies
- VideoTimeout: DWORD;
- VideoDimDisplay: BOOLEAN;
- VideoReserved: array [0..2] of DWORD;
- // hard disk policies
- SpindownTimeout: DWORD;
- // processor policies
- OptimizeForPower: LongBool;
- FanThrottleTolerance: BYTE;
- ForcedThrottle: BYTE;
- MinThrottle: BYTE;
- OverThrottled: POWER_ACTION_POLICY;
- end;
- {$EXTERNALSYM _SYSTEM_POWER_POLICY}
- SYSTEM_POWER_POLICY = _SYSTEM_POWER_POLICY;
- {$EXTERNALSYM SYSTEM_POWER_POLICY}
- TSystemPowerPolicy = SYSTEM_POWER_POLICY;
- PSystemPowerPolicy = PSYSTEM_POWER_POLICY;
- // processor power policy state
- PPROCESSOR_POWER_POLICY_INFO = ^PROCESSOR_POWER_POLICY_INFO;
- {$EXTERNALSYM PPROCESSOR_POWER_POLICY_INFO}
- _PROCESSOR_POWER_POLICY_INFO = record
- // Time based information (will be converted to kernel units)
- TimeCheck: DWORD; // in US
- DemoteLimit: DWORD; // in US
- PromoteLimit: DWORD; // in US
- // Percentage based information
- DemotePercent: BYTE;
- PromotePercent: BYTE;
- Spare: array [0..1] of BYTE;
- // Flags
- Flags: DWORD;
- //DWORD AllowDemotion:1;
- //DWORD AllowPromotion:1;
- //DWORD Reserved:30;
- end;
- {$EXTERNALSYM _PROCESSOR_POWER_POLICY_INFO}
- PROCESSOR_POWER_POLICY_INFO = _PROCESSOR_POWER_POLICY_INFO;
- {$EXTERNALSYM PROCESSOR_POWER_POLICY_INFO}
- TProcessorPowerPolicyInfo = PROCESSOR_POWER_POLICY_INFO;
- PProcessorPowerPolicyInfo = PPROCESSOR_POWER_POLICY_INFO;
- // processor power policy
- PPROCESSOR_POWER_POLICY = ^PROCESSOR_POWER_POLICY;
- {$EXTERNALSYM PPROCESSOR_POWER_POLICY}
- _PROCESSOR_POWER_POLICY = record
- Revision: DWORD; // 1
- // Dynamic Throttling Policy
- DynamicThrottle: BYTE;
- Spare: array [0..2] of BYTE;
- // Flags
- Reserved: DWORD;
- //DWORD DisableCStates:1;
- //DWORD Reserved:31;
- // System policy information
- // The Array is last, in case it needs to be grown and the structure
- // revision incremented.
- PolicyCount: DWORD;
- Policy: array [0..2] of PROCESSOR_POWER_POLICY_INFO;
- end;
- {$EXTERNALSYM _PROCESSOR_POWER_POLICY}
- PROCESSOR_POWER_POLICY = _PROCESSOR_POWER_POLICY;
- {$EXTERNALSYM PROCESSOR_POWER_POLICY}
- TProcessorPowerPolicy = PROCESSOR_POWER_POLICY;
- PProcessorPowerPolicy = PPROCESSOR_POWER_POLICY;
- // administrator power policy overrides
- PADMINISTRATOR_POWER_POLICY = ^ADMINISTRATOR_POWER_POLICY;
- {$EXTERNALSYM PADMINISTRATOR_POWER_POLICY}
- _ADMINISTRATOR_POWER_POLICY = record
- // meaning of power action "sleep"
- MinSleep: SYSTEM_POWER_STATE;
- MaxSleep: SYSTEM_POWER_STATE;
- // video policies
- MinVideoTimeout: DWORD;
- MaxVideoTimeout: DWORD;
- // disk policies
- MinSpindownTimeout: DWORD;
- MaxSpindownTimeout: DWORD;
- end;
- {$EXTERNALSYM _ADMINISTRATOR_POWER_POLICY}
- ADMINISTRATOR_POWER_POLICY = _ADMINISTRATOR_POWER_POLICY;
- {$EXTERNALSYM ADMINISTRATOR_POWER_POLICY}
- TAdministratorPowerPolicy = ADMINISTRATOR_POWER_POLICY;
- PAdministratorPowerPolicy = PADMINISTRATOR_POWER_POLICY;
- PSYSTEM_POWER_CAPABILITIES = ^SYSTEM_POWER_CAPABILITIES;
- {$EXTERNALSYM PSYSTEM_POWER_CAPABILITIES}
- SYSTEM_POWER_CAPABILITIES = record
- // Misc supported system features
- PowerButtonPresent: BOOLEAN;
- SleepButtonPresent: BOOLEAN;
- LidPresent: BOOLEAN;
- SystemS1: BOOLEAN;
- SystemS2: BOOLEAN;
- SystemS3: BOOLEAN;
- SystemS4: BOOLEAN; // hibernate
- SystemS5: BOOLEAN; // off
- HiberFilePresent: BOOLEAN;
- FullWake: BOOLEAN;
- VideoDimPresent: BOOLEAN;
- ApmPresent: BOOLEAN;
- UpsPresent: BOOLEAN;
- // Processors
- ThermalControl: BOOLEAN;
- ProcessorThrottle: BOOLEAN;
- ProcessorMinThrottle: BYTE;
- ProcessorMaxThrottle: BYTE;
- spare2: array [0..4 - 1] of BYTE;
- // Disk
- DiskSpinDown: BOOLEAN;
- spare3: array [0..8 - 1] of BYTE;
- // System Battery
- SystemBatteriesPresent: BOOLEAN;
- BatteriesAreShortTerm: BOOLEAN;
- BatteryScale: array [0..3 - 1] of BATTERY_REPORTING_SCALE;
- // Wake
- AcOnLineWake: SYSTEM_POWER_STATE;
- SoftLidWake: SYSTEM_POWER_STATE;
- RtcWake: SYSTEM_POWER_STATE;
- MinDeviceWakeState: SYSTEM_POWER_STATE; // note this may change on driver load
- DefaultLowLatencyWake: SYSTEM_POWER_STATE;
- end;
- {$EXTERNALSYM SYSTEM_POWER_CAPABILITIES}
- TSystemPowerCapabilities = SYSTEM_POWER_CAPABILITIES;
- PSystemPowerCapabilities = PSYSTEM_POWER_CAPABILITIES;
- PSYSTEM_BATTERY_STATE = ^SYSTEM_BATTERY_STATE;
- {$EXTERNALSYM PSYSTEM_BATTERY_STATE}
- SYSTEM_BATTERY_STATE = record
- AcOnLine: BOOLEAN;
- BatteryPresent: BOOLEAN;
- Charging: BOOLEAN;
- Discharging: BOOLEAN;
- Spare1: array [0..3] of BOOLEAN;
- MaxCapacity: DWORD;
- RemainingCapacity: DWORD;
- Rate: DWORD;
- EstimatedTime: DWORD;
- DefaultAlert1: DWORD;
- DefaultAlert2: DWORD;
- end;
- {$EXTERNALSYM SYSTEM_BATTERY_STATE}
- TSystemBatteryState = SYSTEM_BATTERY_STATE;
- PSystemBatteryState = PSYSTEM_BATTERY_STATE;
- //
- // Image Format
- //
- // #include "pshpack4.h" // 4 byte packing is the default
- const
- IMAGE_DOS_SIGNATURE = $5A4D; // MZ
- {$EXTERNALSYM IMAGE_DOS_SIGNATURE}
- IMAGE_OS2_SIGNATURE = $454E; // NE
- {$EXTERNALSYM IMAGE_OS2_SIGNATURE}
- IMAGE_OS2_SIGNATURE_LE = $454C; // LE
- {$EXTERNALSYM IMAGE_OS2_SIGNATURE_LE}
- IMAGE_VXD_SIGNATURE = $454C; // LE
- {$EXTERNALSYM IMAGE_VXD_SIGNATURE}
- IMAGE_NT_SIGNATURE = $00004550; // PE00
- {$EXTERNALSYM IMAGE_NT_SIGNATURE}
- // #include "pshpack2.h" // 16 bit headers are 2 byte packed
- type
- // DOS .EXE header
- PIMAGE_DOS_HEADER = ^IMAGE_DOS_HEADER;
- {$EXTERNALSYM PIMAGE_DOS_HEADER}
- _IMAGE_DOS_HEADER = record
- e_magic: Word; // Magic number
- e_cblp: Word; // Bytes on last page of file
- e_cp: Word; // Pages in file
- e_crlc: Word; // Relocations
- e_cparhdr: Word; // Size of header in paragraphs
- e_minalloc: Word; // Minimum extra paragraphs needed
- e_maxalloc: Word; // Maximum extra paragraphs needed
- e_ss: Word; // Initial (relative) SS value
- e_sp: Word; // Initial SP value
- e_csum: Word; // Checksum
- e_ip: Word; // Initial IP value
- e_cs: Word; // Initial (relative) CS value
- e_lfarlc: Word; // File address of relocation table
- e_ovno: Word; // Overlay number
- e_res: array [0..3] of Word; // Reserved words
- e_oemid: Word; // OEM identifier (for e_oeminfo)
- e_oeminfo: Word; // OEM information; e_oemid specific
- e_res2: array [0..9] of Word; // Reserved words
- e_lfanew: Longint; // File address of new exe header
- end;
- {$EXTERNALSYM _IMAGE_DOS_HEADER}
- IMAGE_DOS_HEADER = _IMAGE_DOS_HEADER;
- {$EXTERNALSYM IMAGE_DOS_HEADER}
- TImageDosHeader = IMAGE_DOS_HEADER;
- PImageDosHeader = PIMAGE_DOS_HEADER;
- // OS/2 .EXE header
- PIMAGE_OS2_HEADER = ^IMAGE_OS2_HEADER;
- {$EXTERNALSYM PIMAGE_OS2_HEADER}
- _IMAGE_OS2_HEADER = record
- ne_magic: Word; // Magic number
- ne_ver: CHAR; // Version number
- ne_rev: CHAR; // Revision number
- ne_enttab: Word; // Offset of Entry Table
- ne_cbenttab: Word; // Number of bytes in Entry Table
- ne_crc: Longint; // Checksum of whole file
- ne_flags: Word; // Flag word
- ne_autodata: Word; // Automatic data segment number
- ne_heap: Word; // Initial heap allocation
- ne_stack: Word; // Initial stack allocation
- ne_csip: Longint; // Initial CS:IP setting
- ne_sssp: Longint; // Initial SS:SP setting
- ne_cseg: Word; // Count of file segments
- ne_cmod: Word; // Entries in Module Reference Table
- ne_cbnrestab: Word; // Size of non-resident name table
- ne_segtab: Word; // Offset of Segment Table
- ne_rsrctab: Word; // Offset of Resource Table
- ne_restab: Word; // Offset of resident name table
- ne_modtab: Word; // Offset of Module Reference Table
- ne_imptab: Word; // Offset of Imported Names Table
- ne_nrestab: Longint; // Offset of Non-resident Names Table
- ne_cmovent: Word; // Count of movable entries
- ne_align: Word; // Segment alignment shift count
- ne_cres: Word; // Count of resource segments
- ne_exetyp: Byte; // Target Operating system
- ne_flagsothers: Byte; // Other .EXE flags
- ne_pretthunks: Word; // offset to return thunks
- ne_psegrefbytes: Word; // offset to segment ref. bytes
- ne_swaparea: Word; // Minimum code swap area size
- ne_expver: Word; // Expected Windows version number
- end;
- {$EXTERNALSYM _IMAGE_OS2_HEADER}
- IMAGE_OS2_HEADER = _IMAGE_OS2_HEADER;
- {$EXTERNALSYM IMAGE_OS2_HEADER}
- TImageOs2Header = IMAGE_OS2_HEADER;
- PImageOs2Header = PIMAGE_OS2_HEADER;
- // Windows VXD header
- PIMAGE_VXD_HEADER = ^IMAGE_VXD_HEADER;
- {$EXTERNALSYM PIMAGE_VXD_HEADER}
- _IMAGE_VXD_HEADER = record
- e32_magic: Word; // Magic number
- e32_border: Byte; // The byte ordering for the VXD
- e32_worder: Byte; // The word ordering for the VXD
- e32_level: DWORD; // The EXE format level for now = 0
- e32_cpu: Word; // The CPU type
- e32_os: Word; // The OS type
- e32_ver: DWORD; // Module version
- e32_mflags: DWORD; // Module flags
- e32_mpages: DWORD; // Module # pages
- e32_startobj: DWORD; // Object # for instruction pointer
- e32_eip: DWORD; // Extended instruction pointer
- e32_stackobj: DWORD; // Object # for stack pointer
- e32_esp: DWORD; // Extended stack pointer
- e32_pagesize: DWORD; // VXD page size
- e32_lastpagesize: DWORD; // Last page size in VXD
- e32_fixupsize: DWORD; // Fixup section size
- e32_fixupsum: DWORD; // Fixup section checksum
- e32_ldrsize: DWORD; // Loader section size
- e32_ldrsum: DWORD; // Loader section checksum
- e32_objtab: DWORD; // Object table offset
- e32_objcnt: DWORD; // Number of objects in module
- e32_objmap: DWORD; // Object page map offset
- e32_itermap: DWORD; // Object iterated data map offset
- e32_rsrctab: DWORD; // Offset of Resource Table
- e32_rsrccnt: DWORD; // Number of resource entries
- e32_restab: DWORD; // Offset of resident name table
- e32_enttab: DWORD; // Offset of Entry Table
- e32_dirtab: DWORD; // Offset of Module Directive Table
- e32_dircnt: DWORD; // Number of module directives
- e32_fpagetab: DWORD; // Offset of Fixup Page Table
- e32_frectab: DWORD; // Offset of Fixup Record Table
- e32_impmod: DWORD; // Offset of Import Module Name Table
- e32_impmodcnt: DWORD; // Number of entries in Import Module Name Table
- e32_impproc: DWORD; // Offset of Import Procedure Name Table
- e32_pagesum: DWORD; // Offset of Per-Page Checksum Table
- e32_datapage: DWORD; // Offset of Enumerated Data Pages
- e32_preload: DWORD; // Number of preload pages
- e32_nrestab: DWORD; // Offset of Non-resident Names Table
- e32_cbnrestab: DWORD; // Size of Non-resident Name Table
- e32_nressum: DWORD; // Non-resident Name Table Checksum
- e32_autodata: DWORD; // Object # for automatic data object
- e32_debuginfo: DWORD; // Offset of the debugging information
- e32_debuglen: DWORD; // The length of the debugging info. in bytes
- e32_instpreload: DWORD; // Number of instance pages in preload section of VXD file
- e32_instdemand: DWORD; // Number of instance pages in demand load section of VXD file
- e32_heapsize: DWORD; // Size of heap - for 16-bit apps
- e32_res3: array [0..11] of Byte; // Reserved words
- e32_winresoff: DWORD;
- e32_winreslen: DWORD;
- e32_devid: Word; // Device ID for VxD
- e32_ddkver: Word; // DDK version for VxD
- end;
- {$EXTERNALSYM _IMAGE_VXD_HEADER}
- IMAGE_VXD_HEADER = _IMAGE_VXD_HEADER;
- {$EXTERNALSYM IMAGE_VXD_HEADER}
- TImageVxdHeader = IMAGE_VXD_HEADER;
- PImageVxdHeader = PIMAGE_VXD_HEADER;
- // #include "poppack.h" // Back to 4 byte packing
- //
- // File header format.
- //
- PIMAGE_FILE_HEADER = ^IMAGE_FILE_HEADER;
- {$EXTERNALSYM PIMAGE_FILE_HEADER}
- _IMAGE_FILE_HEADER = record
- Machine: WORD;
- NumberOfSections: WORD;
- TimeDateStamp: DWORD;
- PointerToSymbolTable: DWORD;
- NumberOfSymbols: DWORD;
- SizeOfOptionalHeader: WORD;
- Characteristics: WORD;
- end;
- {$EXTERNALSYM _IMAGE_FILE_HEADER}
- IMAGE_FILE_HEADER = _IMAGE_FILE_HEADER;
- {$EXTERNALSYM IMAGE_FILE_HEADER}
- TImageFileHeader = IMAGE_FILE_HEADER;
- PImageFileHeader = PIMAGE_FILE_HEADER;
- const
- IMAGE_SIZEOF_FILE_HEADER = 20;
- {$EXTERNALSYM IMAGE_SIZEOF_FILE_HEADER}
- IMAGE_FILE_RELOCS_STRIPPED = $0001; // Relocation info stripped from file.
- {$EXTERNALSYM IMAGE_FILE_RELOCS_STRIPPED}
- IMAGE_FILE_EXECUTABLE_IMAGE = $0002; // File is executable (i.e. no unresolved externel references).
- {$EXTERNALSYM IMAGE_FILE_EXECUTABLE_IMAGE}
- IMAGE_FILE_LINE_NUMS_STRIPPED = $0004; // Line nunbers stripped from file.
- {$EXTERNALSYM IMAGE_FILE_LINE_NUMS_STRIPPED}
- IMAGE_FILE_LOCAL_SYMS_STRIPPED = $0008; // Local symbols stripped from file.
- {$EXTERNALSYM IMAGE_FILE_LOCAL_SYMS_STRIPPED}
- IMAGE_FILE_AGGRESIVE_WS_TRIM = $0010; // Agressively trim working set
- {$EXTERNALSYM IMAGE_FILE_AGGRESIVE_WS_TRIM}
- IMAGE_FILE_LARGE_ADDRESS_AWARE = $0020; // App can handle >2gb addresses
- {$EXTERNALSYM IMAGE_FILE_LARGE_ADDRESS_AWARE}
- IMAGE_FILE_BYTES_REVERSED_LO = $0080; // Bytes of machine word are reversed.
- {$EXTERNALSYM IMAGE_FILE_BYTES_REVERSED_LO}
- IMAGE_FILE_32BIT_MACHINE = $0100; // 32 bit word machine.
- {$EXTERNALSYM IMAGE_FILE_32BIT_MACHINE}
- IMAGE_FILE_DEBUG_STRIPPED = $0200; // Debugging info stripped from file in .DBG file
- {$EXTERNALSYM IMAGE_FILE_DEBUG_STRIPPED}
- IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = $0400; // If Image is on removable media, copy and run from the swap file.
- {$EXTERNALSYM IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP}
- IMAGE_FILE_NET_RUN_FROM_SWAP = $0800; // If Image is on Net, copy and run from the swap file.
- {$EXTERNALSYM IMAGE_FILE_NET_RUN_FROM_SWAP}
- IMAGE_FILE_SYSTEM = $1000; // System File.
- {$EXTERNALSYM IMAGE_FILE_SYSTEM}
- IMAGE_FILE_DLL = $2000; // File is a DLL.
- {$EXTERNALSYM IMAGE_FILE_DLL}
- IMAGE_FILE_UP_SYSTEM_ONLY = $4000; // File should only be run on a UP machine
- {$EXTERNALSYM IMAGE_FILE_UP_SYSTEM_ONLY}
- IMAGE_FILE_BYTES_REVERSED_HI = $8000; // Bytes of machine word are reversed.
- {$EXTERNALSYM IMAGE_FILE_BYTES_REVERSED_HI}
- IMAGE_FILE_MACHINE_UNKNOWN = 0;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_UNKNOWN}
- IMAGE_FILE_MACHINE_I386 = $014c; // Intel 386.
- {$EXTERNALSYM IMAGE_FILE_MACHINE_I386}
- IMAGE_FILE_MACHINE_R3000 = $0162; // MIPS little-endian, 0x160 big-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_R3000}
- IMAGE_FILE_MACHINE_R4000 = $0166; // MIPS little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_R4000}
- IMAGE_FILE_MACHINE_R10000 = $0168; // MIPS little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_R10000}
- IMAGE_FILE_MACHINE_WCEMIPSV2 = $0169; // MIPS little-endian WCE v2
- {$EXTERNALSYM IMAGE_FILE_MACHINE_WCEMIPSV2}
- IMAGE_FILE_MACHINE_ALPHA = $0184; // Alpha_AXP
- {$EXTERNALSYM IMAGE_FILE_MACHINE_ALPHA}
- IMAGE_FILE_MACHINE_SH3 = $01a2; // SH3 little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_SH3}
- IMAGE_FILE_MACHINE_SH3DSP = $01a3;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_SH3DSP}
- IMAGE_FILE_MACHINE_SH3E = $01a4; // SH3E little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_SH3E}
- IMAGE_FILE_MACHINE_SH4 = $01a6; // SH4 little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_SH4}
- IMAGE_FILE_MACHINE_SH5 = $01a8; // SH5
- {$EXTERNALSYM IMAGE_FILE_MACHINE_SH5}
- IMAGE_FILE_MACHINE_ARM = $01c0; // ARM Little-Endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_ARM}
- IMAGE_FILE_MACHINE_THUMB = $01c2;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_THUMB}
- IMAGE_FILE_MACHINE_AM33 = $01d3;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_AM33}
- IMAGE_FILE_MACHINE_POWERPC = $01F0; // IBM PowerPC Little-Endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_POWERPC}
- IMAGE_FILE_MACHINE_POWERPCFP = $01f1;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_POWERPCFP}
- IMAGE_FILE_MACHINE_IA64 = $0200; // Intel 64
- {$EXTERNALSYM IMAGE_FILE_MACHINE_IA64}
- IMAGE_FILE_MACHINE_MIPS16 = $0266; // MIPS
- {$EXTERNALSYM IMAGE_FILE_MACHINE_MIPS16}
- IMAGE_FILE_MACHINE_ALPHA64 = $0284; // ALPHA64
- {$EXTERNALSYM IMAGE_FILE_MACHINE_ALPHA64}
- IMAGE_FILE_MACHINE_MIPSFPU = $0366; // MIPS
- {$EXTERNALSYM IMAGE_FILE_MACHINE_MIPSFPU}
- IMAGE_FILE_MACHINE_MIPSFPU16 = $0466; // MIPS
- {$EXTERNALSYM IMAGE_FILE_MACHINE_MIPSFPU16}
- IMAGE_FILE_MACHINE_AXP64 = IMAGE_FILE_MACHINE_ALPHA64;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_AXP64}
- IMAGE_FILE_MACHINE_TRICORE = $0520; // Infineon
- {$EXTERNALSYM IMAGE_FILE_MACHINE_TRICORE}
- IMAGE_FILE_MACHINE_CEF = $0CEF;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_CEF}
- IMAGE_FILE_MACHINE_EBC = $0EBC; // EFI Byte Code
- {$EXTERNALSYM IMAGE_FILE_MACHINE_EBC}
- IMAGE_FILE_MACHINE_AMD64 = $8664; // AMD64 (K8)
- {$EXTERNALSYM IMAGE_FILE_MACHINE_AMD64}
- IMAGE_FILE_MACHINE_M32R = $9041; // M32R little-endian
- {$EXTERNALSYM IMAGE_FILE_MACHINE_M32R}
- IMAGE_FILE_MACHINE_CEE = $C0EE;
- {$EXTERNALSYM IMAGE_FILE_MACHINE_CEE}
- //
- // Directory format.
- //
- type
- PIMAGE_DATA_DIRECTORY = ^IMAGE_DATA_DIRECTORY;
- {$EXTERNALSYM PIMAGE_DATA_DIRECTORY}
- _IMAGE_DATA_DIRECTORY = record
- VirtualAddress: DWORD;
- Size: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_DATA_DIRECTORY}
- IMAGE_DATA_DIRECTORY = _IMAGE_DATA_DIRECTORY;
- {$EXTERNALSYM IMAGE_DATA_DIRECTORY}
- TImageDataDirectory = IMAGE_DATA_DIRECTORY;
- PImageDataDirectory = PIMAGE_DATA_DIRECTORY;
- const
- IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16;
- {$EXTERNALSYM IMAGE_NUMBEROF_DIRECTORY_ENTRIES}
- //
- // Optional header format.
- //
- type
- PIMAGE_OPTIONAL_HEADER32 = ^IMAGE_OPTIONAL_HEADER32;
- {$EXTERNALSYM PIMAGE_OPTIONAL_HEADER32}
- _IMAGE_OPTIONAL_HEADER = record
- //
- // Standard fields.
- //
- Magic: Word;
- MajorLinkerVersion: Byte;
- MinorLinkerVersion: Byte;
- SizeOfCode: DWORD;
- SizeOfInitializedData: DWORD;
- SizeOfUninitializedData: DWORD;
- AddressOfEntryPoint: DWORD;
- BaseOfCode: DWORD;
- BaseOfData: DWORD;
- //
- // NT additional fields.
- //
- ImageBase: DWORD;
- SectionAlignment: DWORD;
- FileAlignment: DWORD;
- MajorOperatingSystemVersion: Word;
- MinorOperatingSystemVersion: Word;
- MajorImageVersion: Word;
- MinorImageVersion: Word;
- MajorSubsystemVersion: Word;
- MinorSubsystemVersion: Word;
- Win32VersionValue: DWORD;
- SizeOfImage: DWORD;
- SizeOfHeaders: DWORD;
- CheckSum: DWORD;
- Subsystem: Word;
- DllCharacteristics: Word;
- SizeOfStackReserve: DWORD;
- SizeOfStackCommit: DWORD;
- SizeOfHeapReserve: DWORD;
- SizeOfHeapCommit: DWORD;
- LoaderFlags: DWORD;
- NumberOfRvaAndSizes: DWORD;
- DataDirectory: array [0..IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1] of IMAGE_DATA_DIRECTORY;
- end;
- {$EXTERNALSYM _IMAGE_OPTIONAL_HEADER}
- IMAGE_OPTIONAL_HEADER32 = _IMAGE_OPTIONAL_HEADER;
- {$EXTERNALSYM IMAGE_OPTIONAL_HEADER32}
- TImageOptionalHeader32 = IMAGE_OPTIONAL_HEADER32;
- PImageOptionalHeader32 = PIMAGE_OPTIONAL_HEADER32;
- PIMAGE_ROM_OPTIONAL_HEADER = ^IMAGE_ROM_OPTIONAL_HEADER;
- {$EXTERNALSYM PIMAGE_ROM_OPTIONAL_HEADER}
- _IMAGE_ROM_OPTIONAL_HEADER = record
- Magic: Word;
- MajorLinkerVersion: Byte;
- MinorLinkerVersion: Byte;
- SizeOfCode: DWORD;
- SizeOfInitializedData: DWORD;
- SizeOfUninitializedData: DWORD;
- AddressOfEntryPoint: DWORD;
- BaseOfCode: DWORD;
- BaseOfData: DWORD;
- BaseOfBss: DWORD;
- GprMask: DWORD;
- CprMask: array [0..3] of DWORD;
- GpValue: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_ROM_OPTIONAL_HEADER}
- IMAGE_ROM_OPTIONAL_HEADER = _IMAGE_ROM_OPTIONAL_HEADER;
- {$EXTERNALSYM IMAGE_ROM_OPTIONAL_HEADER}
- TImageRomOptionalHeader = IMAGE_ROM_OPTIONAL_HEADER;
- PImageRomOptionalHeader = PIMAGE_ROM_OPTIONAL_HEADER;
- PIMAGE_OPTIONAL_HEADER64 = ^IMAGE_OPTIONAL_HEADER64;
- {$EXTERNALSYM PIMAGE_OPTIONAL_HEADER64}
- _IMAGE_OPTIONAL_HEADER64 = record
- Magic: Word;
- MajorLinkerVersion: Byte;
- MinorLinkerVersion: Byte;
- SizeOfCode: DWORD;
- SizeOfInitializedData: DWORD;
- SizeOfUninitializedData: DWORD;
- AddressOfEntryPoint: DWORD;
- BaseOfCode: DWORD;
- ImageBase: Int64;
- SectionAlignment: DWORD;
- FileAlignment: DWORD;
- MajorOperatingSystemVersion: Word;
- MinorOperatingSystemVersion: Word;
- MajorImageVersion: Word;
- MinorImageVersion: Word;
- MajorSubsystemVersion: Word;
- MinorSubsystemVersion: Word;
- Win32VersionValue: DWORD;
- SizeOfImage: DWORD;
- SizeOfHeaders: DWORD;
- CheckSum: DWORD;
- Subsystem: Word;
- DllCharacteristics: Word;
- SizeOfStackReserve: Int64;
- SizeOfStackCommit: Int64;
- SizeOfHeapReserve: Int64;
- SizeOfHeapCommit: Int64;
- LoaderFlags: DWORD;
- NumberOfRvaAndSizes: DWORD;
- DataDirectory: array [0..IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1] of IMAGE_DATA_DIRECTORY;
- end;
- {$EXTERNALSYM _IMAGE_OPTIONAL_HEADER64}
- IMAGE_OPTIONAL_HEADER64 = _IMAGE_OPTIONAL_HEADER64;
- {$EXTERNALSYM IMAGE_OPTIONAL_HEADER64}
- TImageOptionalHeader64 = IMAGE_OPTIONAL_HEADER64;
- PImageOptionalHeader64 = PIMAGE_OPTIONAL_HEADER64;
- const
- IMAGE_SIZEOF_ROM_OPTIONAL_HEADER = 56;
- {$EXTERNALSYM IMAGE_SIZEOF_ROM_OPTIONAL_HEADER}
- IMAGE_SIZEOF_STD_OPTIONAL_HEADER = 28;
- {$EXTERNALSYM IMAGE_SIZEOF_STD_OPTIONAL_HEADER}
- IMAGE_SIZEOF_NT_OPTIONAL32_HEADER = 224;
- {$EXTERNALSYM IMAGE_SIZEOF_NT_OPTIONAL32_HEADER}
- IMAGE_SIZEOF_NT_OPTIONAL64_HEADER = 240;
- {$EXTERNALSYM IMAGE_SIZEOF_NT_OPTIONAL64_HEADER}
- IMAGE_NT_OPTIONAL_HDR32_MAGIC = $10b;
- {$EXTERNALSYM IMAGE_NT_OPTIONAL_HDR32_MAGIC}
- IMAGE_NT_OPTIONAL_HDR64_MAGIC = $20b;
- {$EXTERNALSYM IMAGE_NT_OPTIONAL_HDR64_MAGIC}
- IMAGE_ROM_OPTIONAL_HDR_MAGIC = $107;
- {$EXTERNALSYM IMAGE_ROM_OPTIONAL_HDR_MAGIC}
- type
- IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER32;
- {$EXTERNALSYM IMAGE_OPTIONAL_HEADER}
- PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER32;
- {$EXTERNALSYM PIMAGE_OPTIONAL_HEADER}
- const
- IMAGE_SIZEOF_NT_OPTIONAL_HEADER = IMAGE_SIZEOF_NT_OPTIONAL32_HEADER;
- {$EXTERNALSYM IMAGE_SIZEOF_NT_OPTIONAL_HEADER}
- IMAGE_NT_OPTIONAL_HDR_MAGIC = IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- {$EXTERNALSYM IMAGE_NT_OPTIONAL_HDR_MAGIC}
- type
- PIMAGE_NT_HEADERS64 = ^IMAGE_NT_HEADERS64;
- {$EXTERNALSYM PIMAGE_NT_HEADERS64}
- _IMAGE_NT_HEADERS64 = record
- Signature: DWORD;
- FileHeader: IMAGE_FILE_HEADER;
- OptionalHeader: IMAGE_OPTIONAL_HEADER64;
- end;
- {$EXTERNALSYM _IMAGE_NT_HEADERS64}
- IMAGE_NT_HEADERS64 = _IMAGE_NT_HEADERS64;
- {$EXTERNALSYM IMAGE_NT_HEADERS64}
- TImageNtHeaders64 = IMAGE_NT_HEADERS64;
- PImageNtHeaders64 = PIMAGE_NT_HEADERS64;
- PIMAGE_NT_HEADERS32 = ^IMAGE_NT_HEADERS32;
- {$EXTERNALSYM PIMAGE_NT_HEADERS32}
- _IMAGE_NT_HEADERS = record
- Signature: DWORD;
- FileHeader: IMAGE_FILE_HEADER;
- OptionalHeader: IMAGE_OPTIONAL_HEADER32;
- end;
- {$EXTERNALSYM _IMAGE_NT_HEADERS}
- IMAGE_NT_HEADERS32 = _IMAGE_NT_HEADERS;
- {$EXTERNALSYM IMAGE_NT_HEADERS32}
- TImageNtHeaders32 = IMAGE_NT_HEADERS32;
- PImageNtHeaders32 = PIMAGE_NT_HEADERS32;
- PIMAGE_ROM_HEADERS = ^IMAGE_ROM_HEADERS;
- {$EXTERNALSYM PIMAGE_ROM_HEADERS}
- _IMAGE_ROM_HEADERS = record
- FileHeader: IMAGE_FILE_HEADER;
- OptionalHeader: IMAGE_ROM_OPTIONAL_HEADER;
- end;
- {$EXTERNALSYM _IMAGE_ROM_HEADERS}
- IMAGE_ROM_HEADERS = _IMAGE_ROM_HEADERS;
- {$EXTERNALSYM IMAGE_ROM_HEADERS}
- TImageRomHeaders = IMAGE_ROM_HEADERS;
- PImageRomHeaders = PIMAGE_ROM_HEADERS;
- IMAGE_NT_HEADERS = IMAGE_NT_HEADERS32;
- {$EXTERNALSYM IMAGE_NT_HEADERS}
- PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS32;
- {$EXTERNALSYM PIMAGE_NT_HEADERS}
- // Subsystem Values
- const
- IMAGE_SUBSYSTEM_UNKNOWN = 0; // Unknown subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_UNKNOWN}
- IMAGE_SUBSYSTEM_NATIVE = 1; // Image doesn't require a subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_NATIVE}
- IMAGE_SUBSYSTEM_WINDOWS_GUI = 2; // Image runs in the Windows GUI subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_WINDOWS_GUI}
- IMAGE_SUBSYSTEM_WINDOWS_CUI = 3; // Image runs in the Windows character subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_WINDOWS_CUI}
- IMAGE_SUBSYSTEM_OS2_CUI = 5; // image runs in the OS/2 character subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_OS2_CUI}
- IMAGE_SUBSYSTEM_POSIX_CUI = 7; // image runs in the Posix character subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_POSIX_CUI}
- IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8; // image is a native Win9x driver.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_NATIVE_WINDOWS}
- IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9; // Image runs in the Windows CE subsystem.
- {$EXTERNALSYM IMAGE_SUBSYSTEM_WINDOWS_CE_GUI}
- IMAGE_SUBSYSTEM_EFI_APPLICATION = 10;
- {$EXTERNALSYM IMAGE_SUBSYSTEM_EFI_APPLICATION}
- IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11;
- {$EXTERNALSYM IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER}
- IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12;
- {$EXTERNALSYM IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER}
- IMAGE_SUBSYSTEM_EFI_ROM = 13;
- {$EXTERNALSYM IMAGE_SUBSYSTEM_EFI_ROM}
- IMAGE_SUBSYSTEM_XBOX = 14;
- {$EXTERNALSYM IMAGE_SUBSYSTEM_XBOX}
- // DllCharacteristics Entries
- // IMAGE_LIBRARY_PROCESS_INIT 0x0001 // Reserved.
- // IMAGE_LIBRARY_PROCESS_TERM 0x0002 // Reserved.
- // IMAGE_LIBRARY_THREAD_INIT 0x0004 // Reserved.
- // IMAGE_LIBRARY_THREAD_TERM 0x0008 // Reserved.
- IMAGE_DLLCHARACTERISTICS_NO_BIND = $0800; // Do not bind this image.
- {$EXTERNALSYM IMAGE_DLLCHARACTERISTICS_NO_BIND}
- // 0x1000 // Reserved.
- IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = $2000; // Driver uses WDM model
- {$EXTERNALSYM IMAGE_DLLCHARACTERISTICS_WDM_DRIVER}
- // 0x4000 // Reserved.
- IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = $8000;
- {$EXTERNALSYM IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}
- // Directory Entries
- IMAGE_DIRECTORY_ENTRY_EXPORT = 0; // Export Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_EXPORT}
- IMAGE_DIRECTORY_ENTRY_IMPORT = 1; // Import Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_IMPORT}
- IMAGE_DIRECTORY_ENTRY_RESOURCE = 2; // Resource Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_RESOURCE}
- IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3; // Exception Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_EXCEPTION}
- IMAGE_DIRECTORY_ENTRY_SECURITY = 4; // Security Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_SECURITY}
- IMAGE_DIRECTORY_ENTRY_BASERELOC = 5; // Base Relocation Table
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_BASERELOC}
- IMAGE_DIRECTORY_ENTRY_DEBUG = 6; // Debug Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_DEBUG}
- // IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // (X86 usage)
- IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7; // Architecture Specific Data
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_ARCHITECTURE}
- IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8; // RVA of GP
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_GLOBALPTR}
- IMAGE_DIRECTORY_ENTRY_TLS = 9; // TLS Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_TLS}
- IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10; // Load Configuration Directory
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG}
- IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11; // Bound Import Directory in headers
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT}
- IMAGE_DIRECTORY_ENTRY_IAT = 12; // Import Address Table
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_IAT}
- IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13; // Delay Load Import Descriptors
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT}
- IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14; // COM Runtime descriptor
- {$EXTERNALSYM IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR}
- //
- // Non-COFF Object file header
- //
- type
- PAnonObjectHeader = ^ANON_OBJECT_HEADER;
- ANON_OBJECT_HEADER = record
- Sig1: Word; // Must be IMAGE_FILE_MACHINE_UNKNOWN
- Sig2: Word; // Must be 0xffff
- Version: Word; // >= 1 (implies the CLSID field is present)
- Machine: Word;
- TimeDateStamp: DWORD;
- ClassID: CLSID; // Used to invoke CoCreateInstance
- SizeOfData: DWORD; // Size of data that follows the header
- end;
- {$EXTERNALSYM ANON_OBJECT_HEADER}
- TAnonObjectHeader = ANON_OBJECT_HEADER;
- //
- // Section header format.
- //
- const
- IMAGE_SIZEOF_SHORT_NAME = 8;
- {$EXTERNALSYM IMAGE_SIZEOF_SHORT_NAME}
- type
- TImgSecHdrMisc = record
- case Integer of
- 0: (PhysicalAddress: DWORD);
- 1: (VirtualSize: DWORD);
- end;
- PIMAGE_SECTION_HEADER = ^IMAGE_SECTION_HEADER;
- {$EXTERNALSYM PIMAGE_SECTION_HEADER}
- _IMAGE_SECTION_HEADER = record
- Name: array [0..IMAGE_SIZEOF_SHORT_NAME - 1] of BYTE;
- Misc: TImgSecHdrMisc;
- VirtualAddress: DWORD;
- SizeOfRawData: DWORD;
- PointerToRawData: DWORD;
- PointerToRelocations: DWORD;
- PointerToLinenumbers: DWORD;
- NumberOfRelocations: WORD;
- NumberOfLinenumbers: WORD;
- Characteristics: DWORD;
- end;
- {$EXTERNALSYM _IMAGE_SECTION_HEADER}
- IMAGE_SECTION_HEADER = _IMAGE_SECTION_HEADER;
- {$EXTERNALSYM IMAGE_SECTION_HEADER}
- TImageSectionHeader = IMAGE_SECTION_HEADER;
- PImageSectionHeader = PIMAGE_SECTION_HEADER;
- const
- IMAGE_SIZEOF_SECTION_HEADER = 40;
- {$EXTERNALSYM IMAGE_SIZEOF_SECTION_HEADER}
- //
- // Section characteristics.
- //
- // IMAGE_SCN_TYPE_REG 0x00000000 // Reserved.
- // IMAGE_SCN_TYPE_DSECT 0x00000001 // Reserved.
- // IMAGE_SCN_TYPE_NOLOAD 0x00000002 // Reserved.
- // IMAGE_SCN_TYPE_GROUP 0x00000004 // Reserved.
- IMAGE_SCN_TYPE_NO_PAD = $00000008; // Reserved.
- {$EXTERNALSYM IMAGE_SCN_TYPE_NO_PAD}
- // IMAGE_SCN_TYPE_COPY 0x00000010 // Reserved.
- IMAGE_SCN_CNT_CODE = $00000020; // Section contains code.
- {$EXTERNALSYM IMAGE_SCN_CNT_CODE}
- IMAGE_SCN_CNT_INITIALIZED_DATA = $00000040; // Section contains initialized data.
- {$EXTERNALSYM IMAGE_SCN_CNT_INITIALIZED_DATA}
- IMAGE_SCN_CNT_UNINITIALIZED_DATA = $00000080; // Section contains uninitialized data.
- {$EXTERNALSYM IMAGE_SCN_CNT_UNINITIALIZED_DATA}
- IMAGE_SCN_LNK_OTHER = $00000100; // Reserved.
- {$EXTERNALSYM IMAGE_SCN_LNK_OTHER}
- IMAGE_SCN_LNK_INFO = $00000200; // Section contains comments or some other type of information.
- {$EXTERNALSYM IMAGE_SCN_LNK_INFO}
- // IMAGE_SCN_TYPE_OVER 0x00000400 // Reserved.
- IMAGE_SCN_LNK_REMOVE = $00000800; // Section contents will not become part of image.
- {$EXTERNALSYM IMAGE_SCN_LNK_REMOVE}
- IMAGE_SCN_LNK_COMDAT = $00001000; // Section contents comdat.
- {$EXTERNALSYM IMAGE_SCN_LNK_COMDAT}
- // 0x00002000 // Reserved.
- // IMAGE_SCN_MEM_PROTECTED - Obsolete 0x00004000
- IMAGE_SCN_NO_DEFER_SPEC_EXC = $00004000; // Reset speculative exceptions handling bits in the TLB entries for this section.
- {$EXTERNALSYM IMAGE_SCN_NO_DEFER_SPEC_EXC}
- IMAGE_SCN_GPREL = $00008000; // Section content can be accessed relative to GP
- {$EXTERNALSYM IMAGE_SCN_GPREL}
- IMAGE_SCN_MEM_FARDATA = $00008000;
- {$EXTERNALSYM IMAGE_SCN_MEM_FARDATA}
- // IMAGE_SCN_MEM_SYSHEAP - Obsolete 0x00010000
- IMAGE_SCN_MEM_PURGEABLE = $00020000;
- {$EXTERNALSYM IMAGE_SCN_MEM_PURGEABLE}
- IMAGE_SCN_MEM_16BIT = $00020000;
- {$EXTERNALSYM IMAGE_SCN_MEM_16BIT}
- IMAGE_SCN_MEM_LOCKED = $00040000;
- {$EXTERNALSYM IMAGE_SCN_MEM_LOCKED}
- IMAGE_SCN_MEM_PRELOAD = $00080000;
- {$EXTERNALSYM IMAGE_SCN_MEM_PRELOAD}
- IMAGE_SCN_ALIGN_1BYTES = $00100000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_1BYTES}
- IMAGE_SCN_ALIGN_2BYTES = $00200000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_2BYTES}
- IMAGE_SCN_ALIGN_4BYTES = $00300000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_4BYTES}
- IMAGE_SCN_ALIGN_8BYTES = $00400000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_8BYTES}
- IMAGE_SCN_ALIGN_16BYTES = $00500000; // Default alignment if no others are specified.
- {$EXTERNALSYM IMAGE_SCN_ALIGN_16BYTES}
- IMAGE_SCN_ALIGN_32BYTES = $00600000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_32BYTES}
- IMAGE_SCN_ALIGN_64BYTES = $00700000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_64BYTES}
- IMAGE_SCN_ALIGN_128BYTES = $00800000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_128BYTES}
- IMAGE_SCN_ALIGN_256BYTES = $00900000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_256BYTES}
- IMAGE_SCN_ALIGN_512BYTES = $00A00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_512BYTES}
- IMAGE_SCN_ALIGN_1024BYTES = $00B00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_1024BYTES}
- IMAGE_SCN_ALIGN_2048BYTES = $00C00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_2048BYTES}
- IMAGE_SCN_ALIGN_4096BYTES = $00D00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_4096BYTES}
- IMAGE_SCN_ALIGN_8192BYTES = $00E00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_8192BYTES}
- // Unused 0x00F00000
- IMAGE_SCN_ALIGN_MASK = $00F00000;
- {$EXTERNALSYM IMAGE_SCN_ALIGN_MASK}
- IMAGE_SCN_LNK_NRELOC_OVFL = $01000000; // Section contains extended relocations.
- {$EXTERNALSYM IMAGE_SCN_LNK_NRELOC_OVFL}
- IMAGE_SCN_MEM_DISCARDABLE = $02000000; // Section can be discarded.
- {$EXTERNALSYM IMAGE_SCN_MEM_DISCARDABLE}
- IMAGE_SCN_MEM_NOT_CACHED = $04000000; // Section is not cachable.
- {$EXTERNALSYM IMAGE_SCN_MEM_NOT_CACHED}
- IMAGE_SCN_MEM_NOT_PAGED = $08000000; // Section is not pageable.
- {$EXTERNALSYM IMAGE_SCN_MEM_NOT_PAGED}
- IMAGE_SCN_MEM_SHARED = $10000000; // Section is shareable.
- {$EXTERNALSYM IMAGE_SCN_MEM_SHARED}
- IMAGE_SCN_MEM_EXECUTE = $20000000; // Section is executable.
- {$EXTERNALSYM IMAGE_SCN_MEM_EXECUTE}
- IMAGE_SCN_MEM_READ = $40000000; // Section is readable.
- {$EXTERNALSYM IMAGE_SCN_MEM_READ}
- IMAGE_SCN_MEM_WRITE = DWORD($80000000); // Section is writeable.
- {$EXTERNALSYM IMAGE_SCN_MEM_WRITE}
- //
- // TLS Chaacteristic Flags
- //
- IMAGE_SCN_SCALE_INDEX = $00000001; // Tls index is scaled
- {$EXTERNALSYM IMAGE_SCN_SCALE_INDEX}
- // #include "pshpack2.h" // Symbols, relocs, and linenumbers are 2 byte packed
- //
- // Symbol format.
- //
- type
- TImageSymbolN = record
- case Integer of
- 0: (
- ShortName: array [0..7] of BYTE);
- 1: (
- Short: DWORD; // if 0, use LongName
- Long: DWORD); // offset into string table
- 2: (
- LongName: array [0..1] of DWORD);
- end;
- PIMAGE_SYMBOL = ^IMAGE_SYMBOL;
- {$EXTERNALSYM PIMAGE_SYMBOL}
- _IMAGE_SYMBOL = record
- N: TImageSymbolN;
- Value: DWORD;
- SectionNumber: SHORT;
- Type_: WORD;
- StorageClass: BYTE;
- NumberOfAuxSymbols: BYTE;
- end;
- {$EXTERNALSYM _IMAGE_SYMBOL}
- IMAGE_SYMBOL = _IMAGE_SYMBOL;
- {$EXTERNALSYM IMAGE_SYMBOL}
- TImageSymbol = IMAGE_SYMBOL;
- PImageSymbol = PIMAGE_SYMBOL;
- const
- IMAGE_SIZEOF_SYMBOL = 18;
- {$EXTERNALSYM IMAGE_SIZEOF_SYMBOL}
- //
- // Section values.
- //
- // Symbols have a section number of the section in which they are
- // defined. Otherwise, section numbers have the following meanings:
- //
- IMAGE_SYM_UNDEFINED = SHORT(0); // Symbol is undefined or is common.
- {$EXTERNALSYM IMAGE_SYM_UNDEFINED}
- IMAGE_SYM_ABSOLUTE = SHORT(-1); // Symbol is an absolute value.
- {$EXTERNALSYM IMAGE_SYM_ABSOLUTE}
- IMAGE_SYM_DEBUG = SHORT(-2); // Symbol is a special debug item.
- {$EXTERNALSYM IMAGE_SYM_DEBUG}
- IMAGE_SYM_SECTION_MAX = SHORT($FEFF ); // Values 0xFF00-0xFFFF are special
- {$EXTERNALSYM IMAGE_SYM_SECTION_MAX}
- //
- // Type (fundamental) values.
- //
- IMAGE_SYM_TYPE_NULL = $0000; // no type.
- {$EXTERNALSYM IMAGE_SYM_TYPE_NULL}
- IMAGE_SYM_TYPE_VOID = $0001;
- {$EXTERNALSYM IMAGE_SYM_TYPE_VOID}
- IMAGE_SYM_TYPE_CHAR = $0002; // type character.
- {$EXTERNALSYM IMAGE_SYM_TYPE_CHAR}
- IMAGE_SYM_TYPE_SHORT = $0003; // type short integer.
- {$EXTERNALSYM IMAGE_SYM_TYPE_SHORT}
- IMAGE_SYM_TYPE_INT = $0004;
- {$EXTERNALSYM IMAGE_SYM_TYPE_INT}
- IMAGE_SYM_TYPE_LONG = $0005;
- {$EXTERNALSYM IMAGE_SYM_TYPE_LONG}
- IMAGE_SYM_TYPE_FLOAT = $0006;
- {$EXTERNALSYM IMAGE_SYM_TYPE_FLOAT}
- IMAGE_SYM_TYPE_DOUBLE = $0007;
- {$EXTERNALSYM IMAGE_SYM_TYPE_DOUBLE}
- IMAGE_SYM_TYPE_STRUCT = $0008;
- {$EXTERNALSYM IMAGE_SYM_TYPE_STRUCT}
- IMAGE_SYM_TYPE_UNION = $0009;
- {$EXTERNALSYM IMAGE_SYM_TYPE_UNION}
- IMAGE_SYM_TYPE_ENUM = $000A; // enumeration.
- {$EXTERNALSYM IMAGE_SYM_TYPE_ENUM}
- IMAGE_SYM_TYPE_MOE = $000B; // member of enumeration.
- {$EXTERNALSYM IMAGE_SYM_TYPE_MOE}
- IMAGE_SYM_TYPE_BYTE = $000C;
- {$EXTERNALSYM IMAGE_SYM_TYPE_BYTE}
- IMAGE_SYM_TYPE_WORD = $000D;
- {$EXTERNALSYM IMAGE_SYM_TYPE_WORD}
- IMAGE_SYM_TYPE_UINT = $000E;
- {$EXTERNALSYM IMAGE_SYM_TYPE_UINT}
- IMAGE_SYM_TYPE_DWORD = $000F;
- {$EXTERNALSYM IMAGE_SYM_TYPE_DWORD}
- IMAGE_SYM_TYPE_PCODE = $8000;
- {$EXTERNALSYM IMAGE_SYM_TYPE_PCODE}
- //
- // Type (derived) values.
- //
- IMAGE_SYM_DTYPE_NULL = 0; // no derived type.
- {$EXTERNALSYM IMAGE_SYM_DTYPE_NULL}
- IMAGE_SYM_DTYPE_POINTER = 1; // pointer.
- {$EXTERNALSYM IMAGE_SYM_DTYPE_POINTER}
- IMAGE_SYM_DTYPE_FUNCTION = 2; // function.
- {$EXTERNALSYM IMAGE_SYM_DTYPE_FUNCTION}
- IMAGE_SYM_DTYPE_ARRAY = 3; // array.
- {$EXTERNALSYM IMAGE_SYM_DTYPE_ARRAY}
- //
- // Storage classes.
- //
- IMAGE_SYM_CLASS_END_OF_FUNCTION = BYTE(-1);
- {$EXTERNALSYM IMAGE_SYM_CLASS_END_OF_FUNCTION}
- IMAGE_SYM_CLASS_NULL = $0000;
- {$EXTERNALSYM IMAGE_SYM_CLASS_NULL}
- IMAGE_SYM_CLASS_AUTOMATIC = $0001;
- {$EXTERNALSYM IMAGE_SYM_CLASS_AUTOMATIC}
- IMAGE_SYM_CLASS_EXTERNAL = $0002;
- {$EXTERNALSYM IMAGE_SYM_CLASS_EXTERNAL}
- IMAGE_SYM_CLASS_STATIC = $0003;
- {$EXTERNALSYM IMAGE_SYM_CLASS_STATIC}
- IMAGE_SYM_CLASS_REGISTER = $0004;
- {$EXTERNALSYM IMAGE_SYM_CLASS_REGISTER}
- IMAGE_SYM_CLASS_EXTERNAL_DEF = $0005;
- {$EXTERNALSYM IMAGE_SYM_CLASS_EXTERNAL_DEF}
- IMAGE_SYM_CLASS_LABEL = $0006;
- {$EXTERNALSYM IMAGE_SYM_CLASS_LABEL}
- IMAGE_SYM_CLASS_UNDEFINED_LABEL = $0007;
- {$EXTERNALSYM IMAGE_SYM_CLASS_UNDEFINED_LABEL}
- IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = $0008;
- {$EXTERNALSYM IMAGE_SYM_CLASS_MEMBER_OF_STRUCT}
- IMAGE_SYM_CLASS_ARGUMENT = $0009;
- {$EXTERNALSYM IMAGE_SYM_CLASS_ARGUMENT}
- IMAGE_SYM_CLASS_STRUCT_TAG = $000A;
- {$EXTERNALSYM IMAGE_SYM_CLASS_STRUCT_TAG}
- IMAGE_SYM_CLASS_MEMBER_OF_UNION = $000B;
- {$EXTERNALSYM IMAGE_SYM_CLASS_MEMBER_OF_UNION}
- IMAGE_SYM_CLASS_UNION_TAG = $000C;
- {$EXTERNALSYM IMAGE_SYM_CLASS_UNION_TAG}
- IMAGE_SYM_CLASS_TYPE_DEFINITION = $000D;
- {$EXTERNALSYM IMAGE_SYM_CLASS_TYPE_DEFINITION}
- IMAGE_SYM_CLASS_UNDEFINED_STATIC = $000E;
- {$EXTERNALSYM IMAGE_SYM_CLASS_UNDEFINED_STATIC}
- IMAGE_SYM_CLASS_ENUM_TAG = $000F;
- {$EXTERNALSYM IMAGE_SYM_CLASS_ENUM_TAG}
- IMAGE_SYM_CLASS_MEMBER_OF_ENUM = $0010;
- {$EXTERNALSYM IMAGE_SYM_CLASS_MEMBER_OF_ENUM}
- IMAGE_SYM_CLASS_REGISTER_PARAM = $0011;
- {$EXTERNALSYM IMAGE_SYM_CLASS_REGISTER_PARAM}
- IMAGE_SYM_CLASS_BIT_FIELD = $0012;
- {$EXTERNALSYM IMAGE_SYM_CLASS_BIT_FIELD}
- IMAGE_SYM_CLASS_FAR_EXTERNAL = $0044;
- {$EXTERNALSYM IMAGE_SYM_CLASS_FAR_EXTERNAL}
- IMAGE_SYM_CLASS_BLOCK = $0064;
- {$EXTERNALSYM IMAGE_SYM_CLASS_BLOCK}
- IMAGE_SYM_CLASS_FUNCTION = $0065;
- {$EXTERNALSYM IMAGE_SYM_CLASS_FUNCTION}
- IMAGE_SYM_CLASS_END_OF_STRUCT = $0066;
- {$EXTERNALSYM IMAGE_SYM_CLASS_END_OF_STRUCT}
- IMAGE_SYM_CLASS_FILE = $0067;
- {$EXTERNALSYM IMAGE_SYM_CLASS_FILE}
- // new
- IMAGE_SYM_CLASS_SECTION = $0068;
- {$EXTERNALSYM IMAGE_SYM_CLASS_SECTION}
- IMAGE_SYM_CLASS_WEAK_EXTERNAL = $0069;
- {$EXTERNALSYM IMAGE_SYM_CLASS_WEAK_EXTERNAL}
- IMAGE_SYM_CLASS_CLR_TOKEN = $006B;
- {$EXTERNALSYM IMAGE_SYM_CLASS_CLR_TOKEN}
- // type packing constants
- N_BTMASK = $000F;
- {$EXTERNALSYM N_BTMASK}
- N_TMASK = $0030;
- {$EXTERNALSYM N_TMASK}
- N_TMASK1 = $00C0;
- {$EXTERNALSYM N_TMASK1}
- N_TMASK2 = $00F0;
- {$EXTERNALSYM N_TMASK2}
- N_BTSHFT = 4;
- {$EXTERNALSYM N_BTSHFT}
- N_TSHIFT = 2;
- {$EXTERNALSYM N_TSHIFT}
- // MACROS
- // Basic Type of x
- function BTYPE(x: DWORD): DWORD;
- {$EXTERNALSYM BTYPE}
- // Is x a pointer?
- function ISPTR(x: DWORD): Boolean;
- {$EXTERNALSYM ISPTR}
- // Is x a function?
- function ISFCN(x: DWORD): Boolean;
- {$EXTERNALSYM ISFCN}
- // Is x an array?
- function ISARY(x: DWORD): Boolean;
- {$EXTERNALSYM ISARY}
- // Is x a structure, union, or enumeration TAG?
- function ISTAG(x: DWORD): Boolean;
- {$EXTERNALSYM ISTAG}
- //
- // Auxiliary entry format.
- //
- type
- TImgAuzSymSymMisc = record
- case Integer of
- 0: (
- Linenumber: WORD; // declaration line number
- Size: WORD); // size of struct, union, or enum
- 1: (
- TotalSize: DWORD);
- end;
- TImgAuzSymSymFcnAry = record
- case Integer of
- 0: ( // if ISFCN, tag, or .bb
- PointerToLinenumber: DWORD;
- PointerToNextFunction: DWORD);
- 1: ( // if ISARY, up to 4 dimen.
- Dimension: array [0..3] of WORD);
- end;
- TImgAuxSymSym = record
- TagIndex: DWORD; // struct, union, or enum tag index
- Misc: TImgAuzSymSymMisc;
- FcnAry: TImgAuzSymSymFcnAry;
- TvIndex: WORD; // tv index
- end;
- TImgAuxSymFile = record
- Name: array [0..IMAGE_SIZEOF_SYMBOL - 1] of BYTE;
- end;
- TImgAuxSymSection = record
- Length: DWORD; // section length
- NumberOfRelocations: WORD; // number of relocation entries
- NumberOfLinenumbers: WORD; // number of line numbers
- CheckSum: DWORD; // checksum for communal
- Number: SHORT; // section number to associate with
- Selection: BYTE; // communal selection type
- end;
- PIMAGE_AUX_SYMBOL = ^IMAGE_AUX_SYMBOL;
- {$EXTERNALSYM PIMAGE_AUX_SYMBOL}
- _IMAGE_AUX_SYMBOL = record
- case Integer of
- 0: (Sym: TImgAuxSymSym);
- 1: (File_: TImgAuxSymFile);
- 2: (Section: TImgAuxSymSection);
- end;
- {$EXTERNALSYM _IMAGE_AUX_SYMBOL}
- IMAGE_AUX_SYMBOL = _IMAGE_AUX_SYMBOL;
- {$EXTERNALSYM IMAGE_AUX_SYMBOL}
- TImageAuxSymbol = IMAGE_AUX_SYMBOL;
- PImageAuxSymbol = PIMAGE_AUX_SYMBOL;
- const
- IMAGE_SIZEOF_AUX_SYMBOL = 18;
- {$EXTERNALSYM IMAGE_SIZEOF_AUX_SYMBOL}
- IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1;
- {$EXTERNALSYM IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF}
- type
- IMAGE_AUX_SYMBOL_TYPE = DWORD;
- {$EXTERNALSYM IMAGE_AUX_SYMBOL_TYPE}
- TImageAuxSymbolType = IMAGE_AUX_SYMBOL_TYPE;
- IMAGE_AUX_SYMBOL_TOKEN_DEF = packed record
- bAuxType: BYTE; // IMAGE_AUX_SYMBOL_TYPE
- bReserved: BYTE; // Must be 0
- SymbolTableIndex: DWORD;
- rgbReserved: array [0..11] of BYTE; // Must be 0
- end;
- {$EXTERNALSYM IMAGE_AUX_SYMBOL_TOKEN_DEF}
- PIMAGE_AUX_SYMBOL_TOKEN_DEF = ^IMAGE_AUX_SYMBOL_TOKEN_DEF;
- {$EXTERNALSYM PIMAGE_AUX_SYMBOL_TOKEN_DEF}
- TImageAuxSymbolTokenDef = IMAGE_AUX_SYMBOL_TOKEN_DEF;
- PImageAuxSymbolTokenDef = PIMAGE_AUX_SYMBOL_TOKEN_DEF;
- //
- // Communal selection types.
- //
- const
- IMAGE_COMDAT_SELECT_NODUPLICATES = 1;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_NODUPLICATES}
- IMAGE_COMDAT_SELECT_ANY = 2;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_ANY}
- IMAGE_COMDAT_SELECT_SAME_SIZE = 3;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_SAME_SIZE}
- IMAGE_COMDAT_SELECT_EXACT_MATCH = 4;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_EXACT_MATCH}
- IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_ASSOCIATIVE}
- IMAGE_COMDAT_SELECT_LARGEST = 6;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_LARGEST}
- IMAGE_COMDAT_SELECT_NEWEST = 7;
- {$EXTERNALSYM IMAGE_COMDAT_SELECT_NEWEST}
- IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY = 1;
- {$EXTERNALSYM IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY}
- IMAGE_WEAK_EXTERN_SEARCH_LIBRARY = 2;
- {$EXTERNALSYM IMAGE_WEAK_EXTERN_SEARCH_LIBRARY}
- IMAGE_WEAK_EXTERN_SEARCH_ALIAS = 3;
- {$EXTERNALSYM IMAGE_WEAK_EXTERN_SEARCH_ALIAS}
- //
- // Relocation format.
- //
- type
- TImgRelocUnion = record
- case Integer of
- 0: (VirtualAddress: DWORD);
- 1: (RelocCount: DWORD); // Set to the real count when IMAGE_SCN_LNK_NRELOC_OVFL is set
- end;
- PIMAGE_RELOCATION = ^IMAGE_RELOCATION;
- {$EXTERNALSYM PIMAGE_RELOCATION}
- _IMAGE_RELOCATION = record
- Union: TImgRelocUnion;
- SymbolTableIndex: DWORD;
- Type_: WORD;
- end;
- {$EXTERNALSYM _IMAGE_RELOCATION}
- IMAGE_RELOCATION = _IMAGE_RELOCATION;
- {$EXTERNALSYM IMAGE_RELOCATION}
- TImageRelocation = IMAGE_RELOCATION;
- PImageRelocation = PIMAGE_RELOCATION;
- const
- IMAGE_SIZEOF_RELOCATION = 10;
- {$EXTERNALSYM IMAGE_SIZEOF_RELOCATION}
- //
- // I386 relocation types.
- //
- IMAGE_REL_I386_ABSOLUTE = $0000; // Reference is absolute, no relocation is necessary
- {$EXTERNALSYM IMAGE_REL_I386_ABSOLUTE}
- IMAGE_REL_I386_DIR16 = $0001; // Direct 16-bit reference to the symbols virtual address
- {$EXTERNALSYM IMAGE_REL_I386_DIR16}
- IMAGE_REL_I386_REL16 = $0002; // PC-relative 16-bit reference to the symbols virtual address
- {$EXTERNALSYM IMAGE_REL_I386_REL16}
- IMAGE_REL_I386_DIR32 = $0006; // Direct 32-bit reference to the symbols virtual address
- {$EXTERNALSYM IMAGE_REL_I386_DIR32}
- IMAGE_REL_I386_DIR32NB = $0007; // Direct 32-bit reference to the symbols virtual address, base not included
- {$EXTERNALSYM IMAGE_REL_I386_DIR32NB}
- IMAGE_REL_I386_SEG12 = $0009; // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
- {$EXTERNALSYM IMAGE_REL_I386_SEG12}
- IMAGE_REL_I386_SECTION = $000A;
- {$EXTERNALSYM IMAGE_REL_I386_SECTION}
- IMAGE_REL_I386_SECREL = $000B;
- {$EXTERNALSYM IMAGE_REL_I386_SECREL}
- IMAGE_REL_MIPS_SECRELLO = $000C; // Low 16-bit section relative referemce (used for >32k TLS)
- {$EXTERNALSYM IMAGE_REL_MIPS_SECRELLO}
- IMAGE_REL_MIPS_SECRELHI = $000D; // High 16-bit section relative reference (used for >32k TLS)
- {$EXTERNALSYM IMAGE_REL_MIPS_SECRELHI}
- IMAGE_REL_I386_REL32 = $0014; // PC-relative 32-bit reference to the symbols virtual address
- {$EXTERNALSYM IMAGE_REL_I386_REL32}
- //
- // MIPS relocation types.
- //
- IMAGE_REL_MIPS_ABSOLUTE = $0000; // Reference is absolute, no relocation is necessary
- {$EXTERNALSYM IMAGE_REL_MIPS_ABSOLUTE}
- IMAGE_REL_MIPS_REFHALF = $0001;
- {$EXTERNALSYM IMAGE_REL_MIPS_REFHALF}
- IMAGE_REL_MIPS_REFWORD = $0002;
- {$EXTERNALSYM IMAGE_REL_MIPS_REFWORD}
- IMAGE_REL_MIPS_JMPADDR = $0003;
- {$EXTERNALSYM IMAGE_REL_MIPS_JMPADDR}
- IMAGE_REL_MIPS_REFHI = $0004;
- {$EXTERNALSYM IMAGE_REL_MIPS_REFHI}
- IMAGE_REL_MIPS_REFLO = $0005;
- {$EXTERNALSYM IMAGE_REL_MIPS_REFLO}
- IMAGE_REL_MIPS_GPREL = $0006;
- {$EXTERNALSYM IMAGE_REL_MIPS_GPREL}
- IMAGE_REL_MIPS_LITERAL = $0007;
- {$EXTERNALSYM IMAGE_REL_MIPS_LITERAL}
- IMAGE_REL_MIPS_SECTION = $000A;
- {$EXTERNALSYM IMAGE_REL_MIPS_SECTION}
- IMAGE_REL_MIPS_SECREL = $000B;
- {$EXTERNALSYM IMAGE_REL_MIPS_SECREL}
- //IMAGE_REL_MIPS_SECRELLO = $000C; // Low 16-bit section relative referemce (used for >32k TLS)
- //{$EXTERNALSYM IMAGE_REL_MIPS_SECRELLO}
- //IMAGE_REL_MIPS_SECRELHI = $000D; // High 16-bit section relative reference (used for >32k TLS)
- //{$EXTERNALSYM IMAGE_REL_MIPS_SECRELHI}
- IMAGE_REL_MIPS_TOKEN = $000E; // clr token
- {$EXTERNALSYM IMAGE_REL_MIPS_TOKEN}
- IMAGE_REL_MIPS_JMPADDR16 = $0010;
- {$EXTERNALSYM IMAGE_REL_MIPS_JMPADDR16}
- IMAGE_REL_MIPS_REFWORDNB = $0022;
- {$EXTERNALSYM IMAGE_REL_MIPS_REFWORDNB}
- IMAGE_REL_MIPS_PAIR = $0025;
- {$EXTERNALSYM IMAGE_REL_MIPS_PAIR}
- //
- // Alpha Relocation types.
- //
- IMAGE_REL_ALPHA_ABSOLUTE = $0000;
- {$EXTERNALSYM IMAGE_REL_ALPHA_ABSOLUTE}
- IMAGE_REL_ALPHA_REFLONG = $0001;
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFLONG}
- IMAGE_REL_ALPHA_REFQUAD = $0002;
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFQUAD}
- IMAGE_REL_ALPHA_GPREL32 = $0003;
- {$EXTERNALSYM IMAGE_REL_ALPHA_GPREL32}
- IMAGE_REL_ALPHA_LITERAL = $0004;
- {$EXTERNALSYM IMAGE_REL_ALPHA_LITERAL}
- IMAGE_REL_ALPHA_LITUSE = $0005;
- {$EXTERNALSYM IMAGE_REL_ALPHA_LITUSE}
- IMAGE_REL_ALPHA_GPDISP = $0006;
- {$EXTERNALSYM IMAGE_REL_ALPHA_GPDISP}
- IMAGE_REL_ALPHA_BRADDR = $0007;
- {$EXTERNALSYM IMAGE_REL_ALPHA_BRADDR}
- IMAGE_REL_ALPHA_HINT = $0008;
- {$EXTERNALSYM IMAGE_REL_ALPHA_HINT}
- IMAGE_REL_ALPHA_INLINE_REFLONG = $0009;
- {$EXTERNALSYM IMAGE_REL_ALPHA_INLINE_REFLONG}
- IMAGE_REL_ALPHA_REFHI = $000A;
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFHI}
- IMAGE_REL_ALPHA_REFLO = $000B;
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFLO}
- IMAGE_REL_ALPHA_PAIR = $000C;
- {$EXTERNALSYM IMAGE_REL_ALPHA_PAIR}
- IMAGE_REL_ALPHA_MATCH = $000D;
- {$EXTERNALSYM IMAGE_REL_ALPHA_MATCH}
- IMAGE_REL_ALPHA_SECTION = $000E;
- {$EXTERNALSYM IMAGE_REL_ALPHA_SECTION}
- IMAGE_REL_ALPHA_SECREL = $000F;
- {$EXTERNALSYM IMAGE_REL_ALPHA_SECREL}
- IMAGE_REL_ALPHA_REFLONGNB = $0010;
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFLONGNB}
- IMAGE_REL_ALPHA_SECRELLO = $0011; // Low 16-bit section relative reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_SECRELLO}
- IMAGE_REL_ALPHA_SECRELHI = $0012; // High 16-bit section relative reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_SECRELHI}
- IMAGE_REL_ALPHA_REFQ3 = $0013; // High 16 bits of 48 bit reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFQ3}
- IMAGE_REL_ALPHA_REFQ2 = $0014; // Middle 16 bits of 48 bit reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFQ2}
- IMAGE_REL_ALPHA_REFQ1 = $0015; // Low 16 bits of 48 bit reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_REFQ1}
- IMAGE_REL_ALPHA_GPRELLO = $0016; // Low 16-bit GP relative reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_GPRELLO}
- IMAGE_REL_ALPHA_GPRELHI = $0017; // High 16-bit GP relative reference
- {$EXTERNALSYM IMAGE_REL_ALPHA_GPRELHI}
- //
- // IBM PowerPC relocation types.
- //
- IMAGE_REL_PPC_ABSOLUTE = $0000; // NOP
- {$EXTERNALSYM IMAGE_REL_PPC_ABSOLUTE}
- IMAGE_REL_PPC_ADDR64 = $0001; // 64-bit address
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR64}
- IMAGE_REL_PPC_ADDR32 = $0002; // 32-bit address
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR32}
- IMAGE_REL_PPC_ADDR24 = $0003; // 26-bit address, shifted left 2 (branch absolute)
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR24}
- IMAGE_REL_PPC_ADDR16 = $0004; // 16-bit address
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR16}
- IMAGE_REL_PPC_ADDR14 = $0005; // 16-bit address, shifted left 2 (load doubleword)
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR14}
- IMAGE_REL_PPC_REL24 = $0006; // 26-bit PC-relative offset, shifted left 2 (branch relative)
- {$EXTERNALSYM IMAGE_REL_PPC_REL24}
- IMAGE_REL_PPC_REL14 = $0007; // 16-bit PC-relative offset, shifted left 2 (br cond relative)
- {$EXTERNALSYM IMAGE_REL_PPC_REL14}
- IMAGE_REL_PPC_TOCREL16 = $0008; // 16-bit offset from TOC base
- {$EXTERNALSYM IMAGE_REL_PPC_TOCREL16}
- IMAGE_REL_PPC_TOCREL14 = $0009; // 16-bit offset from TOC base, shifted left 2 (load doubleword)
- {$EXTERNALSYM IMAGE_REL_PPC_TOCREL14}
- IMAGE_REL_PPC_ADDR32NB = $000A; // 32-bit addr w/o image base
- {$EXTERNALSYM IMAGE_REL_PPC_ADDR32NB}
- IMAGE_REL_PPC_SECREL = $000B; // va of containing section (as in an image sectionhdr)
- {$EXTERNALSYM IMAGE_REL_PPC_SECREL}
- IMAGE_REL_PPC_SECTION = $000C; // sectionheader number
- {$EXTERNALSYM IMAGE_REL_PPC_SECTION}
- IMAGE_REL_PPC_IFGLUE = $000D; // substitute TOC restore instruction iff symbol is glue code
- {$EXTERNALSYM IMAGE_REL_PPC_IFGLUE}
- IMAGE_REL_PPC_IMGLUE = $000E; // symbol is glue code; virtual address is TOC restore instruction
- {$EXTERNALSYM IMAGE_REL_PPC_IMGLUE}
- IMAGE_REL_PPC_SECREL16 = $000F; // va of containing section (limited to 16 bits)
- {$EXTERNALSYM IMAGE_REL_PPC_SECREL16}
- IMAGE_REL_PPC_REFHI = $0010;
- {$EXTERNALSYM IMAGE_REL_PPC_REFHI}
- IMAGE_REL_PPC_REFLO = $0011;
- {$EXTERNALSYM IMAGE_REL_PPC_REFLO}
- IMAGE_REL_PPC_PAIR = $0012;
- {$EXTERNALSYM IMAGE_REL_PPC_PAIR}
- IMAGE_REL_PPC_SECRELLO = $0013; // Low 16-bit section relative reference (used for >32k TLS)
- {$EXTERNALSYM IMAGE_REL_PPC_SECRELLO}
- IMAGE_REL_PPC_SECRELHI = $0014; // High 16-bit section relative reference (used for >32k TLS)
- {$EXTERNALSYM IMAGE_REL_PPC_SECRELHI}
- IMAGE_REL_PPC_GPREL = $0015;
- {$EXTERNALSYM IMAGE_REL_PPC_GPREL}
- IMAGE_REL_PPC_TOKEN = $0016; // clr token
- {$EXTERNALSYM IMAGE_REL_PPC_TOKEN}
- IMAGE_REL_PPC_TYPEMASK = $00FF; // mask to isolate above values in IMAGE_RELOCATION.Type
- {$EXTERNALSYM IMAGE_REL_PPC_TYPEMASK}
- // Flag bits in IMAGE_RELOCATION.TYPE
- IMAGE_REL_PPC_NEG = $0100; // subtract reloc value rather than adding it
- {$EXTERNALSYM IMAGE_REL_PPC_NEG}
- IMAGE_REL_PPC_BRTAKEN = $0200; // fix branch prediction bit to predict branch taken
- {$EXTERNALSYM IMAGE_REL_PPC_BRTAKEN}
- IMAGE_REL_PPC_BRNTAKEN = $0400; // fix branch prediction bit to predict branch not taken
- {$EXTERNALSYM IMAGE_REL_PPC_BRNTAKEN}
- IMAGE_REL_PPC_TOCDEFN = $0800; // toc slot defined in file (or, data in toc)
- {$EXTERNALSYM IMAGE_REL_PPC_TOCDEFN}
- //
- // Hitachi SH3 relocation types.
- //
- IMAGE_REL_SH3_ABSOLUTE = $0000; // No relocation
- {$EXTERNALSYM IMAGE_REL_SH3_ABSOLUTE}
- IMAGE_REL_SH3_DIRECT16 = $0001; // 16 bit direct
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT16}
- IMAGE_REL_SH3_DIRECT32 = $0002; // 32 bit direct
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT32}
- IMAGE_REL_SH3_DIRECT8 = $0003; // 8 bit direct, -128..255
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT8}
- IMAGE_REL_SH3_DIRECT8_WORD = $0004; // 8 bit direct .W (0 ext.)
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT8_WORD}
- IMAGE_REL_SH3_DIRECT8_LONG = $0005; // 8 bit direct .L (0 ext.)
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT8_LONG}
- IMAGE_REL_SH3_DIRECT4 = $0006; // 4 bit direct (0 ext.)
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT4}
- IMAGE_REL_SH3_DIRECT4_WORD = $0007; // 4 bit direct .W (0 ext.)
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT4_WORD}
- IMAGE_REL_SH3_DIRECT4_LONG = $0008; // 4 bit direct .L (0 ext.)
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT4_LONG}
- IMAGE_REL_SH3_PCREL8_WORD = $0009; // 8 bit PC relative .W
- {$EXTERNALSYM IMAGE_REL_SH3_PCREL8_WORD}
- IMAGE_REL_SH3_PCREL8_LONG = $000A; // 8 bit PC relative .L
- {$EXTERNALSYM IMAGE_REL_SH3_PCREL8_LONG}
- IMAGE_REL_SH3_PCREL12_WORD = $000B; // 12 LSB PC relative .W
- {$EXTERNALSYM IMAGE_REL_SH3_PCREL12_WORD}
- IMAGE_REL_SH3_STARTOF_SECTION = $000C; // Start of EXE section
- {$EXTERNALSYM IMAGE_REL_SH3_STARTOF_SECTION}
- IMAGE_REL_SH3_SIZEOF_SECTION = $000D; // Size of EXE section
- {$EXTERNALSYM IMAGE_REL_SH3_SIZEOF_SECTION}
- IMAGE_REL_SH3_SECTION = $000E; // Section table index
- {$EXTERNALSYM IMAGE_REL_SH3_SECTION}
- IMAGE_REL_SH3_SECREL = $000F; // Offset within section
- {$EXTERNALSYM IMAGE_REL_SH3_SECREL}
- IMAGE_REL_SH3_DIRECT32_NB = $0010; // 32 bit direct not based
- {$EXTERNALSYM IMAGE_REL_SH3_DIRECT32_NB}
- IMAGE_REL_SH3_GPREL4_LONG = $0011; // GP-relative addressing
- {$EXTERNALSYM IMAGE_REL_SH3_GPREL4_LONG}
- IMAGE_REL_SH3_TOKEN = $0012; // clr token
- {$EXTERNALSYM IMAGE_REL_SH3_TOKEN}
- IMAGE_REL_ARM_ABSOLUTE = $0000; // No relocation required
- {$EXTERNALSYM IMAGE_REL_ARM_ABSOLUTE}
- IMAGE_REL_ARM_ADDR32 = $0001; // 32 bit address
- {$EXTERNALSYM IMAGE_REL_ARM_ADDR32}
- IMAGE_REL_ARM_ADDR32NB = $0002; // 32 bit address w/o image base
- {$EXTERNALSYM IMAGE_REL_ARM_ADDR32NB}
- IMAGE_REL_ARM_BRANCH24 = $0003; // 24 bit offset << 2 & sign ext.
- {$EXTERNALSYM IMAGE_REL_ARM_BRANCH24}
- IMAGE_REL_ARM_BRANCH11 = $0004; // Thumb: 2 11 bit offsets
- {$EXTERNALSYM IMAGE_REL_ARM_BRANCH11}
- IMAGE_REL_ARM_TOKEN = $0005; // clr token
- {$EXTERNALSYM IMAGE_REL_ARM_TOKEN}
- IMAGE_REL_ARM_GPREL12 = $0006; // GP-relative addressing (ARM)
- {$EXTERNALSYM IMAGE_REL_ARM_GPREL12}
- IMAGE_REL_ARM_GPREL7 = $0007; // GP-relative addressing (Thumb)
- {$EXTERNALSYM IMAGE_REL_ARM_GPREL7}
- IMAGE_REL_ARM_BLX24 = $0008;
- {$EXTERNALSYM IMAGE_REL_ARM_BLX24}
- IMAGE_REL_ARM_BLX11 = $0009;
- {$EXTERNALSYM IMAGE_REL_ARM_BLX11}
- IMAGE_REL_ARM_SECTION = $000E; // Section table index
- {$EXTERNALSYM IMAGE_REL_ARM_SECTION}
- IMAGE_REL_ARM_SECREL = $000F; // Offset within section
- {$EXTERNALSYM IMAGE_REL_ARM_SECREL}
- IMAGE_REL_AM_ABSOLUTE = $0000;
- {$EXTERNALSYM IMAGE_REL_AM_ABSOLUTE}
- IMAGE_REL_AM_ADDR32 = $0001;
- {$EXTERNALSYM IMAGE_REL_AM_ADDR32}
- IMAGE_REL_AM_ADDR32NB = $0002;
- {$EXTERNALSYM IMAGE_REL_AM_ADDR32NB}
- IMAGE_REL_AM_CALL32 = $0003;
- {$EXTERNALSYM IMAGE_REL_AM_CALL32}
- IMAGE_REL_AM_FUNCINFO = $0004;
- {$EXTERNALSYM IMAGE_REL_AM_FUNCINFO}
- IMAGE_REL_AM_REL32_1 = $0005;
- {$EXTERNALSYM IMAGE_REL_AM_REL32_1}
- IMAGE_REL_AM_REL32_2 = $0006;
- {$EXTERNALSYM IMAGE_REL_AM_REL32_2}
- IMAGE_REL_AM_SECREL = $0007;
- {$EXTERNALSYM IMAGE_REL_AM_SECREL}
- IMAGE_REL_AM_SECTION = $0008;
- {$EXTERNALSYM IMAGE_REL_AM_SECTION}
- IMAGE_REL_AM_TOKEN = $0009;
- {$EXTERNALSYM IMAGE_REL_AM_TOKEN}
- //
- // X86-64 relocations
- //
- IMAGE_REL_AMD64_ABSOLUTE = $0000; // Reference is absolute, no relocation is necessary
- {$EXTERNALSYM IMAGE_REL_AMD64_ABSOLUTE}
- IMAGE_REL_AMD64_ADDR64 = $0001; // 64-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_AMD64_ADDR64}
- IMAGE_REL_AMD64_ADDR32 = $0002; // 32-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_AMD64_ADDR32}
- IMAGE_REL_AMD64_ADDR32NB = $0003; // 32-bit address w/o image base (RVA).
- {$EXTERNALSYM IMAGE_REL_AMD64_ADDR32NB}
- IMAGE_REL_AMD64_REL32 = $0004; // 32-bit relative address from byte following reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32}
- IMAGE_REL_AMD64_REL32_1 = $0005; // 32-bit relative address from byte distance 1 from reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32_1}
- IMAGE_REL_AMD64_REL32_2 = $0006; // 32-bit relative address from byte distance 2 from reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32_2}
- IMAGE_REL_AMD64_REL32_3 = $0007; // 32-bit relative address from byte distance 3 from reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32_3}
- IMAGE_REL_AMD64_REL32_4 = $0008; // 32-bit relative address from byte distance 4 from reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32_4}
- IMAGE_REL_AMD64_REL32_5 = $0009; // 32-bit relative address from byte distance 5 from reloc
- {$EXTERNALSYM IMAGE_REL_AMD64_REL32_5}
- IMAGE_REL_AMD64_SECTION = $000A; // Section index
- {$EXTERNALSYM IMAGE_REL_AMD64_SECTION}
- IMAGE_REL_AMD64_SECREL = $000B; // 32 bit offset from base of section containing target
- {$EXTERNALSYM IMAGE_REL_AMD64_SECREL}
- IMAGE_REL_AMD64_SECREL7 = $000C; // 7 bit unsigned offset from base of section containing target
- {$EXTERNALSYM IMAGE_REL_AMD64_SECREL7}
- IMAGE_REL_AMD64_TOKEN = $000D; // 32 bit metadata token
- {$EXTERNALSYM IMAGE_REL_AMD64_TOKEN}
- //
- // IA64 relocation types.
- //
- IMAGE_REL_IA64_ABSOLUTE = $0000;
- {$EXTERNALSYM IMAGE_REL_IA64_ABSOLUTE}
- IMAGE_REL_IA64_IMM14 = $0001;
- {$EXTERNALSYM IMAGE_REL_IA64_IMM14}
- IMAGE_REL_IA64_IMM22 = $0002;
- {$EXTERNALSYM IMAGE_REL_IA64_IMM22}
- IMAGE_REL_IA64_IMM64 = $0003;
- {$EXTERNALSYM IMAGE_REL_IA64_IMM64}
- IMAGE_REL_IA64_DIR32 = $0004;
- {$EXTERNALSYM IMAGE_REL_IA64_DIR32}
- IMAGE_REL_IA64_DIR64 = $0005;
- {$EXTERNALSYM IMAGE_REL_IA64_DIR64}
- IMAGE_REL_IA64_PCREL21B = $0006;
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL21B}
- IMAGE_REL_IA64_PCREL21M = $0007;
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL21M}
- IMAGE_REL_IA64_PCREL21F = $0008;
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL21F}
- IMAGE_REL_IA64_GPREL22 = $0009;
- {$EXTERNALSYM IMAGE_REL_IA64_GPREL22}
- IMAGE_REL_IA64_LTOFF22 = $000A;
- {$EXTERNALSYM IMAGE_REL_IA64_LTOFF22}
- IMAGE_REL_IA64_SECTION = $000B;
- {$EXTERNALSYM IMAGE_REL_IA64_SECTION}
- IMAGE_REL_IA64_SECREL22 = $000C;
- {$EXTERNALSYM IMAGE_REL_IA64_SECREL22}
- IMAGE_REL_IA64_SECREL64I = $000D;
- {$EXTERNALSYM IMAGE_REL_IA64_SECREL64I}
- IMAGE_REL_IA64_SECREL32 = $000E;
- {$EXTERNALSYM IMAGE_REL_IA64_SECREL32}
- //
- IMAGE_REL_IA64_DIR32NB = $0010;
- {$EXTERNALSYM IMAGE_REL_IA64_DIR32NB}
- IMAGE_REL_IA64_SREL14 = $0011;
- {$EXTERNALSYM IMAGE_REL_IA64_SREL14}
- IMAGE_REL_IA64_SREL22 = $0012;
- {$EXTERNALSYM IMAGE_REL_IA64_SREL22}
- IMAGE_REL_IA64_SREL32 = $0013;
- {$EXTERNALSYM IMAGE_REL_IA64_SREL32}
- IMAGE_REL_IA64_UREL32 = $0014;
- {$EXTERNALSYM IMAGE_REL_IA64_UREL32}
- IMAGE_REL_IA64_PCREL60X = $0015; // This is always a BRL and never converted
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL60X}
- IMAGE_REL_IA64_PCREL60B = $0016; // If possible, convert to MBB bundle with NOP.B in slot 1
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL60B}
- IMAGE_REL_IA64_PCREL60F = $0017; // If possible, convert to MFB bundle with NOP.F in slot 1
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL60F}
- IMAGE_REL_IA64_PCREL60I = $0018; // If possible, convert to MIB bundle with NOP.I in slot 1
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL60I}
- IMAGE_REL_IA64_PCREL60M = $0019; // If possible, convert to MMB bundle with NOP.M in slot 1
- {$EXTERNALSYM IMAGE_REL_IA64_PCREL60M}
- IMAGE_REL_IA64_IMMGPREL64 = $001A;
- {$EXTERNALSYM IMAGE_REL_IA64_IMMGPREL64}
- IMAGE_REL_IA64_TOKEN = $001B; // clr token
- {$EXTERNALSYM IMAGE_REL_IA64_TOKEN}
- IMAGE_REL_IA64_GPREL32 = $001C;
- {$EXTERNALSYM IMAGE_REL_IA64_GPREL32}
- IMAGE_REL_IA64_ADDEND = $001F;
- {$EXTERNALSYM IMAGE_REL_IA64_ADDEND}
- //
- // CEF relocation types.
- //
- IMAGE_REL_CEF_ABSOLUTE = $0000; // Reference is absolute, no relocation is necessary
- {$EXTERNALSYM IMAGE_REL_CEF_ABSOLUTE}
- IMAGE_REL_CEF_ADDR32 = $0001; // 32-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_CEF_ADDR32}
- IMAGE_REL_CEF_ADDR64 = $0002; // 64-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_CEF_ADDR64}
- IMAGE_REL_CEF_ADDR32NB = $0003; // 32-bit address w/o image base (RVA).
- {$EXTERNALSYM IMAGE_REL_CEF_ADDR32NB}
- IMAGE_REL_CEF_SECTION = $0004; // Section index
- {$EXTERNALSYM IMAGE_REL_CEF_SECTION}
- IMAGE_REL_CEF_SECREL = $0005; // 32 bit offset from base of section containing target
- {$EXTERNALSYM IMAGE_REL_CEF_SECREL}
- IMAGE_REL_CEF_TOKEN = $0006; // 32 bit metadata token
- {$EXTERNALSYM IMAGE_REL_CEF_TOKEN}
- //
- // clr relocation types.
- //
- IMAGE_REL_CEE_ABSOLUTE = $0000; // Reference is absolute, no relocation is necessary
- {$EXTERNALSYM IMAGE_REL_CEE_ABSOLUTE}
- IMAGE_REL_CEE_ADDR32 = $0001; // 32-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_CEE_ADDR32}
- IMAGE_REL_CEE_ADDR64 = $0002; // 64-bit address (VA).
- {$EXTERNALSYM IMAGE_REL_CEE_ADDR64}
- IMAGE_REL_CEE_ADDR32NB = $0003; // 32-bit address w/o image base (RVA).
- {$EXTERNALSYM IMAGE_REL_CEE_ADDR32NB}
- IMAGE_REL_CEE_SECTION = $0004; // Section index
- {$EXTERNALSYM IMAGE_REL_CEE_SECTION}
- IMAGE_REL_CEE_SECREL = $0005; // 32 bit offset from base of section containing target
- {$EXTERNALSYM IMAGE_REL_CEE_SECREL}
- IMAGE_REL_CEE_TOKEN = $0006; // 32 bit metadata token
- {$EXTERNALSYM IMAGE_REL_CEE_TOKEN}
- IMAGE_REL_M32R_ABSOLUTE = $0000; // No relocation required
- {$EXTERNALSYM IMAGE_REL_M32R_ABSOLUTE}
- IMAGE_REL_M32R_ADDR32 = $0001; // 32 bit address
- {$EXTERNALSYM IMAGE_REL_M32R_ADDR32}
- IMAGE_REL_M32R_ADDR32NB = $0002; // 32 bit address w/o image base
- {$EXTERNALSYM IMAGE_REL_M32R_ADDR32NB}
- IMAGE_REL_M32R_ADDR24 = $0003; // 24 bit address
- {$EXTERNALSYM IMAGE_REL_M32R_ADDR24}
- IMAGE_REL_M32R_GPREL16 = $0004; // GP relative addressing
- {$EXTERNALSYM IMAGE_REL_M32R_GPREL16}
- IMAGE_REL_M32R_PCREL24 = $0005; // 24 bit offset << 2 & sign ext.
- {$EXTERNALSYM IMAGE_REL_M32R_PCREL24}
- IMAGE_REL_M32R_PCREL16 = $0006; // 16 bit offset << 2 & sign ext.
- {$EXTERNALSYM IMAGE_REL_M32R_PCREL16}
- IMAGE_REL_M32R_PCREL8 = $0007; // 8 bit offset << 2 & sign ext.
- {$EXTERNALSYM IMAGE_REL_M32R_PCREL8}
- IMAGE_REL_M32R_REFHALF = $0008; // 16 MSBs
- {$EXTERNALSYM IMAGE_REL_M32R_REFHALF}
- IMAGE_REL_M32R_REFHI = $0009; // 16 MSBs; adj for LSB sign ext.
- {$EXTERNALSYM IMAGE_REL_M32R_REFHI}
- IMAGE_REL_M32R_REFLO = $000A; // 16 LSBs
- {$EXTERNALSYM IMAGE_REL_M32R_REFLO}
- IMAGE_REL_M32R_PAIR = $000B; // Link HI and LO
- {$EXTERNALSYM IMAGE_REL_M32R_PAIR}
- IMAGE_REL_M32R_SECTION = $000C; // Section table index
- {$EXTERNALSYM IMAGE_REL_M32R_SECTION}
- IMAGE_REL_M32R_SECREL32 = $000D; // 32 bit section relative reference
- {$EXTERNALSYM IMAGE_REL_M32R_SECREL32}
- IMAGE_REL_M32R_TOKEN = $000E; // clr token
- {$EXTERNALSYM IMAGE_REL_M32R_TOKEN}
- // Please contact INTEL to get IA64-specific information
- (* TODO
- #define EXT_IMM64(Value, Address, Size, InstPos, ValPos)
- Value |= (((ULONGLONG)((*(Address) >> InstPos) & (((ULONGLONG)1 << Size) - 1))) << ValPos) // Intel-IA64-Filler
- #define INS_IMM64(Value, Address, Size, InstPos, ValPos) /* Intel-IA64-Filler */
- *(PDWORD)Address = (*(PDWORD)Address & ~(((1 << Size) - 1) << InstPos)) | /* Intel-IA64-Filler */
- ((DWORD)((((ULONGLONG)Value >> ValPos) & (((ULONGLONG)1 << Size) - 1))) << InstPos) // Intel-IA64-Filler
- *)
- const
- EMARCH_ENC_I17_IMM7B_INST_WORD_X = 3; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM7B_INST_WORD_X}
- EMARCH_ENC_I17_IMM7B_SIZE_X = 7; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM7B_SIZE_X}
- EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X = 4; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM7B_VAL_POS_X = 0; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM7B_VAL_POS_X}
- EMARCH_ENC_I17_IMM9D_INST_WORD_X = 3; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM9D_INST_WORD_X}
- EMARCH_ENC_I17_IMM9D_SIZE_X = 9; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM9D_SIZE_X}
- EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X = 18; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM9D_VAL_POS_X = 7; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM9D_VAL_POS_X}
- EMARCH_ENC_I17_IMM5C_INST_WORD_X = 3; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM5C_INST_WORD_X}
- EMARCH_ENC_I17_IMM5C_SIZE_X = 5; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM5C_SIZE_X}
- EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X = 13; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM5C_VAL_POS_X = 16; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM5C_VAL_POS_X}
- EMARCH_ENC_I17_IC_INST_WORD_X = 3; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IC_INST_WORD_X}
- EMARCH_ENC_I17_IC_SIZE_X = 1; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IC_SIZE_X}
- EMARCH_ENC_I17_IC_INST_WORD_POS_X = 12; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IC_INST_WORD_POS_X}
- EMARCH_ENC_I17_IC_VAL_POS_X = 21; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IC_VAL_POS_X}
- EMARCH_ENC_I17_IMM41a_INST_WORD_X = 1; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41a_INST_WORD_X}
- EMARCH_ENC_I17_IMM41a_SIZE_X = 10; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41a_SIZE_X}
- EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X = 14; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM41a_VAL_POS_X = 22; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41a_VAL_POS_X}
- EMARCH_ENC_I17_IMM41b_INST_WORD_X = 1; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41b_INST_WORD_X}
- EMARCH_ENC_I17_IMM41b_SIZE_X = 8; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41b_SIZE_X}
- EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X = 24; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM41b_VAL_POS_X = 32; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41b_VAL_POS_X}
- EMARCH_ENC_I17_IMM41c_INST_WORD_X = 2; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41c_INST_WORD_X}
- EMARCH_ENC_I17_IMM41c_SIZE_X = 23; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41c_SIZE_X}
- EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X = 0; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X}
- EMARCH_ENC_I17_IMM41c_VAL_POS_X = 40; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_IMM41c_VAL_POS_X}
- EMARCH_ENC_I17_SIGN_INST_WORD_X = 3; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_SIGN_INST_WORD_X}
- EMARCH_ENC_I17_SIGN_SIZE_X = 1; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_SIGN_SIZE_X}
- EMARCH_ENC_I17_SIGN_INST_WORD_POS_X = 27; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_SIGN_INST_WORD_POS_X}
- EMARCH_ENC_I17_SIGN_VAL_POS_X = 63; // Intel-IA64-Filler
- {$EXTERNALSYM EMARCH_ENC_I17_SIGN_VAL_POS_X}
- //
- // Line number format.
- //
- type