Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1998-1999, Microsoft Corporation
  3. Module Name:
  4. CHardwar.h
  5. Abstract:
  6. --*/
  7. #ifndef CHARDWARE_H
  8. #define CHARDWARE_H
  9. #ifndef __WINDOWS_H
  10. #include <windows.h>
  11. #endif
  12. // Used Definitions Declarations
  13. #define CHARDWARE_CLASSID 0x13530808L
  14. #define BIOS_DIGIT 0
  15. #define HD_SERIAL_DIGIT 1
  16. #define TOTAL_RAM_DIGIT 2
  17. #define FD_CONFIG_DIGIT 3
  18. #define VIDEO_BIOS_DIGIT 4
  19. #define HARDWARE_ID_SIZE 6
  20. #define HARDWARE_GUID_SIZE 39
  21. #define MAX_BIOS_KEY_LENGTH 2048
  22. #define VWIN32_DIOC_DOS_INT13 4
  23. #define FLAGS_CARRY 1
  24. // Used Type Declarations
  25. typedef struct _DIOC_REGISTERS
  26. {
  27. DWORD reg_EBX;
  28. DWORD reg_EDX;
  29. DWORD reg_ECX;
  30. DWORD reg_EAX;
  31. DWORD reg_EDI;
  32. DWORD reg_ESI;
  33. DWORD reg_Flags;
  34. } DIOC_REGISTERS, *PDIOC_REGISTERS;
  35. #pragma pack(1)
  36. typedef struct _DEVICEPARAMS
  37. {
  38. BYTE dpSpecFunc;
  39. BYTE dpDevType;
  40. WORD dpDevAttr;
  41. WORD dpCylinders;
  42. BYTE dpMediaType;
  43. WORD dpBytesPerSec;
  44. BYTE dpSecPerClust;
  45. WORD dpResSectors;
  46. BYTE dpFATs;
  47. WORD dpRootDirEnts;
  48. WORD dpSectors;
  49. BYTE dpMedia;
  50. WORD dpFATsecs;
  51. WORD dpSecPerTrack;
  52. WORD dpHeads;
  53. DWORD dpHiddenSecs;
  54. DWORD dpHugeSectors;
  55. } DEVICEPARAMS, *PDEVICEPARAMS;
  56. #pragma pack()
  57. // Class Declaration
  58. class CHardware
  59. {
  60. public:
  61. CHardware();
  62. virtual ~CHardware();
  63. public:
  64. LPSTR GetGUID();
  65. LPSTR GetID();
  66. #ifdef HWID_DETAIL ////////////////////////////////////////////////////////////
  67. DWORD GetType();
  68. DWORD GetBiosCrc32() { return m_dwBiosCrc32; };
  69. DWORD GetVolSer() { return m_dwVolSer; };
  70. DWORD GetTotalRamMegs() { return m_dwTotalRamMegs; };
  71. DWORD GetVideoBiosCrc32() { return m_dwVideoBiosCrc32; };
  72. #endif
  73. public:
  74. ULONG uClassID;
  75. private:
  76. #ifndef _WIN64
  77. DWORD CalculateDriveCapacity95( INT nDrive );
  78. #endif
  79. DWORD CalculateMemoryRegionChecksum( LPBYTE pbChecksumArea, INT nNumberBytes );
  80. VOID SetBIOSDigit();
  81. VOID SetFDConfigDigit();
  82. VOID SetHDSerialDigit();
  83. VOID SetTotalRAMDigit();
  84. VOID SetVideoBIOSDigit();
  85. #ifndef NO_HWID_GUID //////////////////////////////////////////////////////////
  86. VOID CalculateHardwareGUID();
  87. #endif ////////////////////////////////////////////////////////////////////////
  88. #if defined(WIN32) || defined(_WIN32)
  89. static UINT CalculateRegKeyChecksum( LPSTR lpszKey );
  90. static DWORD CalculateDriveCapacityNT( INT nDrive );
  91. #endif
  92. private:
  93. CHAR m_szHardwareID[ HARDWARE_ID_SIZE ];
  94. #ifndef NO_HWID_GUID //////////////////////////////////////////////////////////
  95. CHAR m_szHardwareGUID[ HARDWARE_GUID_SIZE ];
  96. #endif ////////////////////////////////////////////////////////////////////////
  97. #ifdef HWID_DETAIL ////////////////////////////////////////////////////////////
  98. DWORD m_dwBiosCrc32;
  99. DWORD m_dwVolSer;
  100. DWORD m_dwTotalRamMegs;
  101. DWORD m_dwVideoBiosCrc32;
  102. #endif
  103. };
  104. #endif