_NM_INFO = record
hFile: THandle;
Info: _FILE_NAME_Information;
Name: array [0 .. MAX_PATH - 1] of WideChar;
end;
TNM_INFO = _NM_INFO;
NM_INFO = _NM_INFO;
Function GetSystemInformationClassSize(Const ATableType: SYSTEM_INFORMATION_CLASS; Const Count: ULONG): ULONG;
begin
Result := 0;
case ATableType of
SystemBasicInformation:
Result := $002C;
SystemProcessorInformation:
Result := $0000C;
SystemPerformanceInformation:
Result := $0138;
// SystemTimeInformation: Result := $0020;
// SystemPathInformation: Result := $0;
// SystemProcessInformation: Result := $00C8 + Count;
// SystemCallInformation: Result := $0018 + (Count * $0004);
SystemConfigurationInformation:
Result := $0018;
// SystemProcessorCounters: Result := $0030 + Count;//per cpu
SystemGlobalFlag:
Result := $0004; // (fails if size != 4)
// SystemCallTimeInformation: Result := $0;
SystemModuleInformation:
Result := $0004 + (Count * Sizeof(SYSTEM_MODULE_INFORMATION)); //(n * 0x011C)
SystemLockInformation:
Result := $0004 + (Count * Sizeof(SYSTEM_LOCK_INFORMATION)); //(n * 0x0024)
// SystemStackTraceInformation: Result := $0;
// SystemPagedPoolInformation: Result := $0;
// SystemNonPagedPoolInformation: Result := $0;
SystemHandleInformation:
Result := $0004 + (Count * Sizeof(SYSTEM_HANDLE_INFORMATION)); //(n * 0x0010)
// SystemObjectTypeInformation: Result := $0038+ + (Count * $0030);// +)
SystemPageFileInformation:
Result := $0018 + (Count * Sizeof(SYSTEM_PAGEFILE_INFORMATION));
// SystemVdmInstemulInformation: Result := $0088;
// SystemVdmBopInformation: Result := $0;
SystemCacheInformation:
Result := $0024;
SystemPoolTagInformation:
Result := $0004 + (Count * Sizeof(SYSTEM_POOL_TAG_INFORMATION)); // (n * 0x001C)
// SystemInterruptInformation: Result := $0000 + Count;//, or 0x0018 per cpu
SystemDpcInformation:
Result := $0014;
// SystemFullMemoryInformation: Result := $0;
// SystemLoadDriver: Result := $0018;//, set mode only
// SystemUnloadDriver: Result := $0004;//, set mode only
// SystemTimeAdjustmentInformation: Result := $000C;//, 0x0008 writeable
// SystemSummaryMemoryInformation: Result := $0;
// SystemNextEventIdInformation: Result := $0;
// SystemEventIdsInformation: Result := $0;
SystemCrashDumpInformation:
Result := $0004;
SystemExceptionInformation:
Result := $0010;
SystemCrashDumpStateInformation:
Result := $0004;
// SystemDebuggerInformation: Result := $0002;
SystemContextSwitchInformation:
Result := $0030;
SystemRegistryQuotaInformation:
Result := $000C;
// SystemAddDriver: Result := $0008;//, set mode only
// SystemPrioritySeparationInformatio: Result := $0004;//, set mode only
// SystemPlugPlayBusInformation: Result := $0;
// SystemDockInformation: Result := $0;
// SystemPowerInfo: Result := $0060;// (XP only!)
// SystemProcessorSpeedInformation: Result := $000C;// (XP only!)
SystemTimeZoneInformation:
Result := $00AC;
SystemLookasideInformation:
Result := Count * $0020;
SystemSetTimeSlipEvent:
Result := $0;
SystemCreateSession:
Result := $0;
SystemDeleteSession:
Result := $0;
SystemInvalidInfoClass1:
Result := $0;
SystemRangeStartInformation:
Result := $0004; // (fails if size != 4)
SystemVerifierInformation:
Result := $0;
SystemAddVerifier:
Result := $0;
SystemSessionProcessesInformation:
Result := $0;
end;
end;
Function GetSystemInformationClassHasCount(Const ATableType: SYSTEM_INFORMATION_CLASS): BOOL;
begin
Result := False;
case ATableType of
// SystemProcessInformation,
// SystemCallInformation,
// SystemProcessorCounters,
SystemModuleInformation,
SystemLockInformation,
SystemHandleInformation,
// SystemObjectTypeInformation,
//SystemPageFileInformation, //好像这个还不确定。
// SystemInterruptInformation,
SystemPoolTagInformation:
Result := True;
end;
//可以 和 GetSystemInformationClassSize 配合使用。
end;[/mw_shl_code]