ReactOS  0.4.13-dev-235-g7373cb3
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 103 of file lsa.c.

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

Referenced by AddImpersonatePrivilege(), and InstallPrivileges().

◆ LsaAddPrivilegesToAccount()

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

Definition at line 139 of file lsa.c.

141 {
143 
144  TRACE("LsaAddPrivilegesToAccount(%p %p)\n",
145  AccountHandle, PrivilegeSet);
146 
148  {
150  (PLSAPR_PRIVILEGE_SET)PrivilegeSet);
151  }
153  {
155  }
156  RpcEndExcept;
157 
158  return Status;
159 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarAddPrivilegesToAccount(LSAPR_HANDLE AccountHandle, PLSAPR_PRIVILEGE_SET Privileges)
Definition: lsarpc.c:1563
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaClearAuditLog()

NTSTATUS WINAPI LsaClearAuditLog ( IN LSA_HANDLE  PolicyHandle)

Definition at line 167 of file lsa.c.

168 {
170 
171  TRACE("LsaClearAuditLog(%p)\n", PolicyHandle);
172 
174  {
175  Status = LsarClearAuditLog((LSAPR_HANDLE)PolicyHandle);
176  }
178  {
180  }
181  RpcEndExcept;
182 
183  return Status;
184 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI LsarClearAuditLog(LSAPR_HANDLE ObjectHandle)
Definition: lsarpc.c:804
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaClose()

NTSTATUS WINAPI LsaClose ( IN LSA_HANDLE  ObjectHandle)

Definition at line 192 of file lsa.c.

193 {
195 
196  TRACE("LsaClose(%p) called\n", ObjectHandle);
197 
199  {
200  Status = LsarClose((PLSAPR_HANDLE)&ObjectHandle);
201  }
203  {
205  }
206  RpcEndExcept;
207 
208  return Status;
209 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarClose(LSAPR_HANDLE *ObjectHandle)
Definition: lsarpc.c:125
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by AccRewriteSetEntriesInAcl(), AddImpersonatePrivilege(), BuildSidListFromDomainAndName(), CleanupSidCacheMgr(), CreateSidCacheMgr(), fill_sid(), GetAccountDomainSid(), GetComputerObjectNameW(), InstallBuiltinAccounts(), InstallPrivileges(), LookupAccountNameW(), LookupAccountSidW(), LookupPrivilegeDisplayNameW(), LookupPrivilegeNameW(), LookupPrivilegeValueW(), NetLocalGroupGetMembers(), NetWkstaGetInfo(), NetWkstaUserGetInfo(), SampGetAccountDomainInfo(), ScmSetServicePassword(), SetAccountsDomainSid(), SetAdministratorPassword(), SetPrimaryDomain(), test_lsa(), test_LsaLookupNames2(), and test_LsaLookupSids().

◆ LsaCreateAccount()

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

Definition at line 217 of file lsa.c.

221 {
223 
224  TRACE("LsaCreateAccount(%p %p 0x%08lx %p)\n",
225  PolicyHandle, AccountSid, DesiredAccess, AccountHandle);
226 
228  {
229  Status = LsarCreateAccount((LSAPR_HANDLE)PolicyHandle,
230  AccountSid,
232  AccountHandle);
233  }
235  {
237  }
238  RpcEndExcept;
239 
240  return Status;
241 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarCreateAccount(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *AccountHandle)
Definition: lsarpc.c:883
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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 249 of file lsa.c.

253 {
255 
256  TRACE("LsaCreateSecret(%p %p 0x%08lx %p)\n",
257  PolicyHandle, SecretName, DesiredAccess, SecretHandle);
258 
260  {
261  Status = LsarCreateSecret((LSAPR_HANDLE)PolicyHandle,
262  (PRPC_UNICODE_STRING)SecretName,
264  SecretHandle);
265  }
267  {
269  }
270  RpcEndExcept;
271 
272  return Status;
273 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarCreateSecret(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING SecretName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *SecretHandle)
Definition: lsarpc.c:1319
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaCreateTrustedDomain()

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

Definition at line 281 of file lsa.c.

285 {
287 
288  TRACE("LsaCreateTrustedDomain(%p %p 0x%08lx %p)\n",
289  PolicyHandle, TrustedDomainInformation, DesiredAccess, TrustedDomainHandle);
290 
292  {
294  (PLSAPR_TRUST_INFORMATION)TrustedDomainInformation,
296  (PLSAPR_HANDLE)TrustedDomainHandle);
297  }
299  {
301  }
302  RpcEndExcept;
303 
304  return Status;
305 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarCreateTrustedDomain(LSAPR_HANDLE PolicyHandle, PLSAPR_TRUST_INFORMATION TrustedDomainInformation, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:1158
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 313 of file lsa.c.

318 {
321 
322  TRACE("LsaCreateTrustedDomainEx(%p %p %p 0x%08lx %p) stub\n",
323  PolicyHandle, TrustedDomainInformation, AuthenticationInformation,
324  DesiredAccess, TrustedDomainHandle);
325 
327  {
328  /* FIXME: Encrypt AuthenticationInformation */
329 
331  (PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX)TrustedDomainInformation,
332  EncryptedAuthInfo,
334  (PLSAPR_HANDLE)TrustedDomainHandle);
335  }
337  {
339  }
340  RpcEndExcept;
341 
342  return Status;
343 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaDelete()

NTSTATUS WINAPI LsaDelete ( IN LSA_HANDLE  ObjectHandle)

Definition at line 351 of file lsa.c.

352 {
354 
355  TRACE("LsaDelete(%p)\n", ObjectHandle);
356 
358  {
359  Status = LsarDelete((LSAPR_HANDLE)ObjectHandle);
360  }
362  {
364  }
365  RpcEndExcept;
366 
367  return Status;
368 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarDelete(LSAPR_HANDLE ObjectHandle)
Definition: lsarpc.c:154
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaDeleteTrustedDomain()

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

Definition at line 376 of file lsa.c.

378 {
380 
381  TRACE("LsaDeleteTrustedDomain(%p %p)\n",
382  PolicyHandle, TrustedDomainSid);
383 
385  {
387  TrustedDomainSid);
388  }
390  {
392  }
393  RpcEndExcept;
394 
395  return Status;
396 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarDeleteTrustedDomain(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid)
Definition: lsarpc.c:3446
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaEnumerateAccountRights()

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

Definition at line 404 of file lsa.c.

408 {
409  LSAPR_USER_RIGHT_SET UserRightsSet;
411 
412  TRACE("LsaEnumerateAccountRights(%p %p %p %p)\n",
413  PolicyHandle, AccountSid, UserRights, CountOfRights);
414 
415  UserRightsSet.Entries = 0;
416  UserRightsSet.UserRights = NULL;
417 
419  {
421  AccountSid,
422  &UserRightsSet);
423 
424  *UserRights = (PUNICODE_STRING)UserRightsSet.UserRights;
425  *CountOfRights = UserRightsSet.Entries;
426  }
428  {
430 
431  if (UserRightsSet.UserRights != NULL)
432  MIDL_user_free(UserRightsSet.UserRights);
433  }
434  RpcEndExcept;
435 
436  return Status;
437 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarEnumerateAccountRights(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, PLSAPR_USER_RIGHT_SET UserRights)
Definition: lsarpc.c:2853
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
PRPC_UNICODE_STRING UserRights
Definition: lsa.idl:393
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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 445 of file lsa.c.

450 {
451  LSAPR_ACCOUNT_ENUM_BUFFER AccountEnumBuffer;
453 
454  TRACE("LsaEnumerateAccounts(%p %p %p %lu %p)\n",
455  PolicyHandle, EnumerationContext, Buffer,
456  PreferedMaximumLength, CountReturned);
457 
458  AccountEnumBuffer.EntriesRead = 0;
459  AccountEnumBuffer.Information = NULL;
460 
462  {
463  Status = LsarEnumerateAccounts((LSAPR_HANDLE)PolicyHandle,
464  EnumerationContext,
465  &AccountEnumBuffer,
466  PreferedMaximumLength);
467 
468  *Buffer = AccountEnumBuffer.Information;
469  *CountReturned = AccountEnumBuffer.EntriesRead;
470  }
472  {
473  if (AccountEnumBuffer.Information != NULL)
474  MIDL_user_free(AccountEnumBuffer.Information);
475 
477  }
478  RpcEndExcept;
479 
480  return Status;
481 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
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
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaEnumerateAccountsWithUserRight()

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

Definition at line 489 of file lsa.c.

493 {
494  LSAPR_ACCOUNT_ENUM_BUFFER AccountEnumBuffer;
496 
497  TRACE("LsaEnumerateAccountsWithUserRight(%p %p %p %p) stub\n",
498  PolicyHandle, UserRight, Buffer, CountReturned);
499 
500  AccountEnumBuffer.EntriesRead = 0;
501  AccountEnumBuffer.Information = NULL;
502 
504  {
506  (PRPC_UNICODE_STRING)UserRight,
507  &AccountEnumBuffer);
508 
509  *Buffer = AccountEnumBuffer.Information;
510  *CountReturned = AccountEnumBuffer.EntriesRead;
511  }
513  {
514  if (AccountEnumBuffer.Information != NULL)
515  MIDL_user_free(AccountEnumBuffer.Information);
516 
518  }
519  RpcEndExcept;
520 
521  return Status;
522 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
PLSAPR_ACCOUNT_INFORMATION Information
Definition: lsa.idl:97
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
NTSTATUS WINAPI LsarEnumerateAccountsWithUserRight(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING UserRight, PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer)
Definition: lsarpc.c:2574
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 530 of file lsa.c.

535 {
536  LSAPR_PRIVILEGE_ENUM_BUFFER PrivilegeEnumBuffer;
538 
539  TRACE("LsaEnumeratePrivileges(%p %p %p %lu %p)\n",
540  PolicyHandle, EnumerationContext, Buffer,
541  PreferedMaximumLength, CountReturned);
542 
543  PrivilegeEnumBuffer.Entries = 0;
544  PrivilegeEnumBuffer.Privileges = NULL;
545 
547  {
549  EnumerationContext,
550  &PrivilegeEnumBuffer,
551  PreferedMaximumLength);
552 
553  *Buffer = PrivilegeEnumBuffer.Privileges;
554  *CountReturned = PrivilegeEnumBuffer.Entries;
555 
556  }
558  {
559  if (PrivilegeEnumBuffer.Privileges != NULL)
560  MIDL_user_free(PrivilegeEnumBuffer.Privileges);
561 
563  }
564  RpcEndExcept;
565 
566  return Status;
567 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI LsarEnumeratePrivileges(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:166
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
PLSAPR_POLICY_PRIVILEGE_DEF Privileges
Definition: lsa.idl:88
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaEnumeratePrivilegesOfAccount()

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

Definition at line 575 of file lsa.c.

577 {
579 
580  TRACE("LsaEnumeratePrivilegesOfAccount(%p %p)\n",
581  AccountHandle, Privileges);
582 
584  {
587  }
589  {
591  }
592  RpcEndExcept;
593 
594  return Status;
595 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarEnumeratePrivilegesAccount(LSAPR_HANDLE AccountHandle, PLSAPR_PRIVILEGE_SET *Privileges)
Definition: lsarpc.c:1504
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 603 of file lsa.c.

608 {
609  LSAPR_TRUSTED_ENUM_BUFFER TrustedEnumBuffer;
611 
612  TRACE("LsaEnumerateTrustedDomains(%p %p %p %lu %p)\n",
613  PolicyHandle, EnumerationContext, Buffer,
614  PreferedMaximumLength, CountReturned);
615 
616  if (Buffer == NULL)
618 
619  TrustedEnumBuffer.EntriesRead = 0;
620  TrustedEnumBuffer.Information = NULL;
621 
623  {
625  EnumerationContext,
626  &TrustedEnumBuffer,
627  PreferedMaximumLength);
628 
629  *Buffer = TrustedEnumBuffer.Information;
630  *CountReturned = TrustedEnumBuffer.EntriesRead;
631 
632  }
634  {
635  if (TrustedEnumBuffer.Information != NULL)
636  MIDL_user_free(TrustedEnumBuffer.Information);
637 
639  }
640  RpcEndExcept;
641 
642  return Status;
643 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarEnumerateTrustedDomains(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:1176
Status
Definition: gdiplustypes.h:24
PLSAPR_TRUST_INFORMATION Information
Definition: lsa.idl:344
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 651 of file lsa.c.

656 {
657  LSAPR_TRUSTED_ENUM_BUFFER_EX TrustedEnumBuffer;
659 
660  TRACE("LsaEnumerateTrustedDomainsEx(%p %p %p %lu %p)\n",
661  PolicyHandle, EnumerationContext, Buffer,
662  PreferedMaximumLength, CountReturned);
663 
664  if (Buffer == NULL)
666 
667  TrustedEnumBuffer.EntriesRead = 0;
668  TrustedEnumBuffer.EnumerationBuffer = NULL;
669 
671  {
673  EnumerationContext,
674  &TrustedEnumBuffer,
675  PreferedMaximumLength);
676 
677  *Buffer = TrustedEnumBuffer.EnumerationBuffer;
678  *CountReturned = TrustedEnumBuffer.EntriesRead;
679 
680  }
682  {
683  if (TrustedEnumBuffer.EnumerationBuffer != NULL)
684  MIDL_user_free(TrustedEnumBuffer.EnumerationBuffer);
685 
687  }
688  RpcEndExcept;
689 
690  return Status;
691 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX EnumerationBuffer
Definition: lsa.idl:442
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarEnumerateTrustedDomainsEx(LSAPR_HANDLE PolicyHandle, DWORD *EnumerationContext, PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: lsarpc.c:3816
Status
Definition: gdiplustypes.h:24
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaFreeMemory()

◆ LsaGetQuotasForAccount()

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

Definition at line 711 of file lsa.c.

713 {
715 
716  TRACE("LsaGetQuotasForAccount(%p %p)\n",
717  AccountHandle, QuotaLimits);
718 
720  {
722  QuotaLimits);
723  }
725  {
727  }
728  RpcEndExcept;
729 
730  return Status;
731 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarGetQuotasForAccount(LSAPR_HANDLE AccountHandle, PQUOTA_LIMITS QuotaLimits)
Definition: lsarpc.c:1878
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaGetRemoteUserName()

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

Definition at line 739 of file lsa.c.

742 {
743  PRPC_UNICODE_STRING UserNameString = NULL;
744  PRPC_UNICODE_STRING DomainNameString = NULL;
746 
747  TRACE("LsaGetRemoteUserName(%s %p %p)\n",
748  SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
749  UserName, DomainName);
750 
752  {
754  &UserNameString,
755  (DomainName != NULL) ? &DomainNameString : NULL);
756 
757  *UserName = (PLSA_UNICODE_STRING)UserNameString;
758 
759  if (DomainName != NULL)
760  *DomainName = (PLSA_UNICODE_STRING)DomainNameString;
761  }
763  {
764  if (UserNameString != NULL)
765  MIDL_user_free(UserNameString);
766 
767  if (DomainNameString != NULL)
768  MIDL_user_free(DomainNameString);
769 
771  }
772  RpcEndExcept;
773 
774  return Status;
775 }
#define RpcEndExcept
Definition: rpc.h:128
LPWSTR PLSAPR_SERVER_NAME
Definition: lsa.idl:7
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarGetUserName(LPWSTR SystemName, PRPC_UNICODE_STRING *UserName, PRPC_UNICODE_STRING *DomainName)
Definition: lsarpc.c:3739
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
struct _LSA_UNICODE_STRING * PLSA_UNICODE_STRING
Status
Definition: gdiplustypes.h:24
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaGetSystemAccessAccount()

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

Definition at line 783 of file lsa.c.

785 {
787 
788  TRACE("LsaGetSystemAccessAccount(%p %p)\n",
789  AccountHandle, SystemAccess);
790 
792  {
794  (ACCESS_MASK *)SystemAccess);
795  }
797  {
799  }
800  RpcEndExcept;
801 
802  return Status;
803 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI LsarGetSystemAccessAccount(LSAPR_HANDLE AccountHandle, ACCESS_MASK *SystemAccess)
Definition: lsarpc.c:1977
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaGetUserName()

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

Definition at line 811 of file lsa.c.

813 {
814  PRPC_UNICODE_STRING UserNameString = NULL;
815  PRPC_UNICODE_STRING DomainNameString = NULL;
817 
818  TRACE("LsaGetUserName(%p %p)\n",
819  UserName, DomainName);
820 
822  {
824  &UserNameString,
825  (DomainName != NULL) ? &DomainNameString : NULL);
826 
827  *UserName = (PUNICODE_STRING)UserNameString;
828 
829  if (DomainName != NULL)
830  *DomainName = (PUNICODE_STRING)DomainNameString;
831  }
833  {
834  if (UserNameString != NULL)
835  MIDL_user_free(UserNameString);
836 
837  if (DomainNameString != NULL)
838  MIDL_user_free(DomainNameString);
839 
841  }
842  RpcEndExcept;
843 
844  return Status;
845 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarGetUserName(LPWSTR SystemName, PRPC_UNICODE_STRING *UserName, PRPC_UNICODE_STRING *DomainName)
Definition: lsarpc.c:3739
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 853 of file lsa.c.

858 {
859  LSAPR_TRANSLATED_SIDS TranslatedSids = {0, NULL};
860  ULONG MappedCount = 0;
862 
863  TRACE("LsaLookupNames(%p %lu %p %p %p)\n",
864  PolicyHandle, Count, Names, ReferencedDomains, Sids);
865 
866  if (ReferencedDomains == NULL || Sids == NULL)
868 
870  {
871  *ReferencedDomains = NULL;
872  *Sids = NULL;
873 
874  TranslatedSids.Entries = Count;
875 
876  Status = LsarLookupNames((LSAPR_HANDLE)PolicyHandle,
877  Count,
879  (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
880  &TranslatedSids,
882  &MappedCount);
883 
884  *Sids = (PLSA_TRANSLATED_SID)TranslatedSids.Sids;
885  }
887  {
888  if (TranslatedSids.Sids != NULL)
889  MIDL_user_free(TranslatedSids.Sids);
890 
892  }
893  RpcEndExcept;
894 
895  return Status;
896 }
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
PLSA_TRANSLATED_SID Sids
Definition: lsa.idl:144
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
struct _LSA_TRANSLATED_SID * PLSA_TRANSLATED_SID
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
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
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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 904 of file lsa.c.

910 {
911  LSAPR_TRANSLATED_SIDS_EX2 TranslatedSids = {0, NULL};
912  ULONG MappedCount = 0;
914 
915  TRACE("LsaLookupNames2(%p 0x%08x %lu %p %p %p)\n",
916  PolicyHandle, Flags, Count, Names, ReferencedDomains, Sids);
917 
918  if (ReferencedDomains == NULL || Sids == NULL)
920 
922  {
923  *ReferencedDomains = NULL;
924  *Sids = NULL;
925 
926  TranslatedSids.Entries = Count;
927 
928  Status = LsarLookupNames3((LSAPR_HANDLE)PolicyHandle,
929  Count,
931  (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
932  &TranslatedSids,
934  &MappedCount,
935  Flags,
936  2);
937 
938  *Sids = (PLSA_TRANSLATED_SID2)TranslatedSids.Sids;
939  }
941  {
942  if (TranslatedSids.Sids != NULL)
943  MIDL_user_free(TranslatedSids.Sids);
944 
946  }
947  RpcEndExcept;
948 
949  return Status;
950 }
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
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
struct _LSA_TRANSLATED_SID2 * PLSA_TRANSLATED_SID2
PLSAPR_TRANSLATED_SID_EX2 Sids
Definition: lsa.idl:210
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by AccpLookupSidByName(), 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 958 of file lsa.c.

962 {
963  PRPC_UNICODE_STRING DisplayNameBuffer = NULL;
965 
966  TRACE("LsaLookupPrivilegeDisplayName(%p %p %p %p)\n",
967  PolicyHandle, Name, DisplayName, LanguageReturned);
968 
970  {
971  Status = LsarLookupPrivilegeDisplayName(PolicyHandle,
975  &DisplayNameBuffer,
976  LanguageReturned);
977 
978  *DisplayName = (PUNICODE_STRING)DisplayNameBuffer;
979  }
981  {
982  if (DisplayNameBuffer != NULL)
983  MIDL_user_free(DisplayNameBuffer);
984 
986  }
987  RpcEndExcept;
988 
989  return Status;
990 }
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: lang.c:806
#define RpcEndExcept
Definition: rpc.h:128
LANGID WINAPI GetSystemDefaultUILanguage(void)
Definition: lang.c:826
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
NTSTATUS WINAPI LsarLookupPrivilegeDisplayName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING Name, USHORT ClientLanguage, USHORT ClientSystemDefaultLanguage, PRPC_UNICODE_STRING *DisplayName, USHORT *LanguageReturned)
Definition: lsarpc.c:2494
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by LookupPrivilegeDisplayNameW().

◆ LsaLookupPrivilegeName()

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

Definition at line 998 of file lsa.c.

1001 {
1002  PRPC_UNICODE_STRING NameBuffer = NULL;
1003  NTSTATUS Status;
1004 
1005  TRACE("LsaLookupPrivilegeName(%p %p %p)\n",
1006  PolicyHandle, Value, Name);
1007 
1008  RpcTryExcept
1009  {
1010  Status = LsarLookupPrivilegeName(PolicyHandle,
1011  Value,
1012  &NameBuffer);
1013 
1014  *Name = (PUNICODE_STRING)NameBuffer;
1015  }
1017  {
1018  if (NameBuffer != NULL)
1019  MIDL_user_free(NameBuffer);
1020 
1022  }
1023  RpcEndExcept;
1024 
1025  return Status;
1026 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarLookupPrivilegeName(LSAPR_HANDLE PolicyHandle, PLUID Value, PRPC_UNICODE_STRING *Name)
Definition: lsarpc.c:2464
Status
Definition: gdiplustypes.h:24
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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 1034 of file lsa.c.

1037 {
1038  LUID Luid;
1039  NTSTATUS Status;
1040 
1041  TRACE("LsaLookupPrivilegeValue(%p %p %p)\n",
1042  PolicyHandle, Name, Value);
1043 
1044  RpcTryExcept
1045  {
1046  Status = LsarLookupPrivilegeValue(PolicyHandle,
1048  &Luid);
1049  if (Status == STATUS_SUCCESS)
1050  *Value = Luid;
1051  }
1053  {
1055  }
1056  RpcEndExcept;
1057 
1058  return Status;
1059 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
return STATUS_SUCCESS
Definition: btrfs.c:2745
#define RpcExcept(expr)
Definition: rpc.h:127
NTSTATUS WINAPI LsarLookupPrivilegeValue(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING Name, PLUID Value)
Definition: lsarpc.c:2428
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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 1067 of file lsa.c.

1072 {
1073  LSAPR_SID_ENUM_BUFFER SidEnumBuffer;
1074  LSAPR_TRANSLATED_NAMES TranslatedNames;
1075  ULONG MappedCount = 0;
1076  NTSTATUS Status;
1077 
1078  TRACE("LsaLookupSids(%p %lu %p %p %p)\n",
1079  PolicyHandle, Count, Sids, ReferencedDomains, Names);
1080 
1081  if (Count == 0)
1082  return STATUS_INVALID_PARAMETER;
1083 
1084  SidEnumBuffer.Entries = Count;
1085  SidEnumBuffer.SidInfo = (PLSAPR_SID_INFORMATION)Sids;
1086 
1087  RpcTryExcept
1088  {
1089  *ReferencedDomains = NULL;
1090  *Names = NULL;
1091 
1092  TranslatedNames.Entries = 0;
1093  TranslatedNames.Names = NULL;
1094 
1095  Status = LsarLookupSids((LSAPR_HANDLE)PolicyHandle,
1096  &SidEnumBuffer,
1097  (PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
1098  &TranslatedNames,
1100  &MappedCount);
1101 
1102  *Names = (PLSA_TRANSLATED_NAME)TranslatedNames.Names;
1103  }
1105  {
1106  if (TranslatedNames.Names != NULL)
1107  {
1108  MIDL_user_free(TranslatedNames.Names);
1109  }
1110 
1112  }
1113  RpcEndExcept;
1114 
1115  return Status;
1116 }
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
PLSAPR_TRANSLATED_NAME Names
Definition: lsa.idl:174
Status
Definition: gdiplustypes.h:24
struct _LSAPR_SID_INFORMATION * PLSAPR_SID_INFORMATION
struct _LSA_TRANSLATED_NAME * PLSA_TRANSLATED_NAME
unsigned int ULONG
Definition: retypes.h:1
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
PLSAPR_SID_INFORMATION SidInfo
Definition: lsa.idl:163
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

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

◆ LsaNtStatusToWinError()

ULONG WINAPI LsaNtStatusToWinError ( IN NTSTATUS  Status)

Definition at line 1129 of file lsa.c.

1130 {
1131  TRACE("LsaNtStatusToWinError(0x%lx)\n", Status);
1132  return RtlNtStatusToDosError(Status);
1133 }
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

Referenced by AccpLookupSidByName(), AccpOpenLSAPolicyHandle(), DsRolepGetBasicInfo(), GetComputerObjectNameW(), LookupAccountNameW(), LookupAccountSidW(), LookupPrivilegeDisplayNameW(), LookupPrivilegeNameW(), LookupPrivilegeValueW(), NetWkstaGetInfo(), NetWkstaUserGetInfo(), OpenLSAPolicyHandle(), and WinMain().

◆ LsaOpenAccount()

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

Definition at line 1141 of file lsa.c.

1145 {
1146  NTSTATUS Status;
1147 
1148  TRACE("LsaOpenAccount(%p %p 0x%08lx %p)\n",
1149  PolicyHandle, AccountSid, DesiredAccess, AccountHandle);
1150 
1151  RpcTryExcept
1152  {
1153  Status = LsarOpenAccount((LSAPR_HANDLE)PolicyHandle,
1154  AccountSid,
1155  DesiredAccess,
1156  AccountHandle);
1157  }
1159  {
1161  }
1162  RpcEndExcept;
1163 
1164  return Status;
1165 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarOpenAccount(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *AccountHandle)
Definition: lsarpc.c:1465
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 1181 of file lsa.c.

1185 {
1186  NTSTATUS Status;
1187 
1188  TRACE("LsaOpenPolicy(%s %p 0x%08lx %p)\n",
1189  SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
1190  ObjectAttributes, DesiredAccess, PolicyHandle);
1191 
1192  /* FIXME: RPC should take care of this */
1193  if (!LsapIsLocalComputer(SystemName))
1195 
1196  RpcTryExcept
1197  {
1198  *PolicyHandle = NULL;
1199 
1200  Status = LsarOpenPolicy(SystemName ? SystemName->Buffer : NULL,
1202  DesiredAccess,
1203  PolicyHandle);
1204  }
1206  {
1208  }
1209  RpcEndExcept;
1210 
1211  TRACE("LsaOpenPolicy() done (Status: 0x%08lx)\n", Status);
1212 
1213  return Status;
1214 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
static BOOL LsapIsLocalComputer(PLSA_UNICODE_STRING ServerName)
Definition: lsa.c:21
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
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:982
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by AccpOpenLSAPolicyHandle(), AddImpersonatePrivilege(), BuildSidListFromDomainAndName(), fill_sid(), GetAccountDomainSid(), GetComputerObjectNameW(), InstallBuiltinAccounts(), InstallPrivileges(), LookupAccountNameW(), LookupAccountSidW(), LookupPrivilegeDisplayNameW(), LookupPrivilegeNameW(), LookupPrivilegeValueW(), NetLocalGroupGetMembers(), NetWkstaGetInfo(), 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 1222 of file lsa.c.

1226 {
1227  NTSTATUS Status;
1228 
1229  TRACE("LsaOpenPolicySce(%s %p 0x%08lx %p)\n",
1230  SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
1231  ObjectAttributes, DesiredAccess, PolicyHandle);
1232 
1233  /* FIXME: RPC should take care of this */
1234  if (!LsapIsLocalComputer(SystemName))
1236 
1237  RpcTryExcept
1238  {
1239  *PolicyHandle = NULL;
1240 
1241  Status = LsarOpenPolicySce(SystemName ? SystemName->Buffer : NULL,
1243  DesiredAccess,
1244  PolicyHandle);
1245  }
1247  {
1249  }
1250  RpcEndExcept;
1251 
1252  TRACE("LsaOpenPolicySce() done (Status: 0x%08lx)\n", Status);
1253 
1254  return Status;
1255 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
static BOOL LsapIsLocalComputer(PLSA_UNICODE_STRING ServerName)
Definition: lsa.c:21
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI LsarOpenPolicySce(LPWSTR SystemName, PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *PolicyHandle)
Definition: lsarpc.c:4346
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:982
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaOpenSecret()

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

Definition at line 1263 of file lsa.c.

1267 {
1268  NTSTATUS Status;
1269 
1270  TRACE("LsaOpenSecret(%p %p 0x%08lx %p)\n",
1271  PolicyHandle, SecretName, DesiredAccess, SecretHandle);
1272 
1273  RpcTryExcept
1274  {
1275  *SecretHandle = NULL;
1276 
1277  Status = LsarOpenSecret((LSAPR_HANDLE)PolicyHandle,
1278  (PRPC_UNICODE_STRING)SecretName,
1279  DesiredAccess,
1280  SecretHandle);
1281  }
1283  {
1285  }
1286  RpcEndExcept;
1287 
1288  TRACE("LsaOpenSecret() done (Status: 0x%08lx)\n", Status);
1289 
1290  return Status;
1291 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarOpenSecret(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING SecretName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *SecretHandle)
Definition: lsarpc.c:2090
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaOpenTrustedDomain()

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

Definition at line 1299 of file lsa.c.

1303 {
1304  NTSTATUS Status;
1305 
1306  TRACE("LsaOpenTrustedDomain(%p %p 0x%08lx %p)\n",
1307  PolicyHandle, TrustedDomainSid, DesiredAccess, TrustedDomainHandle);
1308 
1309  RpcTryExcept
1310  {
1311  Status = LsarOpenTrustedDomain((LSAPR_HANDLE)PolicyHandle,
1312  (PRPC_SID)TrustedDomainSid,
1313  DesiredAccess,
1314  (PLSAPR_HANDLE)TrustedDomainHandle);
1315  }
1317  {
1319  }
1320  RpcEndExcept;
1321 
1322  return Status;
1323 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarOpenTrustedDomain(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:2046
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaOpenTrustedDomainByName()

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

Definition at line 1331 of file lsa.c.

1335 {
1336  NTSTATUS Status;
1337 
1338  TRACE("LsaOpenTrustedDomainByName(%p %p 0x%08lx %p)\n",
1339  PolicyHandle, TrustedDomainName, DesiredAccess, TrustedDomainHandle);
1340 
1341  RpcTryExcept
1342  {
1344  (PRPC_UNICODE_STRING)TrustedDomainName,
1345  DesiredAccess,
1346  TrustedDomainHandle);
1347  }
1349  {
1351  }
1352  RpcEndExcept;
1353 
1354  return Status;
1355 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI LsarOpenTrustedDomainByName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, ACCESS_MASK DesiredAccess, LSAPR_HANDLE *TrustedDomainHandle)
Definition: lsarpc.c:3892
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsapIsLocalComputer()

static BOOL LsapIsLocalComputer ( PLSA_UNICODE_STRING  ServerName)
static

Definition at line 21 of file lsa.c.

22 {
24  BOOL Result;
25  LPWSTR buf;
26 
27  if (ServerName == NULL || ServerName->Length == 0 || ServerName->Buffer == NULL)
28  return TRUE;
29 
30  buf = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
32  if (Result && (ServerName->Buffer[0] == '\\') && (ServerName->Buffer[1] == '\\'))
33  ServerName += 2;
34  Result = Result && !lstrcmpW(ServerName->Buffer, buf);
36 
37  return Result;
38 }
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:440
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
_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:426
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

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 1363 of file lsa.c.

1366 {
1367  PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation = NULL;
1368  NTSTATUS Status;
1369 
1370  TRACE("LsaQueryDomainInformationPolicy(%p %lu %p)\n",
1371  PolicyHandle, InformationClass, Buffer);
1372 
1373  RpcTryExcept
1374  {
1377  &PolicyInformation);
1378 
1379  *Buffer = PolicyInformation;
1380  }
1382  {
1383  if (PolicyInformation != NULL)
1384  MIDL_user_free(PolicyInformation);
1385 
1387  }
1388  RpcEndExcept;
1389 
1390  return Status;
1391 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI LsarQueryDomainInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_DOMAIN_INFORMATION *PolicyInformation)
Definition: lsarpc.c:3866
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaQueryForestTrustInformation()

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

Definition at line 1399 of file lsa.c.

1402 {
1403  NTSTATUS Status;
1404 
1405  TRACE("LsaQueryForestTrustInformation(%p %p %p)\n",
1406  PolicyHandle, TrustedDomainName, ForestTrustInfo);
1407 
1408  RpcTryExcept
1409  {
1411  TrustedDomainName,
1413  ForestTrustInfo);
1414  }
1416  {
1418  }
1419  RpcEndExcept;
1420 
1421  return Status;
1422 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaQueryInformationPolicy()

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

Definition at line 1471 of file lsa.c.

1474 {
1475  PLSAPR_POLICY_INFORMATION PolicyInformation = NULL;
1476  NTSTATUS Status;
1477 
1478  TRACE("LsaQueryInformationPolicy(%p %d %p)\n",
1479  PolicyHandle, InformationClass, Buffer);
1480 
1481  RpcTryExcept
1482  {
1485  &PolicyInformation);
1486  *Buffer = PolicyInformation;
1487  }
1489  {
1490  if (PolicyInformation != NULL)
1491  MIDL_user_free(PolicyInformation);
1492 
1494  }
1495  RpcEndExcept;
1496 
1497  TRACE("Done (Status: 0x%08x)\n", Status);
1498 
1499  return Status;
1500 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
NTSTATUS WINAPI LsarQueryInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_INFORMATION *PolicyInformation)
Definition: lsarpc.c:531
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by GetAccountDomainSid(), GetComputerObjectNameW(), LookupSidInformation(), NetWkstaGetInfo(), 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 1430 of file lsa.c.

1433 {
1434  PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation = NULL;
1435  NTSTATUS Status;
1436 
1437  TRACE("LsaQueryInfoTrustedDomain(%p %d %p) stub\n",
1438  TrustedDomainHandle, InformationClass, Buffer);
1439 
1443 
1444  RpcTryExcept
1445  {
1446  Status = LsarQueryInfoTrustedDomain((LSAPR_HANDLE)TrustedDomainHandle,
1448  &TrustedDomainInformation);
1449  *Buffer = TrustedDomainInformation;
1450  }
1452  {
1453  if (TrustedDomainInformation != NULL)
1454  MIDL_user_free(TrustedDomainInformation);
1455 
1457  }
1458  RpcEndExcept;
1459 
1460  TRACE("Done (Status: 0x%08x)\n", Status);
1461 
1462  return Status;
1463 }
NTSTATUS WINAPI LsarQueryInfoTrustedDomain(LSAPR_HANDLE TrustedDomainHandle, TRUSTED_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
Definition: lsarpc.c:2064
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 1508 of file lsa.c.

1513 {
1514  PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue = NULL;
1515  PLSAPR_CR_CIPHER_VALUE EncryptedOldValue = NULL;
1516  PLSA_UNICODE_STRING DecryptedCurrentValue = NULL;
1517  PLSA_UNICODE_STRING DecryptedOldValue = NULL;
1519  NTSTATUS Status;
1520 
1521  TRACE("LsaQuerySecret(%p %p %p %p %p)\n",
1522  SecretHandle, CurrentValue, CurrentValueSetTime,
1523  OldValue, OldValueSetTime);
1524 
1525  RpcTryExcept
1526  {
1527  Status = LsarQuerySecret((PLSAPR_HANDLE)SecretHandle,
1528  &EncryptedCurrentValue,
1529  CurrentValueSetTime,
1530  &EncryptedOldValue,
1531  OldValueSetTime);
1532  }
1534  {
1536  }
1537  RpcEndExcept;
1538 
1539  if (!NT_SUCCESS(Status))
1540  goto done;
1541 
1542  /* Decrypt the current value */
1543  if (CurrentValue != NULL)
1544  {
1545  if (EncryptedCurrentValue == NULL)
1546  {
1547  *CurrentValue = NULL;
1548  }
1549  else
1550  {
1551  /* FIXME: Decrypt the current value */
1552  BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedCurrentValue->MaximumLength;
1553  DecryptedCurrentValue = midl_user_allocate(BufferSize);
1554  if (DecryptedCurrentValue == NULL)
1555  {
1557  goto done;
1558  }
1559 
1560  DecryptedCurrentValue->Length = (USHORT)EncryptedCurrentValue->Length;
1561  DecryptedCurrentValue->MaximumLength = (USHORT)EncryptedCurrentValue->MaximumLength;
1562  DecryptedCurrentValue->Buffer = (PWSTR)(DecryptedCurrentValue + 1);
1563  RtlCopyMemory(DecryptedCurrentValue->Buffer,
1564  EncryptedCurrentValue->Buffer,
1565  EncryptedCurrentValue->Length);
1566 
1567  *CurrentValue = DecryptedCurrentValue;
1568  }
1569  }
1570 
1571  /* Decrypt the old value */
1572  if (OldValue != NULL)
1573  {
1574  if (EncryptedOldValue == NULL)
1575  {
1576  *OldValue = NULL;
1577  }
1578  else
1579  {
1580  /* FIXME: Decrypt the old value */
1581  BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedOldValue->MaximumLength;
1582  DecryptedOldValue = midl_user_allocate(BufferSize);
1583  if (DecryptedOldValue == NULL)
1584  {
1586  goto done;
1587  }
1588 
1589  DecryptedOldValue->Length = (USHORT)EncryptedOldValue->Length;
1590  DecryptedOldValue->MaximumLength = (USHORT)EncryptedOldValue->MaximumLength;
1591  DecryptedOldValue->Buffer = (PWSTR)(DecryptedOldValue + 1);
1592  RtlCopyMemory(DecryptedOldValue->Buffer,
1593  EncryptedOldValue->Buffer,
1594  EncryptedOldValue->Length);
1595 
1596  *OldValue = DecryptedOldValue;
1597  }
1598  }
1599 
1600 done:
1601  if (!NT_SUCCESS(Status))
1602  {
1603  if (DecryptedCurrentValue != NULL)
1604  midl_user_free(DecryptedCurrentValue);
1605 
1606  if (DecryptedOldValue != NULL)
1607  midl_user_free(DecryptedOldValue);
1608 
1609  if (CurrentValue != NULL)
1610  *CurrentValue = NULL;
1611 
1612  if (OldValue != NULL)
1613  *OldValue = NULL;
1614  }
1615 
1616  if (EncryptedCurrentValue != NULL)
1617  midl_user_free(EncryptedCurrentValue);
1618 
1619  if (EncryptedOldValue != NULL)
1620  midl_user_free(EncryptedOldValue);
1621 
1622  return Status;
1623 }
#define midl_user_free
Definition: rpc.h:45
#define RpcEndExcept
Definition: rpc.h:128
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define midl_user_allocate
Definition: rpc.h:44
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
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
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
struct _LSA_UNICODE_STRING LSA_UNICODE_STRING
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define BufferSize
Definition: classpnp.h:419
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
USHORT MaximumLength
Definition: ntsecapi.h:164
unsigned short USHORT
Definition: pedump.c:61
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaQuerySecurityObject()

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

Definition at line 1631 of file lsa.c.

1634 {
1637  NTSTATUS Status;
1638 
1639  TRACE("LsaQuerySecurityObject(%p %lx %p)\n",
1640  ObjectHandle, SecurityInformation, SecurityDescriptor);
1641 
1642  SdBuffer.Length = 0;
1643  SdBuffer.SecurityDescriptor = NULL;
1644 
1645  SdPointer = &SdBuffer;
1646 
1647  RpcTryExcept
1648  {
1651  &SdPointer);
1652  if (NT_SUCCESS(Status))
1653  {
1655  }
1656  else
1657  {
1659  }
1660  }
1662  {
1664  }
1665  RpcEndExcept;
1666 
1667  return Status;
1668 }
#define RpcEndExcept
Definition: rpc.h:128
_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:182
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS WINAPI LsarQuerySecurityObject(LSAPR_HANDLE ObjectHandle, SECURITY_INFORMATION SecurityInformation, PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: lsarpc.c:198
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaQueryTrustedDomainInfo()

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

Definition at line 1676 of file lsa.c.

1680 {
1681  NTSTATUS Status;
1682 
1683  TRACE("LsaQueryTrustedDomainInfo(%p %p %d %p) stub\n",
1684  PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
1685 
1689 
1690  RpcTryExcept
1691  {
1693  (PRPC_SID)TrustedDomainSid,
1696  }
1698  {
1700  }
1701  RpcEndExcept;
1702 
1703  return Status;
1704 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarQueryTrustedDomainInfo(LSAPR_HANDLE PolicyHandle, PRPC_SID TrustedDomainSid, TRUSTED_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
Definition: lsarpc.c:3410
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaQueryTrustedDomainInfoByName()

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

Definition at line 1712 of file lsa.c.

1716 {
1717  NTSTATUS Status;
1718 
1719  TRACE("LsaQueryTrustedDomainInfoByName(%p %p %d %p)\n",
1720  PolicyHandle, TrustedDomainName, InformationClass, Buffer);
1721 
1725 
1726  RpcTryExcept
1727  {
1729  (PRPC_UNICODE_STRING)TrustedDomainName,
1732  }
1734  {
1736  }
1737  RpcEndExcept;
1738 
1739  return Status;
1740 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI LsarQueryTrustedDomainInfoByName(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation)
Definition: lsarpc.c:3780
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 1748 of file lsa.c.

1753 {
1754  NTSTATUS Status;
1755  LSAPR_USER_RIGHT_SET UserRightSet;
1756 
1757  TRACE("LsaRemoveAccountRights(%p %p %d %p %lu)\n",
1758  PolicyHandle, AccountSid, AllRights, UserRights, CountOfRights);
1759 
1760  UserRightSet.Entries = CountOfRights;
1761  UserRightSet.UserRights = (PRPC_UNICODE_STRING)UserRights;
1762 
1763  RpcTryExcept
1764  {
1766  (PRPC_SID)AccountSid,
1767  AllRights,
1768  &UserRightSet);
1769  }
1771  {
1773  }
1774  RpcEndExcept;
1775 
1776  return Status;
1777 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI LsarRemoveAccountRights(LSAPR_HANDLE PolicyHandle, PRPC_SID AccountSid, BOOLEAN AllRights, PLSAPR_USER_RIGHT_SET UserRights)
Definition: lsarpc.c:3214
struct _RPC_UNICODE_STRING * PRPC_UNICODE_STRING
PRPC_UNICODE_STRING UserRights
Definition: lsa.idl:393
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaRemovePrivilegesFromAccount()

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

Definition at line 1785 of file lsa.c.

1788 {
1789  NTSTATUS Status;
1790 
1791  RpcTryExcept
1792  {
1794  AllPrivileges,
1796  }
1798  {
1800  }
1801  RpcEndExcept;
1802 
1803  return Status;
1804 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarRemovePrivilegesFromAccount(LSAPR_HANDLE AccountHandle, BOOLEAN AllPrivileges, PLSAPR_PRIVILEGE_SET Privileges)
Definition: lsarpc.c:1719
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaRetrievePrivateData()

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

Definition at line 1812 of file lsa.c.

1815 {
1816  PLSAPR_CR_CIPHER_VALUE EncryptedData = NULL;
1817  PLSA_UNICODE_STRING DecryptedData = NULL;
1819  NTSTATUS Status;
1820 
1821  TRACE("LsaRetrievePrivateData(%p %p %p)\n",
1822  PolicyHandle, KeyName, PrivateData);
1823 
1824  RpcTryExcept
1825  {
1828  &EncryptedData);
1829  }
1831  {
1833  }
1834  RpcEndExcept;
1835 
1836  if (EncryptedData == NULL)
1837  {
1838  *PrivateData = NULL;
1839  }
1840  else
1841  {
1842  BufferSize = sizeof(LSA_UNICODE_STRING) + EncryptedData->MaximumLength;
1843  DecryptedData = midl_user_allocate(BufferSize);
1844  if (DecryptedData == NULL)
1845  {
1847  goto done;
1848  }
1849 
1850  DecryptedData->Length = (USHORT)EncryptedData->Length;
1851  DecryptedData->MaximumLength = (USHORT)EncryptedData->MaximumLength;
1852  DecryptedData->Buffer = (PWSTR)(DecryptedData + 1);
1853  RtlCopyMemory(DecryptedData->Buffer,
1854  EncryptedData->Buffer,
1855  EncryptedData->Length);
1856 
1857  *PrivateData = DecryptedData;
1858  }
1859 
1860 done:
1861  if (!NT_SUCCESS(Status))
1862  {
1863  if (DecryptedData != NULL)
1864  midl_user_free(DecryptedData);
1865 
1866  *PrivateData = NULL;
1867  }
1868 
1869  if (EncryptedData != NULL)
1870  midl_user_free(EncryptedData);
1871 
1872  return Status;
1873 }
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define midl_user_free
Definition: rpc.h:45
#define RpcEndExcept
Definition: rpc.h:128
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define midl_user_allocate
Definition: rpc.h:44
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS WINAPI LsarRetrievePrivateData(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING KeyName, PLSAPR_CR_CIPHER_VALUE *EncryptedData)
Definition: lsarpc.c:3618
struct _LSA_UNICODE_STRING LSA_UNICODE_STRING
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define BufferSize
Definition: classpnp.h:419
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
USHORT MaximumLength
Definition: ntsecapi.h:164
unsigned short USHORT
Definition: pedump.c:61
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetDomainInformationPolicy()

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

Definition at line 1881 of file lsa.c.

1884 {
1885  NTSTATUS Status;
1886 
1887  TRACE("LsaSetDomainInformationPolicy(%p %d %p)\n",
1888  PolicyHandle, InformationClass, Buffer);
1889 
1890  RpcTryExcept
1891  {
1895  }
1897  {
1899  }
1900  RpcEndExcept;
1901 
1902  return Status;
1903 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS WINAPI LsarSetDomainInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation)
Definition: lsarpc.c:3879
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ 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 1911 of file lsa.c.

1916 {
1917  NTSTATUS Status;
1918 
1919  TRACE("LsaSetForestTrustInformation(%p %p %p %d %p)\n",
1920  PolicyHandle, TrustedDomainName, ForestTrustInfo, CheckOnly, CollisionInfo);
1921 
1922  RpcTryExcept
1923  {
1925  TrustedDomainName,
1927  ForestTrustInfo,
1928  CheckOnly,
1929  CollisionInfo);
1930  }
1932  {
1934  }
1935  RpcEndExcept;
1936 
1937  return Status;
1938 }
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
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetInformationPolicy()

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

Definition at line 1946 of file lsa.c.

1949 {
1950  NTSTATUS Status;
1951 
1952  TRACE("LsaSetInformationPolicy(%p %d %p)\n",
1953  PolicyHandle, InformationClass, Buffer);
1954 
1955  RpcTryExcept
1956  {
1960  }
1962  {
1964  }
1965  RpcEndExcept;
1966 
1967  return Status;
1968 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
NTSTATUS WINAPI LsarSetInformationPolicy(LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, PLSAPR_POLICY_INFORMATION PolicyInformation)
Definition: lsarpc.c:663
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by SetAccountsDomainSid(), and SetPrimaryDomain().

◆ LsaSetInformationTrustedDomain()

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

Definition at line 1976 of file lsa.c.

1979 {
1980  FIXME("LsaSetInformationTrustedDomain(%p %d %p)\n",
1981  TrustedDomainHandle, InformationClass, Buffer);
1982  return STATUS_NOT_IMPLEMENTED;
1983 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: bufpool.h:45
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714

◆ LsaSetQuotasForAccount()

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

Definition at line 1991 of file lsa.c.

1993 {
1994  NTSTATUS Status;
1995 
1996  TRACE("LsaSetQuotasForAccount(%p %p)\n",
1997  AccountHandle, QuotaLimits);
1998 
1999  RpcTryExcept
2000  {
2001  Status = LsarSetQuotasForAccount((LSAPR_HANDLE)AccountHandle,
2002  QuotaLimits);
2003  }
2005  {
2007  }
2008  RpcEndExcept;
2009 
2010  return Status;
2011 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarSetQuotasForAccount(LSAPR_HANDLE AccountHandle, PQUOTA_LIMITS QuotaLimits)
Definition: lsarpc.c:1913
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetSecret()

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

Definition at line 2019 of file lsa.c.

2022 {
2023  PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue = NULL;
2024  PLSAPR_CR_CIPHER_VALUE EncryptedOldValue = NULL;
2026  NTSTATUS Status;
2027 
2028  TRACE("LsaSetSecret(%p %p %p)\n",
2029  SecretHandle, EncryptedCurrentValue, EncryptedOldValue);
2030 
2031  if (CurrentValue != NULL)
2032  {
2033  BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + CurrentValue->MaximumLength;
2034  EncryptedCurrentValue = midl_user_allocate(BufferSize);
2035  if (EncryptedCurrentValue == NULL)
2036  {
2038  goto done;
2039  }
2040 
2041  EncryptedCurrentValue->Length = CurrentValue->Length;
2042  EncryptedCurrentValue->MaximumLength = CurrentValue->MaximumLength;
2043  EncryptedCurrentValue->Buffer = (BYTE *)(EncryptedCurrentValue + 1);
2044  if (EncryptedCurrentValue->Buffer != NULL)
2045  memcpy(EncryptedCurrentValue->Buffer, CurrentValue->Buffer, CurrentValue->Length);
2046  }
2047 
2048  if (OldValue != NULL)
2049  {
2050  BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + OldValue->MaximumLength;
2051  EncryptedOldValue = midl_user_allocate(BufferSize);
2052  if (EncryptedOldValue == NULL)
2053  {
2055  goto done;
2056  }
2057 
2058  EncryptedOldValue->Length = OldValue->Length;
2059  EncryptedOldValue->MaximumLength = OldValue->MaximumLength;
2060  EncryptedOldValue->Buffer = (BYTE*)(EncryptedOldValue + 1);
2061  if (EncryptedOldValue->Buffer != NULL)
2062  memcpy(EncryptedOldValue->Buffer, OldValue->Buffer, OldValue->Length);
2063  }
2064 
2065  RpcTryExcept
2066  {
2067  Status = LsarSetSecret((LSAPR_HANDLE)SecretHandle,
2068  EncryptedCurrentValue,
2069  EncryptedOldValue);
2070  }
2072  {
2074  }
2075  RpcEndExcept;
2076 
2077 done:
2078  if (EncryptedCurrentValue != NULL)
2079  midl_user_free(EncryptedCurrentValue);
2080 
2081  if (EncryptedOldValue != NULL)
2082  midl_user_free(EncryptedOldValue);
2083 
2084  return Status;
2085 }
#define midl_user_free
Definition: rpc.h:45
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define midl_user_allocate
Definition: rpc.h:44
NTSTATUS WINAPI LsarSetSecret(LSAPR_HANDLE SecretHandle, PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue, PLSAPR_CR_CIPHER_VALUE EncryptedOldValue)
Definition: lsarpc.c:2146
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define BufferSize
Definition: classpnp.h:419
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
struct _LSAPR_CR_CIPHER_VALUE LSAPR_CR_CIPHER_VALUE
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetSecurityObject()

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

Definition at line 2093 of file lsa.c.

2096 {
2097  LSAPR_SR_SECURITY_DESCRIPTOR SdBuffer = {0, NULL};
2098  ULONG SdLength = 0;
2099  NTSTATUS Status;
2100 
2101  TRACE("LsaSetSecurityObject(%p %lx %p)\n",
2102  ObjectHandle, SecurityInformation, SecurityDescriptor);
2103 
2105  NULL,
2106  &SdLength);
2108  return STATUS_INVALID_PARAMETER;
2109 
2110  SdBuffer.SecurityDescriptor = MIDL_user_allocate(SdLength);
2111  if (SdBuffer.SecurityDescriptor == NULL)
2113 
2116  &SdLength);
2117  if (!NT_SUCCESS(Status))
2118  goto done;
2119 
2120  SdBuffer.Length = SdLength;
2121 
2122  RpcTryExcept
2123  {
2124  Status = LsarSetSecurityObject((LSAPR_HANDLE)ObjectHandle,
2126  &SdBuffer);
2127  }
2129  {
2131  }
2132  RpcEndExcept;
2133 
2134 done:
2135  if (SdBuffer.SecurityDescriptor != NULL)
2137 
2138  return Status;
2139 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_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:182
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI LsarSetSecurityObject(LSAPR_HANDLE ObjectHandle, SECURITY_INFORMATION SecurityInformation, PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
Definition: lsarpc.c:323
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
NTSYSAPI NTSTATUS NTAPI RtlMakeSelfRelativeSD(_In_ PSECURITY_DESCRIPTOR AbsoluteSD, _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Inout_ PULONG BufferLength)
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetSystemAccessAccount()

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

Definition at line 2147 of file lsa.c.

2149 {
2150  NTSTATUS Status;
2151 
2152  TRACE("LsaSetSystemAccessAccount(%p 0x%lx)\n",
2153  AccountHandle, SystemAccess);
2154 
2155  RpcTryExcept
2156  {
2158  SystemAccess);
2159  }
2161  {
2163  }
2164  RpcEndExcept;
2165 
2166  return Status;
2167 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsarSetSystemAccessAccount(LSAPR_HANDLE AccountHandle, ACCESS_MASK SystemAccess)
Definition: lsarpc.c:2012
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ LsaSetTrustedDomainInfoByName()

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

Definition at line 2175 of file lsa.c.

2179 {
2180  FIXME("LsaSetTrustedDomainInfoByName(%p %p %d %p) stub\n",
2181  PolicyHandle, TrustedDomainName, InformationClass, Buffer);
2182  return STATUS_SUCCESS;
2183 }
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: bufpool.h:45
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
return STATUS_SUCCESS
Definition: btrfs.c:2745

◆ LsaSetTrustedDomainInformation()

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

Definition at line 2191 of file lsa.c.

2195 {
2196  FIXME("LsaSetTrustedDomainInformation(%p %p %d %p) stub\n",
2197  PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
2198  return STATUS_SUCCESS;
2199 }
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: bufpool.h:45
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1714
return STATUS_SUCCESS
Definition: btrfs.c:2745

◆ LsaStorePrivateData()

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

Definition at line 2207 of file lsa.c.

2210 {
2211  PLSAPR_CR_CIPHER_VALUE EncryptedData = NULL;
2213  NTSTATUS Status;
2214 
2215  TRACE("LsaStorePrivateData(%p %p %p)\n",
2216  PolicyHandle, KeyName, PrivateData);
2217 
2218  if (PrivateData != NULL)
2219  {
2220  BufferSize = sizeof(LSAPR_CR_CIPHER_VALUE) + PrivateData->MaximumLength;
2221  EncryptedData = midl_user_allocate(BufferSize);
2222  if (EncryptedData == NULL)
2223  {
2225  goto done;
2226  }
2227 
2228  EncryptedData->Length = PrivateData->Length;
2229  EncryptedData->MaximumLength = PrivateData->MaximumLength;
2230  EncryptedData->Buffer = (BYTE *)(EncryptedData + 1);
2231  if (EncryptedData->Buffer != NULL)
2232  RtlCopyMemory(EncryptedData->Buffer,
2233  PrivateData->Buffer,
2234  PrivateData->Length);
2235  }
2236 
2237  RpcTryExcept
2238  {
2239  Status = LsarStorePrivateData((LSAPR_HANDLE)PolicyHandle,
2241  EncryptedData);
2242  }
2244  {
2246  }
2247  RpcEndExcept;
2248 
2249 done:
2250  if (EncryptedData != NULL)
2251  midl_user_free(EncryptedData);
2252 
2253  return Status;
2254 }
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define midl_user_free
Definition: rpc.h:45
#define RpcEndExcept
Definition: rpc.h:128
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define midl_user_allocate
Definition: rpc.h:44
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define BufferSize
Definition: classpnp.h:419
unsigned char BYTE
Definition: mem.h:68
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
NTSTATUS WINAPI LsarStorePrivateData(LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING KeyName, PLSAPR_CR_CIPHER_VALUE EncryptedData)
Definition: lsarpc.c:3462
struct _LSAPR_CR_CIPHER_VALUE LSAPR_CR_CIPHER_VALUE
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by ScmSetServicePassword().

◆ PLSAPR_SERVER_NAME_bind()

handle_t __RPC_USER PLSAPR_SERVER_NAME_bind ( PLSAPR_SERVER_NAME  pszSystemName)

Definition at line 43 of file lsa.c.

44 {
46  LPWSTR pszStringBinding;
48 
49  TRACE("PLSAPR_SERVER_NAME_bind() called\n");
50 
52  L"ncacn_np",
53  pszSystemName,
54  L"\\pipe\\lsarpc",
55  NULL,
56  &pszStringBinding);
57  if (status)
58  {
59  TRACE("RpcStringBindingCompose returned 0x%x\n", status);
60  return NULL;
61  }
62 
63  /* Set the binding handle that will be used to bind to the server. */
64  status = RpcBindingFromStringBindingW(pszStringBinding,
65  &hBinding);
66  if (status)
67  {
68  TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
69  }
70 
71  status = RpcStringFreeW(&pszStringBinding);
72  if (status)
73  {
74  TRACE("RpcStringFree returned 0x%x\n", status);
75  }
76 
77  return hBinding;
78 }
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:877
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
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:511
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR L[]
Definition: oid.c:1250
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
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 83 of file lsa.c.

85 {
87 
88  TRACE("PLSAPR_SERVER_NAME_unbind() called\n");
89 
91  if (status)
92  {
93  TRACE("RpcBindingFree returned 0x%x\n", status);
94  }
95 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
handle_t hBinding
Definition: ctx_c.c:54
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( advapi  )