Leaked source code of windows server 2003
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.

97 lines
2.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: serialid.h
  4. //
  5. // Microsoft Digital Rights Management
  6. // Copyright (C) Microsoft Corporation, 1998 - 1999, All Rights Reserved
  7. //
  8. // Description:
  9. //
  10. //-----------------------------------------------------------------------------
  11. #ifndef __SERIALID_H__
  12. #define __SERIALID_H__
  13. #include "objbase.h"
  14. #define MDSP_PMID_SOFT 0
  15. #define MDSP_PMID_SANDISK 1
  16. #define MDSP_PMID_IOMEGA 2
  17. #ifdef USE_PREBETA
  18. #define WMDMID_LENGTH 20
  19. typedef struct __WMDMID
  20. {
  21. UINT cbSize;
  22. DWORD dwVendorID;
  23. BYTE pID[ WMDMID_LENGTH ];
  24. } WMDMID, *PWMDMID;
  25. #else
  26. #define WMDMID_LENGTH 128
  27. typedef struct __WMDMID
  28. {
  29. UINT cbSize;
  30. DWORD dwVendorID;
  31. BYTE pID[ WMDMID_LENGTH ];
  32. UINT SerialNumberLength;
  33. } WMDMID, *PWMDMID;
  34. #endif
  35. typedef struct _CEUTILGETSERIALNUMBERDATA {
  36. WCHAR wcsMediaPath[MAX_PATH];
  37. ULONG SerialNumberLength;
  38. ULONG Result;
  39. ULONG Reserved[2];
  40. BYTE SerialNumberData[WMDMID_LENGTH];
  41. } CEUTILGETSERIALNUMBERDATA, *PCEUTILGETSERIALNUMBERDATA;
  42. #ifndef VWIN32_DIOC_DOS_IOCTL
  43. #define VWIN32_DIOC_DOS_IOCTL 1
  44. typedef struct _DIOC_REGISTERS {
  45. DWORD reg_EBX;
  46. DWORD reg_EDX;
  47. DWORD reg_ECX;
  48. DWORD reg_EAX;
  49. DWORD reg_EDI;
  50. DWORD reg_ESI;
  51. DWORD reg_Flags;
  52. }DIOC_REGISTERS, *PDIOC_REGISTERS;
  53. #endif
  54. #define WIN9X_IOCTL_GET_MEDIA_SERIAL_NUMBER 0x81
  55. #define DEFAULT_MEDIA_SERIAL_NUMBER_LENGTH 80
  56. typedef struct _MEDIA_SERIAL_NUMBER_DATA {
  57. ULONG SerialNumberLength; // offset 00
  58. ULONG Result; // offset 04
  59. ULONG Reserved[2]; // offset 08
  60. UCHAR SerialNumberData[1]; // offset 16
  61. } MEDIA_SERIAL_NUMBER_DATA, *PMEDIA_SERIAL_NUMBER_DATA;
  62. // Diasable warning 4200
  63. // nonstandard extension used : zero-sized array in struct/union
  64. #pragma warning(disable: 4200)
  65. //
  66. // Struct returned for MEDIA_SERIAL_NUMBER
  67. //
  68. typedef struct _GET_MEDIA_SERIAL_NUMBER_RESPONSE_DATA
  69. {
  70. UCHAR DataLength[2];
  71. UCHAR Format : 4;
  72. UCHAR Reserved1 : 4;
  73. UCHAR Reserved2;
  74. UCHAR Data[0]; // variable length structure
  75. } GET_MEDIA_SERIAL_NUMBER_RESPONSE_DATA, *PGET_MEDIA_SERIAL_NUMBER_RESPONSE_DATA;
  76. // Turn on warning 4200 again
  77. #pragma warning(default: 4200)
  78. HRESULT __stdcall UtilGetSerialNumber(WCHAR *wcsDeviceName, PWMDMID pSerialNumber, BOOL fCreate);
  79. HRESULT __stdcall CeUtilGetSerialNumber(WCHAR *wcsDeviceName, PWMDMID pSerialNumber, HANDLE hExit, ULONG fReserved);
  80. HRESULT __stdcall CeGetDiskFreeSpaceEx(LPCWSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);
  81. #endif