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.

733 lines
21 KiB

  1. /*++
  2. Copyright (c) 1987-1991 Microsoft Corporation
  3. Module Name:
  4. logonmsv.h
  5. Abstract:
  6. Definition of API's to the Netlogon service which are callable
  7. by the MSV1_0 authentication package.
  8. Author:
  9. Cliff Van Dyke (cliffv) 23-Jun-1991
  10. Environment:
  11. User mode only.
  12. Contains NT-specific code.
  13. Requires ANSI C extensions: slash-slash comments, long external names.
  14. Revision History:
  15. --*/
  16. #ifndef __LOGONMSV_H__
  17. #define __LOGONMSV_H__
  18. #include <lsass.h> // OLD_LARGE_INTEGER
  19. //
  20. // Name of secret in LSA secret storage where account passwords are kept.
  21. //
  22. #define SSI_SECRET_PREFIX L"$"
  23. #define SSI_SECRET_PREFIX_LENGTH 1
  24. #define SSI_SECRET_POSTFIX L"MACHINE.ACC"
  25. #define SSI_SECRET_NAME L"$MACHINE.ACC"
  26. //
  27. // Name of the event used to synchronize between the security process and
  28. // the service controller.
  29. //
  30. #define SECURITY_SERVICES_STARTED L"SECURITY_SERVICES_STARTED"
  31. //
  32. // The structures supporting remote logon APIs
  33. //
  34. typedef CYPHER_BLOCK NETLOGON_CREDENTIAL, *PNETLOGON_CREDENTIAL ;
  35. typedef struct _NETLOGON_AUTHENTICATOR {
  36. NETLOGON_CREDENTIAL Credential;
  37. DWORD timestamp;
  38. } NETLOGON_AUTHENTICATOR, *PNETLOGON_AUTHENTICATOR ;
  39. typedef struct _NETLOGON_SESSION_KEY {
  40. BYTE Key[CRYPT_TXT_LEN * 2];
  41. } NETLOGON_SESSION_KEY, *PNETLOGON_SESSION_KEY;
  42. typedef enum _NETLOGON_SECURE_CHANNEL_TYPE {
  43. NullSecureChannel = 0,
  44. MsvApSecureChannel,
  45. WorkstationSecureChannel,
  46. TrustedDnsDomainSecureChannel,
  47. TrustedDomainSecureChannel,
  48. UasServerSecureChannel,
  49. ServerSecureChannel
  50. } NETLOGON_SECURE_CHANNEL_TYPE;
  51. #define IsDomainSecureChannelType( _T ) \
  52. ( (_T) == TrustedDnsDomainSecureChannel || \
  53. (_T) == TrustedDomainSecureChannel )
  54. //
  55. // Input information to NetLogonSamLogon.
  56. //
  57. // begin_ntsubauth
  58. typedef enum _NETLOGON_LOGON_INFO_CLASS {
  59. NetlogonInteractiveInformation = 1,
  60. NetlogonNetworkInformation,
  61. NetlogonServiceInformation,
  62. NetlogonGenericInformation,
  63. NetlogonInteractiveTransitiveInformation,
  64. NetlogonNetworkTransitiveInformation,
  65. NetlogonServiceTransitiveInformation
  66. } NETLOGON_LOGON_INFO_CLASS;
  67. typedef struct _NETLOGON_LOGON_IDENTITY_INFO {
  68. UNICODE_STRING LogonDomainName;
  69. ULONG ParameterControl;
  70. OLD_LARGE_INTEGER LogonId;
  71. UNICODE_STRING UserName;
  72. UNICODE_STRING Workstation;
  73. } NETLOGON_LOGON_IDENTITY_INFO,
  74. *PNETLOGON_LOGON_IDENTITY_INFO;
  75. typedef struct _NETLOGON_INTERACTIVE_INFO {
  76. NETLOGON_LOGON_IDENTITY_INFO Identity;
  77. LM_OWF_PASSWORD LmOwfPassword;
  78. NT_OWF_PASSWORD NtOwfPassword;
  79. } NETLOGON_INTERACTIVE_INFO,
  80. *PNETLOGON_INTERACTIVE_INFO;
  81. typedef struct _NETLOGON_SERVICE_INFO {
  82. NETLOGON_LOGON_IDENTITY_INFO Identity;
  83. LM_OWF_PASSWORD LmOwfPassword;
  84. NT_OWF_PASSWORD NtOwfPassword;
  85. } NETLOGON_SERVICE_INFO, *PNETLOGON_SERVICE_INFO;
  86. typedef struct _NETLOGON_NETWORK_INFO {
  87. NETLOGON_LOGON_IDENTITY_INFO Identity;
  88. LM_CHALLENGE LmChallenge;
  89. STRING NtChallengeResponse;
  90. STRING LmChallengeResponse;
  91. } NETLOGON_NETWORK_INFO, *PNETLOGON_NETWORK_INFO;
  92. typedef struct _NETLOGON_GENERIC_INFO {
  93. NETLOGON_LOGON_IDENTITY_INFO Identity;
  94. UNICODE_STRING PackageName;
  95. ULONG DataLength;
  96. #ifdef MIDL_PASS
  97. [size_is(DataLength)]
  98. #endif
  99. PUCHAR LogonData;
  100. } NETLOGON_GENERIC_INFO, *PNETLOGON_GENERIC_INFO;
  101. // end_ntsubauth
  102. //
  103. // Structure to pass a SID_AND_ATTRIBUTES over the network.
  104. //
  105. typedef struct _NETLOGON_SID_AND_ATTRIBUTES {
  106. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  107. PISID Sid;
  108. #else
  109. PSID Sid;
  110. #endif
  111. ULONG Attributes;
  112. } NETLOGON_SID_AND_ATTRIBUTES, *PNETLOGON_SID_AND_ATTRIBUTES;
  113. //
  114. // Values of ParameterControl
  115. //
  116. // (Obsolete: Use the ParameterControl values from ntmsv1_0.h)
  117. #define CLEARTEXT_PASSWORD_ALLOWED 0x02 // Challenge response fields may
  118. // actually be clear text passwords.
  119. //
  120. // Output information to NetLogonSamLogon.
  121. //
  122. typedef enum _NETLOGON_VALIDATION_INFO_CLASS {
  123. NetlogonValidationUasInfo = 1,
  124. NetlogonValidationSamInfo,
  125. NetlogonValidationSamInfo2,
  126. NetlogonValidationGenericInfo,
  127. NetlogonValidationGenericInfo2,
  128. NetlogonValidationSamInfo4
  129. } NETLOGON_VALIDATION_INFO_CLASS;
  130. typedef struct _NETLOGON_VALIDATION_SAM_INFO {
  131. //
  132. // Information retrieved from SAM.
  133. //
  134. OLD_LARGE_INTEGER LogonTime; // 0 for Network logon
  135. OLD_LARGE_INTEGER LogoffTime;
  136. OLD_LARGE_INTEGER KickOffTime;
  137. OLD_LARGE_INTEGER PasswordLastSet; // 0 for Network logon
  138. OLD_LARGE_INTEGER PasswordCanChange; // 0 for Network logon
  139. OLD_LARGE_INTEGER PasswordMustChange; // 0 for Network logon
  140. UNICODE_STRING EffectiveName; // 0 for Network logon
  141. UNICODE_STRING FullName; // 0 for Network logon
  142. UNICODE_STRING LogonScript; // 0 for Network logon
  143. UNICODE_STRING ProfilePath; // 0 for Network logon
  144. UNICODE_STRING HomeDirectory; // 0 for Network logon
  145. UNICODE_STRING HomeDirectoryDrive; // 0 for Network logon
  146. USHORT LogonCount; // 0 for Network logon
  147. USHORT BadPasswordCount; // 0 for Network logon
  148. ULONG UserId;
  149. ULONG PrimaryGroupId;
  150. ULONG GroupCount;
  151. #ifdef MIDL_PASS
  152. [size_is(GroupCount)]
  153. #endif // MIDL_PASS
  154. PGROUP_MEMBERSHIP GroupIds;
  155. //
  156. // Information supplied by the MSV AP/Netlogon service.
  157. //
  158. ULONG UserFlags;
  159. USER_SESSION_KEY UserSessionKey;
  160. UNICODE_STRING LogonServer;
  161. UNICODE_STRING LogonDomainName;
  162. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  163. PISID LogonDomainId;
  164. #else
  165. PSID LogonDomainId;
  166. #endif
  167. ULONG ExpansionRoom[10]; // Put new fields here
  168. } NETLOGON_VALIDATION_SAM_INFO, *PNETLOGON_VALIDATION_SAM_INFO ;
  169. //
  170. // New output information for NetLogonSamLogon. This structure is identical
  171. // to the above structure with some new fields added at the end.
  172. //
  173. typedef struct _NETLOGON_VALIDATION_SAM_INFO2 {
  174. //
  175. // Information retrieved from SAM.
  176. //
  177. OLD_LARGE_INTEGER LogonTime; // 0 for Network logon
  178. OLD_LARGE_INTEGER LogoffTime;
  179. OLD_LARGE_INTEGER KickOffTime;
  180. OLD_LARGE_INTEGER PasswordLastSet; // 0 for Network logon
  181. OLD_LARGE_INTEGER PasswordCanChange; // 0 for Network logon
  182. OLD_LARGE_INTEGER PasswordMustChange; // 0 for Network logon
  183. UNICODE_STRING EffectiveName; // 0 for Network logon
  184. UNICODE_STRING FullName; // 0 for Network logon
  185. UNICODE_STRING LogonScript; // 0 for Network logon
  186. UNICODE_STRING ProfilePath; // 0 for Network logon
  187. UNICODE_STRING HomeDirectory; // 0 for Network logon
  188. UNICODE_STRING HomeDirectoryDrive; // 0 for Network logon
  189. USHORT LogonCount; // 0 for Network logon
  190. USHORT BadPasswordCount; // 0 for Network logon
  191. ULONG UserId;
  192. ULONG PrimaryGroupId;
  193. ULONG GroupCount;
  194. #ifdef MIDL_PASS
  195. [size_is(GroupCount)]
  196. #endif // MIDL_PASS
  197. PGROUP_MEMBERSHIP GroupIds;
  198. //
  199. // Information supplied by the MSV AP/Netlogon service.
  200. //
  201. ULONG UserFlags;
  202. USER_SESSION_KEY UserSessionKey;
  203. UNICODE_STRING LogonServer;
  204. UNICODE_STRING LogonDomainName;
  205. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  206. PISID LogonDomainId;
  207. #else
  208. PSID LogonDomainId;
  209. #endif
  210. ULONG ExpansionRoom[10]; // Put new fields here
  211. //
  212. // The new fields in this structure are a count and a pointer to
  213. // an array of SIDs and attributes.
  214. //
  215. ULONG SidCount;
  216. #ifdef MIDL_PASS
  217. [size_is(SidCount)]
  218. #endif // MIDL_PASS
  219. PNETLOGON_SID_AND_ATTRIBUTES ExtraSids;
  220. } NETLOGON_VALIDATION_SAM_INFO2, *PNETLOGON_VALIDATION_SAM_INFO2 ;
  221. //
  222. // Info level 3 is a version used internally by kerberos. It never appears on the wire.
  223. //
  224. typedef struct _NETLOGON_VALIDATION_SAM_INFO3 {
  225. //
  226. // Information retrieved from SAM.
  227. //
  228. OLD_LARGE_INTEGER LogonTime; // 0 for Network logon
  229. OLD_LARGE_INTEGER LogoffTime;
  230. OLD_LARGE_INTEGER KickOffTime;
  231. OLD_LARGE_INTEGER PasswordLastSet; // 0 for Network logon
  232. OLD_LARGE_INTEGER PasswordCanChange; // 0 for Network logon
  233. OLD_LARGE_INTEGER PasswordMustChange; // 0 for Network logon
  234. UNICODE_STRING EffectiveName; // 0 for Network logon
  235. UNICODE_STRING FullName; // 0 for Network logon
  236. UNICODE_STRING LogonScript; // 0 for Network logon
  237. UNICODE_STRING ProfilePath; // 0 for Network logon
  238. UNICODE_STRING HomeDirectory; // 0 for Network logon
  239. UNICODE_STRING HomeDirectoryDrive; // 0 for Network logon
  240. USHORT LogonCount; // 0 for Network logon
  241. USHORT BadPasswordCount; // 0 for Network logon
  242. ULONG UserId;
  243. ULONG PrimaryGroupId;
  244. ULONG GroupCount;
  245. #ifdef MIDL_PASS
  246. [size_is(GroupCount)]
  247. #endif // MIDL_PASS
  248. PGROUP_MEMBERSHIP GroupIds;
  249. //
  250. // Information supplied by the MSV AP/Netlogon service.
  251. //
  252. ULONG UserFlags;
  253. USER_SESSION_KEY UserSessionKey;
  254. UNICODE_STRING LogonServer;
  255. UNICODE_STRING LogonDomainName;
  256. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  257. PISID LogonDomainId;
  258. #else
  259. PSID LogonDomainId;
  260. #endif
  261. ULONG ExpansionRoom[10]; // Put new fields here
  262. //
  263. // The new fields in this structure are a count and a pointer to
  264. // an array of SIDs and attributes.
  265. //
  266. ULONG SidCount;
  267. #ifdef MIDL_PASS
  268. [size_is(SidCount)]
  269. #endif // MIDL_PASS
  270. PNETLOGON_SID_AND_ATTRIBUTES ExtraSids;
  271. //
  272. // Resource groups. These are present if LOGON_RESOURCE_GROUPS bit is
  273. // set in the user flags
  274. //
  275. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  276. PISID ResourceGroupDomainSid;
  277. #else
  278. PSID ResourceGroupDomainSid;
  279. #endif
  280. ULONG ResourceGroupCount;
  281. #ifdef MIDL_PASS
  282. [size_is(ResourceGroupCount)]
  283. #endif // MIDL_PASS
  284. PGROUP_MEMBERSHIP ResourceGroupIds;
  285. } NETLOGON_VALIDATION_SAM_INFO3, *PNETLOGON_VALIDATION_SAM_INFO3 ;
  286. //
  287. // New output information for NetLogonSamLogon. This structure is identical
  288. // to the NETLOGON_VALIDATION_SAM_INFO2 with some new fields added at the end.
  289. //
  290. // This version was introduced in Whistler.
  291. //
  292. typedef struct _NETLOGON_VALIDATION_SAM_INFO4 {
  293. //
  294. // Information retrieved from SAM.
  295. //
  296. OLD_LARGE_INTEGER LogonTime; // 0 for Network logon
  297. OLD_LARGE_INTEGER LogoffTime;
  298. OLD_LARGE_INTEGER KickOffTime;
  299. OLD_LARGE_INTEGER PasswordLastSet; // 0 for Network logon
  300. OLD_LARGE_INTEGER PasswordCanChange; // 0 for Network logon
  301. OLD_LARGE_INTEGER PasswordMustChange; // 0 for Network logon
  302. UNICODE_STRING EffectiveName; // 0 for Network logon
  303. UNICODE_STRING FullName; // 0 for Network logon
  304. UNICODE_STRING LogonScript; // 0 for Network logon
  305. UNICODE_STRING ProfilePath; // 0 for Network logon
  306. UNICODE_STRING HomeDirectory; // 0 for Network logon
  307. UNICODE_STRING HomeDirectoryDrive; // 0 for Network logon
  308. USHORT LogonCount; // 0 for Network logon
  309. USHORT BadPasswordCount; // 0 for Network logon
  310. ULONG UserId;
  311. ULONG PrimaryGroupId;
  312. ULONG GroupCount;
  313. #ifdef MIDL_PASS
  314. [size_is(GroupCount)]
  315. #endif // MIDL_PASS
  316. PGROUP_MEMBERSHIP GroupIds;
  317. //
  318. // Information supplied by the MSV AP/Netlogon service.
  319. //
  320. ULONG UserFlags;
  321. USER_SESSION_KEY UserSessionKey;
  322. UNICODE_STRING LogonServer;
  323. UNICODE_STRING LogonDomainName;
  324. #if defined(MIDL_PASS) || defined(RPC_SERVER)
  325. PISID LogonDomainId;
  326. #else
  327. PSID LogonDomainId;
  328. #endif
  329. //
  330. // The First two longwords (8 bytes) of ExpansionRoom are reserved for the
  331. // LanManSession Key.
  332. //
  333. #define SAMINFO_LM_SESSION_KEY 0
  334. #define SAMINFO_LM_SESSION_KEY_EXT 1
  335. #define SAMINFO_LM_SESSION_KEY_SIZE (2*sizeof(ULONG))
  336. //
  337. // The third longword (4 bytes) of ExpansionRoom is the user account
  338. // control flag from the account.
  339. //
  340. #define SAMINFO_USER_ACCOUNT_CONTROL 2
  341. #define SAMINFO_USER_ACCOUNT_CONTROL_SIZE sizeof(ULONG)
  342. //
  343. // The fourth longword (4 bytes) of ExpansionRoom is for the status
  344. // returned for subauth users, not from subauth packages (NT5 onwards)
  345. //
  346. #define SAMINFO_SUBAUTH_STATUS 3
  347. #define SAMINFO_SUBAUTH_STATUS_SIZE sizeof(ULONG)
  348. ULONG ExpansionRoom[10]; // Put new fields here
  349. //
  350. // The new fields in this structure are a count and a pointer to
  351. // an array of SIDs and attributes.
  352. //
  353. ULONG SidCount;
  354. #ifdef MIDL_PASS
  355. [size_is(SidCount)]
  356. #endif // MIDL_PASS
  357. PNETLOGON_SID_AND_ATTRIBUTES ExtraSids;
  358. //
  359. // New fields added for version 4 of the structure
  360. //
  361. UNICODE_STRING DnsLogonDomainName; // Dns version of LogonDomainName
  362. UNICODE_STRING Upn; // UPN of the user account
  363. UNICODE_STRING ExpansionString1; // Put new strings here
  364. UNICODE_STRING ExpansionString2; // Put new strings here
  365. UNICODE_STRING ExpansionString3; // Put new strings here
  366. UNICODE_STRING ExpansionString4; // Put new strings here
  367. UNICODE_STRING ExpansionString5; // Put new strings here
  368. UNICODE_STRING ExpansionString6; // Put new strings here
  369. UNICODE_STRING ExpansionString7; // Put new strings here
  370. UNICODE_STRING ExpansionString8; // Put new strings here
  371. UNICODE_STRING ExpansionString9; // Put new strings here
  372. UNICODE_STRING ExpansionString10; // Put new strings here
  373. } NETLOGON_VALIDATION_SAM_INFO4, *PNETLOGON_VALIDATION_SAM_INFO4 ;
  374. // This structure is bogus since it doesn't have a size_is
  375. // Everyone should use the generic info2 structure
  376. typedef struct _NETLOGON_VALIDATION_GENERIC_INFO {
  377. ULONG DataLength;
  378. PUCHAR ValidationData;
  379. } NETLOGON_VALIDATION_GENERIC_INFO, *PNETLOGON_VALIDATION_GENERIC_INFO;
  380. typedef struct _NETLOGON_VALIDATION_GENERIC_INFO2 {
  381. ULONG DataLength;
  382. #ifdef MIDL_PASS
  383. [size_is(DataLength)]
  384. #endif // MIDL_PASS
  385. PUCHAR ValidationData;
  386. } NETLOGON_VALIDATION_GENERIC_INFO2, *PNETLOGON_VALIDATION_GENERIC_INFO2;
  387. //
  388. // Status codes that indicate the password is bad and the call should
  389. // be passed through to the PDC of the domain.
  390. //
  391. #define BAD_PASSWORD( _x ) \
  392. ((_x) == STATUS_WRONG_PASSWORD || \
  393. (_x) == STATUS_PASSWORD_EXPIRED || \
  394. (_x) == STATUS_PASSWORD_MUST_CHANGE || \
  395. (_x) == STATUS_ACCOUNT_LOCKED_OUT )
  396. //
  397. // The actual logon and logoff routines.
  398. //
  399. // The following 2 procedure definitions must match
  400. NTSTATUS
  401. I_NetLogonSamLogon(
  402. IN LPWSTR LogonServer OPTIONAL,
  403. IN LPWSTR ComputerName OPTIONAL,
  404. IN PNETLOGON_AUTHENTICATOR Authenticator OPTIONAL,
  405. OUT PNETLOGON_AUTHENTICATOR ReturnAuthenticator OPTIONAL,
  406. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  407. IN LPBYTE LogonInformation,
  408. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  409. OUT LPBYTE * ValidationInformation,
  410. OUT PBOOLEAN Authoritative
  411. );
  412. typedef NTSTATUS
  413. (*PNETLOGON_SAM_LOGON_PROCEDURE)(
  414. IN LPWSTR LogonServer OPTIONAL,
  415. IN LPWSTR ComputerName OPTIONAL,
  416. IN PNETLOGON_AUTHENTICATOR Authenticator OPTIONAL,
  417. OUT PNETLOGON_AUTHENTICATOR ReturnAuthenticator OPTIONAL,
  418. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  419. IN LPBYTE LogonInformation,
  420. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  421. OUT LPBYTE * ValidationInformation,
  422. OUT PBOOLEAN Authoritative
  423. );
  424. //
  425. // Values of ExtraFlags
  426. //
  427. // For OS earlier that WIN 2K. This field didn't exist.
  428. //
  429. // A WIN 2K client always passes zero and ignores the return.
  430. // A WIN 2K server always returns what it is passed.
  431. //
  432. // A whistler client can pass the NETLOGON_SUPPORTS_CROSS_FOREST bits and ignores the return.
  433. // A whistler server always returns what it is passed.
  434. //
  435. // In all cases, the flags correspond to the hop at hand. Each hop computes which flags it
  436. // want to pass to the next hop. It will only set bits that it understands.
  437. //
  438. // Flags introduced with NETLOGON_SUPPORTS_CROSS_FOREST
  439. #define NL_EXFLAGS_EXPEDITE_TO_ROOT 0x0001 // Pass this request to DC at root of forest
  440. #define NL_EXFLAGS_CROSS_FOREST_HOP 0x0002 // Request is first hop over cross forest trust TDO
  441. NTSTATUS
  442. I_NetLogonSamLogonEx (
  443. IN PVOID ContextHandle,
  444. IN LPWSTR LogonServer OPTIONAL,
  445. IN LPWSTR ComputerName OPTIONAL,
  446. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  447. IN LPBYTE LogonInformation,
  448. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  449. OUT LPBYTE * ValidationInformation,
  450. OUT PBOOLEAN Authoritative,
  451. IN OUT PULONG ExtraFlags,
  452. OUT PBOOLEAN RpcFailed
  453. );
  454. NTSTATUS
  455. I_NetLogonSamLogonWithFlags (
  456. IN LPWSTR LogonServer OPTIONAL,
  457. IN LPWSTR ComputerName OPTIONAL,
  458. IN PNETLOGON_AUTHENTICATOR Authenticator OPTIONAL,
  459. OUT PNETLOGON_AUTHENTICATOR ReturnAuthenticator OPTIONAL,
  460. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  461. IN LPBYTE LogonInformation,
  462. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  463. OUT LPBYTE * ValidationInformation,
  464. OUT PBOOLEAN Authoritative,
  465. IN OUT PULONG ExtraFlags
  466. );
  467. // The following 2 procedure definitions must match
  468. NTSTATUS
  469. I_NetLogonSamLogoff (
  470. IN LPWSTR LogonServer OPTIONAL,
  471. IN LPWSTR ComputerName OPTIONAL,
  472. IN PNETLOGON_AUTHENTICATOR Authenticator OPTIONAL,
  473. OUT PNETLOGON_AUTHENTICATOR ReturnAuthenticator OPTIONAL,
  474. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  475. IN LPBYTE LogonInformation
  476. );
  477. typedef NTSTATUS
  478. (*PNETLOGON_SAM_LOGOFF_PROCEDURE) (
  479. IN LPWSTR LogonServer OPTIONAL,
  480. IN LPWSTR ComputerName OPTIONAL,
  481. IN PNETLOGON_AUTHENTICATOR Authenticator OPTIONAL,
  482. OUT PNETLOGON_AUTHENTICATOR ReturnAuthenticator OPTIONAL,
  483. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  484. IN LPBYTE LogonInformation
  485. );
  486. //
  487. // Actual logon/logoff routines for Cairo
  488. //
  489. NET_API_STATUS
  490. NetlogonInitialize(
  491. PVOID Context
  492. );
  493. NTSTATUS
  494. NetlogonSamLogon (
  495. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  496. IN LPBYTE LogonInformation,
  497. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  498. OUT LPBYTE *ValidationInformation,
  499. OUT PBOOLEAN Authoritative
  500. );
  501. //
  502. // Routine to get a list of NT DC's in the specified domain.
  503. //
  504. NET_API_STATUS NET_API_FUNCTION
  505. I_NetGetDCList (
  506. IN LPWSTR ServerName OPTIONAL,
  507. IN LPWSTR TrustedDomainName,
  508. OUT PULONG DCCount,
  509. OUT PUNICODE_STRING * DCNames
  510. );
  511. //
  512. // Validation routine which lives in msv1_0.dll
  513. //
  514. NTSTATUS
  515. MsvSamValidate (
  516. IN SAM_HANDLE DomainHandle,
  517. IN BOOLEAN UasCompatibilityRequired,
  518. IN NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType,
  519. IN PUNICODE_STRING LogonServer,
  520. IN PUNICODE_STRING LogonDomainName,
  521. IN PSID LogonDomainId,
  522. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  523. IN PVOID LogonInformation,
  524. IN NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  525. OUT PVOID * ValidationInformation,
  526. OUT PBOOLEAN Authoritative,
  527. OUT PBOOLEAN BadPasswordCountZeroed,
  528. IN DWORD AccountsToTry
  529. );
  530. //
  531. // Routine to get running number of logon attempts which lives in msv1_0.dll
  532. //
  533. ULONG
  534. MsvGetLogonAttemptCount (
  535. VOID
  536. );
  537. // Values for AccountsToTry
  538. #define MSVSAM_SPECIFIED 0x01 // Try specified account
  539. #define MSVSAM_GUEST 0x02 // Try guest account
  540. NTSTATUS
  541. MsvSamLogoff (
  542. IN SAM_HANDLE DomainHandle,
  543. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  544. IN PVOID LogonInformation
  545. );
  546. // begin_ntsubauth
  547. // Values for Flags
  548. #define MSV1_0_PASSTHRU 0x01
  549. #define MSV1_0_GUEST_LOGON 0x02
  550. NTSTATUS NTAPI
  551. Msv1_0SubAuthenticationRoutine(
  552. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  553. IN PVOID LogonInformation,
  554. IN ULONG Flags,
  555. IN PUSER_ALL_INFORMATION UserAll,
  556. OUT PULONG WhichFields,
  557. OUT PULONG UserFlags,
  558. OUT PBOOLEAN Authoritative,
  559. OUT PLARGE_INTEGER LogoffTime,
  560. OUT PLARGE_INTEGER KickoffTime
  561. );
  562. typedef struct _MSV1_0_VALIDATION_INFO {
  563. LARGE_INTEGER LogoffTime;
  564. LARGE_INTEGER KickoffTime;
  565. UNICODE_STRING LogonServer;
  566. UNICODE_STRING LogonDomainName;
  567. USER_SESSION_KEY SessionKey;
  568. BOOLEAN Authoritative;
  569. ULONG UserFlags;
  570. ULONG WhichFields;
  571. ULONG UserId;
  572. } MSV1_0_VALIDATION_INFO, *PMSV1_0_VALIDATION_INFO;
  573. // values for WhichFields
  574. #define MSV1_0_VALIDATION_LOGOFF_TIME 0x00000001
  575. #define MSV1_0_VALIDATION_KICKOFF_TIME 0x00000002
  576. #define MSV1_0_VALIDATION_LOGON_SERVER 0x00000004
  577. #define MSV1_0_VALIDATION_LOGON_DOMAIN 0x00000008
  578. #define MSV1_0_VALIDATION_SESSION_KEY 0x00000010
  579. #define MSV1_0_VALIDATION_USER_FLAGS 0x00000020
  580. #define MSV1_0_VALIDATION_USER_ID 0x00000040
  581. // legal values for ActionsPerformed
  582. #define MSV1_0_SUBAUTH_ACCOUNT_DISABLED 0x00000001
  583. #define MSV1_0_SUBAUTH_PASSWORD 0x00000002
  584. #define MSV1_0_SUBAUTH_WORKSTATIONS 0x00000004
  585. #define MSV1_0_SUBAUTH_LOGON_HOURS 0x00000008
  586. #define MSV1_0_SUBAUTH_ACCOUNT_EXPIRY 0x00000010
  587. #define MSV1_0_SUBAUTH_PASSWORD_EXPIRY 0x00000020
  588. #define MSV1_0_SUBAUTH_ACCOUNT_TYPE 0x00000040
  589. #define MSV1_0_SUBAUTH_LOCKOUT 0x00000080
  590. NTSTATUS NTAPI
  591. Msv1_0SubAuthenticationRoutineEx(
  592. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  593. IN PVOID LogonInformation,
  594. IN ULONG Flags,
  595. IN PUSER_ALL_INFORMATION UserAll,
  596. IN SAM_HANDLE UserHandle,
  597. IN OUT PMSV1_0_VALIDATION_INFO ValidationInfo,
  598. OUT PULONG ActionsPerformed
  599. );
  600. NTSTATUS NTAPI
  601. Msv1_0SubAuthenticationRoutineGeneric(
  602. IN PVOID SubmitBuffer,
  603. IN ULONG SubmitBufferLength,
  604. OUT PULONG ReturnBufferLength,
  605. OUT PVOID *ReturnBuffer
  606. );
  607. NTSTATUS NTAPI
  608. Msv1_0SubAuthenticationFilter(
  609. IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
  610. IN PVOID LogonInformation,
  611. IN ULONG Flags,
  612. IN PUSER_ALL_INFORMATION UserAll,
  613. OUT PULONG WhichFields,
  614. OUT PULONG UserFlags,
  615. OUT PBOOLEAN Authoritative,
  616. OUT PLARGE_INTEGER LogoffTime,
  617. OUT PLARGE_INTEGER KickoffTime
  618. );
  619. // end_ntsubauth
  620. #endif // __LOGONMSV_H__