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.

253 lines
5.5 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: global.h
  8. //
  9. // Contents: global include file for NtLm security package
  10. //
  11. //
  12. // History: ChandanS 25-Jul-1996 Stolen from kerberos\client2\kerbp.h
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __GLOBAL_H__
  16. #define __GLOBAL_H__
  17. #ifndef UNICODE
  18. #define UNICODE
  19. #endif // UNICODE
  20. #ifdef __cplusplus
  21. extern "C"
  22. {
  23. #endif // __cplusplus
  24. #include "msvprgma.h"
  25. #include <nt.h>
  26. #include <ntrtl.h>
  27. #include <nturtl.h>
  28. #include <ntlsa.h>
  29. #include <ntsam.h>
  30. #ifndef WIN32_LEAN_AND_MEAN
  31. #define WIN32_LEAN_AND_MEAN
  32. #endif // WIN32_LEAN_AND_MEAN
  33. #include <windows.h>
  34. #ifndef RPC_NO_WINDOWS_H
  35. #define RPC_NO_WINDOWS_H
  36. #endif // RPC_NO_WINDOWS_H
  37. #include <rpc.h>
  38. #include <wincred.h>
  39. #ifndef SECURITY_WIN32
  40. #define SECURITY_WIN32
  41. #endif // SECURITY_WIN32
  42. #define SECURITY_PACKAGE
  43. #define SECURITY_NTLM
  44. #include <security.h>
  45. #include <secint.h>
  46. #include <dsysdbg.h>
  47. #include <lsarpc.h>
  48. #include <lsaitf.h>
  49. #include <dns.h>
  50. #include <dnsapi.h>
  51. #include <alloca.h>
  52. #include <rc4.h>
  53. #include <des.h>
  54. #include <md5.h>
  55. #include <sha.h>
  56. #include <hmac.h>
  57. #include "ntlmfunc.h"
  58. #include "ntlmutil.h"
  59. #include "ntlmsspi.h"
  60. #include "ntlmcomn.h"
  61. //
  62. // Macros for manipulating globals
  63. //
  64. #ifdef EXTERN
  65. #undef EXTERN
  66. #endif
  67. #ifdef NTLM_GLOBAL
  68. #define EXTERN
  69. #else
  70. #define EXTERN extern
  71. #endif // NTLM_GLOBAL
  72. typedef enum _NTLM_STATE {
  73. NtLmLsaMode = 1,
  74. NtLmUserMode
  75. } NTLM_STATE, *PNTLM_STATE;
  76. EXTERN NTLM_STATE NtLmState;
  77. EXTERN ULONG_PTR NtLmPackageId;
  78. EXTERN SECPKG_FUNCTION_TABLE NtLmFunctionTable;
  79. // Helper routines for use by a Security package handed over by Lsa
  80. EXTERN SECPKG_USER_FUNCTION_TABLE NtLmUserFunctionTable;
  81. EXTERN PSECPKG_DLL_FUNCTIONS UserFunctions;
  82. EXTERN PLSA_SECPKG_FUNCTION_TABLE LsaFunctions;
  83. EXTERN LSA_SECPKG_FUNCTION_TABLE Lsa;
  84. // This one guards all globals
  85. EXTERN RTL_RESOURCE NtLmGlobalCritSect;
  86. // Save the PSECPKG_PARAMETERS sent in by SpInitialize
  87. EXTERN SECPKG_PARAMETERS NtLmSecPkg;
  88. EXTERN BOOLEAN NtLmGlobalEncryptionEnabled;
  89. EXTERN ULONG NtLmGlobalLmProtocolSupported;
  90. EXTERN UNICODE_STRING NtLmGlobalNtLm3TargetInfo;
  91. EXTERN BOOLEAN NtLmGlobalRequireNtlm2;
  92. EXTERN BOOLEAN NtLmGlobalDatagramUse128BitEncryption;
  93. EXTERN BOOLEAN NtLmGlobalDatagramUse56BitEncryption;
  94. EXTERN ULONG NtLmGlobalMinimumClientSecurity;
  95. EXTERN ULONG NtLmGlobalMinimumServerSecurity;
  96. //
  97. // Useful constants
  98. //
  99. EXTERN TimeStamp NtLmGlobalForever;
  100. // Local system is NtProductWinNt or NtProductLanmanNt
  101. EXTERN NT_PRODUCT_TYPE NtLmGlobalNtProductType;
  102. //
  103. // The computername of the local system.
  104. //
  105. EXTERN WCHAR NtLmGlobalUnicodeComputerName[CNLEN + 1];
  106. EXTERN CHAR NtLmGlobalOemComputerName[CNLEN + 1];
  107. EXTERN UNICODE_STRING NtLmGlobalUnicodeComputerNameString;
  108. EXTERN STRING NtLmGlobalOemComputerNameString;
  109. EXTERN WCHAR NtLmGlobalUnicodeDnsComputerName[DNS_MAX_NAME_LENGTH + 1];
  110. EXTERN UNICODE_STRING NtLmGlobalUnicodeDnsComputerNameString;
  111. //
  112. // The domain name of the local system
  113. //
  114. EXTERN WCHAR NtLmGlobalUnicodePrimaryDomainName[DNS_MAX_NAME_LENGTH + 1];
  115. EXTERN CHAR NtLmGlobalOemPrimaryDomainName[DNS_MAX_NAME_LENGTH + 1];
  116. EXTERN UNICODE_STRING NtLmGlobalUnicodePrimaryDomainNameString;
  117. EXTERN STRING NtLmGlobalOemPrimaryDomainNameString;
  118. EXTERN WCHAR NtLmGlobalUnicodeDnsDomainName[DNS_MAX_NAME_LENGTH + 1];
  119. EXTERN UNICODE_STRING NtLmGlobalUnicodeDnsDomainNameString;
  120. //
  121. // The TargetName of the local system
  122. //
  123. EXTERN UNICODE_STRING NtLmGlobalUnicodeTargetName;
  124. EXTERN STRING NtLmGlobalOemTargetName;
  125. EXTERN ULONG NtLmGlobalTargetFlags;
  126. EXTERN PSID NtLmGlobalLocalSystemSid;
  127. EXTERN PSID NtLmGlobalAliasAdminsSid;
  128. EXTERN PSID NtLmGlobalProcessUserSid;
  129. EXTERN PSID NtLmGlobalAnonymousSid;
  130. EXTERN UNICODE_STRING NtLmGlobalUnicodeDnsTreeName;
  131. //
  132. // mapped and preferred domain names
  133. // NOTE: these require a reboot to be re-read during package startup
  134. // it is not necessary to hold the global lock as a side-effect of this
  135. // requirement
  136. //
  137. EXTERN UNICODE_STRING NtLmLocklessGlobalMappedDomainString;
  138. EXTERN UNICODE_STRING NtLmLocklessGlobalPreferredDomainString;
  139. EXTERN HKEY NtLmGlobalLsaKey;
  140. EXTERN HKEY NtLmGlobalLsaMsv1_0Key;
  141. EXTERN HANDLE NtLmGlobalRegChangeNotifyEvent;
  142. EXTERN HANDLE NtLmGlobalRegWaitObject;
  143. //
  144. // Access token associated with SYSTEM account.
  145. //
  146. EXTERN HANDLE NtLmGlobalAccessTokenSystem;
  147. //
  148. // System wide fudge for mutual auth in mixed environments
  149. //
  150. EXTERN ULONG NtLmGlobalMutualAuthLevel ;
  151. //
  152. // LogonID of machine credential.
  153. //
  154. EXTERN LUID NtLmGlobalLuidMachineLogon;
  155. //
  156. // LSA policy handle to local machine.
  157. //
  158. EXTERN LSA_HANDLE NtLmGlobalPolicyHandle;
  159. //
  160. // force guest account usage for all network logons?
  161. //
  162. EXTERN BOOLEAN NtLmGlobalForceGuest;
  163. //
  164. // indicates if we are running on the Personal product SKU
  165. //
  166. EXTERN BOOLEAN NtLmGlobalPersonalSKU;
  167. EXTERN BOOLEAN NtLmGlobalSafeBoot;
  168. //
  169. // Allow blank password logons?
  170. //
  171. EXTERN BOOLEAN NtLmGlobalAllowBlankPassword;
  172. //
  173. // Joined to a domain?
  174. //
  175. EXTERN BOOLEAN NtLmGlobalDomainJoined;
  176. //
  177. // Joined to downlevel (pre-Win2k) domain?
  178. //
  179. EXTERN BOOLEAN NtLmGlobalDownlevelDomain;
  180. //
  181. // magic number
  182. //
  183. EXTERN CHAR NtlmGlobalMagicNumber[MSV1_0_USER_SESSION_KEY_LENGTH];
  184. #ifdef __cplusplus
  185. }
  186. #endif // __cplusplus
  187. #endif // __GLOBAL_H__