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.

195 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. Pack.h
  5. Abstract:
  6. Author:
  7. Arthur Hanson (arth) Dec 07, 1994
  8. Environment:
  9. Revision History:
  10. Jeff Parham (jeffparh) 05-Dec-1995
  11. o Added new fields to purchase record to support secure certificates.
  12. o Unified per server purchase model with per seat purchase model for
  13. secure certificates; per server model still done in the traditional
  14. manner for non-secure certificates (for backwards compatibility).
  15. o Added SaveAll() function analogous to LoadAll().
  16. o Added support for extended user data packing/unpacking. This was
  17. done to save the SUITE_USE flag across restarts of the service.
  18. o Removed user table parameters from unpack routines that didn't use
  19. them.
  20. --*/
  21. #ifndef _LLS_PACK_H
  22. #define _LLS_PACK_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /////////////////////////////////////////////////////////////////////
  27. //
  28. // Save / Load Mapping
  29. //
  30. #define MAPPING_FILE_VERSION 0x0100
  31. typedef struct _PACK_MAPPING_RECORD {
  32. LPTSTR Name;
  33. LPTSTR Comment;
  34. ULONG Licenses;
  35. } PACK_MAPPING_RECORD, *PPACK_MAPPING_RECORD;
  36. typedef struct _PACK_MAPPING_USER_RECORD {
  37. ULONG Mapping;
  38. LPTSTR Name;
  39. } PACK_MAPPING_USER_RECORD, *PPACK_MAPPING_USER_RECORD;
  40. typedef struct _MAPPING_FILE_HEADER {
  41. ULONG MappingUserTableSize;
  42. ULONG MappingUserStringSize;
  43. ULONG MappingTableSize;
  44. ULONG MappingStringSize;
  45. } MAPPING_FILE_HEADER, *PMAPPING_FILE_HEADER;
  46. /////////////////////////////////////////////////////////////////////
  47. //
  48. // Save / Load License
  49. //
  50. ///////////////// OLD (3.51) FORMAT ////////////////////
  51. #define LICENSE_FILE_VERSION_0 0x0100
  52. typedef struct _PACK_LICENSE_PURCHASE_RECORD_0 {
  53. ULONG Service;
  54. LONG NumberLicenses;
  55. DWORD Date;
  56. LPTSTR Admin;
  57. LPTSTR Comment;
  58. } PACK_LICENSE_PURCHASE_RECORD_0, *PPACK_LICENSE_PURCHASE_RECORD_0;
  59. typedef struct _LICENSE_FILE_HEADER_0 {
  60. ULONG LicenseServiceTableSize;
  61. ULONG LicenseServiceStringSize;
  62. ULONG LicenseTableSize;
  63. ULONG LicenseStringSize;
  64. } LICENSE_FILE_HEADER_0, *PLICENSE_FILE_HEADER_0;
  65. ///////////////// NEW FORMAT ////////////////////
  66. #define LICENSE_FILE_VERSION 0x0201
  67. typedef struct _PACK_LICENSE_SERVICE_RECORD {
  68. LPTSTR ServiceName;
  69. LONG NumberLicenses;
  70. } PACK_LICENSE_SERVICE_RECORD, *PPACK_LICENSE_SERVICE_RECORD;
  71. typedef struct _PACK_LICENSE_PURCHASE_RECORD {
  72. ULONG Service;
  73. LONG NumberLicenses;
  74. DWORD Date;
  75. LPTSTR Admin;
  76. LPTSTR Comment;
  77. // new for SUR: (see description in purchase.h)
  78. ULONG PerServerService;
  79. DWORD AllowedModes;
  80. DWORD CertificateID;
  81. LPTSTR Source;
  82. DWORD ExpirationDate;
  83. DWORD MaxQuantity;
  84. LPTSTR Vendor;
  85. DWORD Secrets[ LLS_NUM_SECRETS ];
  86. } PACK_LICENSE_PURCHASE_RECORD, *PPACK_LICENSE_PURCHASE_RECORD;
  87. typedef struct _LICENSE_FILE_HEADER {
  88. ULONG LicenseServiceTableSize;
  89. ULONG LicenseServiceStringSize;
  90. ULONG LicenseTableSize;
  91. ULONG LicenseStringSize;
  92. // new for SUR:
  93. ULONG PerServerLicenseServiceTableSize;
  94. ULONG PerServerLicenseServiceStringSize;
  95. } LICENSE_FILE_HEADER, *PLICENSE_FILE_HEADER;
  96. /////////////////////////////////////////////////////////////////////
  97. //
  98. // Save / Load LLS Data
  99. //
  100. ///////////////// OLD (3.51) FORMAT ////////////////////
  101. #define USER_FILE_VERSION_0 0x0100
  102. typedef struct _LLS_DATA_FILE_HEADER_0 {
  103. ULONG ServiceTableSize;
  104. ULONG ServiceStringSize;
  105. ULONG ServerTableSize;
  106. ULONG ServerStringSize;
  107. ULONG ServerServiceTableSize;
  108. ULONG UserTableSize;
  109. ULONG UserStringSize;
  110. } LLS_DATA_FILE_HEADER_0, *PLLS_DATA_FILE_HEADER_0;
  111. ///////////////// NEW FORMAT ////////////////////
  112. #define USER_FILE_VERSION 0x0200
  113. typedef struct _LLS_DATA_FILE_HEADER {
  114. ULONG ServiceLevel;
  115. ULONG ServiceTableSize;
  116. ULONG ServiceStringSize;
  117. ULONG ServerLevel;
  118. ULONG ServerTableSize;
  119. ULONG ServerStringSize;
  120. ULONG ServerServiceLevel;
  121. ULONG ServerServiceTableSize;
  122. ULONG UserLevel;
  123. ULONG UserTableSize;
  124. ULONG UserStringSize;
  125. } LLS_DATA_FILE_HEADER, *PLLS_DATA_FILE_HEADER;
  126. VOID LicenseListLoad();
  127. NTSTATUS LicenseListSave();
  128. VOID MappingListLoad();
  129. NTSTATUS MappingListSave();
  130. VOID LLSDataLoad();
  131. NTSTATUS LLSDataSave();
  132. VOID LoadAll ( );
  133. VOID SaveAll ( );
  134. NTSTATUS ServiceListPack ( ULONG *pServiceTableSize, PREPL_SERVICE_RECORD *pServices );
  135. VOID ServiceListUnpack ( ULONG ServiceTableSize, PREPL_SERVICE_RECORD Services, ULONG ServerTableSize, PREPL_SERVER_RECORD Servers, ULONG ServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD ServerServices );
  136. NTSTATUS ServerListPack ( ULONG *pServerTableSize, PREPL_SERVER_RECORD *pServers );
  137. VOID ServerListUnpack ( ULONG ServiceTableSize, PREPL_SERVICE_RECORD Services, ULONG ServerTableSize, PREPL_SERVER_RECORD Servers, ULONG ServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD ServerServices );
  138. NTSTATUS ServerServiceListPack ( ULONG *pServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD *pServerServices );
  139. VOID ServerServiceListUnpack ( ULONG ServiceTableSize, PREPL_SERVICE_RECORD Services, ULONG ServerTableSize, PREPL_SERVER_RECORD Servers, ULONG ServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD ServerServices );
  140. NTSTATUS UserListPack ( DWORD LastReplicated, ULONG UserLevel, ULONG *pUserTableSize, LPVOID *pUsers );
  141. VOID UserListUnpack ( ULONG ServiceTableSize, PREPL_SERVICE_RECORD Services, ULONG ServerTableSize, PREPL_SERVER_RECORD Servers, ULONG ServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD ServerServices, ULONG UserLevel, ULONG UserTableSize, LPVOID Users );
  142. NTSTATUS PackAll ( DWORD LastReplicated, ULONG *pServiceTableSize, PREPL_SERVICE_RECORD *pServices, ULONG *pServerTableSize, PREPL_SERVER_RECORD *pServers, ULONG *pServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD *pServerServices, ULONG UserLevel, ULONG *pUserTableSize, LPVOID *pUsers );
  143. VOID UnpackAll ( ULONG ServiceTableSize, PREPL_SERVICE_RECORD Services, ULONG ServerTableSize, PREPL_SERVER_RECORD Servers, ULONG ServerServiceTableSize, PREPL_SERVER_SERVICE_RECORD ServerServices, ULONG UserLevel, ULONG UserTableSize, LPVOID Users );
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147. #endif