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.

729 lines
25 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. ntmsv1_0.h
  5. Abstract:
  6. This module contains the public data structures provided by
  7. the MSV1_0 authentication package.
  8. Author:
  9. Jim Kelly (JimK) 12-April-1991
  10. Revision History:
  11. 22-Apr-1991 (CliffV)
  12. Added call package message types. Converted U_STRING to UNICODE_STRING.
  13. 11-Mar-1992 (DaveHart)
  14. Added MsV1_0ChangePassword call package message type.
  15. 15-Jan-1998 (SField)
  16. Added MsV1_0DeriveCredential call package message type.
  17. --*/
  18. #ifndef _NTMSV1_0_
  19. #define _NTMSV1_0_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif
  23. #include <ntlsa.h>
  24. #include <ntsam.h>
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. // begin_ntifs begin_ntsecapi
  29. /////////////////////////////////////////////////////////////////////////
  30. // //
  31. // Name of the MSV1_0 authentication package //
  32. // //
  33. /////////////////////////////////////////////////////////////////////////
  34. #define MSV1_0_PACKAGE_NAME "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
  35. #define MSV1_0_PACKAGE_NAMEW L"MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
  36. #define MSV1_0_PACKAGE_NAMEW_LENGTH sizeof(MSV1_0_PACKAGE_NAMEW) - sizeof(WCHAR)
  37. //
  38. // Location of MSV authentication package data
  39. //
  40. #define MSV1_0_SUBAUTHENTICATION_KEY "SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0"
  41. #define MSV1_0_SUBAUTHENTICATION_VALUE "Auth"
  42. /////////////////////////////////////////////////////////////////////////
  43. // //
  44. // Widely used MSV1_0 data types //
  45. // //
  46. /////////////////////////////////////////////////////////////////////////
  47. ///////////////////////////////////////////////////////////////////////////////
  48. // //
  49. // LOGON Related Data Structures
  50. //
  51. // //
  52. ///////////////////////////////////////////////////////////////////////////////
  53. //
  54. // When a LsaLogonUser() call is dispatched to the MsV1_0 authentication
  55. // package, the beginning of the AuthenticationInformation buffer is
  56. // cast to a MSV1_0_LOGON_SUBMIT_TYPE to determine the type of logon
  57. // being requested. Similarly, upon return, the type of profile buffer
  58. // can be determined by typecasting it to a MSV_1_0_PROFILE_BUFFER_TYPE.
  59. //
  60. //
  61. // MSV1.0 LsaLogonUser() submission message types.
  62. //
  63. typedef enum _MSV1_0_LOGON_SUBMIT_TYPE {
  64. MsV1_0InteractiveLogon = 2,
  65. MsV1_0Lm20Logon,
  66. MsV1_0NetworkLogon,
  67. MsV1_0SubAuthLogon,
  68. MsV1_0WorkstationUnlockLogon = 7
  69. } MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE;
  70. //
  71. // MSV1.0 LsaLogonUser() profile buffer types.
  72. //
  73. typedef enum _MSV1_0_PROFILE_BUFFER_TYPE {
  74. MsV1_0InteractiveProfile = 2,
  75. MsV1_0Lm20LogonProfile,
  76. MsV1_0SmartCardProfile
  77. } MSV1_0_PROFILE_BUFFER_TYPE, *PMSV1_0_PROFILE_BUFFER_TYPE;
  78. //
  79. // MsV1_0InteractiveLogon
  80. //
  81. // The AuthenticationInformation buffer of an LsaLogonUser() call to
  82. // perform an interactive logon contains the following data structure:
  83. //
  84. typedef struct _MSV1_0_INTERACTIVE_LOGON {
  85. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  86. UNICODE_STRING LogonDomainName;
  87. UNICODE_STRING UserName;
  88. UNICODE_STRING Password;
  89. } MSV1_0_INTERACTIVE_LOGON, *PMSV1_0_INTERACTIVE_LOGON;
  90. //
  91. // Where:
  92. //
  93. // MessageType - Contains the type of logon being requested. This
  94. // field must be set to MsV1_0InteractiveLogon.
  95. //
  96. // UserName - Is a string representing the user's account name. The
  97. // name may be up to 255 characters long. The name is treated case
  98. // insensitive.
  99. //
  100. // Password - Is a string containing the user's cleartext password.
  101. // The password may be up to 255 characters long and contain any
  102. // UNICODE value.
  103. //
  104. //
  105. //
  106. // The ProfileBuffer returned upon a successful logon of this type
  107. // contains the following data structure:
  108. //
  109. typedef struct _MSV1_0_INTERACTIVE_PROFILE {
  110. MSV1_0_PROFILE_BUFFER_TYPE MessageType;
  111. USHORT LogonCount;
  112. USHORT BadPasswordCount;
  113. LARGE_INTEGER LogonTime;
  114. LARGE_INTEGER LogoffTime;
  115. LARGE_INTEGER KickOffTime;
  116. LARGE_INTEGER PasswordLastSet;
  117. LARGE_INTEGER PasswordCanChange;
  118. LARGE_INTEGER PasswordMustChange;
  119. UNICODE_STRING LogonScript;
  120. UNICODE_STRING HomeDirectory;
  121. UNICODE_STRING FullName;
  122. UNICODE_STRING ProfilePath;
  123. UNICODE_STRING HomeDirectoryDrive;
  124. UNICODE_STRING LogonServer;
  125. ULONG UserFlags;
  126. } MSV1_0_INTERACTIVE_PROFILE, *PMSV1_0_INTERACTIVE_PROFILE;
  127. //
  128. // where:
  129. //
  130. // MessageType - Identifies the type of profile data being returned.
  131. // Contains the type of logon being requested. This field must
  132. // be set to MsV1_0InteractiveProfile.
  133. //
  134. // LogonCount - Number of times the user is currently logged on.
  135. //
  136. // BadPasswordCount - Number of times a bad password was applied to
  137. // the account since last successful logon.
  138. //
  139. // LogonTime - Time when user last logged on. This is an absolute
  140. // format NT standard time value.
  141. //
  142. // LogoffTime - Time when user should log off. This is an absolute
  143. // format NT standard time value.
  144. //
  145. // KickOffTime - Time when system should force user logoff. This is
  146. // an absolute format NT standard time value.
  147. //
  148. // PasswordLastChanged - Time and date the password was last
  149. // changed. This is an absolute format NT standard time
  150. // value.
  151. //
  152. // PasswordCanChange - Time and date when the user can change the
  153. // password. This is an absolute format NT time value. To
  154. // prevent a password from ever changing, set this field to a
  155. // date very far into the future.
  156. //
  157. // PasswordMustChange - Time and date when the user must change the
  158. // password. If the user can never change the password, this
  159. // field is undefined. This is an absolute format NT time
  160. // value.
  161. //
  162. // LogonScript - The (relative) path to the account's logon
  163. // script.
  164. //
  165. // HomeDirectory - The home directory for the user.
  166. //
  167. //
  168. // MsV1_0Lm20Logon and MsV1_0NetworkLogon
  169. //
  170. // The AuthenticationInformation buffer of an LsaLogonUser() call to
  171. // perform an network logon contains the following data structure:
  172. //
  173. // MsV1_0NetworkLogon logon differs from MsV1_0Lm20Logon in that the
  174. // ParameterControl field exists.
  175. //
  176. #define MSV1_0_CHALLENGE_LENGTH 8
  177. #define MSV1_0_USER_SESSION_KEY_LENGTH 16
  178. #define MSV1_0_LANMAN_SESSION_KEY_LENGTH 8
  179. //
  180. // Values for ParameterControl.
  181. //
  182. #define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED 0x02
  183. #define MSV1_0_UPDATE_LOGON_STATISTICS 0x04
  184. #define MSV1_0_RETURN_USER_PARAMETERS 0x08
  185. #define MSV1_0_DONT_TRY_GUEST_ACCOUNT 0x10
  186. #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x20
  187. #define MSV1_0_RETURN_PASSWORD_EXPIRY 0x40
  188. // this next flag says that CaseInsensitiveChallengeResponse
  189. // (aka LmResponse) contains a client challenge in the first 8 bytes
  190. #define MSV1_0_USE_CLIENT_CHALLENGE 0x80
  191. #define MSV1_0_TRY_GUEST_ACCOUNT_ONLY 0x100
  192. #define MSV1_0_RETURN_PROFILE_PATH 0x200
  193. #define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY 0x400
  194. #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800
  195. #define MSV1_0_DISABLE_PERSONAL_FALLBACK 0x00001000
  196. #define MSV1_0_ALLOW_FORCE_GUEST 0x00002000
  197. #define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED 0x00004000
  198. #define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY 0x00008000
  199. #define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000
  200. //
  201. // The high order byte is a value indicating the SubAuthentication DLL.
  202. // Zero indicates no SubAuthentication DLL.
  203. //
  204. #define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000
  205. #define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24
  206. #define MSV1_0_MNS_LOGON 0x01000000
  207. //
  208. // This is the list of subauthentication dlls used in MS
  209. //
  210. #define MSV1_0_SUBAUTHENTICATION_DLL_RAS 2
  211. #define MSV1_0_SUBAUTHENTICATION_DLL_IIS 132
  212. typedef struct _MSV1_0_LM20_LOGON {
  213. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  214. UNICODE_STRING LogonDomainName;
  215. UNICODE_STRING UserName;
  216. UNICODE_STRING Workstation;
  217. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  218. STRING CaseSensitiveChallengeResponse;
  219. STRING CaseInsensitiveChallengeResponse;
  220. ULONG ParameterControl;
  221. } MSV1_0_LM20_LOGON, * PMSV1_0_LM20_LOGON;
  222. //
  223. // NT 5.0 SubAuth dlls can use this struct
  224. //
  225. typedef struct _MSV1_0_SUBAUTH_LOGON{
  226. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  227. UNICODE_STRING LogonDomainName;
  228. UNICODE_STRING UserName;
  229. UNICODE_STRING Workstation;
  230. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  231. STRING AuthenticationInfo1;
  232. STRING AuthenticationInfo2;
  233. ULONG ParameterControl;
  234. ULONG SubAuthPackageId;
  235. } MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON;
  236. //
  237. // Values for UserFlags.
  238. //
  239. #define LOGON_GUEST 0x01
  240. #define LOGON_NOENCRYPTION 0x02
  241. #define LOGON_CACHED_ACCOUNT 0x04
  242. #define LOGON_USED_LM_PASSWORD 0x08
  243. #define LOGON_EXTRA_SIDS 0x20
  244. #define LOGON_SUBAUTH_SESSION_KEY 0x40
  245. #define LOGON_SERVER_TRUST_ACCOUNT 0x80
  246. #define LOGON_NTLMV2_ENABLED 0x100 // says DC understands NTLMv2
  247. #define LOGON_RESOURCE_GROUPS 0x200
  248. #define LOGON_PROFILE_PATH_RETURNED 0x400
  249. //
  250. // The high order byte is reserved for return by SubAuthentication DLLs.
  251. //
  252. #define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000
  253. // Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL
  254. #define LOGON_GRACE_LOGON 0x01000000
  255. typedef struct _MSV1_0_LM20_LOGON_PROFILE {
  256. MSV1_0_PROFILE_BUFFER_TYPE MessageType;
  257. LARGE_INTEGER KickOffTime;
  258. LARGE_INTEGER LogoffTime;
  259. ULONG UserFlags;
  260. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  261. UNICODE_STRING LogonDomainName;
  262. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  263. UNICODE_STRING LogonServer;
  264. UNICODE_STRING UserParameters;
  265. } MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE;
  266. //
  267. // Supplemental credentials structure used for passing credentials into
  268. // MSV1_0 from other packages
  269. //
  270. #define MSV1_0_OWF_PASSWORD_LENGTH 16
  271. #define MSV1_0_CRED_LM_PRESENT 0x1
  272. #define MSV1_0_CRED_NT_PRESENT 0x2
  273. #define MSV1_0_CRED_VERSION 0
  274. typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL {
  275. ULONG Version;
  276. ULONG Flags;
  277. UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
  278. UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
  279. } MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
  280. //
  281. // NTLM3 definitions.
  282. //
  283. #define MSV1_0_NTLM3_RESPONSE_LENGTH 16
  284. #define MSV1_0_NTLM3_OWF_LENGTH 16
  285. //
  286. // this is the longest amount of time we'll allow challenge response
  287. // pairs to be used. Note that this also has to allow for worst case clock skew
  288. //
  289. #define MSV1_0_MAX_NTLM3_LIFE 129600 // 36 hours (in seconds)
  290. #define MSV1_0_MAX_AVL_SIZE 64000
  291. //
  292. // MsvAvFlags bit values
  293. //
  294. #define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001
  295. // this is an MSV1_0 private data structure, defining the layout of an NTLM3 response, as sent by a
  296. // client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structure. If can be differentiated
  297. // from an old style NT response by its length. This is crude, but it needs to pass through servers and
  298. // the servers' DCs that do not understand NTLM3 but that are willing to pass longer responses.
  299. typedef struct _MSV1_0_NTLM3_RESPONSE {
  300. UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH]; // hash of OWF of password with all the following fields
  301. UCHAR RespType; // id number of response; current is 1
  302. UCHAR HiRespType; // highest id number understood by client
  303. USHORT Flags; // reserved; must be sent as zero at this version
  304. ULONG MsgWord; // 32 bit message from client to server (for use by auth protocol)
  305. ULONGLONG TimeStamp; // time stamp when client generated response -- NT system time, quad part
  306. UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH];
  307. ULONG AvPairsOff; // offset to start of AvPairs (to allow future expansion)
  308. UCHAR Buffer[1]; // start of buffer with AV pairs (or future stuff -- so use the offset)
  309. } MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE;
  310. #define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH)
  311. #define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM3_RESPONSE, AvPairsOff)
  312. typedef enum {
  313. MsvAvEOL, // end of list
  314. MsvAvNbComputerName, // server's computer name -- NetBIOS
  315. MsvAvNbDomainName, // server's domain name -- NetBIOS
  316. MsvAvDnsComputerName, // server's computer name -- DNS
  317. MsvAvDnsDomainName, // server's domain name -- DNS
  318. MsvAvDnsTreeName, // server's tree name -- DNS
  319. MsvAvFlags // server's extended flags -- DWORD mask
  320. } MSV1_0_AVID;
  321. typedef struct _MSV1_0_AV_PAIR {
  322. USHORT AvId;
  323. USHORT AvLen;
  324. // Data is treated as byte array following structure
  325. } MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR;
  326. ///////////////////////////////////////////////////////////////////////////////
  327. // //
  328. // CALL PACKAGE Related Data Structures //
  329. // //
  330. ///////////////////////////////////////////////////////////////////////////////
  331. //
  332. // MSV1.0 LsaCallAuthenticationPackage() submission and response
  333. // message types.
  334. //
  335. typedef enum _MSV1_0_PROTOCOL_MESSAGE_TYPE {
  336. MsV1_0Lm20ChallengeRequest = 0, // Both submission and response
  337. MsV1_0Lm20GetChallengeResponse, // Both submission and response
  338. MsV1_0EnumerateUsers, // Both submission and response
  339. MsV1_0GetUserInfo, // Both submission and response
  340. MsV1_0ReLogonUsers, // Submission only
  341. MsV1_0ChangePassword, // Both submission and response
  342. MsV1_0ChangeCachedPassword, // Both submission and response
  343. MsV1_0GenericPassthrough, // Both submission and response
  344. MsV1_0CacheLogon, // Submission only, no response
  345. MsV1_0SubAuth, // Both submission and response
  346. MsV1_0DeriveCredential, // Both submission and response
  347. MsV1_0CacheLookup, // Both submission and response
  348. MsV1_0SetProcessOption, // Submission only, no response
  349. } MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE;
  350. // end_ntsecapi
  351. //
  352. // MsV1_0Lm20ChallengeRequest submit buffer and response
  353. //
  354. typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {
  355. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  356. } MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
  357. typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {
  358. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  359. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  360. } MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
  361. //
  362. // MsV1_0Lm20GetChallengeResponse submit buffer and response
  363. //
  364. #define USE_PRIMARY_PASSWORD 0x01
  365. #define RETURN_PRIMARY_USERNAME 0x02
  366. #define RETURN_PRIMARY_LOGON_DOMAINNAME 0x04
  367. #define RETURN_NON_NT_USER_SESSION_KEY 0x08
  368. #define GENERATE_CLIENT_CHALLENGE 0x10
  369. #define GCR_NTLM3_PARMS 0x20
  370. #define GCR_TARGET_INFO 0x40 // ServerName field contains target info AV pairs
  371. #define RETURN_RESERVED_PARAMETER 0x80 // was 0x10
  372. #define GCR_ALLOW_NTLM 0x100 // allow the use of NTLM
  373. #define GCR_USE_OEM_SET 0x200 // response uses oem character set
  374. #define GCR_MACHINE_CREDENTIAL 0x400
  375. #define GCR_USE_OWF_PASSWORD 0x800 // use owf passwords
  376. #define GCR_ALLOW_LM 0x1000 // allow the use of LM
  377. //
  378. // version 1 of the GETCHALLENRESP structure, which was used by RAS and others.
  379. // compiled before the additional fields added to GETCHALLENRESP_REQUEST.
  380. // here to allow sizing operations for backwards compatibility.
  381. //
  382. typedef struct _MSV1_0_GETCHALLENRESP_REQUEST_V1 {
  383. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  384. ULONG ParameterControl;
  385. LUID LogonId;
  386. UNICODE_STRING Password;
  387. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  388. } MSV1_0_GETCHALLENRESP_REQUEST_V1, *PMSV1_0_GETCHALLENRESP_REQUEST_V1;
  389. typedef struct _MSV1_0_GETCHALLENRESP_REQUEST {
  390. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  391. ULONG ParameterControl;
  392. LUID LogonId;
  393. UNICODE_STRING Password;
  394. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  395. //
  396. // the following 3 fields are only present if GCR_NTLM3_PARMS is set in ParameterControl
  397. //
  398. UNICODE_STRING UserName;
  399. UNICODE_STRING LogonDomainName;
  400. UNICODE_STRING ServerName; // server domain or target info AV pairs
  401. } MSV1_0_GETCHALLENRESP_REQUEST, *PMSV1_0_GETCHALLENRESP_REQUEST;
  402. typedef struct _MSV1_0_GETCHALLENRESP_RESPONSE {
  403. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  404. STRING CaseSensitiveChallengeResponse;
  405. STRING CaseInsensitiveChallengeResponse;
  406. UNICODE_STRING UserName;
  407. UNICODE_STRING LogonDomainName;
  408. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  409. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  410. } MSV1_0_GETCHALLENRESP_RESPONSE, *PMSV1_0_GETCHALLENRESP_RESPONSE;
  411. //
  412. // MsV1_0EnumerateUsers submit buffer and response
  413. //
  414. typedef struct _MSV1_0_ENUMUSERS_REQUEST {
  415. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  416. } MSV1_0_ENUMUSERS_REQUEST, *PMSV1_0_ENUMUSERS_REQUEST;
  417. typedef struct _MSV1_0_ENUMUSERS_RESPONSE {
  418. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  419. ULONG NumberOfLoggedOnUsers;
  420. PLUID LogonIds;
  421. PULONG EnumHandles;
  422. } MSV1_0_ENUMUSERS_RESPONSE, *PMSV1_0_ENUMUSERS_RESPONSE;
  423. //
  424. // MsV1_0GetUserInfo submit buffer and response
  425. //
  426. typedef struct _MSV1_0_GETUSERINFO_REQUEST {
  427. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  428. LUID LogonId;
  429. } MSV1_0_GETUSERINFO_REQUEST, *PMSV1_0_GETUSERINFO_REQUEST;
  430. typedef struct _MSV1_0_GETUSERINFO_RESPONSE {
  431. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  432. PSID UserSid;
  433. UNICODE_STRING UserName;
  434. UNICODE_STRING LogonDomainName;
  435. UNICODE_STRING LogonServer;
  436. SECURITY_LOGON_TYPE LogonType;
  437. } MSV1_0_GETUSERINFO_RESPONSE, *PMSV1_0_GETUSERINFO_RESPONSE;
  438. // end_ntifs
  439. //
  440. // MsV1_0RelogonUsers submit buffer
  441. //
  442. typedef struct _MSV1_0_RELOGON_REQUEST {
  443. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  444. UNICODE_STRING LogonServer;
  445. } MSV1_0_RELOGON_REQUEST, *PMSV1_0_RELOGON_REQUEST;
  446. //
  447. // MsV1_0ChangePassword and MsV1_0ChangeCachedPassword submit buffer
  448. //
  449. // MsV1_0ChangePassword changes the password on the SAM account plus
  450. // the password cache and logon credentials if applicable.
  451. //
  452. // MsV1_0ChangeCachedPassword only changes the password cache and the logon
  453. // credentials.
  454. //
  455. // begin_ntsecapi
  456. typedef struct _MSV1_0_CHANGEPASSWORD_REQUEST {
  457. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  458. UNICODE_STRING DomainName;
  459. UNICODE_STRING AccountName;
  460. UNICODE_STRING OldPassword;
  461. UNICODE_STRING NewPassword;
  462. BOOLEAN Impersonating;
  463. } MSV1_0_CHANGEPASSWORD_REQUEST, *PMSV1_0_CHANGEPASSWORD_REQUEST;
  464. typedef struct _MSV1_0_CHANGEPASSWORD_RESPONSE {
  465. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  466. BOOLEAN PasswordInfoValid;
  467. DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo;
  468. } MSV1_0_CHANGEPASSWORD_RESPONSE, *PMSV1_0_CHANGEPASSWORD_RESPONSE;
  469. //
  470. // MsV1_0GenericPassthrough - for remoting a CallPackage to
  471. // a domain controller on the specified domain
  472. //
  473. typedef struct _MSV1_0_PASSTHROUGH_REQUEST {
  474. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  475. UNICODE_STRING DomainName;
  476. UNICODE_STRING PackageName;
  477. ULONG DataLength;
  478. PUCHAR LogonData;
  479. ULONG Pad ;
  480. } MSV1_0_PASSTHROUGH_REQUEST, *PMSV1_0_PASSTHROUGH_REQUEST;
  481. typedef struct _MSV1_0_PASSTHROUGH_RESPONSE {
  482. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  483. ULONG Pad;
  484. ULONG DataLength;
  485. PUCHAR ValidationData;
  486. } MSV1_0_PASSTHROUGH_RESPONSE, *PMSV1_0_PASSTHROUGH_RESPONSE;
  487. // end_ntsecapi
  488. //
  489. // MsV1_0CacheLogon submit buffer
  490. //
  491. // Values for RequestFlags
  492. #define MSV1_0_CACHE_LOGON_REQUEST_MIT_LOGON 0x00000001
  493. #define MSV1_0_CACHE_LOGON_REQUEST_INFO4 0x00000002
  494. #define MSV1_0_CACHE_LOGON_DELETE_ENTRY 0x00000004
  495. #define MSV1_0_CACHE_LOGON_REQUEST_SMARTCARD_ONLY 0x00000008
  496. typedef struct _MSV1_0_CACHE_LOGON_REQUEST {
  497. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  498. PVOID LogonInformation;
  499. PVOID ValidationInformation;
  500. PVOID SupplementalCacheData;
  501. ULONG SupplementalCacheDataLength;
  502. ULONG RequestFlags;
  503. } MSV1_0_CACHE_LOGON_REQUEST, *PMSV1_0_CACHE_LOGON_REQUEST;
  504. //
  505. // MsV1_0CacheLookup submit buffer
  506. //
  507. // values for CredentialType
  508. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_NONE 0
  509. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_RAW 1
  510. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_NTOWF 2
  511. typedef struct _MSV1_0_CACHE_LOOKUP_REQUEST {
  512. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  513. UNICODE_STRING UserName;
  514. UNICODE_STRING DomainName;
  515. ULONG CredentialType;
  516. ULONG CredentialInfoLength;
  517. UCHAR CredentialSubmitBuffer[1]; // in-place array of length CredentialInfoLength
  518. } MSV1_0_CACHE_LOOKUP_REQUEST, *PMSV1_0_CACHE_LOOKUP_REQUEST;
  519. typedef struct _MSV1_0_CACHE_LOOKUP_RESPONSE {
  520. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  521. PVOID ValidationInformation;
  522. PVOID SupplementalCacheData;
  523. ULONG SupplementalCacheDataLength;
  524. } MSV1_0_CACHE_LOOKUP_RESPONSE, *PMSV1_0_CACHE_LOOKUP_RESPONSE;
  525. // begin_ntsecapi
  526. //
  527. // MsV1_0SubAuthInfo submit buffer and response - for submitting a buffer to a
  528. // specified Subauthentication Package during an LsaCallAuthenticationPackage().
  529. // If this Subauthentication is to be done locally, then package this message
  530. // in LsaCallAuthenticationPackage(). If this SubAuthentication needs to be done
  531. // on the domain controller, then call LsaCallauthenticationPackage with the
  532. // message type being MsV1_0GenericPassThrough and the LogonData in this struct
  533. // should be a PMSV1_0_SUBAUTH_REQUEST
  534. //
  535. typedef struct _MSV1_0_SUBAUTH_REQUEST{
  536. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  537. ULONG SubAuthPackageId;
  538. ULONG SubAuthInfoLength;
  539. PUCHAR SubAuthSubmitBuffer;
  540. } MSV1_0_SUBAUTH_REQUEST, *PMSV1_0_SUBAUTH_REQUEST;
  541. typedef struct _MSV1_0_SUBAUTH_RESPONSE{
  542. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  543. ULONG SubAuthInfoLength;
  544. PUCHAR SubAuthReturnBuffer;
  545. } MSV1_0_SUBAUTH_RESPONSE, *PMSV1_0_SUBAUTH_RESPONSE;
  546. // end_ntsecapi
  547. //
  548. // Credential Derivation types for MsV1_0DeriveCredential Submit DeriveCredType
  549. //
  550. //
  551. // Derive Credential using SHA-1 and Request buffer DeriveCredSubmitBuffer of
  552. // length DeriveCredInfoLength mixing bytes.
  553. // Response buffer DeriveCredReturnBuffer will contain SHA-1 hash of size
  554. // A_SHA_DIGEST_LEN (20)
  555. //
  556. #define MSV1_0_DERIVECRED_TYPE_SHA1 0
  557. #define MSV1_0_DERIVECRED_TYPE_SHA1_V2 1
  558. //
  559. // MsV1_0DeriveCredential submit buffer and response - for submitting a buffer
  560. // an call to LsaCallAuthenticationPackage().
  561. //
  562. typedef struct _MSV1_0_DERIVECRED_REQUEST {
  563. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  564. LUID LogonId;
  565. ULONG DeriveCredType;
  566. ULONG DeriveCredInfoLength;
  567. UCHAR DeriveCredSubmitBuffer[1]; // in-place array of length DeriveCredInfoLength
  568. } MSV1_0_DERIVECRED_REQUEST, *PMSV1_0_DERIVECRED_REQUEST;
  569. typedef struct _MSV1_0_DERIVECRED_RESPONSE {
  570. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  571. ULONG DeriveCredInfoLength;
  572. UCHAR DeriveCredReturnBuffer[1]; // in-place array of length DeriveCredInfoLength
  573. } MSV1_0_DERIVECRED_RESPONSE, *PMSV1_0_DERIVECRED_RESPONSE;
  574. //
  575. // MsV1_0SetProcessOption submit buffer - for submitting a buffer
  576. // an call to LsaCallAuthenticationPackage().
  577. //
  578. #define MSV1_0_OPTION_ALLOW_BLANK_PASSWORD 0x01
  579. #define MSV1_0_OPTION_DISABLE_ADMIN_LOCKOUT 0x02
  580. #define MSV1_0_OPTION_DISABLE_FORCE_GUEST 0x04
  581. #define MSV1_0_OPTION_ALLOW_OLD_PASSWORD 0x08
  582. #define MSV1_0_OPTION_TRY_CACHE_FIRST 0x10
  583. typedef struct _MSV1_0_SETPROCESSOPTION_REQUEST {
  584. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  585. ULONG ProcessOptions;
  586. BOOLEAN DisableOptions;
  587. } MSV1_0_SETPROCESSOPTION_REQUEST, *PMSV1_0_SETPROCESSOPTION_REQUEST;
  588. #ifdef __cplusplus
  589. }
  590. #endif
  591. #endif //_NTMSV1_0_