2020-06-21 21:47:30 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: Authentication Package DLL
|
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
|
|
* PURPOSE: Security Account Manager (SAM) related functions - header
|
|
|
|
* COPYRIGHT: Copyright 2013 Eric Kohl <eric.kohl@reactos.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-07-16 18:44:01 +00:00
|
|
|
typedef enum _LSA_SAM_NETLOGON_TYPE
|
|
|
|
{
|
|
|
|
NetLogonAnonymous = 0,
|
|
|
|
NetLogonLmKey,
|
|
|
|
NetLogonNtKey
|
|
|
|
} LSA_SAM_NETLOGON_TYPE;
|
|
|
|
|
2020-06-21 21:47:30 +00:00
|
|
|
typedef struct _LSA_SAM_PWD_DATA
|
|
|
|
{
|
|
|
|
/* TRUE: PlainPwd is filled,
|
|
|
|
FALSE: LmPwd and NtPwd is filled */
|
|
|
|
BOOL IsNetwork;
|
|
|
|
PUNICODE_STRING PlainPwd;
|
|
|
|
|
2020-06-22 17:01:37 +00:00
|
|
|
/* Input (IsNetwork = TRUE) */
|
2020-07-16 18:44:01 +00:00
|
|
|
PMSV1_0_LM20_LOGON LogonInfo;
|
2020-06-22 17:01:37 +00:00
|
|
|
PUNICODE_STRING ComputerName;
|
2020-07-16 18:44:01 +00:00
|
|
|
/* Result (IsNetwork = TRUE) */
|
|
|
|
LSA_SAM_NETLOGON_TYPE LogonType;
|
|
|
|
LANMAN_SESSION_KEY LanmanSessionKey;
|
|
|
|
USER_SESSION_KEY UserSessionKey;
|
2020-06-21 21:47:30 +00:00
|
|
|
} LSA_SAM_PWD_DATA, *PLSA_SAM_PWD_DATA;
|
|
|
|
|
|
|
|
/**
|
2020-06-22 17:01:37 +00:00
|
|
|
* @brief Validates a user by checking if it exists in the sam database.
|
|
|
|
* Some other checks are done further.
|
2020-06-21 21:47:30 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
2020-06-22 17:01:37 +00:00
|
|
|
SamValidateUser(
|
|
|
|
_In_ SECURITY_LOGON_TYPE LogonType,
|
|
|
|
_In_ PUNICODE_STRING LogonUserName,
|
|
|
|
_In_ PUNICODE_STRING LogonDomain,
|
|
|
|
_In_ PLSA_SAM_PWD_DATA LogonPwdData,
|
2020-06-21 21:47:30 +00:00
|
|
|
_In_ PUNICODE_STRING ComputerName,
|
2020-06-22 17:01:37 +00:00
|
|
|
_Out_ PBOOL SpecialAccount,
|
2020-06-21 21:47:30 +00:00
|
|
|
_Out_ PRPC_SID* AccountDomainSidPtr,
|
|
|
|
_Out_ SAMPR_HANDLE* UserHandlePtr,
|
|
|
|
_Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr,
|
|
|
|
_Out_ PNTSTATUS SubStatus);
|