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.

123 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. certdb.h
  5. Abstract:
  6. Author:
  7. Jeff Parham (jeffparh) 16-Nov-1995
  8. Revision History:
  9. --*/
  10. #ifndef _CERTDB_H_
  11. #define _CERTDB_H_
  12. // maximum time (in seconds) allowed to pass between certificate replications
  13. // before we remove the apparently no longer used data. this is so that, for
  14. // example, if a machine goes down (taking its licenses with it), the licenses
  15. // it had registered won't forever keep the user from reinstalling them.
  16. #define LLS_CERT_DB_REPLICATION_DATE_DELTA_MAX ( 60 * 60 * 72 )
  17. #define LLS_CERT_DB_FILE_VERSION ( 0x0201 )
  18. typedef struct _LLS_CERT_DB_FILE_HEADER
  19. {
  20. ULONG ProductStringSize;
  21. ULONG NumCertificates;
  22. ULONG NumClaims;
  23. } LLS_CERT_DB_FILE_HEADER, *PLLS_CERT_DB_FILE_HEADER;
  24. typedef struct _LLS_CERT_DB_CERTIFICATE_CLAIM
  25. {
  26. TCHAR ServerName[ 1 + MAX_COMPUTERNAME_LENGTH ];
  27. DWORD ReplicationDate;
  28. LONG Quantity;
  29. } LLS_CERT_DB_CERTIFICATE_CLAIM, *PLLS_CERT_DB_CERTIFICATE_CLAIM;
  30. typedef struct _LLS_CERT_DB_CERTIFICATE_HEADER
  31. {
  32. LPTSTR Product;
  33. DWORD CertificateID;
  34. DWORD MaxQuantity;
  35. DWORD ExpirationDate;
  36. DWORD NumClaims;
  37. PLLS_CERT_DB_CERTIFICATE_CLAIM Claims;
  38. } LLS_CERT_DB_CERTIFICATE_HEADER, *PLLS_CERT_DB_CERTIFICATE_HEADER;
  39. NTSTATUS
  40. CertDbInit();
  41. NTSTATUS
  42. CertDbLoad();
  43. NTSTATUS
  44. CertDbSave();
  45. void
  46. CertDbLogViolations();
  47. void
  48. CertDbPrune();
  49. void
  50. CertDbRemoveLocalClaims();
  51. void
  52. CertDbUpdateLocalClaims();
  53. NTSTATUS
  54. CertDbClaimEnter( LPTSTR pszServerName,
  55. PLLS_LICENSE_INFO_1 pLicense,
  56. BOOL bIsTotal,
  57. DWORD ReplicationDate );
  58. BOOL
  59. CertDbClaimApprove( PLLS_LICENSE_INFO_1 pLicense );
  60. PLLS_CERT_DB_CERTIFICATE_HEADER
  61. CertDbHeaderFind( PLLS_LICENSE_INFO_1 pLicense );
  62. PLLS_CERT_DB_CERTIFICATE_HEADER
  63. CertDbHeaderAdd( PLLS_LICENSE_INFO_1 pLicense );
  64. int
  65. CertDbClaimFind( PLLS_CERT_DB_CERTIFICATE_HEADER pHeader,
  66. LPTSTR pszServerName );
  67. NTSTATUS
  68. CertDbPack( LPDWORD pcchProductStrings,
  69. LPTSTR * ppchProductStrings,
  70. LPDWORD pdwNumHeaders,
  71. PREPL_CERT_DB_CERTIFICATE_HEADER_0 * ppHeaders,
  72. LPDWORD pdwNumClaims,
  73. PREPL_CERT_DB_CERTIFICATE_CLAIM_0 * ppClaims );
  74. NTSTATUS
  75. CertDbUnpack( DWORD cchProductStrings,
  76. LPTSTR pchProductStrings,
  77. DWORD dwNumHeaders,
  78. PREPL_CERT_DB_CERTIFICATE_HEADER_0 pHeaders,
  79. DWORD dwNumClaims,
  80. PREPL_CERT_DB_CERTIFICATE_CLAIM_0 pClaims,
  81. BOOL bReplicated );
  82. NTSTATUS
  83. CertDbClaimsGet( PLLS_LICENSE_INFO_1 pLicense,
  84. LPDWORD pdwNumClaims,
  85. PLLS_CERTIFICATE_CLAIM_INFO_0 * ppTargets );
  86. #if DBG
  87. void CertDbDebugDump();
  88. #endif
  89. #endif