1c2c66affSColin Finck /* 2c2c66affSColin Finck * COPYRIGHT: See COPYING in the top level directory 3c2c66affSColin Finck * PROJECT: Local Security Authority (LSA) Server 4c2c66affSColin Finck * FILE: reactos/dll/win32/lsasrv/lsasrv.h 5c2c66affSColin Finck * PURPOSE: Common header file 6c2c66affSColin Finck * 7c2c66affSColin Finck * PROGRAMMERS: Eric Kohl 8c2c66affSColin Finck */ 9c2c66affSColin Finck 10c2c66affSColin Finck #ifndef _LSASRV_H 11c2c66affSColin Finck #define _LSASRV_H 12c2c66affSColin Finck 13c2c66affSColin Finck #include <stdarg.h> 14c2c66affSColin Finck 15c2c66affSColin Finck #define WIN32_NO_STATUS 16c2c66affSColin Finck #define _INC_WINDOWS 17c2c66affSColin Finck #define COM_NO_WINDOWS_H 18c2c66affSColin Finck 19c2c66affSColin Finck #include <windef.h> 20c2c66affSColin Finck #include <winbase.h> 21c2c66affSColin Finck #include <winreg.h> 22c2c66affSColin Finck 23c2c66affSColin Finck #define NTOS_MODE_USER 24c2c66affSColin Finck #include <ndk/cmfuncs.h> 25c2c66affSColin Finck #include <ndk/exfuncs.h> 26c2c66affSColin Finck #include <ndk/kefuncs.h> 27c2c66affSColin Finck #include <ndk/mmfuncs.h> 28c2c66affSColin Finck #include <ndk/obfuncs.h> 29c2c66affSColin Finck #include <ndk/psfuncs.h> 30c2c66affSColin Finck #include <ndk/rtlfuncs.h> 31a66c7d2eSEric Kohl #include <ndk/sefuncs.h> 32ee90e7f6SEric Kohl #include <ndk/ketypes.h> 33c2c66affSColin Finck #include <ndk/setypes.h> 34c2c66affSColin Finck 35c2c66affSColin Finck #include <ntsam.h> 36c2c66affSColin Finck #include <ntlsa.h> 37c2c66affSColin Finck #include <sddl.h> 38c2c66affSColin Finck 39c2c66affSColin Finck #include <srmp.h> 40c2c66affSColin Finck 41c2c66affSColin Finck #include <lsass.h> 42c2c66affSColin Finck #include <lsa_s.h> 43c2c66affSColin Finck 44c2c66affSColin Finck #include <wine/debug.h> 45c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(lsasrv); 46c2c66affSColin Finck 47c2c66affSColin Finck typedef enum _LSA_DB_OBJECT_TYPE 48c2c66affSColin Finck { 49c2c66affSColin Finck LsaDbIgnoreObject, 50c2c66affSColin Finck LsaDbPolicyObject, 51c2c66affSColin Finck LsaDbAccountObject, 52c2c66affSColin Finck LsaDbDomainObject, 53c2c66affSColin Finck LsaDbSecretObject 54c2c66affSColin Finck } LSA_DB_OBJECT_TYPE, *PLSA_DB_OBJECT_TYPE; 55c2c66affSColin Finck 56c2c66affSColin Finck typedef struct _LSA_DB_OBJECT 57c2c66affSColin Finck { 58c2c66affSColin Finck ULONG Signature; 59c2c66affSColin Finck LSA_DB_OBJECT_TYPE ObjectType; 60c2c66affSColin Finck ULONG RefCount; 61c2c66affSColin Finck ACCESS_MASK Access; 62c2c66affSColin Finck HANDLE KeyHandle; 63c2c66affSColin Finck BOOLEAN Trusted; 64c2c66affSColin Finck struct _LSA_DB_OBJECT *ParentObject; 65c2c66affSColin Finck } LSA_DB_OBJECT, *PLSA_DB_OBJECT; 66c2c66affSColin Finck 67c2c66affSColin Finck #define LSAP_DB_SIGNATURE 0x12345678 68c2c66affSColin Finck 69c2c66affSColin Finck #define POLICY_AUDIT_EVENT_TYPE_COUNT (AuditCategoryAccountLogon - AuditCategorySystem + 1) 70c2c66affSColin Finck typedef struct _LSAP_POLICY_AUDIT_EVENTS_DATA 71c2c66affSColin Finck { 72c2c66affSColin Finck BOOLEAN AuditingMode; 73c2c66affSColin Finck DWORD AuditEvents[POLICY_AUDIT_EVENT_TYPE_COUNT]; 74c2c66affSColin Finck DWORD MaximumAuditEventCount; 75c2c66affSColin Finck } LSAP_POLICY_AUDIT_EVENTS_DATA, *PLSAP_POLICY_AUDIT_EVENTS_DATA; 76c2c66affSColin Finck 77c2c66affSColin Finck typedef struct _LSAP_LOGON_CONTEXT 78c2c66affSColin Finck { 79c2c66affSColin Finck LIST_ENTRY Entry; 80c2c66affSColin Finck HANDLE ClientProcessHandle; 81c2c66affSColin Finck HANDLE ConnectionHandle; 821fbb295dSEric Kohl BOOL TrustedCaller; 83c2c66affSColin Finck } LSAP_LOGON_CONTEXT, *PLSAP_LOGON_CONTEXT; 84c2c66affSColin Finck 8544d57334SAmine Khaldi typedef struct _SAMPR_ULONG_ARRAY 8644d57334SAmine Khaldi { 8744d57334SAmine Khaldi unsigned long Count; 8844d57334SAmine Khaldi unsigned long *Element; 8944d57334SAmine Khaldi } SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY; 9044d57334SAmine Khaldi 91ee90e7f6SEric Kohl extern NT_PRODUCT_TYPE LsapProductType; 92ee90e7f6SEric Kohl 93c2c66affSColin Finck extern SID_IDENTIFIER_AUTHORITY NullSidAuthority; 94c2c66affSColin Finck extern SID_IDENTIFIER_AUTHORITY WorldSidAuthority; 95c2c66affSColin Finck extern SID_IDENTIFIER_AUTHORITY LocalSidAuthority; 96c2c66affSColin Finck extern SID_IDENTIFIER_AUTHORITY CreatorSidAuthority; 97c2c66affSColin Finck extern SID_IDENTIFIER_AUTHORITY NtAuthority; 98c2c66affSColin Finck 99c2c66affSColin Finck extern PSID BuiltinDomainSid; 100c2c66affSColin Finck extern UNICODE_STRING BuiltinDomainName; 101c2c66affSColin Finck extern PSID AccountDomainSid; 102c2c66affSColin Finck extern UNICODE_STRING AccountDomainName; 103c2c66affSColin Finck 104c2c66affSColin Finck extern PSID LsapWorldSid; 105c2c66affSColin Finck extern PSID LsapNetworkSid; 106c2c66affSColin Finck extern PSID LsapBatchSid; 107c2c66affSColin Finck extern PSID LsapInteractiveSid; 108c2c66affSColin Finck extern PSID LsapServiceSid; 109c2c66affSColin Finck extern PSID LsapLocalSystemSid; 110c2c66affSColin Finck extern PSID LsapAdministratorsSid; 111c2c66affSColin Finck 112c2c66affSColin Finck 113c2c66affSColin Finck /* authpackage.c */ 114c2c66affSColin Finck NTSTATUS 115c2c66affSColin Finck LsapInitAuthPackages(VOID); 116c2c66affSColin Finck 117c2c66affSColin Finck NTSTATUS 118c2c66affSColin Finck LsapLookupAuthenticationPackage(PLSA_API_MSG RequestMsg, 119c2c66affSColin Finck PLSAP_LOGON_CONTEXT LogonContext); 120c2c66affSColin Finck 121c2c66affSColin Finck NTSTATUS 122c2c66affSColin Finck LsapCallAuthenticationPackage(PLSA_API_MSG RequestMsg, 123c2c66affSColin Finck PLSAP_LOGON_CONTEXT LogonContext); 124c2c66affSColin Finck 125c2c66affSColin Finck NTSTATUS 126c2c66affSColin Finck LsapLogonUser(PLSA_API_MSG RequestMsg, 127c2c66affSColin Finck PLSAP_LOGON_CONTEXT LogonContext); 128c2c66affSColin Finck 1296ae7fc2bSEric Kohl VOID 1306ae7fc2bSEric Kohl LsapTerminateLogon( 1316ae7fc2bSEric Kohl _In_ PLUID LogonId); 1326ae7fc2bSEric Kohl 1336ae7fc2bSEric Kohl 134c2c66affSColin Finck /* authport.c */ 135c2c66affSColin Finck NTSTATUS 136c2c66affSColin Finck StartAuthenticationPort(VOID); 137c2c66affSColin Finck 138c2c66affSColin Finck /* database.c */ 139c2c66affSColin Finck NTSTATUS 140c2c66affSColin Finck LsapInitDatabase(VOID); 141c2c66affSColin Finck 142c2c66affSColin Finck NTSTATUS 143c2c66affSColin Finck LsapCreateDbObject(IN PLSA_DB_OBJECT ParentObject, 144c2c66affSColin Finck IN LPWSTR ContainerName, 145c2c66affSColin Finck IN LPWSTR ObjectName, 146c2c66affSColin Finck IN LSA_DB_OBJECT_TYPE HandleType, 147c2c66affSColin Finck IN ACCESS_MASK DesiredAccess, 148c2c66affSColin Finck IN BOOLEAN Trusted, 149c2c66affSColin Finck OUT PLSA_DB_OBJECT *DbObject); 150c2c66affSColin Finck 151c2c66affSColin Finck NTSTATUS 152c2c66affSColin Finck LsapOpenDbObject(IN PLSA_DB_OBJECT ParentObject, 153c2c66affSColin Finck IN LPWSTR ContainerName, 154c2c66affSColin Finck IN LPWSTR ObjectName, 155c2c66affSColin Finck IN LSA_DB_OBJECT_TYPE ObjectType, 156c2c66affSColin Finck IN ACCESS_MASK DesiredAccess, 157c2c66affSColin Finck IN BOOLEAN Trusted, 158c2c66affSColin Finck OUT PLSA_DB_OBJECT *DbObject); 159c2c66affSColin Finck 160c2c66affSColin Finck NTSTATUS 161c2c66affSColin Finck LsapValidateDbObject(IN LSAPR_HANDLE Handle, 162c2c66affSColin Finck IN LSA_DB_OBJECT_TYPE HandleType, 163c2c66affSColin Finck IN ACCESS_MASK GrantedAccess, 164c2c66affSColin Finck OUT PLSA_DB_OBJECT *DbObject); 165c2c66affSColin Finck 166c2c66affSColin Finck NTSTATUS 167c2c66affSColin Finck LsapCloseDbObject(IN PLSA_DB_OBJECT DbObject); 168c2c66affSColin Finck 169c2c66affSColin Finck NTSTATUS 170c2c66affSColin Finck LsapDeleteDbObject(IN PLSA_DB_OBJECT DbObject); 171c2c66affSColin Finck 172c2c66affSColin Finck NTSTATUS 173c2c66affSColin Finck LsapGetObjectAttribute(PLSA_DB_OBJECT DbObject, 174c2c66affSColin Finck LPWSTR AttributeName, 175c2c66affSColin Finck LPVOID AttributeData, 176c2c66affSColin Finck PULONG AttributeSize); 177c2c66affSColin Finck 178c2c66affSColin Finck NTSTATUS 179c2c66affSColin Finck LsapSetObjectAttribute(PLSA_DB_OBJECT DbObject, 180c2c66affSColin Finck LPWSTR AttributeName, 181c2c66affSColin Finck LPVOID AttributeData, 182c2c66affSColin Finck ULONG AttributeSize); 183c2c66affSColin Finck 184c2c66affSColin Finck NTSTATUS 185c2c66affSColin Finck LsapDeleteObjectAttribute(PLSA_DB_OBJECT DbObject, 186c2c66affSColin Finck LPWSTR AttributeName); 187c2c66affSColin Finck 188c2c66affSColin Finck /* dssetup.c */ 189c2c66affSColin Finck VOID 190c2c66affSColin Finck DsSetupInit(VOID); 191c2c66affSColin Finck 192c2c66affSColin Finck /* lookup.c */ 193c2c66affSColin Finck NTSTATUS 194c2c66affSColin Finck LsapInitSids(VOID); 195c2c66affSColin Finck 196c2c66affSColin Finck ULONG 197c2c66affSColin Finck LsapGetRelativeIdFromSid(PSID Sid); 198c2c66affSColin Finck 199c2c66affSColin Finck NTSTATUS 200c2c66affSColin Finck LsapLookupNames(DWORD Count, 201c2c66affSColin Finck PRPC_UNICODE_STRING Names, 202c2c66affSColin Finck PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, 203c2c66affSColin Finck PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids, 204c2c66affSColin Finck LSAP_LOOKUP_LEVEL LookupLevel, 205c2c66affSColin Finck DWORD *MappedCount, 206c2c66affSColin Finck DWORD LookupOptions, 207c2c66affSColin Finck DWORD ClientRevision); 208c2c66affSColin Finck 209c2c66affSColin Finck NTSTATUS 210c2c66affSColin Finck LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, 211c2c66affSColin Finck PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, 212c2c66affSColin Finck PLSAPR_TRANSLATED_NAMES_EX TranslatedNames, 213c2c66affSColin Finck LSAP_LOOKUP_LEVEL LookupLevel, 214c2c66affSColin Finck DWORD *MappedCount, 215c2c66affSColin Finck DWORD LookupOptions, 216c2c66affSColin Finck DWORD ClientRevision); 217c2c66affSColin Finck 218c2c66affSColin Finck /* lsarpc.c */ 219c901c3d3SHermès Bélusca-Maïto NTSTATUS 220c2c66affSColin Finck LsarStartRpcServer(VOID); 221c2c66affSColin Finck 222620217ceSEric Kohl /* notify.c */ 223620217ceSEric Kohl VOID 224620217ceSEric Kohl LsapInitNotificationList(VOID); 225620217ceSEric Kohl 226620217ceSEric Kohl NTSTATUS 227620217ceSEric Kohl LsapRegisterNotification( 228620217ceSEric Kohl PLSA_API_MSG RequestMsg); 229620217ceSEric Kohl 2304e32ad36SEric Kohl VOID 2314e32ad36SEric Kohl LsapNotifyPolicyChange( 2324e32ad36SEric Kohl POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass); 2334e32ad36SEric Kohl 234c2c66affSColin Finck /* policy.c */ 235c2c66affSColin Finck NTSTATUS 236c2c66affSColin Finck LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject, 237c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 238c2c66affSColin Finck 239c2c66affSColin Finck NTSTATUS 240c2c66affSColin Finck LsarQueryAuditEvents(PLSA_DB_OBJECT PolicyObject, 241c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 242c2c66affSColin Finck 243c2c66affSColin Finck NTSTATUS 244c2c66affSColin Finck LsarQueryPrimaryDomain(PLSA_DB_OBJECT PolicyObject, 245c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 246c2c66affSColin Finck 247c2c66affSColin Finck NTSTATUS 248c2c66affSColin Finck LsarQueryPdAccount(PLSA_DB_OBJECT PolicyObject, 249c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 250c2c66affSColin Finck 251c2c66affSColin Finck NTSTATUS 252c2c66affSColin Finck LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject, 253c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 254c2c66affSColin Finck 255c2c66affSColin Finck NTSTATUS 256c2c66affSColin Finck LsarQueryServerRole(PLSA_DB_OBJECT PolicyObject, 257c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 258c2c66affSColin Finck 259c2c66affSColin Finck NTSTATUS 260c2c66affSColin Finck LsarQueryReplicaSource(PLSA_DB_OBJECT PolicyObject, 261c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 262c2c66affSColin Finck 263c2c66affSColin Finck NTSTATUS 264c2c66affSColin Finck LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject, 265c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 266c2c66affSColin Finck 267c2c66affSColin Finck NTSTATUS 268c2c66affSColin Finck LsarQueryModification(PLSA_DB_OBJECT PolicyObject, 269c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 270c2c66affSColin Finck 271c2c66affSColin Finck NTSTATUS 272c2c66affSColin Finck LsarQueryAuditFull(PLSA_DB_OBJECT PolicyObject, 273c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 274c2c66affSColin Finck 275c2c66affSColin Finck NTSTATUS 276c2c66affSColin Finck LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject, 277c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 278c2c66affSColin Finck 279c2c66affSColin Finck NTSTATUS 280c2c66affSColin Finck LsarQueryDnsDomainInt(PLSA_DB_OBJECT PolicyObject, 281c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 282c2c66affSColin Finck 283c2c66affSColin Finck NTSTATUS 284c2c66affSColin Finck LsarQueryLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, 285c2c66affSColin Finck PLSAPR_POLICY_INFORMATION *PolicyInformation); 286c2c66affSColin Finck 287c2c66affSColin Finck NTSTATUS 288c2c66affSColin Finck LsarSetAuditLog(PLSA_DB_OBJECT PolicyObject, 289c2c66affSColin Finck PPOLICY_AUDIT_LOG_INFO Info); 290c2c66affSColin Finck 291c2c66affSColin Finck NTSTATUS 292c2c66affSColin Finck LsarSetAuditEvents(PLSA_DB_OBJECT PolicyObject, 293c2c66affSColin Finck PLSAPR_POLICY_AUDIT_EVENTS_INFO Info); 294c2c66affSColin Finck 295c2c66affSColin Finck NTSTATUS 296c2c66affSColin Finck LsarSetPrimaryDomain(PLSA_DB_OBJECT PolicyObject, 297c2c66affSColin Finck PLSAPR_POLICY_PRIMARY_DOM_INFO Info); 298c2c66affSColin Finck 299c2c66affSColin Finck NTSTATUS 300c2c66affSColin Finck LsarSetAccountDomain(PLSA_DB_OBJECT PolicyObject, 301c2c66affSColin Finck PLSAPR_POLICY_ACCOUNT_DOM_INFO Info); 302c2c66affSColin Finck 303c2c66affSColin Finck NTSTATUS 304c2c66affSColin Finck LsarSetServerRole(PLSA_DB_OBJECT PolicyObject, 305c2c66affSColin Finck PPOLICY_LSA_SERVER_ROLE_INFO Info); 306c2c66affSColin Finck 307c2c66affSColin Finck NTSTATUS 308c2c66affSColin Finck LsarSetReplicaSource(PLSA_DB_OBJECT PolicyObject, 309c2c66affSColin Finck PPOLICY_LSA_REPLICA_SRCE_INFO Info); 310c2c66affSColin Finck 311c2c66affSColin Finck NTSTATUS 312c2c66affSColin Finck LsarSetDefaultQuota(PLSA_DB_OBJECT PolicyObject, 313c2c66affSColin Finck PPOLICY_DEFAULT_QUOTA_INFO Info); 314c2c66affSColin Finck 315c2c66affSColin Finck NTSTATUS 316c2c66affSColin Finck LsarSetModification(PLSA_DB_OBJECT PolicyObject, 317c2c66affSColin Finck PPOLICY_MODIFICATION_INFO Info); 318c2c66affSColin Finck 319c2c66affSColin Finck NTSTATUS 320c2c66affSColin Finck LsarSetAuditFull(PLSA_DB_OBJECT PolicyObject, 321c2c66affSColin Finck PPOLICY_AUDIT_FULL_QUERY_INFO Info); 322c2c66affSColin Finck 323c2c66affSColin Finck NTSTATUS 324c2c66affSColin Finck LsarSetDnsDomain(PLSA_DB_OBJECT PolicyObject, 325c2c66affSColin Finck PLSAPR_POLICY_DNS_DOMAIN_INFO Info); 326c2c66affSColin Finck 327c2c66affSColin Finck NTSTATUS 328c2c66affSColin Finck LsarSetDnsDomainInt(PLSA_DB_OBJECT PolicyObject, 329c2c66affSColin Finck PLSAPR_POLICY_DNS_DOMAIN_INFO Info); 330c2c66affSColin Finck 331c2c66affSColin Finck NTSTATUS 332c2c66affSColin Finck LsarSetLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, 333c2c66affSColin Finck PLSAPR_POLICY_ACCOUNT_DOM_INFO Info); 334c2c66affSColin Finck 335c2c66affSColin Finck /* privileges.c */ 336c2c66affSColin Finck NTSTATUS 337c2c66affSColin Finck LsarpLookupPrivilegeName(PLUID Value, 338c2c66affSColin Finck PRPC_UNICODE_STRING *Name); 339c2c66affSColin Finck 340c2c66affSColin Finck NTSTATUS 341c2c66affSColin Finck LsarpLookupPrivilegeDisplayName(PRPC_UNICODE_STRING Name, 342c2c66affSColin Finck USHORT ClientLanguage, 343c2c66affSColin Finck USHORT ClientSystemDefaultLanguage, 344c2c66affSColin Finck PRPC_UNICODE_STRING *DisplayName, 345c2c66affSColin Finck USHORT *LanguageReturned); 346c2c66affSColin Finck 347c2c66affSColin Finck PLUID 348c2c66affSColin Finck LsarpLookupPrivilegeValue( 349c2c66affSColin Finck IN PRPC_UNICODE_STRING Name); 350c2c66affSColin Finck 351c2c66affSColin Finck NTSTATUS 352c2c66affSColin Finck LsarpEnumeratePrivileges(DWORD *EnumerationContext, 353c2c66affSColin Finck PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer, 354c2c66affSColin Finck DWORD PreferedMaximumLength); 355c2c66affSColin Finck 356c2c66affSColin Finck NTSTATUS 357c2c66affSColin Finck LsapLookupAccountRightName(ULONG RightValue, 358c2c66affSColin Finck PRPC_UNICODE_STRING *Name); 359c2c66affSColin Finck 360c2c66affSColin Finck ACCESS_MASK 361c2c66affSColin Finck LsapLookupAccountRightValue( 362c2c66affSColin Finck IN PRPC_UNICODE_STRING Name); 363c2c66affSColin Finck 364c2c66affSColin Finck /* registry.h */ 365c2c66affSColin Finck NTSTATUS 366c2c66affSColin Finck LsapRegCloseKey(IN HANDLE KeyHandle); 367c2c66affSColin Finck 368c2c66affSColin Finck NTSTATUS 369c2c66affSColin Finck LsapRegCreateKey(IN HANDLE ParentKeyHandle, 370c2c66affSColin Finck IN LPCWSTR KeyName, 371c2c66affSColin Finck IN ACCESS_MASK DesiredAccess, 372c2c66affSColin Finck OUT HANDLE KeyHandle); 373c2c66affSColin Finck 374c2c66affSColin Finck NTSTATUS 375c2c66affSColin Finck LsapRegDeleteSubKey(IN HANDLE ParentKeyHandle, 376c2c66affSColin Finck IN LPCWSTR KeyName); 377c2c66affSColin Finck 378c2c66affSColin Finck NTSTATUS 379c2c66affSColin Finck LsapRegDeleteKey(IN HANDLE KeyHandle); 380c2c66affSColin Finck 381c2c66affSColin Finck NTSTATUS 382c2c66affSColin Finck LsapRegEnumerateSubKey(IN HANDLE KeyHandle, 383c2c66affSColin Finck IN ULONG Index, 384c2c66affSColin Finck IN ULONG Length, 385c2c66affSColin Finck OUT LPWSTR Buffer); 386c2c66affSColin Finck 387c2c66affSColin Finck NTSTATUS 388c2c66affSColin Finck LsapRegOpenKey(IN HANDLE ParentKeyHandle, 389c2c66affSColin Finck IN LPCWSTR KeyName, 390c2c66affSColin Finck IN ACCESS_MASK DesiredAccess, 391c2c66affSColin Finck OUT HANDLE KeyHandle); 392c2c66affSColin Finck 393c2c66affSColin Finck NTSTATUS 394c2c66affSColin Finck LsapRegQueryKeyInfo(IN HANDLE KeyHandle, 395c2c66affSColin Finck OUT PULONG SubKeyCount, 396c2c66affSColin Finck OUT PULONG MaxSubKeyNameLength, 397c2c66affSColin Finck OUT PULONG ValueCount); 398c2c66affSColin Finck 399c2c66affSColin Finck NTSTATUS 400c2c66affSColin Finck LsapRegDeleteValue(IN HANDLE KeyHandle, 401c2c66affSColin Finck IN LPWSTR ValueName); 402c2c66affSColin Finck 403c2c66affSColin Finck NTSTATUS 404c2c66affSColin Finck LsapRegEnumerateValue(IN HANDLE KeyHandle, 405c2c66affSColin Finck IN ULONG Index, 406c2c66affSColin Finck OUT LPWSTR Name, 407c2c66affSColin Finck IN OUT PULONG NameLength, 408c2c66affSColin Finck OUT PULONG Type OPTIONAL, 409c2c66affSColin Finck OUT PVOID Data OPTIONAL, 410c2c66affSColin Finck IN OUT PULONG DataLength OPTIONAL); 411c2c66affSColin Finck 412c2c66affSColin Finck NTSTATUS 413c2c66affSColin Finck LsapRegQueryValue(IN HANDLE KeyHandle, 414c2c66affSColin Finck IN LPWSTR ValueName, 415c2c66affSColin Finck OUT PULONG Type OPTIONAL, 416c2c66affSColin Finck OUT LPVOID Data OPTIONAL, 417c2c66affSColin Finck IN OUT PULONG DataLength OPTIONAL); 418c2c66affSColin Finck 419c2c66affSColin Finck NTSTATUS 420c2c66affSColin Finck LsapRegSetValue(IN HANDLE KeyHandle, 421c2c66affSColin Finck IN LPWSTR ValueName, 422c2c66affSColin Finck IN ULONG Type, 423c2c66affSColin Finck IN LPVOID Data, 424c2c66affSColin Finck IN ULONG DataLength); 425c2c66affSColin Finck 426c2c66affSColin Finck /* security.c */ 427c2c66affSColin Finck NTSTATUS 428c2c66affSColin Finck LsapCreatePolicySd(PSECURITY_DESCRIPTOR *PolicySd, 429c2c66affSColin Finck PULONG PolicySdSize); 430c2c66affSColin Finck 431c2c66affSColin Finck NTSTATUS 432c2c66affSColin Finck LsapCreateAccountSd(PSECURITY_DESCRIPTOR *AccountSd, 433c2c66affSColin Finck PULONG AccountSdSize); 434c2c66affSColin Finck 435c2c66affSColin Finck NTSTATUS 436c2c66affSColin Finck LsapCreateSecretSd(PSECURITY_DESCRIPTOR *SecretSd, 437c2c66affSColin Finck PULONG SecretSdSize); 438c2c66affSColin Finck 439*bee9b2fcSGeorge Bișoc NTSTATUS 440*bee9b2fcSGeorge Bișoc LsapCreateTokenSd( 441*bee9b2fcSGeorge Bișoc _In_ const TOKEN_USER *User, 442*bee9b2fcSGeorge Bișoc _Outptr_ PSECURITY_DESCRIPTOR *TokenSd, 443*bee9b2fcSGeorge Bișoc _Out_ PULONG TokenSdSize); 444*bee9b2fcSGeorge Bișoc 445c2c66affSColin Finck /* session.c */ 446c2c66affSColin Finck VOID 447c2c66affSColin Finck LsapInitLogonSessions(VOID); 448c2c66affSColin Finck 449c2c66affSColin Finck NTSTATUS 450c2c66affSColin Finck NTAPI 451c2c66affSColin Finck LsapCreateLogonSession(IN PLUID LogonId); 452c2c66affSColin Finck 453c2c66affSColin Finck NTSTATUS 454c2c66affSColin Finck NTAPI 455c2c66affSColin Finck LsapDeleteLogonSession(IN PLUID LogonId); 456c2c66affSColin Finck 457c2c66affSColin Finck NTSTATUS 458c2c66affSColin Finck NTAPI 459c2c66affSColin Finck LsapAddCredential( 460c2c66affSColin Finck _In_ PLUID LogonId, 461c2c66affSColin Finck _In_ ULONG AuthenticationPackage, 462c2c66affSColin Finck _In_ PLSA_STRING PrimaryKeyValue, 463c2c66affSColin Finck _In_ PLSA_STRING Credential); 464c2c66affSColin Finck 465c2c66affSColin Finck NTSTATUS 466c2c66affSColin Finck NTAPI 467c2c66affSColin Finck LsapGetCredentials( 468c2c66affSColin Finck _In_ PLUID LogonId, 469c2c66affSColin Finck _In_ ULONG AuthenticationPackage, 470c2c66affSColin Finck _Inout_ PULONG QueryContext, 471c2c66affSColin Finck _In_ BOOLEAN RetrieveAllCredentials, 472c2c66affSColin Finck _Inout_ PLSA_STRING PrimaryKeyValue, 473c2c66affSColin Finck _Out_ PULONG PrimaryKeyLength, 474c2c66affSColin Finck _Out_ PLSA_STRING Credentials); 475c2c66affSColin Finck 476c2c66affSColin Finck NTSTATUS 477c2c66affSColin Finck NTAPI 478c2c66affSColin Finck LsapDeleteCredential( 479c2c66affSColin Finck _In_ PLUID LogonId, 480c2c66affSColin Finck _In_ ULONG AuthenticationPackage, 481c2c66affSColin Finck _In_ PLSA_STRING PrimaryKeyValue); 482c2c66affSColin Finck 483c2c66affSColin Finck NTSTATUS 484c2c66affSColin Finck LsapSetLogonSessionData( 485c2c66affSColin Finck _In_ PLUID LogonId, 486c2c66affSColin Finck _In_ ULONG LogonType, 487c2c66affSColin Finck _In_ PUNICODE_STRING UserName, 488c2c66affSColin Finck _In_ PUNICODE_STRING LogonDomain, 489c2c66affSColin Finck _In_ PSID Sid); 490c2c66affSColin Finck 491c2c66affSColin Finck NTSTATUS 492c2c66affSColin Finck LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg); 493c2c66affSColin Finck 494c2c66affSColin Finck NTSTATUS 495c2c66affSColin Finck LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg); 496c2c66affSColin Finck 497c2c66affSColin Finck /* srm.c */ 498c2c66affSColin Finck NTSTATUS 499c2c66affSColin Finck LsapRmInitializeServer(VOID); 500c2c66affSColin Finck 501c2c66affSColin Finck NTSTATUS 502c2c66affSColin Finck LsapRmCreateLogonSession( 503c2c66affSColin Finck PLUID LogonId); 504c2c66affSColin Finck 505c2c66affSColin Finck NTSTATUS 506c2c66affSColin Finck LsapRmDeleteLogonSession( 507c2c66affSColin Finck PLUID LogonId); 508c2c66affSColin Finck 509c2c66affSColin Finck /* utils.c */ 510c2c66affSColin Finck INT 511c2c66affSColin Finck LsapLoadString(HINSTANCE hInstance, 512c2c66affSColin Finck UINT uId, 513c2c66affSColin Finck LPWSTR lpBuffer, 514c2c66affSColin Finck INT nBufferMax); 515c2c66affSColin Finck 516c2c66affSColin Finck INT 517c2c66affSColin Finck LsapGetResourceStringLengthEx( 518c2c66affSColin Finck _In_ HINSTANCE hInstance, 519c2c66affSColin Finck _In_ UINT uId, 520c2c66affSColin Finck _In_ USHORT usLanguage); 521c2c66affSColin Finck 522c2c66affSColin Finck INT 523c2c66affSColin Finck LsapLoadStringEx( 524c2c66affSColin Finck _In_ HINSTANCE hInstance, 525c2c66affSColin Finck _In_ UINT uId, 526c2c66affSColin Finck _In_ USHORT usLanguage, 527c2c66affSColin Finck _Out_ LPWSTR lpBuffer, 528c2c66affSColin Finck _Out_ INT nBufferMax); 529c2c66affSColin Finck 530c2c66affSColin Finck PSID 531c2c66affSColin Finck LsapAppendRidToSid( 532c2c66affSColin Finck PSID SrcSid, 533c2c66affSColin Finck ULONG Rid); 534c2c66affSColin Finck 535c2c66affSColin Finck #endif /* _LSASRV_H */ 536