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.

727 lines
24 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_SUBAUTHENTICATION_DLL_EX 0x00100000
  198. //
  199. // The high order byte is a value indicating the SubAuthentication DLL.
  200. // Zero indicates no SubAuthentication DLL.
  201. //
  202. #define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000
  203. #define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24
  204. #define MSV1_0_MNS_LOGON 0x01000000
  205. //
  206. // This is the list of subauthentication dlls used in MS
  207. //
  208. #define MSV1_0_SUBAUTHENTICATION_DLL_RAS 2
  209. #define MSV1_0_SUBAUTHENTICATION_DLL_IIS 132
  210. typedef struct _MSV1_0_LM20_LOGON {
  211. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  212. UNICODE_STRING LogonDomainName;
  213. UNICODE_STRING UserName;
  214. UNICODE_STRING Workstation;
  215. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  216. STRING CaseSensitiveChallengeResponse;
  217. STRING CaseInsensitiveChallengeResponse;
  218. ULONG ParameterControl;
  219. } MSV1_0_LM20_LOGON, * PMSV1_0_LM20_LOGON;
  220. //
  221. // NT 5.0 SubAuth dlls can use this struct
  222. //
  223. typedef struct _MSV1_0_SUBAUTH_LOGON{
  224. MSV1_0_LOGON_SUBMIT_TYPE MessageType;
  225. UNICODE_STRING LogonDomainName;
  226. UNICODE_STRING UserName;
  227. UNICODE_STRING Workstation;
  228. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  229. STRING AuthenticationInfo1;
  230. STRING AuthenticationInfo2;
  231. ULONG ParameterControl;
  232. ULONG SubAuthPackageId;
  233. } MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON;
  234. //
  235. // Values for UserFlags.
  236. //
  237. #define LOGON_GUEST 0x01
  238. #define LOGON_NOENCRYPTION 0x02
  239. #define LOGON_CACHED_ACCOUNT 0x04
  240. #define LOGON_USED_LM_PASSWORD 0x08
  241. #define LOGON_EXTRA_SIDS 0x20
  242. #define LOGON_SUBAUTH_SESSION_KEY 0x40
  243. #define LOGON_SERVER_TRUST_ACCOUNT 0x80
  244. #define LOGON_NTLMV2_ENABLED 0x100 // says DC understands NTLMv2
  245. #define LOGON_RESOURCE_GROUPS 0x200
  246. #define LOGON_PROFILE_PATH_RETURNED 0x400
  247. //
  248. // The high order byte is reserved for return by SubAuthentication DLLs.
  249. //
  250. #define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000
  251. // Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL
  252. #define LOGON_GRACE_LOGON 0x01000000
  253. typedef struct _MSV1_0_LM20_LOGON_PROFILE {
  254. MSV1_0_PROFILE_BUFFER_TYPE MessageType;
  255. LARGE_INTEGER KickOffTime;
  256. LARGE_INTEGER LogoffTime;
  257. ULONG UserFlags;
  258. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  259. UNICODE_STRING LogonDomainName;
  260. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  261. UNICODE_STRING LogonServer;
  262. UNICODE_STRING UserParameters;
  263. } MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE;
  264. //
  265. // Supplemental credentials structure used for passing credentials into
  266. // MSV1_0 from other packages
  267. //
  268. #define MSV1_0_OWF_PASSWORD_LENGTH 16
  269. #define MSV1_0_CRED_LM_PRESENT 0x1
  270. #define MSV1_0_CRED_NT_PRESENT 0x2
  271. #define MSV1_0_CRED_VERSION 0
  272. typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL {
  273. ULONG Version;
  274. ULONG Flags;
  275. UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
  276. UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
  277. } MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
  278. //
  279. // NTLM3 definitions.
  280. //
  281. #define MSV1_0_NTLM3_RESPONSE_LENGTH 16
  282. #define MSV1_0_NTLM3_OWF_LENGTH 16
  283. //
  284. // this is the longest amount of time we'll allow challenge response
  285. // pairs to be used. Note that this also has to allow for worst case clock skew
  286. //
  287. #define MSV1_0_MAX_NTLM3_LIFE 129600 // 36 hours (in seconds)
  288. #define MSV1_0_MAX_AVL_SIZE 64000
  289. //
  290. // MsvAvFlags bit values
  291. //
  292. #define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001
  293. // this is an MSV1_0 private data structure, defining the layout of an NTLM3 response, as sent by a
  294. // client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structure. If can be differentiated
  295. // from an old style NT response by its length. This is crude, but it needs to pass through servers and
  296. // the servers' DCs that do not understand NTLM3 but that are willing to pass longer responses.
  297. typedef struct _MSV1_0_NTLM3_RESPONSE {
  298. UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH]; // hash of OWF of password with all the following fields
  299. UCHAR RespType; // id number of response; current is 1
  300. UCHAR HiRespType; // highest id number understood by client
  301. USHORT Flags; // reserved; must be sent as zero at this version
  302. ULONG MsgWord; // 32 bit message from client to server (for use by auth protocol)
  303. ULONGLONG TimeStamp; // time stamp when client generated response -- NT system time, quad part
  304. UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH];
  305. ULONG AvPairsOff; // offset to start of AvPairs (to allow future expansion)
  306. UCHAR Buffer[1]; // start of buffer with AV pairs (or future stuff -- so use the offset)
  307. } MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE;
  308. #define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH)
  309. typedef enum {
  310. MsvAvEOL, // end of list
  311. MsvAvNbComputerName, // server's computer name -- NetBIOS
  312. MsvAvNbDomainName, // server's domain name -- NetBIOS
  313. MsvAvDnsComputerName, // server's computer name -- DNS
  314. MsvAvDnsDomainName, // server's domain name -- DNS
  315. MsvAvDnsTreeName, // server's tree name -- DNS
  316. MsvAvFlags // server's extended flags -- DWORD mask
  317. } MSV1_0_AVID;
  318. typedef struct _MSV1_0_AV_PAIR {
  319. USHORT AvId;
  320. USHORT AvLen;
  321. // Data is treated as byte array following structure
  322. } MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR;
  323. ///////////////////////////////////////////////////////////////////////////////
  324. // //
  325. // CALL PACKAGE Related Data Structures //
  326. // //
  327. ///////////////////////////////////////////////////////////////////////////////
  328. //
  329. // MSV1.0 LsaCallAuthenticationPackage() submission and response
  330. // message types.
  331. //
  332. typedef enum _MSV1_0_PROTOCOL_MESSAGE_TYPE {
  333. MsV1_0Lm20ChallengeRequest = 0, // Both submission and response
  334. MsV1_0Lm20GetChallengeResponse, // Both submission and response
  335. MsV1_0EnumerateUsers, // Both submission and response
  336. MsV1_0GetUserInfo, // Both submission and response
  337. MsV1_0ReLogonUsers, // Submission only
  338. MsV1_0ChangePassword, // Both submission and response
  339. MsV1_0ChangeCachedPassword, // Both submission and response
  340. MsV1_0GenericPassthrough, // Both submission and response
  341. MsV1_0CacheLogon, // Submission only, no response
  342. MsV1_0SubAuth, // Both submission and response
  343. MsV1_0DeriveCredential, // Both submission and response
  344. MsV1_0CacheLookup, // Both submission and response
  345. MsV1_0SetProcessOption, // Submission only, no response
  346. } MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE;
  347. // end_ntsecapi
  348. //
  349. // MsV1_0Lm20ChallengeRequest submit buffer and response
  350. //
  351. typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {
  352. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  353. } MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
  354. typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {
  355. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  356. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  357. } MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
  358. //
  359. // MsV1_0Lm20GetChallengeResponse submit buffer and response
  360. //
  361. #define USE_PRIMARY_PASSWORD 0x01
  362. #define RETURN_PRIMARY_USERNAME 0x02
  363. #define RETURN_PRIMARY_LOGON_DOMAINNAME 0x04
  364. #define RETURN_NON_NT_USER_SESSION_KEY 0x08
  365. #define GENERATE_CLIENT_CHALLENGE 0x10
  366. #define GCR_NTLM3_PARMS 0x20
  367. #define GCR_TARGET_INFO 0x40 // ServerName field contains target info AV pairs
  368. #define RETURN_RESERVED_PARAMETER 0x80 // was 0x10
  369. #define GCR_ALLOW_NTLM 0x100
  370. #define GCR_MACHINE_CREDENTIAL 0x400
  371. //
  372. // version 1 of the GETCHALLENRESP structure, which was used by RAS and others.
  373. // compiled before the additional fields added to GETCHALLENRESP_REQUEST.
  374. // here to allow sizing operations for backwards compatibility.
  375. //
  376. typedef struct _MSV1_0_GETCHALLENRESP_REQUEST_V1 {
  377. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  378. ULONG ParameterControl;
  379. LUID LogonId;
  380. UNICODE_STRING Password;
  381. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  382. } MSV1_0_GETCHALLENRESP_REQUEST_V1, *PMSV1_0_GETCHALLENRESP_REQUEST_V1;
  383. typedef struct _MSV1_0_GETCHALLENRESP_REQUEST {
  384. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  385. ULONG ParameterControl;
  386. LUID LogonId;
  387. UNICODE_STRING Password;
  388. UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
  389. //
  390. // the following 3 fields are only present if GCR_NTLM3_PARMS is set in ParameterControl
  391. //
  392. UNICODE_STRING UserName;
  393. UNICODE_STRING LogonDomainName;
  394. UNICODE_STRING ServerName; // server domain or target info AV pairs
  395. } MSV1_0_GETCHALLENRESP_REQUEST, *PMSV1_0_GETCHALLENRESP_REQUEST;
  396. typedef struct _MSV1_0_GETCHALLENRESP_RESPONSE {
  397. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  398. STRING CaseSensitiveChallengeResponse;
  399. STRING CaseInsensitiveChallengeResponse;
  400. UNICODE_STRING UserName;
  401. UNICODE_STRING LogonDomainName;
  402. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  403. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  404. } MSV1_0_GETCHALLENRESP_RESPONSE, *PMSV1_0_GETCHALLENRESP_RESPONSE;
  405. //
  406. // MsV1_0EnumerateUsers submit buffer and response
  407. //
  408. typedef struct _MSV1_0_ENUMUSERS_REQUEST {
  409. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  410. } MSV1_0_ENUMUSERS_REQUEST, *PMSV1_0_ENUMUSERS_REQUEST;
  411. typedef struct _MSV1_0_ENUMUSERS_RESPONSE {
  412. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  413. ULONG NumberOfLoggedOnUsers;
  414. PLUID LogonIds;
  415. PULONG EnumHandles;
  416. } MSV1_0_ENUMUSERS_RESPONSE, *PMSV1_0_ENUMUSERS_RESPONSE;
  417. //
  418. // MsV1_0GetUserInfo submit buffer and response
  419. //
  420. typedef struct _MSV1_0_GETUSERINFO_REQUEST {
  421. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  422. LUID LogonId;
  423. } MSV1_0_GETUSERINFO_REQUEST, *PMSV1_0_GETUSERINFO_REQUEST;
  424. typedef struct _MSV1_0_GETUSERINFO_RESPONSE {
  425. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  426. PSID UserSid;
  427. UNICODE_STRING UserName;
  428. UNICODE_STRING LogonDomainName;
  429. UNICODE_STRING LogonServer;
  430. SECURITY_LOGON_TYPE LogonType;
  431. } MSV1_0_GETUSERINFO_RESPONSE, *PMSV1_0_GETUSERINFO_RESPONSE;
  432. // end_ntifs
  433. //
  434. // MsV1_0RelogonUsers submit buffer
  435. //
  436. typedef struct _MSV1_0_RELOGON_REQUEST {
  437. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  438. UNICODE_STRING LogonServer;
  439. } MSV1_0_RELOGON_REQUEST, *PMSV1_0_RELOGON_REQUEST;
  440. //
  441. // MsV1_0ChangePassword and MsV1_0ChangeCachedPassword submit buffer
  442. //
  443. // MsV1_0ChangePassword changes the password on the SAM account plus
  444. // the password cache and logon credentials if applicable.
  445. //
  446. // MsV1_0ChangeCachedPassword only changes the password cache and the logon
  447. // credentials.
  448. //
  449. // begin_ntsecapi
  450. typedef struct _MSV1_0_CHANGEPASSWORD_REQUEST {
  451. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  452. UNICODE_STRING DomainName;
  453. UNICODE_STRING AccountName;
  454. UNICODE_STRING OldPassword;
  455. UNICODE_STRING NewPassword;
  456. BOOLEAN Impersonating;
  457. } MSV1_0_CHANGEPASSWORD_REQUEST, *PMSV1_0_CHANGEPASSWORD_REQUEST;
  458. typedef struct _MSV1_0_CHANGEPASSWORD_RESPONSE {
  459. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  460. BOOLEAN PasswordInfoValid;
  461. DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo;
  462. } MSV1_0_CHANGEPASSWORD_RESPONSE, *PMSV1_0_CHANGEPASSWORD_RESPONSE;
  463. // end_ntsecapi
  464. //
  465. // MsV1_0GenericPassthrough - for remoting a CallPackage to
  466. // a domain controller on the specified domain
  467. //
  468. typedef struct _MSV1_0_PASSTHROUGH_REQUEST {
  469. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  470. UNICODE_STRING DomainName;
  471. UNICODE_STRING PackageName;
  472. ULONG DataLength;
  473. PUCHAR LogonData;
  474. ULONG Pad ;
  475. } MSV1_0_PASSTHROUGH_REQUEST, *PMSV1_0_PASSTHROUGH_REQUEST;
  476. typedef struct _MSV1_0_PASSTHROUGH_RESPONSE {
  477. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  478. ULONG Pad;
  479. ULONG DataLength;
  480. PUCHAR ValidationData;
  481. } MSV1_0_PASSTHROUGH_RESPONSE, *PMSV1_0_PASSTHROUGH_RESPONSE;
  482. //
  483. // MsV1_0CacheLogon submit buffer
  484. //
  485. // Values for RequestFlags
  486. #define MSV1_0_CACHE_LOGON_REQUEST_MIT_LOGON 0x00000001
  487. #define MSV1_0_CACHE_LOGON_REQUEST_INFO4 0x00000002
  488. #define MSV1_0_CACHE_LOGON_DELETE_ENTRY 0x00000004
  489. typedef struct _MSV1_0_CACHE_LOGON_REQUEST {
  490. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  491. PVOID LogonInformation;
  492. PVOID ValidationInformation;
  493. PVOID SupplementalCacheData;
  494. ULONG SupplementalCacheDataLength;
  495. ULONG RequestFlags;
  496. } MSV1_0_CACHE_LOGON_REQUEST, *PMSV1_0_CACHE_LOGON_REQUEST;
  497. //
  498. // MsV1_0CacheLookup submit buffer
  499. //
  500. // values for CredentialType
  501. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_NONE 0
  502. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_RAW 1
  503. #define MSV1_0_CACHE_LOOKUP_CREDTYPE_NTOWF 2
  504. typedef struct _MSV1_0_CACHE_LOOKUP_REQUEST {
  505. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  506. UNICODE_STRING UserName;
  507. UNICODE_STRING DomainName;
  508. ULONG CredentialType;
  509. ULONG CredentialInfoLength;
  510. UCHAR CredentialSubmitBuffer[1]; // in-place array of length CredentialInfoLength
  511. } MSV1_0_CACHE_LOOKUP_REQUEST, *PMSV1_0_CACHE_LOOKUP_REQUEST;
  512. typedef struct _MSV1_0_CACHE_LOOKUP_RESPONSE {
  513. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  514. PVOID ValidationInformation;
  515. PVOID SupplementalCacheData;
  516. ULONG SupplementalCacheDataLength;
  517. } MSV1_0_CACHE_LOOKUP_RESPONSE, *PMSV1_0_CACHE_LOOKUP_RESPONSE;
  518. // begin_ntsecapi
  519. //
  520. // MsV1_0SubAuthInfo submit buffer and response - for submitting a buffer to a
  521. // specified Subauthentication Package during an LsaCallAuthenticationPackage().
  522. // If this Subauthentication is to be done locally, then package this message
  523. // in LsaCallAuthenticationPackage(). If this SubAuthentication needs to be done
  524. // on the domain controller, then call LsaCallauthenticationPackage with the
  525. // message type being MsV1_0GenericPassThrough and the LogonData in this struct
  526. // should be a PMSV1_0_SUBAUTH_REQUEST
  527. //
  528. typedef struct _MSV1_0_SUBAUTH_REQUEST{
  529. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  530. ULONG SubAuthPackageId;
  531. ULONG SubAuthInfoLength;
  532. PUCHAR SubAuthSubmitBuffer;
  533. } MSV1_0_SUBAUTH_REQUEST, *PMSV1_0_SUBAUTH_REQUEST;
  534. typedef struct _MSV1_0_SUBAUTH_RESPONSE{
  535. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  536. ULONG SubAuthInfoLength;
  537. PUCHAR SubAuthReturnBuffer;
  538. } MSV1_0_SUBAUTH_RESPONSE, *PMSV1_0_SUBAUTH_RESPONSE;
  539. // end_ntsecapi
  540. //
  541. // Credential Derivation types for MsV1_0DeriveCredential Submit DeriveCredType
  542. //
  543. //
  544. // Derive Credential using SHA-1 and Request buffer DeriveCredSubmitBuffer of
  545. // length DeriveCredInfoLength mixing bytes.
  546. // Response buffer DeriveCredReturnBuffer will contain SHA-1 hash of size
  547. // A_SHA_DIGEST_LEN (20)
  548. //
  549. #define MSV1_0_DERIVECRED_TYPE_SHA1 0
  550. #define MSV1_0_DERIVECRED_TYPE_SHA1_V2 1
  551. //
  552. // MsV1_0DeriveCredential submit buffer and response - for submitting a buffer
  553. // an call to LsaCallAuthenticationPackage().
  554. //
  555. typedef struct _MSV1_0_DERIVECRED_REQUEST {
  556. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  557. LUID LogonId;
  558. ULONG DeriveCredType;
  559. ULONG DeriveCredInfoLength;
  560. UCHAR DeriveCredSubmitBuffer[1]; // in-place array of length DeriveCredInfoLength
  561. } MSV1_0_DERIVECRED_REQUEST, *PMSV1_0_DERIVECRED_REQUEST;
  562. typedef struct _MSV1_0_DERIVECRED_RESPONSE {
  563. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  564. ULONG DeriveCredInfoLength;
  565. UCHAR DeriveCredReturnBuffer[1]; // in-place array of length DeriveCredInfoLength
  566. } MSV1_0_DERIVECRED_RESPONSE, *PMSV1_0_DERIVECRED_RESPONSE;
  567. //
  568. // MsV1_0SetProcessOption submit buffer - for submitting a buffer
  569. // an call to LsaCallAuthenticationPackage().
  570. //
  571. #define MSV1_0_OPTION_ALLOW_BLANK_PASSWORD 0x1
  572. #define MSV1_0_OPTION_DISABLE_ADMIN_LOCKOUT 0x2
  573. #define MSV1_0_OPTION_DISABLE_FORCE_GUEST 0x4
  574. typedef struct _MSV1_0_SETPROCESSOPTION_REQUEST {
  575. MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
  576. ULONG ProcessOptions;
  577. BOOLEAN DisableOptions;
  578. } MSV1_0_SETPROCESSOPTION_REQUEST, *PMSV1_0_SETPROCESSOPTION_REQUEST;
  579. #ifdef __cplusplus
  580. }
  581. #endif
  582. #endif //_NTMSV1_0_