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.

136 lines
3.2 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File: globals.cpp
  6. //
  7. // Contents: Global varaiables
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #include "pch.cpp"
  13. #include "windows.h"
  14. #include "winsock2.h"
  15. #include "tlsjob.h"
  16. #include "wkspace.h"
  17. #include "srvdef.h"
  18. #ifndef _NO_ODBC_JET
  19. TLSDbWorkSpace* g_DbWorkSpace;
  20. #endif
  21. // Defaule server scope
  22. TCHAR g_szScope[LSERVER_MAX_STRING_SIZE+1];
  23. LPTSTR g_pszScope;
  24. // Full Path to database file name.
  25. TCHAR g_szDatabaseFile[MAX_PATH+1];
  26. // database file directory.
  27. // JetBlue require last character be '\'
  28. TCHAR g_szDatabaseDir[MAX_PATH+1];
  29. TCHAR g_szDatabaseFname[MAX_PATH+1];
  30. TCHAR g_szDbUser[MAXUSERNAMELENGTH+1];
  31. TCHAR g_szDbPwd[MAXUSERNAMELENGTH+1];
  32. LPCTSTR szManufactureMS=_TEXT("Microsoft");
  33. LONG g_NextKeyPackId=0;
  34. LONG g_NextLicenseId=0;
  35. PBYTE g_pbSecretKey=NULL;
  36. DWORD g_cbSecretKey=0;
  37. LPTSTR g_pszServerUniqueId = NULL;
  38. DWORD g_cbServerUniqueId = 0;
  39. LPTSTR g_pszServerPid = NULL;
  40. DWORD g_cbServerPid = 0;
  41. PBYTE g_pbServerSPK = NULL;
  42. DWORD g_cbServerSPK = 0;
  43. DWORD g_GracePeriod=GRACE_PERIOD; // in days.
  44. BOOL g_IssueTemporayLicense=TRUE;
  45. BOOL g_bHasHydraCert=FALSE;
  46. PBYTE g_pbSignatureEncodedCert=NULL;
  47. DWORD g_cbSignatureEncodedCert=0;
  48. PBYTE g_pbExchangeEncodedCert=NULL;
  49. DWORD g_cbExchangeEncodedCert=0;
  50. TCHAR g_szHostName[MAXTCPNAME+1];
  51. DWORD g_cbHostName=sizeof(g_szHostName)/sizeof(g_szHostName[0]);
  52. TCHAR g_szComputerName[MAX_COMPUTERNAME_LENGTH+2];
  53. DWORD g_cbComputerName=MAX_COMPUTERNAME_LENGTH+1;
  54. PCCERT_CONTEXT g_LicenseCertContext=NULL;
  55. //
  56. // Self-signed certificates...
  57. //
  58. PCCERT_CONTEXT g_SelfSignCertContext = NULL;
  59. HCRYPTPROV g_hCryptProv=NULL;
  60. DWORD g_GeneralDbTimeout = DEFAULT_CONNECTION_TIMEOUT; // Time out for acquiring DB handle
  61. DWORD g_EnumDbTimeout = DB_ENUM_WAITTIMEOUT; // Time out for acquiring enumeration DB handle
  62. DWORD g_dwMaxDbHandles = DEFAULT_DB_CONNECTIONS; // number of connection to DB
  63. #if ENFORCE_LICENSING
  64. HCERTSTORE g_hCaStore=NULL;
  65. HKEY g_hCaRegKey=NULL;
  66. #endif
  67. HCRYPTKEY g_SignKey=NULL;
  68. HCRYPTKEY g_ExchKey=NULL;
  69. //PBYTE g_pbDomainSid=NULL;
  70. //DWORD g_cbDomainSid=0;
  71. DWORD g_SrvRole=0;
  72. LPTSTR g_szDomainGuid = NULL;
  73. PCERT_EXTENSIONS g_pCertExtensions;
  74. DWORD g_cbCertExtensions;
  75. FILETIME g_ftCertExpiredTime;
  76. FILETIME g_ftLastShutdownTime={0, 0};
  77. DWORD g_dwTlsJobInterval=DEFAULT_JOB_INTERVAL;
  78. DWORD g_dwTlsJobRetryTimes=DEFAULT_JOB_RETRYTIMES;
  79. DWORD g_dwTlsJobRestartTime=DEFAULT_JOB_INTERVAL;
  80. SERVER_ROLE_IN_DOMAIN g_ServerRoleInDomain;
  81. DWORD g_LowLicenseCountWarning=0;
  82. DWORD g_EsentMaxCacheSize=0;
  83. DWORD g_EsentStartFlushThreshold=0;
  84. DWORD g_EsentStopFlushThreadhold=0;
  85. //
  86. // Reissuance Parameters
  87. //
  88. DWORD g_dwReissueLeaseMinimum;
  89. DWORD g_dwReissueLeaseRange;
  90. DWORD g_dwReissueLeaseLeeway;
  91. DWORD g_dwReissueExpireThreadSleep;
  92. //
  93. // Counters
  94. //
  95. LONG g_lTemporaryLicensesIssued = 0;
  96. LONG g_lPermanentLicensesIssued = 0;
  97. LONG g_lPermanentLicensesReissued = 0;
  98. LONG g_lPermanentLicensesReturned = 0;
  99. LONG g_lLicensesMarked = 0;