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.

74 lines
1.8 KiB

  1. #ifndef __SYSINFO_H_
  2. #define __SYSINFO_H_
  3. /*++
  4. Copyright (C) 1997-1999 Microsoft Corporation
  5. Module Name:
  6. sysinfo.h
  7. Abstract:
  8. header file for sysinfo.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. #include <winioctl.h>
  14. typedef struct tagDiskInfo
  15. {
  16. DWORD cbSize;
  17. UINT DriveType;
  18. STORAGE_MEDIA_TYPE MediaType;
  19. ULARGE_INTEGER TotalSpace;
  20. ULARGE_INTEGER FreeSpace;
  21. LARGE_INTEGER Cylinders;
  22. ULONG Heads;
  23. ULONG BytesPerSector;
  24. ULONG SectorsPerTrack;
  25. }DISK_INFO, *PDISK_INFO;
  26. class CSystemInfo
  27. {
  28. public:
  29. CSystemInfo(CMachine* pMachine = NULL);
  30. ~CSystemInfo();
  31. BOOL GetDiskInfo(int Drive, DISK_INFO& DiskInfo);
  32. LPCTSTR ComputerName()
  33. {
  34. return m_strComputerName;
  35. }
  36. DWORD MachineType(TCHAR* Buffer, DWORD BufferSize);
  37. DWORD WindowsVersion(TCHAR* Buffer, DWORD BufferSize);
  38. DWORD SystemBiosDate(TCHAR* Buffer, DWORD BufferSize);
  39. DWORD SystemBiosVersion(TCHAR* Buffer, DWORD BufferSize);
  40. DWORD ProcessorType(TCHAR* Buffer, DWORD BufferSize);
  41. DWORD RegisteredOwner(TCHAR* Buffer, DWORD BufferSize);
  42. DWORD RegisteredOrganization(TCHAR* Buffer, DWORD BufferSize);
  43. DWORD ProcessorVendor(TCHAR* Buffer, DWORD BufferSize);
  44. DWORD NumberOfProcessors();
  45. DWORD ProcessorInfo(LPCTSTR ValueName, TCHAR* Buffer, DWORD BufferSize);
  46. void TotalPhysicalMemory(ULARGE_INTEGER& Size);
  47. private:
  48. DWORD InfoFromRegistry(LPCTSTR SubkeyName,
  49. LPCTSTR ValueName,
  50. TCHAR* Buffer,
  51. DWORD BufferSize,
  52. HKEY hKeyAncestor = NULL
  53. );
  54. String m_strComputerName;
  55. BOOL m_fLocalMachine;
  56. HKEY m_hKeyMachine;
  57. };
  58. #endif