ReactOS 0.4.16-dev-336-gb667d82
lsa.c File Reference
#include <advapi32.h>
#include <lsa_c.h>
Include dependency graph for lsa.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (advapi)
 
static BOOL LsapIsLocalComputer (PLSA_UNICODE_STRING ServerName)
 
handle_t __RPC_USER PLSAPR_SERVER_NAME_bind (PLSAPR_SERVER_NAME pszSystemName)
 
void __RPC_USER PLSAPR_SERVER_NAME_unbind (PLSAPR_SERVER_NAME pszSystemName, handle_t hBinding)
 
NTSTATUS WINAPI LsaAddAccountRights (IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, IN PLSA_UNICODE_STRING UserRights, IN ULONG CountOfRights)
 
NTSTATUS WINAPI LsaAddPrivilegesToAccount (IN LSA_HANDLE AccountHandle, IN PPRIVILEGE_SET PrivilegeSet)
 
NTSTATUS WINAPI LsaClearAuditLog (IN LSA_HANDLE PolicyHandle)
 
NTSTATUS WINAPI LsaClose (IN LSA_HANDLE ObjectHandle)
 
NTSTATUS WINAPI LsaCreateAccount (IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE AccountHandle)
 
NTSTATUS WINAPI LsaCreateSecret (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING SecretName, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE SecretHandle)
 
NTSTATUS WINAPI LsaCreateTrustedDomain (IN LSA_HANDLE PolicyHandle, IN PLSA_TRUST_INFORMATION TrustedDomainInformation, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE TrustedDomainHandle)
 
NTSTATUS WINAPI LsaCreateTrustedDomainEx (IN LSA_HANDLE PolicyHandle, IN PTRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation, IN PTRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE TrustedDomainHandle)
 
NTSTATUS WINAPI LsaDelete (IN LSA_HANDLE ObjectHandle)
 
NTSTATUS WINAPI LsaDeleteTrustedDomain (IN LSA_HANDLE PolicyHandle, IN PSID TrustedDomainSid)
 
NTSTATUS WINAPI LsaEnumerateAccountRights (IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, OUT PLSA_UNICODE_STRING *UserRights, OUT PULONG CountOfRights)
 
NTSTATUS WINAPI LsaEnumerateAccounts (IN LSA_HANDLE PolicyHandle, IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS WINAPI LsaEnumerateAccountsWithUserRight (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING UserRight OPTIONAL, OUT PVOID *Buffer, OUT PULONG CountReturned)
 
NTSTATUS WINAPI LsaEnumeratePrivileges (IN LSA_HANDLE PolicyHandle, IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS WINAPI LsaEnumeratePrivilegesOfAccount (IN LSA_HANDLE AccountHandle, OUT PPRIVILEGE_SET *Privileges)
 
NTSTATUS WINAPI LsaEnumerateTrustedDomains (IN LSA_HANDLE PolicyHandle, IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS WINAPI LsaEnumerateTrustedDomainsEx (IN LSA_HANDLE PolicyHandle, IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS WINAPI LsaFreeMemory (IN PVOID Buffer)
 
NTSTATUS WINAPI LsaGetQuotasForAccount (IN LSA_HANDLE AccountHandle, OUT PQUOTA_LIMITS QuotaLimits)
 
NTSTATUS WINAPI LsaGetRemoteUserName (IN PLSA_UNICODE_STRING SystemName OPTIONAL, OUT PLSA_UNICODE_STRING *UserName, OUT PLSA_UNICODE_STRING *DomainName OPTIONAL)
 
NTSTATUS WINAPI LsaGetSystemAccessAccount (IN LSA_HANDLE AccountHandle, OUT PULONG SystemAccess)
 
NTSTATUS WINAPI LsaGetUserName (OUT PUNICODE_STRING *UserName, OUT PUNICODE_STRING *DomainName OPTIONAL)
 
NTSTATUS WINAPI LsaLookupNames (IN LSA_HANDLE PolicyHandle, IN ULONG Count, IN PLSA_UNICODE_STRING Names, OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, OUT PLSA_TRANSLATED_SID *Sids)
 
NTSTATUS WINAPI LsaLookupNames2 (IN LSA_HANDLE PolicyHandle, IN ULONG Flags, IN ULONG Count, IN PLSA_UNICODE_STRING Names, OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, OUT PLSA_TRANSLATED_SID2 *Sids)
 
NTSTATUS WINAPI LsaLookupPrivilegeDisplayName (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING Name, OUT PLSA_UNICODE_STRING *DisplayName, OUT PUSHORT LanguageReturned)
 
NTSTATUS WINAPI LsaLookupPrivilegeName (IN LSA_HANDLE PolicyHandle, IN PLUID Value, OUT PUNICODE_STRING *Name)
 
NTSTATUS WINAPI LsaLookupPrivilegeValue (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING Name, OUT PLUID Value)
 
NTSTATUS WINAPI LsaLookupSids (IN LSA_HANDLE PolicyHandle, IN ULONG Count, IN PSID *Sids, OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, OUT PLSA_TRANSLATED_NAME *Names)
 
ULONG WINAPI LsaNtStatusToWinError (IN NTSTATUS Status)
 
NTSTATUS WINAPI LsaOpenAccount (IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE AccountHandle)
 
NTSTATUS WINAPI LsaOpenPolicy (IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
 
NTSTATUS WINAPI LsaOpenPolicySce (IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
 
NTSTATUS WINAPI LsaOpenSecret (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING SecretName, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE SecretHandle)
 
NTSTATUS WINAPI LsaOpenTrustedDomain (IN LSA_HANDLE PolicyHandle, IN PSID TrustedDomainSid, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE TrustedDomainHandle)
 
NTSTATUS WINAPI LsaOpenTrustedDomainByName (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING TrustedDomainName, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE TrustedDomainHandle)
 
NTSTATUS WINAPI LsaQueryDomainInformationPolicy (IN LSA_HANDLE PolicyHandle, IN POLICY_DOMAIN_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
 
NTSTATUS WINAPI LsaQueryForestTrustInformation (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING TrustedDomainName, OUT PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo)
 
NTSTATUS WINAPI LsaQueryInfoTrustedDomain (IN LSA_HANDLE TrustedDomainHandle, IN TRUSTED_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
 
NTSTATUS WINAPI LsaQueryInformationPolicy (IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
 
NTSTATUS WINAPI LsaQuerySecret (IN LSA_HANDLE SecretHandle, OUT PLSA_UNICODE_STRING *CurrentValue OPTIONAL, OUT PLARGE_INTEGER CurrentValueSetTime OPTIONAL, OUT PLSA_UNICODE_STRING *OldValue OPTIONAL, OUT PLARGE_INTEGER OldValueSetTime OPTIONAL)
 
NTSTATUS WINAPI LsaQuerySecurityObject (IN LSA_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
NTSTATUS WINAPI LsaQueryTrustedDomainInfo (IN LSA_HANDLE PolicyHandle, IN PSID TrustedDomainSid, IN TRUSTED_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
 
NTSTATUS WINAPI LsaQueryTrustedDomainInfoByName (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING TrustedDomainName, IN TRUSTED_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
 
NTSTATUS WINAPI LsaRemoveAccountRights (IN LSA_HANDLE PolicyHandle, IN PSID AccountSid, IN BOOLEAN AllRights, IN PLSA_UNICODE_STRING UserRights, IN ULONG CountOfRights)
 
NTSTATUS WINAPI LsaRemovePrivilegesFromAccount (IN LSA_HANDLE AccountHandle, IN BOOLEAN AllPrivileges, IN PPRIVILEGE_SET Privileges OPTIONAL)
 
NTSTATUS WINAPI LsaRetrievePrivateData (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING KeyName, OUT PLSA_UNICODE_STRING *PrivateData)
 
NTSTATUS WINAPI LsaSetDomainInformationPolicy (IN LSA_HANDLE PolicyHandle, IN POLICY_DOMAIN_INFORMATION_CLASS InformationClass, IN PVOID Buffer OPTIONAL)
 
NTSTATUS WINAPI LsaSetForestTrustInformation (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING TrustedDomainName, IN PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo, IN BOOLEAN CheckOnly, OUT PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
 
NTSTATUS WINAPI LsaSetInformationPolicy (IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, IN PVOID Buffer)
 
NTSTATUS WINAPI LsaSetInformationTrustedDomain (IN LSA_HANDLE TrustedDomainHandle, IN TRUSTED_INFORMATION_CLASS InformationClass, IN PVOID Buffer)
 
NTSTATUS WINAPI LsaSetQuotasForAccount (IN LSA_HANDLE AccountHandle, IN PQUOTA_LIMITS QuotaLimits)
 
NTSTATUS WINAPI LsaSetSecret (IN LSA_HANDLE SecretHandle, IN PLSA_UNICODE_STRING CurrentValue OPTIONAL, IN PLSA_UNICODE_STRING OldValue OPTIONAL)
 
NTSTATUS WINAPI LsaSetSecurityObject (IN LSA_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 
NTSTATUS WINAPI LsaSetSystemAccessAccount (IN LSA_HANDLE AccountHandle, IN ULONG SystemAccess)
 
NTSTATUS WINAPI LsaSetTrustedDomainInfoByName (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING TrustedDomainName, IN TRUSTED_INFORMATION_CLASS InformationClass, IN PVOID Buffer)
 
NTSTATUS WINAPI LsaSetTrustedDomainInformation (IN LSA_HANDLE PolicyHandle, IN PSID TrustedDomainSid, IN TRUSTED_INFORMATION_CLASS InformationClass, IN PVOID Buffer)
 
NTSTATUS WINAPI LsaStorePrivateData (IN LSA_HANDLE PolicyHandle, IN PLSA_UNICODE_STRING KeyName, IN PLSA_UNICODE_STRING PrivateData OPTIONAL)
 

Function Documentation

◆ LsaAddAccountRights()

NTSTATUS WINAPI LsaAddAccountRights ( IN LSA_HANDLE  PolicyHandle,
IN PSID  AccountSid,
IN PLSA_UNICODE_STRING  UserRights,
IN ULONG  CountOfRights 
)

Definition at line 105 of file lsa.c.

109{
110 LSAPR_USER_RIGHT_SET UserRightSet;
112
113 TRACE("LsaAddAccountRights(%p %p %p 0x%08x)\n",
114 PolicyHandle, AccountSid, UserRights, CountOfRights);
115
116 UserRightSet.Entries = CountOfRights;
117 UserRightSet.UserRights = (PRPC_UNICODE_STRING)UserRights;
118
120 {
122 (PRPC_SID)AccountSid,
123 &UserRightSet);
124
125 }
127 {
129 }
131
132 return Status;
133}
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
NTSTATUS WINAPI LsarAddAccountRights(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, PLSAPR_USER_RIGHT_SET UserRights)
Definition: lsarpc.c:3003
struct _RPC_UNICODE_STRING * PRPC_UNICODE_STRING
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:740
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
PRPC_UNICODE_STRING UserRights
Definition: lsa.idl:393

Referenced by AddImpersonatePrivilege(), and InstallPrivileges().

◆ LsaAddPrivilegesToAccount()

NTSTATUS WINAPI LsaAddPrivilegesToAccount ( IN LSA_HANDLE  AccountHandle,
IN PPRIVILEGE_SET  PrivilegeSet 
)

Definition at line 141 of file lsa.c.

143{
145
146 TRACE("LsaAddPrivilegesToAccount(%p %p)\n",
147 AccountHandle, PrivilegeSet);
148
150 {
152 (PLSAPR_PRIVILEGE_SET)PrivilegeSet);
153 }
155 {
157 }
159
160 return Status;
161}
NTSTATUS WINAPI LsarAddPrivilegesToAccount(LSAPR_HANDLE AccountHandle, PLSAPR_PRIVILEGE_SET Privileges)
Definition: lsarpc.c:1563

◆ LsaClearAuditLog()

NTSTATUS WINAPI LsaClearAuditLog ( IN LSA_HANDLE  PolicyHandle)

Definition at line 169 of file lsa.c.

170{
172
173 TRACE("LsaClearAuditLog(%p)\n", PolicyHandle);
174
176 {
177 Status = LsarClearAuditLog((LSAPR_HANDLE)PolicyHandle);
178 }
180 {
182 }
184
185 return Status;
186}
NTSTATUS WINAPI LsarClearAuditLog(LSAPR_HANDLE ObjectHandle)
Definition: lsarpc.c:804

◆ LsaClose()

◆ LsaCreateAccount()

NTSTATUS WINAPI LsaCreateAccount ( IN LSA_HANDLE  PolicyHandle,
IN PSID  AccountSid,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  AccountHandle 
)

Definition at line 219 of file lsa.c.

223{
225
226 TRACE("LsaCreateAccount(%p %p 0x%08lx %p)\n",
227 PolicyHandle, AccountSid, DesiredAccess, AccountHandle);
228
230 {
231 Status = LsarCreateAccount((LSAPR_HANDLE)PolicyHandle,
232 AccountSid,
234 AccountHandle);
235 }
237 {
239 }
241
242 return Status;
243}
NTSTATUS WINAPI LsarCreateAccount(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *AccountHandle)
Definition: lsarpc.c:883
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658

Referenced by InstallBuiltinAccounts().

◆ LsaCreateSecret()

NTSTATUS WINAPI LsaCreateSecret ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  SecretName,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  SecretHandle 
)

Definition at line 251 of file lsa.c.

255{
257
258 TRACE("LsaCreateSecret(%p %p 0x%08lx %p)\n",
259 PolicyHandle, SecretName, DesiredAccess, SecretHandle);
260
262 {
263 Status = LsarCreateSecret((LSAPR_HANDLE)PolicyHandle,
264 (PRPC_UNICODE_STRING)SecretName,
266 SecretHandle);
267 }
269 {
271 }
273
274 return Status;
275}
NTSTATUS WINAPI LsarCreateSecret(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING SecretName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *SecretHandle)
Definition: lsarpc.c:1319

◆ LsaCreateTrustedDomain()

NTSTATUS WINAPI LsaCreateTrustedDomain ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_TRUST_INFORMATION  TrustedDomainInformation,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  TrustedDomainHandle 
)

Definition at line 283 of file lsa.c.

287{
289
290 TRACE("LsaCreateTrustedDomain(%p %p 0x%08lx %p)\n",
291 PolicyHandle, TrustedDomainInformation, DesiredAccess, TrustedDomainHandle);
292
294 {
296 (PLSAPR_TRUST_INFORMATION)TrustedDomainInformation,
298 (PLSAPR_HANDLE)TrustedDomainHandle);
299 }
301 {
303 }
305
306 return Status;
307}
NTSTATUS WINAPI LsarCreateTrustedDomain(LSAPR_HANDLE PolicyHandle, PLSAPR_TRUST_INFORMATION TrustedDomainInformation, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:1158

◆ LsaCreateTrustedDomainEx()

NTSTATUS WINAPI LsaCreateTrustedDomainEx ( IN LSA_HANDLE  PolicyHandle,
IN PTRUSTED_DOMAIN_INFORMATION_EX  TrustedDomainInformation,
IN PTRUSTED_DOMAIN_AUTH_INFORMATION  AuthenticationInformation,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  TrustedDomainHandle 
)

Definition at line 315 of file lsa.c.

320{
323
324 TRACE("LsaCreateTrustedDomainEx(%p %p %p 0x%08lx %p) stub\n",
325 PolicyHandle, TrustedDomainInformation, AuthenticationInformation,
326 DesiredAccess, TrustedDomainHandle);
327
329 {
330 /* FIXME: Encrypt AuthenticationInformation */
331
333 (PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX)TrustedDomainInformation,
334 EncryptedAuthInfo,
336 (PLSAPR_HANDLE)TrustedDomainHandle);
337 }
339 {
341 }
343
344 return Status;
345}
#define NULL
Definition: types.h:112
NTSTATUS WINAPI LsarCreateTrustedDomainEx2(LSAPR_HANDLE PolicyHandle, PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation, PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthentificationInformation, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:4025

◆ LsaDelete()

NTSTATUS WINAPI LsaDelete ( IN LSA_HANDLE  ObjectHandle)

Definition at line 353 of file lsa.c.

354{
356
357 TRACE("LsaDelete(%p)\n", ObjectHandle);
358
360 {
361 Status = LsarDelete((LSAPR_HANDLE)ObjectHandle);
362 }
364 {
366 }
368
369 return Status;
370}
NTSTATUS WINAPI LsarDelete(LSAPR_HANDLE ObjectHandle)
Definition: lsarpc.c:154

◆ LsaDeleteTrustedDomain()

NTSTATUS WINAPI LsaDeleteTrustedDomain ( IN LSA_HANDLE  PolicyHandle,
IN PSID  TrustedDomainSid 
)

Definition at line 378 of file lsa.c.

380{
382
383 TRACE("LsaDeleteTrustedDomain(%p %p)\n",
384 PolicyHandle, TrustedDomainSid);
385
387 {
389 TrustedDomainSid);
390 }
392 {
394 }
396
397 return Status;
398}
NTSTATUS WINAPI LsarDeleteTrustedDomain(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid)
Definition: lsarpc.c:3446

◆ LsaEnumerateAccountRights()

NTSTATUS WINAPI LsaEnumerateAccountRights ( IN LSA_HANDLE  PolicyHandle,
IN PSID  AccountSid,
OUT PLSA_UNICODE_STRING UserRights,
OUT PULONG  CountOfRights 
)

Definition at line 406 of file lsa.c.

410{
411 LSAPR_USER_RIGHT_SET UserRightsSet;
413
414 TRACE("LsaEnumerateAccountRights(%p %p %p %p)\n",
415 PolicyHandle, AccountSid, UserRights, CountOfRights);
416
417 UserRightsSet.Entries = 0;
418 UserRightsSet.UserRights = NULL;
419
421 {
423 AccountSid,
424 &UserRightsSet);
425
426 *UserRights = (PUNICODE_STRING)UserRightsSet.UserRights;
427 *CountOfRights = UserRightsSet.Entries;
428 }
430 {
432
433 if (UserRightsSet.UserRights != NULL)
434 MIDL_user_free(UserRightsSet.UserRights);
435 }
437
438 return Status;
439}
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
NTSTATUS WINAPI LsarEnumerateAccountRights(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, PLSAPR_USER_RIGHT_SET UserRights)
Definition: lsarpc.c:2853

Referenced by test_lsa().

◆ LsaEnumerateAccounts()

NTSTATUS WINAPI LsaEnumerateAccounts ( IN LSA_HANDLE  PolicyHandle,
IN OUT PLSA_ENUMERATION_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 447 of file lsa.c.

452{
453 LSAPR_ACCOUNT_ENUM_BUFFER AccountEnumBuffer;
455
456 TRACE("LsaEnumerateAccounts(%p %p %p %lu %p)\n",
457 PolicyHandle, EnumerationContext, Buffer,
458 PreferedMaximumLength, CountReturned);
459
460 AccountEnumBuffer.EntriesRead = 0;
461 AccountEnumBuffer.Information = NULL;
462
464 {
466 EnumerationContext,
467 &AccountEnumBuffer,
468 PreferedMaximumLength);
469
470 *Buffer = AccountEnumBuffer.Information;
471 *CountReturned = AccountEnumBuffer.EntriesRead;
472 }
474 {
475 if (AccountEnumBuffer.Information != NULL)
476 MIDL_user_free(AccountEnumBuffer.Information);
477
479 }
481
482 return Status;
483}
Definition: bufpool.h:45
NTSTATUS WINAPI LsarEnumerateAccounts(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:928
PLSAPR_ACCOUNT_INFORMATION Information
Definition: lsa.idl:97

◆ LsaEnumerateAccountsWithUserRight()

NTSTATUS WINAPI LsaEnumerateAccountsWithUserRight ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING UserRight  OPTIONAL,
OUT PVOID Buffer,
OUT PULONG  CountReturned 
)

Definition at line 491 of file lsa.c.

495{
496 LSAPR_ACCOUNT_ENUM_BUFFER AccountEnumBuffer;
498
499 TRACE("LsaEnumerateAccountsWithUserRight(%p %p %p %p) stub\n",
500 PolicyHandle, UserRight, Buffer, CountReturned);
501
502 AccountEnumBuffer.EntriesRead = 0;
503 AccountEnumBuffer.Information = NULL;
504
506 {
508 (PRPC_UNICODE_STRING)UserRight,
509 &AccountEnumBuffer);
510
511 *Buffer = AccountEnumBuffer.Information;
512 *CountReturned = AccountEnumBuffer.EntriesRead;
513 }
515 {
516 if (AccountEnumBuffer.Information != NULL)
517 MIDL_user_free(AccountEnumBuffer.Information);
518
520 }
522
523 return Status;
524}
NTSTATUS WINAPI LsarEnumerateAccountsWithUserRight(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING UserRight, PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer)
Definition: lsarpc.c:2574

◆ LsaEnumeratePrivileges()

NTSTATUS WINAPI LsaEnumeratePrivileges ( IN LSA_HANDLE  PolicyHandle,
IN OUT PLSA_ENUMERATION_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 532 of file lsa.c.

537{
538 LSAPR_PRIVILEGE_ENUM_BUFFER PrivilegeEnumBuffer;
540
541 TRACE("LsaEnumeratePrivileges(%p %p %p %lu %p)\n",
542 PolicyHandle, EnumerationContext, Buffer,
543 PreferedMaximumLength, CountReturned);
544
545 PrivilegeEnumBuffer.Entries = 0;
546 PrivilegeEnumBuffer.Privileges = NULL;
547
549 {
551 EnumerationContext,
552 &PrivilegeEnumBuffer,
553 PreferedMaximumLength);
554
555 *Buffer = PrivilegeEnumBuffer.Privileges;
556 *CountReturned = PrivilegeEnumBuffer.Entries;
557
558 }
560 {
561 if (PrivilegeEnumBuffer.Privileges != NULL)
562 MIDL_user_free(PrivilegeEnumBuffer.Privileges);
563
565 }
567
568 return Status;
569}
NTSTATUS WINAPI LsarEnumeratePrivileges(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:166
PLSAPR_POLICY_PRIVILEGE_DEF Privileges
Definition: lsa.idl:88

◆ LsaEnumeratePrivilegesOfAccount()

NTSTATUS WINAPI LsaEnumeratePrivilegesOfAccount ( IN LSA_HANDLE  AccountHandle,
OUT PPRIVILEGE_SET Privileges 
)

Definition at line 577 of file lsa.c.

579{
581
582 TRACE("LsaEnumeratePrivilegesOfAccount(%p %p)\n",
583 AccountHandle, Privileges);
584
586 {
589 }
591 {
593 }
595
596 return Status;
597}
NTSTATUS WINAPI LsarEnumeratePrivilegesAccount(LSAPR_HANDLE AccountHandle, PLSAPR_PRIVILEGE_SET *Privileges)
Definition: lsarpc.c:1504
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:17

◆ LsaEnumerateTrustedDomains()

NTSTATUS WINAPI LsaEnumerateTrustedDomains ( IN LSA_HANDLE  PolicyHandle,
IN OUT PLSA_ENUMERATION_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 605 of file lsa.c.

610{
611 LSAPR_TRUSTED_ENUM_BUFFER TrustedEnumBuffer;
613
614 TRACE("LsaEnumerateTrustedDomains(%p %p %p %lu %p)\n",
615 PolicyHandle, EnumerationContext, Buffer,
616 PreferedMaximumLength, CountReturned);
617
618 if (Buffer == NULL)
620
621 TrustedEnumBuffer.EntriesRead = 0;
622 TrustedEnumBuffer.Information = NULL;
623
625 {
627 EnumerationContext,
628 &TrustedEnumBuffer,
629 PreferedMaximumLength);
630
631 *Buffer = TrustedEnumBuffer.Information;
632 *CountReturned = TrustedEnumBuffer.EntriesRead;
633
634 }
636 {
637 if (TrustedEnumBuffer.Information != NULL)
638 MIDL_user_free(TrustedEnumBuffer.Information);
639
641 }
643
644 return Status;
645}
NTSTATUS WINAPI LsarEnumerateTrustedDomains(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:1176
PLSAPR_TRUST_INFORMATION Information
Definition: lsa.idl:344
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ LsaEnumerateTrustedDomainsEx()

NTSTATUS WINAPI LsaEnumerateTrustedDomainsEx ( IN LSA_HANDLE  PolicyHandle,
IN OUT PLSA_ENUMERATION_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 653 of file lsa.c.

658{
659 LSAPR_TRUSTED_ENUM_BUFFER_EX TrustedEnumBuffer;
661
662 TRACE("LsaEnumerateTrustedDomainsEx(%p %p %p %lu %p)\n",
663 PolicyHandle, EnumerationContext, Buffer,
664 PreferedMaximumLength, CountReturned);
665
666 if (Buffer == NULL)
668
669 TrustedEnumBuffer.EntriesRead = 0;
670 TrustedEnumBuffer.EnumerationBuffer = NULL;
671
673 {
675 EnumerationContext,
676 &TrustedEnumBuffer,
677 PreferedMaximumLength);
678
679 *Buffer = TrustedEnumBuffer.EnumerationBuffer;
680 *CountReturned = TrustedEnumBuffer.EntriesRead;
681
682 }
684 {
685 if (TrustedEnumBuffer.EnumerationBuffer != NULL)
686 MIDL_user_free(TrustedEnumBuffer.EnumerationBuffer);
687
689 }
691
692 return Status;
693}
NTSTATUS WINAPI LsarEnumerateTrustedDomainsEx(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:3816
PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX EnumerationBuffer
Definition: lsa.idl:442

◆ LsaFreeMemory()

◆ LsaGetQuotasForAccount()

NTSTATUS WINAPI LsaGetQuotasForAccount ( IN LSA_HANDLE  AccountHandle,
OUT PQUOTA_LIMITS  QuotaLimits 
)

Definition at line 713 of file lsa.c.

715{
717
718 TRACE("LsaGetQuotasForAccount(%p %p)\n",
719 AccountHandle, QuotaLimits);
720
722 {
724 QuotaLimits);
725 }
727 {
729 }
731
732 return Status;
733}
NTSTATUS WINAPI LsarGetQuotasForAccount(LSAPR_HANDLE AccountHandle, PQUOTA_LIMITS QuotaLimits)
Definition: lsarpc.c:1878

◆ LsaGetRemoteUserName()

NTSTATUS WINAPI LsaGetRemoteUserName ( IN PLSA_UNICODE_STRING SystemName  OPTIONAL,
OUT PLSA_UNICODE_STRING UserName,
OUT PLSA_UNICODE_STRING *DomainName  OPTIONAL 
)

Definition at line 741 of file lsa.c.

744{
745 PRPC_UNICODE_STRING UserNameString = NULL;
746 PRPC_UNICODE_STRING DomainNameString = NULL;
748
749 TRACE("LsaGetRemoteUserName(%s %p %p)\n",
750 SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
751 UserName, DomainName);
752
754 {
756 &UserNameString,
757 (DomainName != NULL) ? &DomainNameString : NULL);
758
759 *UserName = (PLSA_UNICODE_STRING)UserNameString;
760
761 if (DomainName != NULL)
762 *DomainName = (PLSA_UNICODE_STRING)DomainNameString;
763 }
765 {
766 if (UserNameString != NULL)
767 MIDL_user_free(UserNameString);
768
769 if (DomainNameString != NULL)
770 MIDL_user_free(DomainNameString);
771
773 }
775
776 return Status;
777}
#define debugstr_w
Definition: kernel32.h:32
LPWSTR PLSAPR_SERVER_NAME
Definition: lsa.idl:7
NTSTATUS WINAPI LsarGetUserName(LPWSTR SystemName, PRPC_UNICODE_STRING *UserName, PRPC_UNICODE_STRING *DomainName)
Definition: lsarpc.c:3739
struct _LSA_UNICODE_STRING * PLSA_UNICODE_STRING

◆ LsaGetSystemAccessAccount()

NTSTATUS WINAPI LsaGetSystemAccessAccount ( IN LSA_HANDLE  AccountHandle,
OUT PULONG  SystemAccess 
)

Definition at line 785 of file lsa.c.

787{
789
790 TRACE("LsaGetSystemAccessAccount(%p %p)\n",
791 AccountHandle, SystemAccess);
792
794 {
796 (ACCESS_MASK *)SystemAccess);
797 }
799 {
801 }
803
804 return Status;
805}
NTSTATUS WINAPI LsarGetSystemAccessAccount(LSAPR_HANDLE AccountHandle, ACCESS_MASK *SystemAccess)
Definition: lsarpc.c:1977
ULONG ACCESS_MASK
Definition: nt_native.h:40

◆ LsaGetUserName()

NTSTATUS WINAPI LsaGetUserName ( OUT PUNICODE_STRING UserName,
OUT PUNICODE_STRING *DomainName  OPTIONAL 
)

Definition at line 813 of file lsa.c.

815{
816 PRPC_UNICODE_STRING UserNameString = NULL;
817 PRPC_UNICODE_STRING DomainNameString = NULL;
819
820 TRACE("LsaGetUserName(%p %p)\n",
821 UserName, DomainName);
822
824 {
826 &UserNameString,
827 (DomainName != NULL) ? &DomainNameString : NULL);
828
829 *UserName = (PUNICODE_STRING)UserNameString;
830
831 if (DomainName != NULL)
832 *DomainName = (PUNICODE_STRING)DomainNameString;
833 }
835 {
836 if (UserNameString != NULL)
837 MIDL_user_free(UserNameString);
838
839 if (DomainNameString != NULL)
840 MIDL_user_free(DomainNameString);
841
843 }
845
846 return Status;
847}

◆ LsaLookupNames()

NTSTATUS WINAPI LsaLookupNames ( IN LSA_HANDLE  PolicyHandle,
IN ULONG  Count,
IN PLSA_UNICODE_STRING  Names,
OUT PLSA_REFERENCED_DOMAIN_LIST ReferencedDomains,
OUT PLSA_TRANSLATED_SID Sids 
)

Definition at line 855 of file lsa.c.

860{
861 LSAPR_TRANSLATED_SIDS TranslatedSids = {0, NULL};
862 ULONG MappedCount = 0;
864
865 TRACE("LsaLookupNames(%p %lu %p %p %p)\n",
866 PolicyHandle, Count, Names, ReferencedDomains, Sids);
867
868 if (ReferencedDomains == NULL || Sids == NULL)
870
872 {
873 *ReferencedDomains = NULL;
874 *Sids = NULL;
875
876 TranslatedSids.Entries = Count;
877
878 Status = LsarLookupNames((LSAPR_HANDLE)PolicyHandle,
879 Count,
881 (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
882 &TranslatedSids,
884 &MappedCount);
885
886 *Sids = (PLSA_TRANSLATED_SID)TranslatedSids.Sids;
887 }
889 {
890 if (TranslatedSids.Sids != NULL)
891 MIDL_user_free(TranslatedSids.Sids);
892
894 }
896
897 return Status;
898}
PWSTR Names[]
@ LsapLookupWksta
Definition: lsa.idl:148
NTSTATUS WINAPI LsarLookupNames(LSAPR_HANDLE PolicyHandle, DWORD Count, PRPC_UNICODE_STRING Names, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, PLSAPR_TRANSLATED_SIDS TranslatedSids, LSAP_LOOKUP_LEVEL LookupLevel, DWORD *MappedCount)
Definition: lsarpc.c:1192
int Count
Definition: noreturn.cpp:7
struct _LSA_TRANSLATED_SID * PLSA_TRANSLATED_SID
PLSA_TRANSLATED_SID Sids
Definition: lsa.idl:144
uint32_t ULONG
Definition: typedefs.h:59

Referenced by BuildSidListFromDomainAndName(), and LookupAccountNameW().

◆ LsaLookupNames2()

NTSTATUS WINAPI LsaLookupNames2 ( IN LSA_HANDLE  PolicyHandle,
IN ULONG  Flags,
IN ULONG  Count,
IN PLSA_UNICODE_STRING  Names,
OUT PLSA_REFERENCED_DOMAIN_LIST ReferencedDomains,
OUT PLSA_TRANSLATED_SID2 Sids 
)

Definition at line 906 of file lsa.c.

912{
913 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSids = {0, NULL};
914 ULONG MappedCount = 0;
916
917 TRACE("LsaLookupNames2(%p 0x%08x %lu %p %p %p)\n",
918 PolicyHandle, Flags, Count, Names, ReferencedDomains, Sids);
919
920 if (ReferencedDomains == NULL || Sids == NULL)
922
924 {
925 *ReferencedDomains = NULL;
926 *Sids = NULL;
927
928 TranslatedSids.Entries = Count;
929
930 Status = LsarLookupNames3((LSAPR_HANDLE)PolicyHandle,
931 Count,
933 (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
934 &TranslatedSids,
936 &MappedCount,
937 Flags,
938 2);
939
940 *Sids = (PLSA_TRANSLATED_SID2)TranslatedSids.Sids;
941 }
943 {
944 if (TranslatedSids.Sids != NULL)
945 MIDL_user_free(TranslatedSids.Sids);
946
948 }
950
951 return Status;
952}
NTSTATUS WINAPI LsarLookupNames3(LSAPR_HANDLE PolicyHandle, DWORD Count, PRPC_UNICODE_STRING Names, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids, LSAP_LOOKUP_LEVEL LookupLevel, DWORD *MappedCount, DWORD LookupOptions, DWORD ClientRevision)
Definition: lsarpc.c:4138
struct _LSA_TRANSLATED_SID2 * PLSA_TRANSLATED_SID2
PLSAPR_TRANSLATED_SID_EX2 Sids
Definition: lsa.idl:210
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by AccpLookupSidByName(), InstallPrivileges(), and test_LsaLookupNames2().

◆ LsaLookupPrivilegeDisplayName()

NTSTATUS WINAPI LsaLookupPrivilegeDisplayName ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  Name,
OUT PLSA_UNICODE_STRING DisplayName,
OUT PUSHORT  LanguageReturned 
)

Definition at line 960 of file lsa.c.

964{
965 PRPC_UNICODE_STRING DisplayNameBuffer = NULL;
967
968 TRACE("LsaLookupPrivilegeDisplayName(%p %p %p %p)\n",
969 PolicyHandle, Name, DisplayName, LanguageReturned);
970
972 {
977 &DisplayNameBuffer,
978 LanguageReturned);
979
980 *DisplayName = (PUNICODE_STRING)DisplayNameBuffer;
981 }
983 {
984 if (DisplayNameBuffer != NULL)
985 MIDL_user_free(DisplayNameBuffer);
986
988 }
990
991 return Status;
992}
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1375
LANGID WINAPI GetSystemDefaultUILanguage(void)
Definition: locale.c:1395
NTSTATUS WINAPI LsarLookupPrivilegeDisplayName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING Name, USHORT ClientLanguage, USHORT ClientSystemDefaultLanguage, PRPC_UNICODE_STRING *DisplayName, USHORT *LanguageReturned)
Definition: lsarpc.c:2494

Referenced by LookupPrivilegeDisplayNameW().

◆ LsaLookupPrivilegeName()

NTSTATUS WINAPI LsaLookupPrivilegeName ( IN LSA_HANDLE  PolicyHandle,
IN PLUID  Value,
OUT PUNICODE_STRING Name 
)

Definition at line 1000 of file lsa.c.

1003{
1004 PRPC_UNICODE_STRING NameBuffer = NULL;
1006
1007 TRACE("LsaLookupPrivilegeName(%p %p %p)\n",
1008 PolicyHandle, Value, Name);
1009
1011 {
1012 Status = LsarLookupPrivilegeName(PolicyHandle,
1013 Value,
1014 &NameBuffer);
1015
1016 *Name = (PUNICODE_STRING)NameBuffer;
1017 }
1019 {
1020 if (NameBuffer != NULL)
1021 MIDL_user_free(NameBuffer);
1022
1024 }
1026
1027 return Status;
1028}
NTSTATUS WINAPI LsarLookupPrivilegeName(LSAPR_HANDLE PolicyHandle, PLUID Value, PRPC_UNICODE_STRING *Name)
Definition: lsarpc.c:2464
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by LookupPrivilegeNameW(), and test_LsaLookupPrivilegeName().

◆ LsaLookupPrivilegeValue()

NTSTATUS WINAPI LsaLookupPrivilegeValue ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  Name,
OUT PLUID  Value 
)

Definition at line 1036 of file lsa.c.

1039{
1040 LUID Luid;
1042
1043 TRACE("LsaLookupPrivilegeValue(%p %p %p)\n",
1044 PolicyHandle, Name, Value);
1045
1047 {
1048 Status = LsarLookupPrivilegeValue(PolicyHandle,
1050 &Luid);
1051 if (Status == STATUS_SUCCESS)
1052 *Value = Luid;
1053 }
1055 {
1057 }
1059
1060 return Status;
1061}
NTSTATUS WINAPI LsarLookupPrivilegeValue(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING Name, PLUID Value)
Definition: lsarpc.c:2428
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by LookupPrivilegeValueW().

◆ LsaLookupSids()

NTSTATUS WINAPI LsaLookupSids ( IN LSA_HANDLE  PolicyHandle,
IN ULONG  Count,
IN PSID Sids,
OUT PLSA_REFERENCED_DOMAIN_LIST ReferencedDomains,
OUT PLSA_TRANSLATED_NAME Names 
)

Definition at line 1069 of file lsa.c.

1074{
1075 LSAPR_SID_ENUM_BUFFER SidEnumBuffer;
1076 LSAPR_TRANSLATED_NAMES TranslatedNames;
1077 ULONG MappedCount = 0;
1079
1080 TRACE("LsaLookupSids(%p %lu %p %p %p)\n",
1081 PolicyHandle, Count, Sids, ReferencedDomains, Names);
1082
1083 if (Count == 0)
1085
1086 SidEnumBuffer.Entries = Count;
1087 SidEnumBuffer.SidInfo = (PLSAPR_SID_INFORMATION)Sids;
1088
1090 {
1091 *ReferencedDomains = NULL;
1092 *Names = NULL;
1093
1094 TranslatedNames.Entries = 0;
1095 TranslatedNames.Names = NULL;
1096
1097 Status = LsarLookupSids((LSAPR_HANDLE)PolicyHandle,
1098 &SidEnumBuffer,
1099 (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
1100 &TranslatedNames,
1102 &MappedCount);
1103
1104 *Names = (PLSA_TRANSLATED_NAME)TranslatedNames.Names;
1105 }
1107 {
1108 if (TranslatedNames.Names != NULL)
1109 {
1110 MIDL_user_free(TranslatedNames.Names);
1111 }
1112
1114 }
1116
1117 return Status;
1118}
struct _LSAPR_SID_INFORMATION * PLSAPR_SID_INFORMATION
NTSTATUS WINAPI LsarLookupSids(LSAPR_HANDLE PolicyHandle, PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, PLSAPR_TRANSLATED_NAMES TranslatedNames, LSAP_LOOKUP_LEVEL LookupLevel, DWORD *MappedCount)
Definition: lsarpc.c:1256
struct _LSA_TRANSLATED_NAME * PLSA_TRANSLATED_NAME
PLSAPR_SID_INFORMATION SidInfo
Definition: lsa.idl:163
PLSAPR_TRANSLATED_NAME Names
Definition: lsa.idl:174

Referenced by fill_sid(), LookupAccountSidW(), LookupSidInformation(), NetLocalGroupGetMembers(), and test_LsaLookupSids().

◆ LsaNtStatusToWinError()

◆ LsaOpenAccount()

NTSTATUS WINAPI LsaOpenAccount ( IN LSA_HANDLE  PolicyHandle,
IN PSID  AccountSid,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  AccountHandle 
)

Definition at line 1143 of file lsa.c.

1147{
1149
1150 TRACE("LsaOpenAccount(%p %p 0x%08lx %p)\n",
1151 PolicyHandle, AccountSid, DesiredAccess, AccountHandle);
1152
1154 {
1155 Status = LsarOpenAccount((LSAPR_HANDLE)PolicyHandle,
1156 AccountSid,
1158 AccountHandle);
1159 }
1161 {
1163 }
1165
1166 return Status;
1167}
NTSTATUS WINAPI LsarOpenAccount(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *AccountHandle)
Definition: lsarpc.c:1465

◆ LsaOpenPolicy()

NTSTATUS WINAPI LsaOpenPolicy ( IN PLSA_UNICODE_STRING SystemName  OPTIONAL,
IN PLSA_OBJECT_ATTRIBUTES  ObjectAttributes,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  PolicyHandle 
)

Definition at line 1183 of file lsa.c.

1187{
1189
1190 TRACE("LsaOpenPolicy(%s %p 0x%08lx %p)\n",
1191 SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
1192 ObjectAttributes, DesiredAccess, PolicyHandle);
1193
1194 /* FIXME: RPC should take care of this */
1195 if (!LsapIsLocalComputer(SystemName))
1197
1199 {
1200 *PolicyHandle = NULL;
1201
1202 Status = LsarOpenPolicy(SystemName ? SystemName->Buffer : NULL,
1205 PolicyHandle);
1206 }
1208 {
1210 }
1212
1213 TRACE("LsaOpenPolicy() done (Status: 0x%08lx)\n", Status);
1214
1215 return Status;
1216}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
static BOOL LsapIsLocalComputer(PLSA_UNICODE_STRING ServerName)
Definition: lsa.c:21
NTSTATUS WINAPI LsarOpenPolicy(LPWSTR SystemName, PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *PolicyHandle)
Definition: lsarpc.c:495
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:1201

Referenced by AccpOpenLSAPolicyHandle(), AddImpersonatePrivilege(), ApplyAccountSettings(), ApplyAuditEvents(), ApplyLockoutSettings(), ApplyPasswordSettings(), BuildSidListFromDomainAndName(), fill_sid(), GetAccountDomainSid(), GetComputerObjectNameW(), InstallBuiltinAccounts(), InstallPrivileges(), LookupAccountNameW(), LookupAccountSidW(), LookupPrivilegeDisplayNameW(), LookupPrivilegeNameW(), LookupPrivilegeValueW(), NetLocalGroupGetMembers(), NetpGetJoinInformation(), NetpSetPrimaryDomain(), NetrWkstaGetInfo(), NetWkstaUserGetInfo(), OpenLSAPolicyHandle(), SampGetAccountDomainInfo(), ScmSetServicePassword(), SetAccountsDomainSid(), SetAdministratorPassword(), SetPrimaryDomain(), test_lsa(), test_LsaLookupNames2(), test_LsaLookupPrivilegeName(), and test_LsaLookupSids().

◆ LsaOpenPolicySce()

NTSTATUS WINAPI LsaOpenPolicySce ( IN PLSA_UNICODE_STRING SystemName  OPTIONAL,
IN PLSA_OBJECT_ATTRIBUTES  ObjectAttributes,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  PolicyHandle 
)

Definition at line 1224 of file lsa.c.

1228{
1230
1231 TRACE("LsaOpenPolicySce(%s %p 0x%08lx %p)\n",
1232 SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
1233 ObjectAttributes, DesiredAccess, PolicyHandle);
1234
1235 /* FIXME: RPC should take care of this */
1236 if (!LsapIsLocalComputer(SystemName))
1238
1240 {
1241 *PolicyHandle = NULL;
1242
1243 Status = LsarOpenPolicySce(SystemName ? SystemName->Buffer : NULL,
1246 PolicyHandle);
1247 }
1249 {
1251 }
1253
1254 TRACE("LsaOpenPolicySce() done (Status: 0x%08lx)\n", Status);
1255
1256 return Status;
1257}
NTSTATUS WINAPI LsarOpenPolicySce(LPWSTR SystemName, PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *PolicyHandle)
Definition: lsarpc.c:4346

◆ LsaOpenSecret()

NTSTATUS WINAPI LsaOpenSecret ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  SecretName,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  SecretHandle 
)

Definition at line 1265 of file lsa.c.

1269{
1271
1272 TRACE("LsaOpenSecret(%p %p 0x%08lx %p)\n",
1273 PolicyHandle, SecretName, DesiredAccess, SecretHandle);
1274
1276 {
1277 *SecretHandle = NULL;
1278
1279 Status = LsarOpenSecret((LSAPR_HANDLE)PolicyHandle,
1280 (PRPC_UNICODE_STRING)SecretName,
1282 SecretHandle);
1283 }
1285 {
1287 }
1289
1290 TRACE("LsaOpenSecret() done (Status: 0x%08lx)\n", Status);
1291
1292 return Status;
1293}
NTSTATUS WINAPI LsarOpenSecret(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING SecretName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *SecretHandle)
Definition: lsarpc.c:2090

◆ LsaOpenTrustedDomain()

NTSTATUS WINAPI LsaOpenTrustedDomain ( IN LSA_HANDLE  PolicyHandle,
IN PSID  TrustedDomainSid,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  TrustedDomainHandle 
)

Definition at line 1301 of file lsa.c.

1305{
1307
1308 TRACE("LsaOpenTrustedDomain(%p %p 0x%08lx %p)\n",
1309 PolicyHandle, TrustedDomainSid, DesiredAccess, TrustedDomainHandle);
1310
1312 {
1314 (PRPC_SID)TrustedDomainSid,
1316 (PLSAPR_HANDLE)TrustedDomainHandle);
1317 }
1319 {
1321 }
1323
1324 return Status;
1325}
NTSTATUS WINAPI LsarOpenTrustedDomain(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:2046

◆ LsaOpenTrustedDomainByName()

NTSTATUS WINAPI LsaOpenTrustedDomainByName ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  TrustedDomainName,
IN ACCESS_MASK  DesiredAccess,
OUT PLSA_HANDLE  TrustedDomainHandle 
)

Definition at line 1333 of file lsa.c.

1337{
1339
1340 TRACE("LsaOpenTrustedDomainByName(%p %p 0x%08lx %p)\n",
1341 PolicyHandle, TrustedDomainName, DesiredAccess, TrustedDomainHandle);
1342
1344 {
1346 (PRPC_UNICODE_STRING)TrustedDomainName,
1348 TrustedDomainHandle);
1349 }
1351 {
1353 }
1355
1356 return Status;
1357}
NTSTATUS WINAPI LsarOpenTrustedDomainByName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:3892

◆ LsapIsLocalComputer()

static BOOL LsapIsLocalComputer ( PLSA_UNICODE_STRING  ServerName)
static

Definition at line 21 of file lsa.c.

22{
25 LPWSTR buf;
26 PCWSTR pSrvName;
27
28 if (ServerName == NULL || ServerName->Length == 0 || ServerName->Buffer == NULL)
29 return TRUE;
30
31 pSrvName = ServerName->Buffer;
32 buf = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
34 if (Result && (pSrvName[0] == L'\\') && (pSrvName[1] == L'\\'))
35 pSrvName += 2;
36 Result = Result && !lstrcmpW(pSrvName, buf);
38
39 return Result;
40}
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define L(x)
Definition: ntvdm.h:50
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:269
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by LsaOpenPolicy(), and LsaOpenPolicySce().

◆ LsaQueryDomainInformationPolicy()

NTSTATUS WINAPI LsaQueryDomainInformationPolicy ( IN LSA_HANDLE  PolicyHandle,
IN POLICY_DOMAIN_INFORMATION_CLASS  InformationClass,
OUT PVOID Buffer 
)

Definition at line 1365 of file lsa.c.

1368{
1369 PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation = NULL;
1371
1372 TRACE("LsaQueryDomainInformationPolicy(%p %lu %p)\n",
1373 PolicyHandle, InformationClass, Buffer);
1374
1376 {
1379 &PolicyInformation);
1380
1381 *Buffer = PolicyInformation;
1382 }
1384 {
1385 if (PolicyInformation != NULL)
1386 MIDL_user_free(PolicyInformation);
1387
1389 }
1391
1392 return Status;
1393}
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1713
NTSTATUS WINAPI LsarQueryDomainInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_DOMAIN_INFORMATION *PolicyInformation)
Definition: lsarpc.c:3866

◆ LsaQueryForestTrustInformation()

NTSTATUS WINAPI LsaQueryForestTrustInformation ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  TrustedDomainName,
OUT PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo 
)

Definition at line 1401 of file lsa.c.

1404{
1406
1407 TRACE("LsaQueryForestTrustInformation(%p %p %p)\n",
1408 PolicyHandle, TrustedDomainName, ForestTrustInfo);
1409
1411 {
1413 TrustedDomainName,
1415 ForestTrustInfo);
1416 }
1418 {
1420 }
1422
1423 return Status;
1424}
NTSTATUS WINAPI LsarQueryForestTrustInformation(LSAPR_HANDLE PolicyHandle, PLSA_UNICODE_STRING TrustedDomainName, LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType, PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo)
Definition: lsarpc.c:4224
@ ForestTrustDomainInfo
Definition: ntsecapi.h:345

◆ LsaQueryInformationPolicy()

NTSTATUS WINAPI LsaQueryInformationPolicy ( IN LSA_HANDLE  PolicyHandle,
IN POLICY_INFORMATION_CLASS  InformationClass,
OUT PVOID Buffer 
)

Definition at line 1473 of file lsa.c.

1476{
1477 PLSAPR_POLICY_INFORMATION PolicyInformation = NULL;
1479
1480 TRACE("LsaQueryInformationPolicy(%p %d %p)\n",
1481 PolicyHandle, InformationClass, Buffer);
1482
1484 {
1487 &PolicyInformation);
1488 *Buffer = PolicyInformation;
1489 }
1491 {
1492 if (PolicyInformation != NULL)
1493 MIDL_user_free(PolicyInformation);
1494
1496 }
1498
1499 TRACE("Done (Status: 0x%08x)\n", Status);
1500
1501 return Status;
1502}
NTSTATUS WINAPI LsarQueryInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_INFORMATION *PolicyInformation)
Definition: lsarpc.c:531

Referenced by ApplyAccountSettings(), ApplyLockoutSettings(), ApplyPasswordSettings(), GetAccountDomainSid(), GetComputerObjectNameW(), LookupSidInformation(), NetpGetJoinInformation(), NetrWkstaGetInfo(), NetWkstaUserGetInfo(), SampGetAccountDomainInfo(), SetAccountsDomainSid(), SetAdministratorPassword(), SetPrimaryDomain(), and test_lsa().

◆ LsaQueryInfoTrustedDomain()

NTSTATUS WINAPI LsaQueryInfoTrustedDomain ( IN LSA_HANDLE  TrustedDomainHandle,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
OUT PVOID Buffer 
)

Definition at line 1432 of file lsa.c.

1435{
1436 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation = NULL;
1438
1439 TRACE("LsaQueryInfoTrustedDomain(%p %d %p) stub\n",
1440 TrustedDomainHandle, InformationClass, Buffer);
1441
1445
1447 {
1448 Status = LsarQueryInfoTrustedDomain((LSAPR_HANDLE)TrustedDomainHandle,
1450 &TrustedDomainInformation);
1451 *Buffer = TrustedDomainInformation;
1452 }
1454 {
1455 if (TrustedDomainInformation != NULL)
1456 MIDL_user_free(TrustedDomainInformation);
1457
1459 }
1461
1462 TRACE("Done (Status: 0x%08x)\n", Status);
1463
1464 return Status;
1465}
NTSTATUS WINAPI LsarQueryInfoTrustedDomain(LSAPR_HANDLE TrustedDomainHandle, TRUSTED_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
Definition: lsarpc.c:2064
@ TrustedDomainFullInformationInternal
Definition: ntsecapi.h:340
@ TrustedDomainAuthInformationInternal
Definition: ntsecapi.h:339
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240

◆ LsaQuerySecret()

NTSTATUS WINAPI LsaQuerySecret ( IN LSA_HANDLE  SecretHandle,
OUT PLSA_UNICODE_STRING *CurrentValue  OPTIONAL,
OUT PLARGE_INTEGER CurrentValueSetTime  OPTIONAL,
OUT PLSA_UNICODE_STRING *OldValue  OPTIONAL,
OUT PLARGE_INTEGER OldValueSetTime  OPTIONAL 
)

Definition at line 1510 of file lsa.c.

1515{
1516 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue = NULL;
1517 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue = NULL;
1518 PLSA_UNICODE_STRING DecryptedCurrentValue = NULL;
1519 PLSA_UNICODE_STRING DecryptedOldValue = NULL;
1522
1523 TRACE("LsaQuerySecret(%p %p %p %p %p)\n",
1524 SecretHandle, CurrentValue, CurrentValueSetTime,
1525 OldValue, OldValueSetTime);
1526
1528 {
1529 Status = LsarQuerySecret((PLSAPR_HANDLE)SecretHandle,
1530 &EncryptedCurrentValue,
1531 CurrentValueSetTime,
1532 &EncryptedOldValue,
1533 OldValueSetTime);
1534 }
1536 {
1538 }
1540
1541 if (!NT_SUCCESS(Status))
1542 goto done;
1543
1544 /* Decrypt the current value */
1545 if (CurrentValue != NULL)
1546 {
1547 if (EncryptedCurrentValue == NULL)
1548 {
1549 *CurrentValue = NULL;
1550 }
1551 else
1552 {
1553 /* FIXME: Decrypt the current value */
1554 BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedCurrentValue->MaximumLength;
1555 DecryptedCurrentValue = midl_user_allocate(BufferSize);
1556 if (DecryptedCurrentValue == NULL)
1557 {
1559 goto done;
1560 }
1561
1562 DecryptedCurrentValue->Length = (USHORT)EncryptedCurrentValue->Length;
1563 DecryptedCurrentValue->MaximumLength = (USHORT)EncryptedCurrentValue->MaximumLength;
1564 DecryptedCurrentValue->Buffer = (PWSTR)(DecryptedCurrentValue + 1);
1565 RtlCopyMemory(DecryptedCurrentValue->Buffer,
1566 EncryptedCurrentValue->Buffer,
1567 EncryptedCurrentValue->Length);
1568
1569 *CurrentValue = DecryptedCurrentValue;
1570 }
1571 }
1572
1573 /* Decrypt the old value */
1574 if (OldValue != NULL)
1575 {
1576 if (EncryptedOldValue == NULL)
1577 {
1578 *OldValue = NULL;
1579 }
1580 else
1581 {
1582 /* FIXME: Decrypt the old value */
1583 BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedOldValue->MaximumLength;
1584 DecryptedOldValue = midl_user_allocate(BufferSize);
1585 if (DecryptedOldValue == NULL)
1586 {
1588 goto done;
1589 }
1590
1591 DecryptedOldValue->Length = (USHORT)EncryptedOldValue->Length;
1592 DecryptedOldValue->MaximumLength = (USHORT)EncryptedOldValue->MaximumLength;
1593 DecryptedOldValue->Buffer = (PWSTR)(DecryptedOldValue + 1);
1594 RtlCopyMemory(DecryptedOldValue->Buffer,
1595 EncryptedOldValue->Buffer,
1596 EncryptedOldValue->Length);
1597
1598 *OldValue = DecryptedOldValue;
1599 }
1600 }
1601
1602done:
1603 if (!NT_SUCCESS(Status))
1604 {
1605 if (DecryptedCurrentValue != NULL)
1606 midl_user_free(DecryptedCurrentValue);
1607
1608 if (DecryptedOldValue != NULL)
1609 midl_user_free(DecryptedOldValue);
1610
1611 if (CurrentValue != NULL)
1612 *CurrentValue = NULL;
1613
1614 if (OldValue != NULL)
1615 *OldValue = NULL;
1616 }
1617
1618 if (EncryptedCurrentValue != NULL)
1619 midl_user_free(EncryptedCurrentValue);
1620
1621 if (EncryptedOldValue != NULL)
1622 midl_user_free(EncryptedOldValue);
1623
1624 return Status;
1625}
#define BufferSize
Definition: mmc.h:75
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS WINAPI LsarQuerySecret(LSAPR_HANDLE SecretHandle, PLSAPR_CR_CIPHER_VALUE *EncryptedCurrentValue, PLARGE_INTEGER CurrentValueSetTime, PLSAPR_CR_CIPHER_VALUE *EncryptedOldValue, PLARGE_INTEGER OldValueSetTime)
Definition: lsarpc.c:2246
struct _LSA_UNICODE_STRING LSA_UNICODE_STRING
unsigned short USHORT
Definition: pedump.c:61
#define midl_user_free
Definition: rpc.h:45
#define midl_user_allocate
Definition: rpc.h:44
USHORT MaximumLength
Definition: ntsecapi.h:164
uint16_t * PWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

◆ LsaQuerySecurityObject()

NTSTATUS WINAPI LsaQuerySecurityObject ( IN LSA_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
OUT PSECURITY_DESCRIPTOR SecurityDescriptor 
)

Definition at line 1633 of file lsa.c.

1636{
1640
1641 TRACE("LsaQuerySecurityObject(%p %lx %p)\n",
1643
1644 SdBuffer.Length = 0;
1645 SdBuffer.SecurityDescriptor = NULL;
1646
1647 SdPointer = &SdBuffer;
1648
1650 {
1653 &SdPointer);
1654 if (NT_SUCCESS(Status))
1655 {
1657 }
1658 else
1659 {
1661 }
1662 }
1664 {
1666 }
1668
1669 return Status;
1670}
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1340
NTSTATUS WINAPI LsarQuerySecurityObject(LSAPR_HANDLE ObjectHandle, SECURITY_INFORMATION SecurityInformation, PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: lsarpc.c:198
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:191

◆ LsaQueryTrustedDomainInfo()

NTSTATUS WINAPI LsaQueryTrustedDomainInfo ( IN LSA_HANDLE  PolicyHandle,
IN PSID  TrustedDomainSid,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
OUT PVOID Buffer 
)

Definition at line 1678 of file lsa.c.

1682{
1684
1685 TRACE("LsaQueryTrustedDomainInfo(%p %p %d %p) stub\n",
1686 PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
1687
1691
1693 {
1695 (PRPC_SID)TrustedDomainSid,
1698 }
1700 {
1702 }
1704
1705 return Status;
1706}
NTSTATUS WINAPI LsarQueryTrustedDomainInfo(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid, TRUSTED_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
Definition: lsarpc.c:3410

◆ LsaQueryTrustedDomainInfoByName()

NTSTATUS WINAPI LsaQueryTrustedDomainInfoByName ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  TrustedDomainName,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
OUT PVOID Buffer 
)

Definition at line 1714 of file lsa.c.

1718{
1720
1721 TRACE("LsaQueryTrustedDomainInfoByName(%p %p %d %p)\n",
1722 PolicyHandle, TrustedDomainName, InformationClass, Buffer);
1723
1727
1729 {
1731 (PRPC_UNICODE_STRING)TrustedDomainName,
1734 }
1736 {
1738 }
1740
1741 return Status;
1742}
NTSTATUS WINAPI LsarQueryTrustedDomainInfoByName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation)
Definition: lsarpc.c:3780

◆ LsaRemoveAccountRights()

NTSTATUS WINAPI LsaRemoveAccountRights ( IN LSA_HANDLE  PolicyHandle,
IN PSID  AccountSid,
IN BOOLEAN  AllRights,
IN PLSA_UNICODE_STRING  UserRights,
IN ULONG  CountOfRights 
)

Definition at line 1750 of file lsa.c.

1755{
1757 LSAPR_USER_RIGHT_SET UserRightSet;
1758
1759 TRACE("LsaRemoveAccountRights(%p %p %d %p %lu)\n",
1760 PolicyHandle, AccountSid, AllRights, UserRights, CountOfRights);
1761
1762 UserRightSet.Entries = CountOfRights;
1763 UserRightSet.UserRights = (PRPC_UNICODE_STRING)UserRights;
1764
1766 {
1768 (PRPC_SID)AccountSid,
1769 AllRights,
1770 &UserRightSet);
1771 }
1773 {
1775 }
1777
1778 return Status;
1779}
NTSTATUS WINAPI LsarRemoveAccountRights(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, BOOLEAN AllRights, PLSAPR_USER_RIGHT_SET UserRights)
Definition: lsarpc.c:3214

◆ LsaRemovePrivilegesFromAccount()

NTSTATUS WINAPI LsaRemovePrivilegesFromAccount ( IN LSA_HANDLE  AccountHandle,
IN BOOLEAN  AllPrivileges,
IN PPRIVILEGE_SET Privileges  OPTIONAL 
)

Definition at line 1787 of file lsa.c.

1790{
1792
1794 {
1796 AllPrivileges,
1798 }
1800 {
1802 }
1804
1805 return Status;
1806}
NTSTATUS WINAPI LsarRemovePrivilegesFromAccount(LSAPR_HANDLE AccountHandle, BOOLEAN AllPrivileges, PLSAPR_PRIVILEGE_SET Privileges)
Definition: lsarpc.c:1719

◆ LsaRetrievePrivateData()

NTSTATUS WINAPI LsaRetrievePrivateData ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  KeyName,
OUT PLSA_UNICODE_STRING PrivateData 
)

Definition at line 1814 of file lsa.c.

1817{
1818 PLSAPR_CR_CIPHER_VALUE EncryptedData = NULL;
1819 PLSA_UNICODE_STRING DecryptedData = NULL;
1822
1823 TRACE("LsaRetrievePrivateData(%p %p %p)\n",
1824 PolicyHandle, KeyName, PrivateData);
1825
1827 {
1830 &EncryptedData);
1831 }
1833 {
1835 }
1837
1838 if (EncryptedData == NULL)
1839 {
1840 *PrivateData = NULL;
1841 }
1842 else
1843 {
1844 BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedData->MaximumLength;
1845 DecryptedData = midl_user_allocate(BufferSize);
1846 if (DecryptedData == NULL)
1847 {
1849 goto done;
1850 }
1851
1852 DecryptedData->Length = (USHORT)EncryptedData->Length;
1853 DecryptedData->MaximumLength = (USHORT)EncryptedData->MaximumLength;
1854 DecryptedData->Buffer = (PWSTR)(DecryptedData + 1);
1855 RtlCopyMemory(DecryptedData->Buffer,
1856 EncryptedData->Buffer,
1857 EncryptedData->Length);
1858
1859 *PrivateData = DecryptedData;
1860 }
1861
1862done:
1863 if (!NT_SUCCESS(Status))
1864 {
1865 if (DecryptedData != NULL)
1866 midl_user_free(DecryptedData);
1867
1868 *PrivateData = NULL;
1869 }
1870
1871 if (EncryptedData != NULL)
1872 midl_user_free(EncryptedData);
1873
1874 return Status;
1875}
NTSTATUS WINAPI LsarRetrievePrivateData(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING KeyName, PLSAPR_CR_CIPHER_VALUE *EncryptedData)
Definition: lsarpc.c:3618
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699

◆ LsaSetDomainInformationPolicy()

NTSTATUS WINAPI LsaSetDomainInformationPolicy ( IN LSA_HANDLE  PolicyHandle,
IN POLICY_DOMAIN_INFORMATION_CLASS  InformationClass,
IN PVOID Buffer  OPTIONAL 
)

Definition at line 1883 of file lsa.c.

1886{
1888
1889 TRACE("LsaSetDomainInformationPolicy(%p %d %p)\n",
1890 PolicyHandle, InformationClass, Buffer);
1891
1893 {
1897 }
1899 {
1901 }
1903
1904 return Status;
1905}
NTSTATUS WINAPI LsarSetDomainInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation)
Definition: lsarpc.c:3879

◆ LsaSetForestTrustInformation()

NTSTATUS WINAPI LsaSetForestTrustInformation ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  TrustedDomainName,
IN PLSA_FOREST_TRUST_INFORMATION  ForestTrustInfo,
IN BOOLEAN  CheckOnly,
OUT PLSA_FOREST_TRUST_COLLISION_INFORMATION CollisionInfo 
)

Definition at line 1913 of file lsa.c.

1918{
1920
1921 TRACE("LsaSetForestTrustInformation(%p %p %p %d %p)\n",
1922 PolicyHandle, TrustedDomainName, ForestTrustInfo, CheckOnly, CollisionInfo);
1923
1925 {
1927 TrustedDomainName,
1929 ForestTrustInfo,
1930 CheckOnly,
1931 CollisionInfo);
1932 }
1934 {
1936 }
1938
1939 return Status;
1940}
NTSTATUS WINAPI LsarSetForestTrustInformation(LSAPR_HANDLE PolicyHandle, PLSA_UNICODE_STRING TrustedDomainName, LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType, PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo, BOOLEAN CheckOnly, PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
Definition: lsarpc.c:4238

◆ LsaSetInformationPolicy()

NTSTATUS WINAPI LsaSetInformationPolicy ( IN LSA_HANDLE  PolicyHandle,
IN POLICY_INFORMATION_CLASS  InformationClass,
IN PVOID  Buffer 
)

Definition at line 1948 of file lsa.c.

1951{
1953
1954 TRACE("LsaSetInformationPolicy(%p %d %p)\n",
1955 PolicyHandle, InformationClass, Buffer);
1956
1958 {
1962 }
1964 {
1966 }
1968
1969 return Status;
1970}
NTSTATUS WINAPI LsarSetInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_INFORMATION PolicyInformation)
Definition: lsarpc.c:663

Referenced by ApplyAuditEvents(), NetpSetPrimaryDomain(), SetAccountsDomainSid(), and SetPrimaryDomain().

◆ LsaSetInformationTrustedDomain()

NTSTATUS WINAPI LsaSetInformationTrustedDomain ( IN LSA_HANDLE  TrustedDomainHandle,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
IN PVOID  Buffer 
)

Definition at line 1978 of file lsa.c.

1981{
1982 FIXME("LsaSetInformationTrustedDomain(%p %d %p)\n",
1983 TrustedDomainHandle, InformationClass, Buffer);
1985}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42

◆ LsaSetQuotasForAccount()

NTSTATUS WINAPI LsaSetQuotasForAccount ( IN LSA_HANDLE  AccountHandle,
IN PQUOTA_LIMITS  QuotaLimits 
)

Definition at line 1993 of file lsa.c.

1995{
1997
1998 TRACE("LsaSetQuotasForAccount(%p %p)\n",
1999 AccountHandle, QuotaLimits);
2000
2002 {
2004 QuotaLimits);
2005 }
2007 {
2009 }
2011
2012 return Status;
2013}
NTSTATUS WINAPI LsarSetQuotasForAccount(LSAPR_HANDLE AccountHandle, PQUOTA_LIMITS QuotaLimits)
Definition: lsarpc.c:1913

◆ LsaSetSecret()

NTSTATUS WINAPI LsaSetSecret ( IN LSA_HANDLE  SecretHandle,
IN PLSA_UNICODE_STRING CurrentValue  OPTIONAL,
IN PLSA_UNICODE_STRING OldValue  OPTIONAL 
)

Definition at line 2021 of file lsa.c.

2024{
2025 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue = NULL;
2026 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue = NULL;
2029
2030 TRACE("LsaSetSecret(%p %p %p)\n",
2031 SecretHandle, EncryptedCurrentValue, EncryptedOldValue);
2032
2033 if (CurrentValue != NULL)
2034 {
2035 BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + CurrentValue->MaximumLength;
2036 EncryptedCurrentValue = midl_user_allocate(BufferSize);
2037 if (EncryptedCurrentValue == NULL)
2038 {
2040 goto done;
2041 }
2042
2043 EncryptedCurrentValue->Length = CurrentValue->Length;
2044 EncryptedCurrentValue->MaximumLength = CurrentValue->MaximumLength;
2045 EncryptedCurrentValue->Buffer = (BYTE *)(EncryptedCurrentValue + 1);
2046 if (EncryptedCurrentValue->Buffer != NULL)
2047 memcpy(EncryptedCurrentValue->Buffer, CurrentValue->Buffer, CurrentValue->Length);
2048 }
2049
2050 if (OldValue != NULL)
2051 {
2052 BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + OldValue->MaximumLength;
2053 EncryptedOldValue = midl_user_allocate(BufferSize);
2054 if (EncryptedOldValue == NULL)
2055 {
2057 goto done;
2058 }
2059
2060 EncryptedOldValue->Length = OldValue->Length;
2061 EncryptedOldValue->MaximumLength = OldValue->MaximumLength;
2062 EncryptedOldValue->Buffer = (BYTE*)(EncryptedOldValue + 1);
2063 if (EncryptedOldValue->Buffer != NULL)
2064 memcpy(EncryptedOldValue->Buffer, OldValue->Buffer, OldValue->Length);
2065 }
2066
2068 {
2069 Status = LsarSetSecret((LSAPR_HANDLE)SecretHandle,
2070 EncryptedCurrentValue,
2071 EncryptedOldValue);
2072 }
2074 {
2076 }
2078
2079done:
2080 if (EncryptedCurrentValue != NULL)
2081 midl_user_free(EncryptedCurrentValue);
2082
2083 if (EncryptedOldValue != NULL)
2084 midl_user_free(EncryptedOldValue);
2085
2086 return Status;
2087}
struct _LSAPR_CR_CIPHER_VALUE LSAPR_CR_CIPHER_VALUE
NTSTATUS WINAPI LsarSetSecret(LSAPR_HANDLE SecretHandle, PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue, PLSAPR_CR_CIPHER_VALUE EncryptedOldValue)
Definition: lsarpc.c:2146
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: xxhash.c:193

◆ LsaSetSecurityObject()

NTSTATUS WINAPI LsaSetSecurityObject ( IN LSA_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
IN PSECURITY_DESCRIPTOR  SecurityDescriptor 
)

Definition at line 2095 of file lsa.c.

2098{
2099 LSAPR_SR_SECURITY_DESCRIPTOR SdBuffer = {0, NULL};
2100 ULONG SdLength = 0;
2102
2103 TRACE("LsaSetSecurityObject(%p %lx %p)\n",
2105
2107 NULL,
2108 &SdLength);
2111
2112 SdBuffer.SecurityDescriptor = MIDL_user_allocate(SdLength);
2113 if (SdBuffer.SecurityDescriptor == NULL)
2115
2118 &SdLength);
2119 if (!NT_SUCCESS(Status))
2120 goto done;
2121
2122 SdBuffer.Length = SdLength;
2123
2125 {
2128 &SdBuffer);
2129 }
2131 {
2133 }
2135
2136done:
2137 if (SdBuffer.SecurityDescriptor != NULL)
2139
2140 return Status;
2141}
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
NTSTATUS WINAPI LsarSetSecurityObject(LSAPR_HANDLE ObjectHandle, SECURITY_INFORMATION SecurityInformation, PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
Definition: lsarpc.c:323
NTSYSAPI NTSTATUS NTAPI RtlMakeSelfRelativeSD(_In_ PSECURITY_DESCRIPTOR AbsoluteSD, _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Inout_ PULONG BufferLength)
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69

◆ LsaSetSystemAccessAccount()

NTSTATUS WINAPI LsaSetSystemAccessAccount ( IN LSA_HANDLE  AccountHandle,
IN ULONG  SystemAccess 
)

Definition at line 2149 of file lsa.c.

2151{
2153
2154 TRACE("LsaSetSystemAccessAccount(%p 0x%lx)\n",
2155 AccountHandle, SystemAccess);
2156
2158 {
2160 SystemAccess);
2161 }
2163 {
2165 }
2167
2168 return Status;
2169}
NTSTATUS WINAPI LsarSetSystemAccessAccount(LSAPR_HANDLE AccountHandle, ACCESS_MASK SystemAccess)
Definition: lsarpc.c:2012

◆ LsaSetTrustedDomainInfoByName()

NTSTATUS WINAPI LsaSetTrustedDomainInfoByName ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  TrustedDomainName,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
IN PVOID  Buffer 
)

Definition at line 2177 of file lsa.c.

2181{
2182 FIXME("LsaSetTrustedDomainInfoByName(%p %p %d %p) stub\n",
2183 PolicyHandle, TrustedDomainName, InformationClass, Buffer);
2184 return STATUS_SUCCESS;
2185}

◆ LsaSetTrustedDomainInformation()

NTSTATUS WINAPI LsaSetTrustedDomainInformation ( IN LSA_HANDLE  PolicyHandle,
IN PSID  TrustedDomainSid,
IN TRUSTED_INFORMATION_CLASS  InformationClass,
IN PVOID  Buffer 
)

Definition at line 2193 of file lsa.c.

2197{
2198 FIXME("LsaSetTrustedDomainInformation(%p %p %d %p) stub\n",
2199 PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
2200 return STATUS_SUCCESS;
2201}

◆ LsaStorePrivateData()

NTSTATUS WINAPI LsaStorePrivateData ( IN LSA_HANDLE  PolicyHandle,
IN PLSA_UNICODE_STRING  KeyName,
IN PLSA_UNICODE_STRING PrivateData  OPTIONAL 
)

Definition at line 2209 of file lsa.c.

2212{
2213 PLSAPR_CR_CIPHER_VALUE EncryptedData = NULL;
2216
2217 TRACE("LsaStorePrivateData(%p %p %p)\n",
2218 PolicyHandle, KeyName, PrivateData);
2219
2220 if (PrivateData != NULL)
2221 {
2222 BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + PrivateData->MaximumLength;
2223 EncryptedData = midl_user_allocate(BufferSize);
2224 if (EncryptedData == NULL)
2225 {
2227 goto done;
2228 }
2229
2230 EncryptedData->Length = PrivateData->Length;
2231 EncryptedData->MaximumLength = PrivateData->MaximumLength;
2232 EncryptedData->Buffer = (BYTE *)(EncryptedData + 1);
2233 if (EncryptedData->Buffer != NULL)
2234 RtlCopyMemory(EncryptedData->Buffer,
2235 PrivateData->Buffer,
2236 PrivateData->Length);
2237 }
2238
2240 {
2243 EncryptedData);
2244 }
2246 {
2248 }
2250
2251done:
2252 if (EncryptedData != NULL)
2253 midl_user_free(EncryptedData);
2254
2255 return Status;
2256}
NTSTATUS WINAPI LsarStorePrivateData(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING KeyName, PLSAPR_CR_CIPHER_VALUE EncryptedData)
Definition: lsarpc.c:3462

Referenced by ScmSetServicePassword().

◆ PLSAPR_SERVER_NAME_bind()

handle_t __RPC_USER PLSAPR_SERVER_NAME_bind ( PLSAPR_SERVER_NAME  pszSystemName)

Definition at line 45 of file lsa.c.

46{
48 LPWSTR pszStringBinding;
50
51 TRACE("PLSAPR_SERVER_NAME_bind() called\n");
52
54 L"ncacn_np",
55 pszSystemName,
56 L"\\pipe\\lsarpc",
57 NULL,
58 &pszStringBinding);
59 if (status)
60 {
61 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
62 return NULL;
63 }
64
65 /* Set the binding handle that will be used to bind to the server. */
66 status = RpcBindingFromStringBindingW(pszStringBinding,
67 &hBinding);
68 if (status)
69 {
70 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
71 }
72
73 status = RpcStringFreeW(&pszStringBinding);
74 if (status)
75 {
76 TRACE("RpcStringFree returned 0x%x\n", status);
77 }
78
79 return hBinding;
80}
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
long RPC_STATUS
Definition: rpc.h:52
Definition: ps.c:97

◆ PLSAPR_SERVER_NAME_unbind()

void __RPC_USER PLSAPR_SERVER_NAME_unbind ( PLSAPR_SERVER_NAME  pszSystemName,
handle_t  hBinding 
)

Definition at line 85 of file lsa.c.

87{
89
90 TRACE("PLSAPR_SERVER_NAME_unbind() called\n");
91
93 if (status)
94 {
95 TRACE("RpcBindingFree returned 0x%x\n", status);
96 }
97}
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( advapi  )