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.

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