00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef _SYSINFO_H_
00061 #define _SYSINFO_H_
00062
00063 #define SYSINFO_API extern "C" __declspec(dllexport)
00064
00065
00066
00067
00068 #include <stdio.h>
00069 #include "SysInfoIncludes.h"
00070
00071
00072
00073
00074 #define VSHORT_STRING_LEN 16 //Size of a generic very short string
00075 #define SHORT_STRING_LEN 64 //Size of a generic short string
00076 #define LONG_STRING_LEN 256 //Size of a generic long string
00077 #define VLONG_STRING_LEN 1024 //Size of a generic very long string
00078
00079
00080
00081
00082
00083
00092 SYSINFO_API const wchar_t* SysInfoDll_GetVersion( void );
00093
00099 SYSINFO_API BOOL SysInfoDll_StartLogging( LPWSTR lpszPath );
00100
00106 SYSINFO_API BOOL SysInfoDll_StartLoggingExisting(FILE *fp);
00107
00112 SYSINFO_API BOOL SysInfoDll_StopLogging( void );
00113
00120 SYSINFO_API BOOL SysInfoDll_GetLastErrorString( LPWSTR lpszError ,
00121 DWORD dwsize );
00122
00124
00125
00126
00127
00128
00140 SYSINFO_API BOOL SysInfoDll_GetComputerName( LPWSTR lpBuffer ,
00141 LPDWORD nSize );
00142
00144
00145
00146
00147
00148
00161 SYSINFO_API const wchar_t* SysInfoDll_GetOS( LPWSTR lpszOS ,
00162 int iLen );
00163
00169 SYSINFO_API BOOL SysInfoDll_GetOSEx( LPOSVERSIONINFOW lpVersionInformation );
00170
00172
00173
00174
00175
00176
00181
00182
00184 #define MAX_NUM_CPUS 256
00185
00186 #define MAX_NUM_CPU_PACKAGES 32
00187
00188 #define MAX_CPU_GROUPS 4
00189
00190 #define MAX_CPU_IN_GROUP 64
00191
00192 #define MAX_AFFINITY_SUPPORT MAXIMUM_PROC_PER_GROUP
00193
00194 #define CPU_SPEED_STRING_LENGTH 15
00195 #define CPU_STRING_LEN 34
00196 #define CPUCODE_STRING_LENGTH 16
00197 #define STEPPING_STRING_LENGTH 6
00198 #define SOCKET_STRING_LENGTH 16
00199 #define FAB_STRING_LENGTH 5
00200
00201 enum CPU_OCLK
00202 {
00203 CPU_OVERCLOCKED_UNKNOWN = 0,
00204 CPU_OVERCLOCKED = 1,
00205 CPU_UNDERCLOCKED = 2,
00206 CPU_OVERCLOCKED_NO = 3,
00207 CPU_MAXVAL = 4,
00208 };
00209
00210
00211 typedef struct _CPU_SPECIFICATION
00212 {
00213 wchar_t szCPU[CPU_STRING_LEN];
00214 int iType;
00215 int iFamily;
00216 int iModel;
00218 int iStepping;
00219 WORD wCPUCodeName;
00221 WORD wStepping;
00222 BYTE bySocket;
00223 BYTE byFabrication;
00224 wchar_t szCPUCodeName[CPU_STRING_LEN];
00225 wchar_t szStepping[STEPPING_STRING_LENGTH];
00226 wchar_t szSocket[SOCKET_STRING_LENGTH];
00227 wchar_t szFabrication[FAB_STRING_LENGTH];
00228 int iTJunction;
00229 } CPU_SPECIFICATION;
00230
00231 typedef struct _CPUMSRINFO
00232 {
00233
00234 ULONGLONG ullMSR0x17;
00235 ULONGLONG ullMSR0x1B;
00236 ULONGLONG ullMSR0xE7;
00237 ULONGLONG ullMSR0xE8;
00238 ULONGLONG ullMSR0x19C;
00239 ULONGLONG ullMSR0x1A0;
00240
00241
00242 ULONGLONG ullMSR0x2A;
00243 ULONGLONG ullMSR0x2C;
00244 ULONGLONG ullMSR0xCD;
00245
00246
00247 ULONGLONG ullMSR0xCE;
00248 ULONGLONG ullMSR0x1AD;
00249 ULONGLONG ullMSR0x1A2;
00250 ULONGLONG ullMSR0x1AC;
00251
00252 int iNonIntegerBusRatio;
00254 float flBusFrequencyRatio;
00256 float raw_freq_cpu;
00257
00258 float flScalableBusSpeed;
00259 float flFSB;
00260
00262 float flExternalClock;
00263
00265 float flHTFreq;
00266
00267 int iMinimumRatio;
00268 int iMaximumRatio;
00269
00270 int iMaxTurbo1Core;
00271 int iMaxTurbo2Core;
00272 int iMaxTurbo3Core;
00273 int iMaxTurbo4Core;
00274 int iTDPLimit;
00275 int iTDCLimit;
00276
00277 int iTemperatureTarget;
00278
00279
00280 float flCPUSpeedTurbo;
00281 float flCPUMultTurbo;
00282 float flCPUExternalClockTurbo;
00283
00284
00285 float flCPUSpeedStock;
00286 float flCPUMultStock;
00287 float flCPUExternalClockStock;
00288
00289
00291 float flCPUTSC;
00292
00293
00294 float flScalableBusSpeedStock;
00295 float flFSBStock;
00296
00297
00299 CPU_OCLK OCLKBaseClock;
00301 CPU_OCLK OCLKMultiplier;
00303 CPU_OCLK OCLKFreq;
00304
00305
00307 float flCPUExternalClockBoosted;
00309 float flMinMult;
00311 float flMaxMult;
00313 float flBoostedMult;
00314
00315 } CPUMSRINFO;
00316
00317 typedef struct _CPU_SPECIFICATION_STEPPING
00318 {
00320 int iStepping;
00321 wchar_t szStepping[STEPPING_STRING_LENGTH];
00323 wchar_t szCPUID[SHORT_STRING_LEN];
00324 } CPU_SPECIFICATION_STEPPING;
00325
00326 typedef struct _CPU_GROUP_INFO
00327 {
00329 DWORD dwMaximumProcessorCount;
00331 DWORD dwActiveProcessorCount;
00333 KAFFINITY ActiveProcessorMask;
00334 } CPU_GROUP_INFO;
00335
00336 typedef struct _CPU_GROUPS_INFO
00337 {
00339 WORD wMaximumProcessorGroupCount;
00341 WORD wActiveProcessorGroupCount;
00343 CPU_GROUP_INFO CPUGroupInfo[MAX_CPU_GROUPS];
00344 } CPU_GROUPS_INFO;
00345
00346 typedef struct _CPUINFO
00347 {
00349 int number;
00351 float speed1;
00353 float speed2;
00354 int Family;
00355 int Model;
00356 int stepping;
00358 int MMX;
00360 int SIMD;
00362 unsigned int features;
00364 int CPUIDSupport;
00366 wchar_t manufacture[20];
00368 wchar_t typestring[50];
00370 wchar_t speedstring1[CPU_SPEED_STRING_LENGTH];
00372 wchar_t speedstring2[CPU_SPEED_STRING_LENGTH];
00374 int cacheinfo_num;
00376 int L2_cache_size;
00378 int Brand;
00380 int SerialAvail;
00382 DWORD SerialNum1;
00384 DWORD SerialNum2;
00386 DWORD SerialNum3;
00388 int SMID_SSE2;
00390 int AMD3DNow;
00392 int iLogicalsPerCore;
00394 int iHyperThreadStatus;
00396 int L3_cache_size;
00398 int SMID_SSE3;
00400 int iCoresPerPackage;
00402 int MaxBasicInputValue;
00404 int PAE;
00406 int DEP;
00408 int SMID_SSE4_1;
00410 int SMID_SSE4_2;
00412 int EMT64;
00414 int L1_instruction_cache_size;
00416 int Trace_cache_size;
00418 int L1_data_cache_size;
00420 int Prefetching;
00422 int L1_data_caches_per_package;
00424 int L1_instruction_caches_per_package;
00426 int L2_caches_per_package;
00428 int L3_caches_per_package;
00429 CPUMSRINFO MSR[MAX_NUM_CPUS];
00431 int SMID_SSSE3;
00433 int SMID_SSE4a;
00435 int VMX;
00437 int SMX;
00439 int ACPI;
00441 wchar_t szEMT[VSHORT_STRING_LEN];
00442 int iManufacture;
00444 int HTT ;
00446 CPU_SPECIFICATION Spec;
00448 CPU_SPECIFICATION_STEPPING CPUPackage[MAX_NUM_CPU_PACKAGES] ;
00450 bool bDTS;
00452 bool bIntelTurboBoost;
00454 int iMaxTurbo1Core;
00456 int iMaxTurbo2Core;
00458 int iMaxTurbo3Core;
00460 int iMaxTurbo4Core;
00462 float flCPUSpeedTurbo;
00464 int AES;
00465
00466
00468 CPU_OCLK OCLKBaseClock;
00470 CPU_OCLK OCLKMultiplier;
00472 CPU_OCLK OCLKFreq;
00474 bool bAMDTurboCore;
00476 wchar_t szHyperThreadStatus[LONG_STRING_LEN];
00478 wchar_t szCPUSummary[LONG_STRING_LEN];
00479
00481 CPU_GROUPS_INFO CPUGroupsInfo;
00482
00484 int Future_expansion8[100];
00485 } CPUINFO;
00486
00490 enum CPUINFO_STATUS
00491 {
00492 CPUINFO_SUCCESS = 0,
00493 CPUINFO_ACCESS_DENIED = 1,
00494 CPUINFO_INIT_DIRECTIO = 2,
00495 CPUINFO_DIRECTIO_VERSION = 3,
00496 CPUINFO_NOT_ALL_CPUS_AVAILABLE = 4,
00497 };
00498
00504 SYSINFO_API int SysInfoDll_GetCPUInfo( CPUINFO *pCPUinfo );
00505
00506
00508
00509
00510
00511
00512
00517 #define MODULE_PARTNO_LEN 18
00518 #define MAX_MEMORY_SLOTS 16
00519
00523 enum SPDINFO_STATUS
00524 {
00525 SPDINFO_SUCCESS = 0,
00526 SPDINFO_ACCESS_DENIED = 1,
00527 SPDINFO_INIT_DIRECTIO = 2,
00528 SPDINFO_DIRECTIO_VERSION = 3,
00529 SPDINFO_ACCESS_COLLISION = 4,
00530 };
00531
00532
00533 #define SPDINFO_MEMTYPE_SDRAM 0x04
00534 #define SPDINFO_MEMTYPE_DDR 0x07
00535 #define SPDINFO_MEMTYPE_DDR2 0x08
00536 #define SPDINFO_MEMTYPE_DDR2FB 0x09
00537 #define SPDINFO_MEMTYPE_DDR2FBPROBE 0x0A
00538 #define SPDINFO_MEMTYPE_DDR3 0x0B
00539
00540
00541 #define SPDINFO_DDR2_EPP_PROFILE_ABBR 0xA1
00542 #define SPDINFO_DDR2_EPP_PROFILE_FULL 0XB1
00543
00544 typedef struct _SPDINFO
00545 {
00547 wchar_t szHeading[SHORT_STRING_LEN];
00549 wchar_t szLine1[SHORT_STRING_LEN];
00551 wchar_t szLine2[SHORT_STRING_LEN];
00553 wchar_t szLine3[SHORT_STRING_LEN];
00554
00556 int type;
00558 int spdRev;
00560 bool registered;
00562 bool ecc;
00564 int year;
00566 int week;
00568 int dimmNum;
00570 UINT64 jedecID;
00572 wchar_t jedecManuf[SHORT_STRING_LEN];
00573
00575 char modulePartNo[MODULE_PARTNO_LEN];
00577 int moduleRev;
00579 int moduleSerialNo;
00581 int moduleManufLoc;
00582
00584 int rowAddrBits;
00586 int colAddrBits;
00588 int numBanks;
00590 int numRanks;
00592 int deviceWidth;
00594 int busWidth;
00596 wchar_t moduleVoltage[SHORT_STRING_LEN];
00597
00599 float clkspeed;
00601 wchar_t szModulespeed[SHORT_STRING_LEN];
00603 int size;
00604
00606 wchar_t CASSupported[SHORT_STRING_LEN];
00608 float tCK;
00610 float tAA;
00612 float tRCD;
00614 float tRP;
00616 float tRAS;
00618 float tRRD;
00620 float tRC;
00622 float tRFC;
00623
00625 union SPECIFICINFO {
00627 struct SDRSDRAMINFO {
00629 float tAC;
00631 float tCKmed;
00633 float tACmed;
00635 float tCKshort;
00637 float tACshort;
00638
00640 float tIS;
00642 float tIH;
00644 float tDS;
00646 float tDH;
00647
00649 wchar_t CSSupported[SHORT_STRING_LEN];
00651 wchar_t WESupported[SHORT_STRING_LEN];
00652
00654 wchar_t BurstLengthsSupported[SHORT_STRING_LEN];
00656 wchar_t RefreshRate[SHORT_STRING_LEN];
00657
00659 bool buffered;
00661 bool OnCardPLL;
00663 bool BufferedDQMB;
00665 bool RegisteredDQMB;
00667 bool DiffClockInput;
00668
00670 bool EarlyRASPrechargeSupported;
00672 bool AutoPrechargeSupported;
00674 bool PrechargeAllSupported;
00676 bool WriteReadBurstSupported;
00677
00678 } SDRSDRAM;
00680 struct DDR1SDRAMINFO {
00682 float tAC;
00684 float tCKmed;
00686 float tACmed;
00688 float tCKshort;
00690 float tACshort;
00692 float tCKmax;
00693
00695 float tIS;
00697 float tIH;
00699 float tDS;
00701 float tDH;
00702
00704 float tDQSQ;
00706 float tQHS;
00707
00709 wchar_t CSSupported[SHORT_STRING_LEN];
00711 wchar_t WESupported[SHORT_STRING_LEN];
00712
00714 wchar_t BurstLengthsSupported[SHORT_STRING_LEN];
00716 wchar_t RefreshRate[SHORT_STRING_LEN];
00717
00719 bool buffered;
00721 bool OnCardPLL;
00723 bool FETOnCardEnable;
00725 bool FETExtEnable;
00727 bool DiffClockInput;
00728
00730 bool WeakDriverIncluded;
00732 bool ConcAutoPrecharge;
00734 bool FastAPSupported;
00735
00737 wchar_t bankDensity[VSHORT_STRING_LEN];
00739 wchar_t moduleHeight[VSHORT_STRING_LEN];
00740 } DDR1SDRAM;
00742 struct DDR2SDRAMINFO {
00744 float tAC;
00746 float tCKmed;
00748 float tACmed;
00750 float tCKshort;
00752 float tACshort;
00754 float tCKmax;
00755
00757 float tWR;
00759 float tWTR;
00761 float tRTP;
00762
00764 float tIS;
00766 float tIH;
00768 float tDS;
00770 float tDH;
00771
00773 float tDQSQ;
00775 float tQHS;
00777 float tPLLRelock;
00778
00780 wchar_t DRAMPackage[VSHORT_STRING_LEN];
00781
00783 wchar_t BurstLengthsSupported[SHORT_STRING_LEN];
00785 wchar_t RefreshRate[SHORT_STRING_LEN];
00786
00788 int numPLLs;
00790 bool FETExtEnable;
00792 bool AnalysisProbeInstalled;
00794 bool WeakDriverSupported;
00796 bool _50ohmODTSupported;
00798 bool PASRSupported;
00799
00801 wchar_t moduleType[SHORT_STRING_LEN];
00803 wchar_t moduleHeight[VSHORT_STRING_LEN];
00804
00806 bool EPPSupported;
00807
00809 struct EPPInfo {
00811 int profileType;
00813 int optimalProfile;
00814
00816 union PROFILEINFO {
00818 struct ABBRPROFILEINFO {
00820 bool enabled;
00822 wchar_t voltageLevel[SHORT_STRING_LEN];
00824 float clkspeed;
00826 int cmdRate;
00827
00829 int CASSupported;
00831 float tCK;
00832
00834 float tRCD;
00836 float tRP;
00838 float tRAS;
00839
00840 } abbrProfile[4];
00841 struct FULLPROFILEINFO {
00843 bool enabled;
00845 wchar_t voltageLevel[SHORT_STRING_LEN];
00847 float clkspeed;
00849 int cmdRate;
00850
00852 wchar_t addrDriveStrength[VSHORT_STRING_LEN];
00854 wchar_t CSDriveStrength[VSHORT_STRING_LEN];
00856 wchar_t clockDriveStrength[VSHORT_STRING_LEN];
00858 wchar_t dataDriveStrength[VSHORT_STRING_LEN];
00860 wchar_t DQSDriveStrength[VSHORT_STRING_LEN];
00862 wchar_t addrCmdFineDelay[VSHORT_STRING_LEN];
00864 wchar_t addrCmdSetupTime[VSHORT_STRING_LEN];
00866 wchar_t CSFineDelay[VSHORT_STRING_LEN];
00868 wchar_t CSSetupTime[VSHORT_STRING_LEN];
00869
00871 int CASSupported;
00873 float tCK;
00874
00876 float tRCD;
00878 float tRP;
00880 float tRAS;
00881
00883 float tWR;
00885 float tRC;
00886
00887 } fullProfile[2];
00888 } profileData;
00889 } EPP;
00890
00891 } DDR2SDRAM;
00893 struct DDR2FBSDRAMINFO {
00895 float tCKmax;
00897 float tWR;
00899 float tWTR;
00901 float tRTP;
00903 float tFAW;
00904
00906 wchar_t WRSupported[SHORT_STRING_LEN];
00908 wchar_t WESupported[SHORT_STRING_LEN];
00910 wchar_t ALSupported[SHORT_STRING_LEN];
00911
00913 wchar_t BurstLengthsSupported[SHORT_STRING_LEN];
00915 wchar_t RefreshRate[SHORT_STRING_LEN];
00917 wchar_t TerminationsSupported[SHORT_STRING_LEN];
00919 wchar_t DriversSupported[SHORT_STRING_LEN];
00920
00922 wchar_t moduleType[SHORT_STRING_LEN];
00924 wchar_t moduleHeight[VSHORT_STRING_LEN];
00926 wchar_t moduleThickness[VSHORT_STRING_LEN];
00927
00929 int DRAMManufID;
00930 } DDR2FBSDRAM;
00932 struct DDR3SDRAMINFO {
00934 float tWR;
00936 float tWTR;
00938 float tRTP;
00940 float tFAW;
00941
00943 bool RZQ6Supported;
00945 bool RZQ7Supported;
00947 bool DLLOffModeSupported;
00949 int OperatingTempRange;
00951 int RefreshRateExtTempRange;
00953 bool autoSelfRefresh;
00955 bool onDieThermalSensorReadout;
00957 bool partialArraySelfRefresh;
00959 bool thermalSensorPresent;
00960
00962 wchar_t nonStdSDRAMType[SHORT_STRING_LEN];
00963
00965 wchar_t moduleType[SHORT_STRING_LEN];
00967 int moduleHeight;
00969 int moduleThicknessFront;
00971 int moduleThicknessBack;
00973 wchar_t moduleWidth[VSHORT_STRING_LEN];
00974
00976 wchar_t moduleRefCard[SHORT_STRING_LEN];
00978 int DRAMManufID;
00980 int numDRAMRows;
00982 int numRegisters;
00984 char regManuf;
00986 char regDeviceType;
00988 int regRev;
00989
00991 bool XMPSupported;
00992
00994 struct XMPInfo {
00996 int revision;
00997
00999 struct XMPProfile {
01001 bool enabled;
01002
01004 int dimmsPerChannel;
01005
01007 wchar_t moduleVdd[SHORT_STRING_LEN];
01009 float clkspeed;
01010
01012 wchar_t CASSupported[SHORT_STRING_LEN];
01014 float tCK;
01016 float tAA;
01018 float tRCD;
01020 float tRP;
01022 float tRAS;
01024 float tRRD;
01026 float tRC;
01028 float tRFC;
01029
01031 float tWR;
01033 float tWTR;
01035 float tRTP;
01037 float tFAW;
01038
01040 float tCWL;
01042 float tREFI;
01043
01045 wchar_t WRtoRDTurnaround[SHORT_STRING_LEN];
01046
01048 wchar_t RDtoWRTurnaround[SHORT_STRING_LEN];
01049
01051 wchar_t back2BackTurnaround[SHORT_STRING_LEN];
01052
01054 int cmdRateMode;
01055
01056 } profile[2];
01057 } XMP;
01058 } DDR3SDRAM;
01059 } specific;
01060
01061 } SPDINFO;
01062
01063 typedef struct _MEMMODULEINFO
01064 {
01066 int iNumMemSticks;
01068 SPDINFO memSPDInfo[MAX_MEMORY_SLOTS];
01069 } MEMMODULEINFO;
01070
01076 SYSINFO_API BOOL SysInfoDll_GetMemoryInfo( MEMORYSTATUSEX *pMemInfoEx );
01077
01083 SYSINFO_API int SysInfoDll_GetMemSPDInfo( MEMMODULEINFO *pMemModuleInfo );
01084
01086
01087
01088
01089
01090
01091
01095
01097 #define NUMMONITORS 4
01098 #define MAX_MONITOR_INFO_LEN 256
01099
01100 #define MAX_DISPLAY_DEVICES 16 //Max number of "DISPLAY<n>" devices - more than the number of adapters, adapters will be started for each DISPLAY device
01101
01102 #define MAX_MONITORS 4
01103 #define MAX_STRINGLEN 128
01104 #define MAX_DEV_MODES 800
01105 #define MAX_VIDEO_INFO_LEN 128
01106
01107
01108 typedef struct _MONITOR_ATTRIBUTES
01109 {
01111 int iBPP;
01113 int iX;
01115 int iY;
01117 float flRefreshRate;
01119 wchar_t szMonitorNumber[MAX_MONITOR_INFO_LEN];
01121 wchar_t szDisplay[MAX_MONITOR_INFO_LEN];
01122 } MONITOR_ATTRIBUTES;
01123
01124 typedef struct _MULTIMONITOR_DYN
01125 {
01126 int iNumberMonitorsInit;
01127 int iNumberMonitors;
01128 HMONITOR hMon[NUMMONITORS];
01129 MONITORINFOEX mi[NUMMONITORS];
01130 MONITOR_ATTRIBUTES ma[NUMMONITORS];
01131 } MULTIMONITOR_DYN;
01132
01133 typedef struct _SYSINFO_DISPLAY_DEVICE
01134 {
01135 bool bDisplay;
01136 wchar_t szDisplayDevice[MAX_VIDEO_INFO_LEN];
01137 wchar_t szDeviceDescription[MAX_VIDEO_INFO_LEN];
01138 wchar_t szDeviceID[MAX_VIDEO_INFO_LEN];
01139 wchar_t szDeviceKey[MAX_VIDEO_INFO_LEN];
01140
01141 bool bDriverInstalled;
01142 wchar_t szDeviceDescription2[MAX_VIDEO_INFO_LEN];
01143 wchar_t szChipType[MAX_VIDEO_INFO_LEN];
01144 wchar_t szDACType[MAX_VIDEO_INFO_LEN];
01145 wchar_t szBIOSString[MAX_VIDEO_INFO_LEN];
01146 wchar_t szInstalledDisplayDrivers[MAX_VIDEO_INFO_LEN];
01147 DWORD dwMemorySize;
01148
01149 wchar_t szDriverProviderName[MAX_VIDEO_INFO_LEN];
01150 wchar_t szDriverVersion[MAX_VIDEO_INFO_LEN];
01151 wchar_t szDriverDate[MAX_VIDEO_INFO_LEN];
01152
01153 int iNumMonitors;
01155 int iMonitorIndex[MAX_MONITORS];
01156 } SYSINFO_DISPLAY_DEVICE;
01157
01158 typedef struct _DISPLAY_DEVICES
01159 {
01161 int iNumDD;
01163 SYSINFO_DISPLAY_DEVICE dd[MAX_DISPLAY_DEVICES];
01164 } DISPLAY_DEVICES;
01165
01166
01175 SYSINFO_API BOOL SysInfoDll_GetGraphicsInfo( MULTIMONITOR_DYN *MM ,
01176 DISPLAY_DEVICES *DD ,
01177 LPWSTR szSummary ,
01178 int iLen );
01179
01180
01187 SYSINFO_API wchar_t * SysInfoDll_GetGraphicsSummaryLine(wchar_t * szSummary, int iLen);
01188
01190
01191
01192
01193
01198
01199 #define MAXUSBHOSTCONTROLLERS 10
01200
01201 #define MAXUSBDEVICES 14 //Per host controller
01202 #define USBSTRINGLEN 128
01203
01204
01205 typedef struct _USB_HOST_CONTROLLER
01206 {
01208 int iNumDev;
01210 wchar_t szHostController[USBSTRINGLEN];
01212 wchar_t szDevice[MAXUSBDEVICES][USBSTRINGLEN];
01213 } USB_HOST_CONTROLLER;
01214
01215 typedef struct _USB_HOST_CONTROLLERS
01216 {
01218 int iNumHostControllers;
01219 USB_HOST_CONTROLLER USBHostController[MAXUSBHOSTCONTROLLERS];
01220 } USB_HOST_CONTROLLERS;
01221
01227 SYSINFO_API BOOL SysInfoDll_GetUSBInfo(USB_HOST_CONTROLLERS *USBHostControllers);
01228
01230
01231
01232
01233
01237
01238 #define WMISI_VSHORTSTRING 25
01239 #define WMISI_SHORTSTRING 50
01240 #define WMISI_INFO_VSHORTSTRING 100
01241 #define WMISI_INFO_SHORTSTRING 200
01242
01243 #define MAXBIOSMODULES 1
01244 #define MAXBIOSCHARACTERISTICS 100
01245
01247 #define MAXNUMCDDVD 20
01248
01249 #define WMISI_MAXPAGEFILES 2
01250 #define MAX_FILENAME 512
01251
01252 #define MAXNUMDISKS 80
01253 #define MAXLOGICALDISKS 26
01254 #define MAXRAMMODULES 64
01255 #define MAXCOMPUTERSYSTEMS 1
01256 #define MAXBASEBOARDS 1
01257 #define MAXSERIALPORTS 64
01258 #define MAXSPARALLELPORTS 10
01259 #define MAXNETWORKADAPTERS 20
01260 #define MAXPORTCONNECTORS 50
01261
01262
01263 typedef struct _BIOSINFO
01264 {
01265 wchar_t szBIOS_Manufacturer[MAXBIOSMODULES][WMISI_INFO_SHORTSTRING];
01266 wchar_t szBIOS_ReleaseDate[MAXBIOSMODULES][WMISI_INFO_SHORTSTRING];
01267 wchar_t szBIOS_BIOSVersion[MAXBIOSMODULES][WMISI_INFO_SHORTSTRING];
01268 } BIOSINFO;
01269
01270 typedef struct _VIRTUALMEMORYINFO
01271 {
01273 int NumberPageFiles;
01275 wchar_t PageFileName[WMISI_MAXPAGEFILES][MAX_FILENAME];
01276 DWORD dwPageFileAllocatedBaseSize[WMISI_MAXPAGEFILES];
01277 } VIRTUALMEMORYINFO;
01278
01279 typedef struct _OPTICALDRIVEINFO
01280 {
01281 wchar_t OpticalDriveSummary[LONG_STRING_LEN];
01282 wchar_t OpticalDriveModel[MAXNUMCDDVD][WMISI_SHORTSTRING];
01283 int OpticalDrivesNum;
01284 } OPTICALDRIVEINFO;
01285
01286 typedef struct _PHYSDISKINFO
01287 {
01288 DWORD dwDisk_Index;
01289 UINT64 Size;
01290 bool bFixed;
01291 wchar_t Name[WMISI_SHORTSTRING];
01292 wchar_t szDisk_Description[WMISI_SHORTSTRING];
01293 wchar_t szSummary[WMISI_INFO_SHORTSTRING];
01294 } PHYSDISKINFO;
01295
01296 typedef struct _PHYSDISKINFOSUMMARY
01297 {
01298 UINT64 Size;
01299 int iNum;
01300
01301 } PHYSDISKINFOSUMMARY;
01302
01303 typedef struct _PHYSICALDRIVEINFO
01304 {
01305 int iNumPhysDisks;
01306 wchar_t tszHDDSummary[LONG_STRING_LEN];
01307 PHYSDISKINFO PhysDisk[MAXNUMDISKS];
01308 } PHYSICALDRIVEINFO;
01309
01310 typedef struct _DISKVOLUMEINFO
01311 {
01312 int iNumLogicalDisks;
01313 wchar_t szLogicalDisk_VolumeName[MAXLOGICALDISKS][WMISI_SHORTSTRING];
01314 wchar_t szLogicalDisk_Name[MAXLOGICALDISKS][WMISI_SHORTSTRING];
01315 wchar_t szLogicalDisk_Description[MAXLOGICALDISKS][WMISI_SHORTSTRING];
01316 wchar_t szLogicalDisk_FileSystem[MAXLOGICALDISKS][WMISI_SHORTSTRING];
01317 wchar_t szLogicalDisk_ProductName[MAXLOGICALDISKS][WMISI_SHORTSTRING];
01318 wchar_t szLogicalDisk_VolumeSummary[MAXLOGICALDISKS][LONG_STRING_LEN];
01319 int iLogicalDisk_DriveType[MAXLOGICALDISKS];
01320 ULONGLONG ullLogicalDisk_Totalbytes[MAXLOGICALDISKS];
01321 ULONGLONG ullLogicalDisk_Freebytes[MAXLOGICALDISKS];
01322 } DISKVOLUMEINFO;
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350 enum RAMTYPE
01351 {
01352 RAMTYPE_UNDEFINED = 0,
01353 RAMTYPE_OTHER,
01354 RAMTYPE_UNKNOWN,
01355 RAMTYPE_DRAM,
01356 RAMTYPE_EDRAM,
01357 RAMTYPE_VRAM,
01358 RAMTYPE_SRAM,
01359 RAMTYPE_RAM,
01360 RAMTYPE_ROM,
01361 RAMTYPE_FLASH,
01362 RAMTYPE_EEPROM,
01363 RAMTYPE_FEPROM,
01364 RAMTYPE_EPROM,
01365 RAMTYPE_CDRAM,
01366 RAMTYPE_3DRAM,
01367 RAMTYPE_SDRAM,
01368 RAMTYPE_SGRAM,
01369 RAMTYPE_RDRAM,
01370 RAMTYPE_DDR,
01371 RAMTYPE_DDR2,
01372 RAMTYPE_DDR2_FB_DIMM,
01373 RAMTYPE_DDR3,
01374 RAMTYPE_TERMINATOR,
01375 };
01376
01377 typedef struct _RAMINFO_WMI
01378 {
01379 DWORD dwRAM_MemoryType[MAXRAMMODULES];
01380 ULONGLONG ullWMI_RAM_Capacity[MAXRAMMODULES];
01381 DWORD dwWMI_RAM_MemoryType[MAXRAMMODULES];
01382 } RAMINFO_WMI;
01383
01384 typedef struct _COMPUTERMODELINFO
01385 {
01386 wchar_t szComputer_Model[MAXCOMPUTERSYSTEMS][WMISI_INFO_SHORTSTRING];
01387 } COMPUTERMODELINFO;
01388
01389 typedef struct _BASEBOARDINFO
01390 {
01391 wchar_t szBaseBoard_Manufacturer[MAXBASEBOARDS][WMISI_INFO_SHORTSTRING];
01392 wchar_t szBaseBoard_Product[MAXBASEBOARDS][WMISI_INFO_SHORTSTRING];
01393 wchar_t szBaseBoard_SerialNumber[MAXBASEBOARDS][WMISI_INFO_SHORTSTRING];
01394 wchar_t szBaseBoard_Version[MAXBASEBOARDS][WMISI_INFO_SHORTSTRING];
01395 } BASEBOARDINFO;
01396
01397 typedef struct _SERIALPORTINFO
01398 {
01399 wchar_t szSerialPort_DeviceID[MAXSERIALPORTS][WMISI_VSHORTSTRING];
01400 wchar_t szSerialPort_Description[MAXSERIALPORTS][WMISI_VSHORTSTRING];
01401 wchar_t szSerialPort_ProviderType[MAXSERIALPORTS][WMISI_VSHORTSTRING];
01402 DWORD dwSerialPort_MaxBaudRate[MAXSERIALPORTS];
01403 } SERIALPORTINFO;
01404
01405 typedef struct _PARALLELPORTINFO
01406 {
01407 wchar_t szParallelPort_Caption[MAXSPARALLELPORTS][WMISI_VSHORTSTRING];
01408 } PARALLELPORTINFO;
01409
01410 typedef struct _NETWORKADAPTERINFO
01411 {
01412 wchar_t szNetworkAdapter_PNPDeviceID[MAXNETWORKADAPTERS][WMISI_INFO_SHORTSTRING];
01413 wchar_t szNetworkAdapter_Description[MAXNETWORKADAPTERS][WMISI_INFO_SHORTSTRING];
01414 wchar_t szNetworkAdapter_Summary[MAXNETWORKADAPTERS][LONG_STRING_LEN];
01415 UINT64 ui64Speed[MAXNETWORKADAPTERS];
01416 } NETWORKADAPTERINFO;
01417
01419 #define Win32_PortConnector_PortType_PS2 2
01420 #define Win32_PortConnector_PortType_Keyboard 13
01421 #define Win32_PortConnector_PortType_Mouse 14
01422 #define Win32_PortConnector_PortType_USB 16
01423 #define Win32_PortConnector_PortType_Firewire 17
01424 #define Win32_PortConnector_PortType_Audio 29
01425 #define Win32_PortConnector_PortType_NUM 33
01426
01427 typedef struct _PORTCONNECTORINFO
01428 {
01429 DWORD dwPortConnector_PortType[MAXPORTCONNECTORS];
01430 wchar_t szPortConnector_PortType[MAXPORTCONNECTORS][WMISI_SHORTSTRING];
01431 wchar_t szPortConnector_ConnectorType[MAXPORTCONNECTORS][WMISI_SHORTSTRING];
01432 DWORD dwPortConnector_NumUSBPorts;
01433 DWORD dwPortConnector_NumFirewirePorts;
01434 } PORTCONNECTORINFO;
01435
01436 typedef struct _DISKPARTITIONINFO
01437 {
01439 int iNumDiskPartitions[MAXNUMDISKS];
01440 } DISKPARTITIONINFO;
01441
01442 typedef struct _SYSINFO_WMI
01443 {
01444 BIOSINFO BIOSInfo;
01445 VIRTUALMEMORYINFO VirtualMemoryInfo;
01446 OPTICALDRIVEINFO OpticalDriveInfo;
01447 PHYSICALDRIVEINFO PhyscialDriveInfo;
01448 DISKVOLUMEINFO DiskVolumeInfo;
01449 RAMINFO_WMI RAMInfo;
01450 COMPUTERMODELINFO ComputerModelInfo;
01451 BASEBOARDINFO BaseBoardInfo;
01452 SERIALPORTINFO SerialPortInfo;
01453 PARALLELPORTINFO ParallelPortInfo;
01454 NETWORKADAPTERINFO NetworkAdapterInfo;
01455 PORTCONNECTORINFO PortConnectorInfo;
01456 DISKPARTITIONINFO DiskPartitionInfo;
01457
01458 } SYSINFO_WMI;
01459
01473 SYSINFO_API BOOL SysInfoDll_GetSystemInfo_WMI ( SYSINFO_WMI *SysInfo);
01474
01489 SYSINFO_API BOOL SysInfoDll_GetSystemInfo_WMI_async ( SYSINFO_WMI *SysInfo_WMI ) ;
01490
01491
01502 SYSINFO_API BOOL SysInfoDll_GetSystemInfo_WMI_async_complete ( SYSINFO_WMI *SysInfo ,
01503 int *iProgressPercent ) ;
01504
01505
01513 SYSINFO_API wchar_t * SysInfoDll_GetHDDSummaryLine(SYSINFO_WMI *SysInfo_WMI, wchar_t * line, int iLen);
01514
01516
01517
01518
01522
01523 #define SMB_VSHORT_STRINGLEN 32
01524 #define SMB_STRINGLEN 64
01525
01526 typedef struct _RAMINFO_SMBIOS
01527 {
01528 int iNumberRAMModules;
01529 ULONGLONG ullRAM_Capacity[MAXRAMMODULES];
01530 DWORD dwRAM_MemoryType[MAXRAMMODULES];
01531 DWORD dwRAM_PositionInRow[MAXRAMMODULES];
01532 wchar_t szRAM_MemoryLocation[MAXRAMMODULES][SMB_VSHORT_STRINGLEN];
01533 DWORD dwRAM_Speed[MAXRAMMODULES];
01534 wchar_t szRAM_Manufacturer[MAXRAMMODULES][SMB_VSHORT_STRINGLEN];
01535 wchar_t szRAM_szSerialNumber[MAXRAMMODULES][SMB_STRINGLEN];
01536 wchar_t szRAM_RAMModuleHeading[MAXRAMMODULES][SMB_VSHORT_STRINGLEN];
01537 wchar_t szRAM_RAMModuleLine1[MAXRAMMODULES][WMISI_INFO_VSHORTSTRING];
01538 wchar_t szRAM_RAMModuleLine2[MAXRAMMODULES][WMISI_INFO_VSHORTSTRING];
01539 } RAMINFO_SMBIOS;
01540
01541 typedef struct _SYSINFO_SMBIOS
01542 {
01543 BIOSINFO BIOSInfo;
01544 RAMINFO_SMBIOS RAMInfo;
01545 } SYSINFO_SMBIOS;
01546
01547 enum SMB_STATUS {
01548 SMBERR_SUCCESS,
01549 SMBERR_MEMALLOC,
01550 SMBERR_INIT_DIRECTIO,
01551 SMBERR_NO_SMBIOS,
01552 SMBERR_ACCESS_DENIED,
01553 SMBERR_FAILURE,
01554 };
01555
01556
01562 SYSINFO_API int SysInfoDll_GetSystemInfo_SMBIOS( SYSINFO_SMBIOS *SysInfo );
01563
01565
01566
01567
01568
01589 SYSINFO_API BOOL SysInfoDll_GetAll( LPWSTR szComputerName ,
01590 LPWSTR szszOSName ,
01591 CPUINFO *pCPUinfo ,
01592 MEMORYSTATUSEX *pMemInfoEx ,
01593 MULTIMONITOR_DYN *MM ,
01594 DISPLAY_DEVICES *DD ,
01595 LPWSTR szGraphicsSummary ,
01596 SYSINFO_WMI *SysInfo_WMI ,
01597 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01598 USB_HOST_CONTROLLERS *USBHostControllers );
01599
01600
01624 SYSINFO_API BOOL SysInfoDll_GetAll_async( LPWSTR szComputerName ,
01625 LPWSTR szszOSName ,
01626 CPUINFO *pCPUinfo ,
01627 MEMORYSTATUSEX *pMemInfoEx ,
01628 MULTIMONITOR_DYN *MM ,
01629 DISPLAY_DEVICES *DD ,
01630 LPWSTR szGraphicsSummary ,
01631 SYSINFO_WMI *SysInfo_WMI ,
01632 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01633 USB_HOST_CONTROLLERS *USBHostControllers );
01634
01636
01637
01638
01639
01640
01644
01645 enum SYSINFO_FORMAT_TYPE {
01646 FORMAT_TEXT = 0,
01647 FORMAT_HTML};
01648
01667 SYSINFO_API BOOL SysInfoDll_FormatAll( SYSINFO_FORMAT_TYPE Format ,
01668 LPWSTR szComputerName ,
01669 LPWSTR szOSName ,
01670 CPUINFO *pCPUinfo ,
01671 MEMORYSTATUSEX *pMemInfoEx ,
01672 MEMMODULEINFO *pMemModuleInfo,
01673 MULTIMONITOR_DYN *MM ,
01674 DISPLAY_DEVICES *DD ,
01675 LPWSTR szGraphicsSummary ,
01676 SYSINFO_WMI *SysInfo_WMI ,
01677 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01678 USB_HOST_CONTROLLERS *USBHostControllers ,
01679 LPWSTR pszRes ,
01680 int *iResLen );
01681
01696 SYSINFO_API BOOL SysInfoDll_FormatSummary( SYSINFO_FORMAT_TYPE Format ,
01697 LPWSTR szComputerName ,
01698 LPWSTR szOSName ,
01699 CPUINFO *pCPUinfo ,
01700 MEMORYSTATUSEX *pMemInfoEx ,
01701 LPWSTR szGraphicsSummary ,
01702 SYSINFO_WMI *SysInfo_WMI ,
01703 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01704 LPWSTR pszRes ,
01705 int *iResLen );
01706
01717 SYSINFO_API BOOL SysInfoDll_FormatGeneral( SYSINFO_FORMAT_TYPE Format ,
01718 LPWSTR szComputerName ,
01719 SYSINFO_WMI *SysInfo_WMI ,
01720 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01721 LPWSTR pszRes ,
01722 int *iResLen );
01723
01732 SYSINFO_API BOOL SysInfoDll_FormatCPU( SYSINFO_FORMAT_TYPE Format ,
01733 CPUINFO *pCPUinfo ,
01734 LPWSTR pszRes ,
01735 int *iResLen );
01736
01748 SYSINFO_API BOOL SysInfoDll_FormatMemory( SYSINFO_FORMAT_TYPE Format ,
01749 MEMORYSTATUSEX *pMemInfoEx ,
01750 SYSINFO_WMI *SysInfo_WMI ,
01751 SYSINFO_SMBIOS *SysInfo_SMBIOS ,
01752 MEMMODULEINFO *pMemModuleInfo ,
01753 LPWSTR pszRes ,
01754 int *iResLen );
01755
01764 SYSINFO_API BOOL SysInfoDll_FormatMemSPD( SYSINFO_FORMAT_TYPE Format ,
01765 MEMMODULEINFO *pMemModuleInfo ,
01766 LPWSTR pszRes ,
01767 int *iResLen );
01778 SYSINFO_API BOOL SysInfoDll_FormatGraphics( SYSINFO_FORMAT_TYPE Format,
01779 MULTIMONITOR_DYN *MM,
01780 DISPLAY_DEVICES *DD,
01781 LPWSTR szGraphicsSummary,
01782 LPWSTR pszRes,
01783 int *iResLen);
01784
01793 SYSINFO_API BOOL SysInfoDll_FormatDiskVolumes ( SYSINFO_FORMAT_TYPE Format ,
01794 SYSINFO_WMI *SysInfo_WMI ,
01795 LPWSTR pszRes ,
01796 int *iResLen );
01797
01806 SYSINFO_API BOOL SysInfoDll_FormatDiskDrives( SYSINFO_FORMAT_TYPE Format ,
01807 SYSINFO_WMI *SysInfo_WMI ,
01808 LPWSTR pszRes ,
01809 int *iResLen );
01810
01819 SYSINFO_API BOOL SysInfoDll_FormatOpticalDrives( SYSINFO_FORMAT_TYPE Format,
01820 SYSINFO_WMI *SysInfo_WMI,
01821 LPWSTR pszRes,
01822 int *iResLen);
01823
01832 SYSINFO_API BOOL SysInfoDll_FormatNetwork( SYSINFO_FORMAT_TYPE Format,
01833 SYSINFO_WMI *SysInfo_WMI,
01834 LPWSTR pszRes,
01835 int *iResLen);
01836
01845 SYSINFO_API BOOL SysInfoDll_FormatPorts( SYSINFO_FORMAT_TYPE Format,
01846 SYSINFO_WMI *SysInfo_WMI,
01847 LPWSTR pszRes,
01848 int *iResLen);
01849
01858 SYSINFO_API BOOL SysInfoDll_FormatUSB( SYSINFO_FORMAT_TYPE Format,
01859 USB_HOST_CONTROLLERS *USBHostControllers,
01860 LPWSTR pszRes,
01861 int *iResLen);
01862
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883
01888
01889
01890 #define SERIAL_NUM_LEN 20
01891 #define FIRMWARE_REV_LEN 8
01892 #define MODEL_NUM_LEN 40
01893 #define VENDOR_UNIQUE_LEN 3
01894 #define WWN_LEN 8
01895
01896 #define MAX_PARTITIONS_PER_DEVICE 8
01897
01901
01902 #define SMART_STATUS_SUCCESS 0
01903
01905 #define SMART_ERR_DEVICE_ID_DNE -1000
01906
01907 #define SMART_ERR_DEVICE_ID_NOT_SMART -1001
01908 #define SMART_ERR_DEVICE_OPEN -1002
01909
01910 #define SMART_ERR_DRIVE_NUMBER_INVALID -1100
01911
01912 #define SMART_ERR_DRIVE_NUMBER_DNE -1101
01913
01914 #define SMART_ERR_DRIVE_NUMBER_NOT_FIXED -1102
01915
01917 #define SMART_ERR_BUFFER_INVALID -2000
01918
01919 #define SMART_ERR_BUFFER_TOO_SMALL -2001
01920
01921 #define SMART_ERR_BUFFER_FAILED_ALLOCATE -2002
01922
01924 #define SMART_ERR_SMART_DEVICE_ID_EMPTY -3001
01925
01926 #define SMART_ERR_SMART_DEVICE_ID_EOL -3002
01927
01929 #define SMART_ERR_SMART_ATTR_ID_EMPTY -4001
01930
01931 #define SMART_ERR_SMART_ATTR_ID_EOL -4002
01932
01933 #define SMART_ERR_SMART_ATTR_ID_INVALID -4003
01934
01935 #define SMART_WARN_SMART_ATTR_ID_UNKNOWN -4004
01936
01938 #define SMART_ERR_FOPEN_FAIL -5001
01939
01940 #define SMART_ERR_FWRITE_FAIL -5002
01941
01942 #define SMART_ERR_FREAD_FAIL -5003
01943
01944 #define SMART_ERR_ACCESS_RW -5101
01945
01946 #define SMART_ERR_ACCESS_RO -5102
01947
01948 #define SMART_ERR_FSEEK_FAIL -5201
01949
01951 #define SMART_ERR_GET_PHY_CAPACITY -6001
01952
01954 #define SMART_ERR_BUILD_DRIVES_INFO_NO_ACCESS -7001
01955
01956 #define SMART_ERR_NO_ADMIN_RIGHTS -7002
01957
01959 #define SMART_ERR_DLL_NOT_INIT -10001
01960
01961 #define SMART_ERR_DLL_INIT_MEMORY_ALLOC_FAIL -10002
01962
01963 #define SMART_ERR_FUNCTION_NOT_SUPPORTED -10003
01964
01965 #define SMART_ERR_EMPTY_STRING -10004
01966
01968 #define SMART_ERR_TEC_NO_ATTRIBUTES -20001
01969
01970 #define SMART_ERR_TEC_SIGNATURE_HEAD -20002
01971
01972 #define SMART_ERR_TEC_SIGNATURE_TAIL -20003
01973
01974 #define SMART_ERR_TEC_FILE_DNE -20004
01975
01976 #define SMART_WARN_TEC_NOT_ENOUGH_DATA -20005
01977
01978 #define SMART_WARN_TEC_ATTR_ID_NA -20006
01979
01980 #define SMART_WARN_TEC_UNABLE_TO_PREDICT -20007
01981
01982 #define SMART_ERR_UNEXPECTED -30001
01983
01985
01989 #define ATTR_INVALID 0x0
01990
01991 #define ATTR_READ_ERROR_RATE 0x1
01992
01993 #define ATTR_THROUGHPUT_PERF 0x2
01994
01995 #define ATTR_SPIN_UP_TIME 0x3
01996
01997 #define ATTR_START_STOP_COUNT 0x4
01998
01999 #define ATTR_REALLOC_SECTOR_COUNT 0x5
02000
02001 #define ATTR_READ_CHANNEL_MARGIN 0x6
02002
02003 #define ATTR_SEEK_ERROR_RATE 0x7
02004
02005 #define ATTR_SEEK_TIME_PERF 0x8
02006
02007 #define ATTR_POWER_ON_TIME 0x9
02008
02009 #define ATTR_SPIN_RETRY_COUNT 0xA
02010
02011 #define ATTR_CALIBRATION_RETRY_COUNT 0xB
02012
02013 #define ATTR_POWER_CYCLE_COUNT 0xC
02014
02015 #define ATTR_SOFT_READ_ERROR_RATE 0xD
02016
02017 #define ATTR_DOWNSHIFT_ERROR_COUNT 0xB7
02018 #define ATTR_END_TO_END_ERROR 0xB8
02019 #define ATTR_HEAD_STABILITY 0xB9
02020 #define ATTR_INDUCED_OP_VIB_DETECT 0xBA
02021 #define ATTR_UNCORRECTABLE_ERRORS 0xBB
02022 #define ATTR_COMMAND_TIMEOUT 0xBC
02023 #define ATTR_COMMAND_HIGH_FLY_WRITES 0xBD
02024
02025 #define ATTR_100_MINUS_TEMPERATURE 0xBE
02026
02027 #define ATTR_GSENSE_ERROR_RATE_BF 0xBF
02028
02030 #define ATTR_POWER_OFF_RETRACT_COUNT 0xC0
02031
02032 #define ATTR_LOAD_CYCLE_COUNT 0xC1
02033
02034 #define ATTR_TEMPERATURE_C2 0xC2
02035
02036 #define ATTR_HARDWARE_ECC_RECOVERED 0xC3
02037
02038 #define ATTR_REALLOC_EVENT_COUNT 0xC4
02039
02040 #define ATTR_PENDING_SECTOR_COUNT 0xC5
02041
02042 #define ATTR_UNCORRECTABLE_SECTOR_COUNT 0xC6
02043
02044 #define ATTR_ULTRADMA_CRC_ERROR_COUNT 0xC7
02045
02046 #define ATTR_WRITE_ERROR_COUNT 0xC8
02047
02048 #define ATTR_OFF_TRACK_ERRORS 0xC9
02049
02050 #define ATTR_DATA_ADDRESS_MARK_ERRORS 0xCA
02051
02052 #define ATTR_ECC_ERRORS 0xCB
02053
02054 #define ATTR_SOFT_ECC_CORRECTION 0xCC
02055
02056 #define ATTR_THERMAL_ASPERITY_RATE 0xCD
02057
02058 #define ATTR_FLYING_HEIGHT 0xCE
02059
02060 #define ATTR_SPIN_HIGH_CURRENT 0xCF
02061
02063 #define ATTR_SPIN_BUZZ 0xD0
02064
02065 #define ATTR_OFFLINE_SEEK_PERFORMANCE 0xD1
02066 #define ATTR_VIBRATION_DURING_WRITE 0xD3
02067 #define ATTR_SHOCK_DURING_WRITE 0xD4
02068
02069 #define ATTR_DISK_SHIFT 0xDC
02070
02071 #define ATTR_GSENSE_ERROR_RATE_DD 0xDD
02072
02073 #define ATTR_LOADED_HOURS 0xDE
02074
02075 #define ATTR_LOAD_UNLOAD_RERTY_COUNT 0xDF
02076
02078 #define ATTR_LOAD_FRICTION 0xE0
02079
02080 #define ATTR_LOAD_UNLOAD_CYCLE_COUNT 0xE1
02081
02082 #define ATTR_LOAD_IN_TIME 0xE2
02083
02084 #define ATTR_TORQUE_AMPLIFICATION_COUNT 0xE3
02085
02086 #define ATTR_POWEROFF_RETRACT_CYCLE 0xE4
02087
02088 #define ATTR_GMR_HEAD_AMPLITUDE 0xE6
02089
02090 #define ATTR_TEMPERATURE_E7 0xE7
02091
02093 #define ATTR_HEAD_FLYING_HOURS 0xF0
02094 #define ATTR_TOTAL_LBAS_WRITTEN 0xF1
02095 #define ATTR_TOTAL_LBAS_READ 0xF2
02096
02097 #define ATTR_READ_ERROR_RETRY_RATE 0xFA
02098 #define ATTR_FREE_FALL_PROTECTION 0xFE
02099
02101
02102
02104 #define ATTR_TYPE_STR_DESC 0x20
02105
02106 #define ATTR_TYPE_INT_STATUS 0x40
02107
02109 #define ATTR_TYPE_INT_VALUE 0x01
02110
02111 #define ATTR_TYPE_ULONGLONG_RAW 0x02
02112
02113 #define ATTR_TYPE_INT_WORST 0x04
02114
02115 #define ATTR_TYPE_INT_THRESHOLD 0x08
02116
02121
02122 #define INTERACE_TYPE_UNKNOWN 0x00
02123 #define INTERACE_TYPE_SCSI 0x01
02124 #define INTERACE_TYPE_ATAPI 0x02
02125 #define INTERACE_TYPE_ATA 0x03
02126 #define INTERACE_TYPE_1394 0x04
02127 #define INTERACE_TYPE_SSA 0x05
02128 #define INTERACE_TYPE_FIBRE 0x06
02129 #define INTERACE_TYPE_USB 0x07
02130 #define INTERACE_TYPE_RAID 0x08
02131 #define INTERACE_TYPE_ISCSI 0x09
02132 #define INTERACE_TYPE_SAS 0x0A
02133 #define INTERACE_TYPE_SATA 0x0B
02134
02135
02136
02137 #define ATA_COMPLIANCE(x) (x != 0x0000 && x != 0xFFFF)
02138 #define ATA8_SUPPORTED(x) (x & (1 << 8))
02139 #define ATA7_SUPPORTED(x) (x & (1 << 7))
02140 #define ATA6_SUPPORTED(x) (x & (1 << 6))
02141 #define ATA5_SUPPORTED(x) (x & (1 << 5))
02142 #define ATA4_SUPPORTED(x) (x & (1 << 4))
02143
02144
02145 #define TRANSPORT_TYPE_AVAILABLE(x) (x != 0x0000 && x != 0xFFFF)
02146 #define TRANSPORT_TYPE_SERIAL(x) (x & (1 << 12))
02147 #define TRANSPORT_TYPE_PARALLEL(x) ((x & (1 << 12)) == 0)
02148 #define SATA3_0_COMPLIANCE(x) (x & (1 << 5))
02149 #define SATA2_6_COMPLIANCE(x) (x & (1 << 4))
02150 #define SATA2_5_COMPLIANCE(x) (x & (1 << 3))
02151 #define SATA2_EXT_COMPLIANCE(x) (x & (1 << 2))
02152 #define SATA1_COMPLIANCE(x) (x & (1 << 1))
02153 #define ATA7_COMPLIANCE(x) (x & (1 << 1))
02154 #define ATA8_COMPLIANCE(x) (x & 1)
02155
02156
02157 #define ROTATION_RATE_AVAILABLE(x) (x != 0)
02158 #define ROTATION_RATE_SSD(x) (x == 0x0001)
02159
02160
02161 #define MULTIDMA_MODE2_SUPPORTED(x) (x & (1 << 2))
02162 #define MULTIDMA_MODE1_SUPPORTED(x) (x & (1 << 1))
02163 #define MULTIDMA_MODE0_SUPPORTED(x) (x & 1)
02164
02165
02166 #define MULTIDMA_MODE2_SELECTED(x) (x & (1 << 2))
02167 #define MULTIDMA_MODE1_SELECTED(x) (x & (1 << 1))
02168 #define MULTIDMA_MODE0_SELECTED(x) (x & 1)
02169
02170
02171 #define ULTRADMA_MODE6_SUPPORTED(x) (x & (1 << 6))
02172 #define ULTRADMA_MODE5_SUPPORTED(x) (x & (1 << 5))
02173 #define ULTRADMA_MODE4_SUPPORTED(x) (x & (1 << 4))
02174 #define ULTRADMA_MODE3_SUPPORTED(x) (x & (1 << 3))
02175 #define ULTRADMA_MODE2_SUPPORTED(x) (x & (1 << 2))
02176 #define ULTRADMA_MODE1_SUPPORTED(x) (x & (1 << 1))
02177 #define ULTRADMA_MODE0_SUPPORTED(x) (x & 1)
02178
02179
02180 #define ULTRADMA_MODE6_SELECTED(x) (x & (1 << 6))
02181 #define ULTRADMA_MODE5_SELECTED(x) (x & (1 << 5))
02182 #define ULTRADMA_MODE4_SELECTED(x) (x & (1 << 4))
02183 #define ULTRADMA_MODE3_SELECTED(x) (x & (1 << 3))
02184 #define ULTRADMA_MODE2_SELECTED(x) (x & (1 << 2))
02185 #define ULTRADMA_MODE1_SELECTED(x) (x & (1 << 1))
02186 #define ULTRADMA_MODE0_SELECTED(x) (x & 1)
02187
02188
02189 #define PIO_MODE3_SUPPORTED(x) (x & 1)
02190 #define PIO_MODE4_SUPPORTED(x) (x & (1 << 1))
02191
02192
02193 #define SATA_NCQ_PRIO_INFO_SUPPORTED(x) (x & (1 << 12))
02194 #define SATA_UNLOAD_NCQ_PENDING_SUPPORTED(x) (x & (1 << 11))
02195 #define SATA_PHY_EVENT_COUNTERS_SUPPORTED(x) (x & (1 << 10))
02196 #define SATA_POWER_MGMT_REQUESTS_SUPPORTED(x) (x & (1 << 9))
02197 #define SATA_NCQ_FEATURES_SUPPORTED(x) (x & (1 << 8))
02198 #define SATA_GEN2_SIGNAL_SPEED_SUPPORTED(x) (x & (1 << 2))
02199 #define SATA_GEN1_SIGNAL_SPEED_SUPPORTED(x) (x & (1 << 1))
02200
02201
02202 #define SATA_SSP_SUPPORTED(x) (x & (1 << 6))
02203 #define SATA_IN_ORDER_DELIVERY_SUPPORTED(x) (x & (1 << 4))
02204 #define SATA_INIT_POWER_MGMT_SUPPORTED(x) (x & (1 << 3))
02205 #define SATA_DMA_SETUP_AUTO_ACT_SUPPORTED(x) (x & (1 << 2))
02206 #define SATA_NON_ZERO_BUFOFF_SUPPORTED(x) (x & (1 << 1))
02207
02208
02209 #define SATA_SSP_ENABLED(x) (x & (1 << 6))
02210 #define SATA_IN_ORDER_DELIVERY_ENABLED(x) (x & (1 << 4))
02211 #define SATA_INIT_POWER_MGMT_ENABLED(x) (x & (1 << 3))
02212 #define SATA_DMA_SETUP_AUTO_ACT_ENABLED(x) (x & (1 << 2))
02213 #define SATA_NON_ZERO_BUFOFF_ENABLED(x) (x & (1 << 1))
02214
02215
02216 #define AAM_LEVEL_VENDOR_SPECIFIC(x) (x == 0x00)
02217 #define AAM_LEVEL_MIN_ACOUSTIC(x) (x == 0x80)
02218 #define AAM_LEVEL_INT_ACOUSTIC(x) (x >= 0x81 && x <= 0xFD)
02219 #define AAM_LEVEL_MAX_PERFORMANCE(x) (x == 0xFE)
02220
02221
02222 #define APM_LEVEL_MIN_POWER_WITH_STANDBY(x) (x == 0x01)
02223 #define APM_LEVEL_INT_POWER_WITH_STANDBY(x) (x >= 0x02 && x <= 0x7F)
02224 #define APM_LEVEL_MIN_POWER_WITHOUT_STANDBY(x) (x == 0x80)
02225 #define APM_LEVEL_INT_POWER_WITHOUT_STANDBY(x) (x >= 0x81 && x <= 0xFD)
02226 #define APM_LEVEL_MAX_PERFORMANCE(x) (x == 0xFE)
02227
02228
02229 #define SCT_TRANSPORT_SUPPORTED(x) (x & 1)
02230 #define SCT_DATA_TABLES_SUPPORTED(x) (x & (1 << 5))
02231 #define SCT_FEATURES_CTRL_SUPPORTED(x) (x & (1 << 4))
02232 #define SCT_ERROR_RECOVERY_CTRL_SUPPORTED(x) (x & (1 << 3))
02233 #define SCT_WRITE_SAME_SUPPORTED(x) (x & (1 << 2))
02234
02235
02236 typedef struct _DEVICEINFO
02237 {
02238
02239 BYTE bChannelId;
02240 BYTE bTargetId;
02241 BYTE bLun;
02243 BYTE bInterfaceType;
02244
02245
02246 UINT64 qwNumCylinders;
02247 WORD wBytesPerSector;
02248 WORD wSectorsPerTrack;
02249 WORD wTracksPerCylinder;
02251 WORD wLogicalSectorSize;
02253 WORD wPhysicalSectorSize;
02255 DWORD dwBufferSize;
02257 WORD wECCSize;
02259 WORD wMediaRotationRate;
02260
02261
02263 WORD wATAVersionSupported;
02265 WORD wTransportTypeSupported;
02266 UINT64 qwTotalAddressableSectors;
02267
02269 BYTE bSerialNumber[SERIAL_NUM_LEN];
02271 BYTE bFirmwareRev[FIRMWARE_REV_LEN];
02273 BYTE bModelNumber[MODEL_NUM_LEN];
02274 BYTE bWorldWideID[WWN_LEN];
02275
02276
02277 BOOLEAN bSMARTSupported;
02278 BOOLEAN bSMARTEnabled;
02279 BOOLEAN bSMARTSelfTestSupported;
02280 BOOLEAN bSMARTErrorLoggingSupported;
02281
02282 BOOLEAN bLBASupported;
02283 BOOLEAN bIORDYSupported;
02284 BOOLEAN bCFastSupported;
02285
02286 BOOLEAN bDMASupported;
02288 BYTE bMultiwordDMASupported ;
02290 BYTE bMultiwordDMASelected ;
02291
02293 BYTE bUltraDMASupported ;
02295 BYTE bUltraDMASelected ;
02296
02298 BYTE bPIOSupported;
02299
02300 BOOLEAN bSATACompliance;
02302 WORD wSATACapabilities;
02304 WORD wSATAFeaturesSupported;
02306 WORD wSATAFeaturesEnabled;
02307
02308 BOOLEAN bTrustedComputingSupported;
02309 BOOLEAN bHPASupported;
02310 BOOLEAN bReadLookAheadSupported;
02311 BOOLEAN bReadLookAheadEnabled;
02312 BOOLEAN bWriteCacheSupported;
02313 BOOLEAN bWriteCacheEnabled;
02314 BOOLEAN bPowerManagementSupported;
02315 BOOLEAN bSecurityModeSupported;
02316 BOOLEAN bSecurityModeEnabled;
02317 BOOLEAN bDeviceConfigOverlaySupported;
02318 BOOLEAN b48BitAddressSupported;
02319 BOOLEAN bAutoAcousticSupported;
02320 BOOLEAN bAutoAcousticEnabled;
02321 BYTE bRecommendedAAMLevel;
02322 BYTE bCurrentAAMLevel;
02323 BOOLEAN bPowerUpStandbySupported;
02324 BOOLEAN bPowerUpStandbyEnabled;
02325 BOOLEAN bAutoPowerManagementSupported;
02326 BOOLEAN bAutoPowerManagementEnabled;
02327 BYTE bCurrentAPMLevel;
02328 BOOLEAN bCFASupported;
02329 BOOLEAN bGPLoggingSupported;
02330 BOOLEAN bStreamingSupported;
02331 BOOLEAN bMediaCardPassthroughSupported;
02332 BOOLEAN bMediaCardPassthroughEnabled;
02333 BOOLEAN bExtPowerConditionsSupported;
02334 BOOLEAN bExtPowerConditionsEnabled;
02335 BOOLEAN bExtStatusReportingSupported;
02336 BOOLEAN bExtStatusReportingEnabled;
02337 BOOLEAN bFreefallControlSupported;
02338 BOOLEAN bFreefallControlEnabled;
02339 BOOLEAN bWriteReadVerifySupported;
02340 BOOLEAN bWriteReadVerifyEnabled;
02341 BOOLEAN bTrimSupported;
02343 WORD wSCTCommandTransportSupported;
02344 BOOLEAN bNVCacheEnabled;
02345 BOOLEAN bNVCachePMSupported;
02346 BOOLEAN bNVCachePMEnabled;
02347
02348 } DEVICEINFO, *LPDEVICEINFO;
02349
02351
02366 SYSINFO_API int SysInfoDll_Smart_Init( bool debug,
02367 wchar_t *iDebugFile = NULL,
02368 bool iRecordTEC = true );
02369
02379 SYSINFO_API void SysInfoDll_Smart_Cleanup( void );
02380
02391 SYSINFO_API int SysInfoDll_Smart_Refresh( bool iRecordTEC = false );
02392
02397 SYSINFO_API int SysInfoDll_Smart_GetNumSmartDevices( void );
02398
02403 SYSINFO_API int SysInfoDll_Smart_GetNumDetectedDrives( void );
02404
02410 SYSINFO_API int SysInfoDll_Smart_IsValidSmartDevice( int iDeviceID );
02411
02433 SYSINFO_API int SysInfoDll_Smart_GetDevicePartitionInfo( int *ioDriveNumSameDisk ,
02434 int* ioNumPartition ,
02435 int iDeviceID );
02436
02443 SYSINFO_API int SysInfoDll_Smart_GetDriveLetterFromDriveNum( wchar_t* ioDriveLetter,
02444 int iDriveNum );
02445
02454 SYSINFO_API int SysInfoDll_Smart_GetDeviceSerialNumber( wchar_t* ioBuf ,
02455 int* ioLen ,
02456 int iDeviceID );
02457
02466 SYSINFO_API int SysInfoDll_Smart_GetDeviceFirmWareRev( wchar_t* ioBuf ,
02467 int* ioLen ,
02468 int iDeviceID );
02469
02478 SYSINFO_API int SysInfoDll_Smart_GetDeviceModelNumber( wchar_t* ioBuf ,
02479 int* ioLen ,
02480 int iDeviceID );
02481
02488 SYSINFO_API int SysInfoDll_Smart_GetDeviceCapacity( int* ioCapacity ,
02489 int iDeviceID );
02490
02497 SYSINFO_API int SysInfoDll_Smart_GetVolumeCapacity( int* ioCapacity ,
02498 int iDriveNum );
02499
02505 SYSINFO_API int SysInfoDll_Smart_GetSmartDeviceIDFirst( void );
02506
02515 SYSINFO_API int SysInfoDll_Smart_GetSmartDeviceIDNext( void );
02516
02522 SYSINFO_API int SysInfoDll_Smart_GetNumSmartAttr( int iDeviceID );
02523
02530 SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeIDFirst( int iDeviceID );
02531
02540 SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeIDNext( int iDeviceID );
02541
02559 SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeByID( void* ioPtr ,
02560 int* ioLen ,
02561 int iAttrID ,
02562 int inAttrType ,
02563 int iDeviceID );
02564
02565
02573 SYSINFO_API int SysInfoDll_Smart_GetAttrDescByID( wchar_t *oBuf ,
02574 int *ioLen ,
02575 int iAttrID );
02576
02583 SYSINFO_API int SysInfoDll_Smart_GetDeviceInfo( DEVICEINFO *oDeviceInfo ,
02584 int iDeviceID );
02585
02599 SYSINFO_API int SysInfoDll_Smart_ExportReport( wchar_t *filename ,
02600 int iDeviceID ,
02601 wchar_t *iHeaderText ,
02602 int iHeaderTextLen ,
02603 int iExportFlags = 3 ,
02604 int iHistoryAttr = 0 );
02605
02612 SYSINFO_API int SysInfoDll_Smart_RecordTECData( int iDeviceID );
02613
02621 SYSINFO_API int SysInfoDll_Smart_GetTECDataSetCount( int* ioCount ,
02622 int iDeviceID );
02623
02635 SYSINFO_API int SysInfoDll_Smart_ExportTECData( time_t* ioTimeArray ,
02636 int* ioNormValArray ,
02637 int* ioWorstValArray ,
02638 int* ioArraySize ,
02639 int iAttrID ,
02640 int iDeviceID );
02652 SYSINFO_API int SysInfoDll_Smart_GetTECDataAtIndex( time_t* ioTime ,
02653 int* ioNormVal ,
02654 int* ioWorstVal ,
02655 int inIndex ,
02656 int iAttrID ,
02657 int iDeviceID );
02658
02674 SYSINFO_API int SysInfoDll_Smart_EstimateTECByAttributeID( time_t* ioEarliest ,
02675 time_t* ioLatest ,
02676 int iAttrID ,
02677 int iDeviceID );
02678
02695 SYSINFO_API int SysInfoDll_Smart_EstimateTEC( time_t* ioEarliest ,
02696 time_t* ioLatest ,
02697 int* oAttrID ,
02698 int iDeviceID );
02699
02701
02702 #endif