ReactOS 0.4.16-dev-125-g798ea90
lsasrv.c File Reference
#include "lsasrv.h"
Include dependency graph for lsasrv.c:

Go to the source code of this file.

Functions

VOID NTAPI LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER (IN PLSAPR_ACCOUNT_ENUM_BUFFER Ptr)
 
VOID NTAPI LsaIFree_LSAPR_CR_CIPHER_VALUE (IN PLSAPR_CR_CIPHER_VALUE Ptr)
 
VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION (IN POLICY_INFORMATION_CLASS InformationClass, IN PLSAPR_POLICY_INFORMATION PolicyInformation)
 
VOID NTAPI LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER (IN PLSAPR_PRIVILEGE_ENUM_BUFFER Ptr)
 
VOID NTAPI LsaIFree_LSAPR_PRIVILEGE_SET (IN PLSAPR_PRIVILEGE_SET Ptr)
 
VOID NTAPI LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST (IN PLSAPR_REFERENCED_DOMAIN_LIST Ptr)
 
VOID NTAPI LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR (IN PLSAPR_SR_SECURITY_DESCRIPTOR Ptr)
 
VOID NTAPI LsaIFree_LSAPR_TRANSLATED_NAMES (IN PLSAPR_TRANSLATED_NAMES Ptr)
 
VOID NTAPI LsaIFree_LSAPR_TRANSLATED_SIDS (IN PLSAPR_TRANSLATED_SIDS Ptr)
 
NTSTATUS WINAPI LsapInitLsa (VOID)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 

Variables

NT_PRODUCT_TYPE LsapProductType = NtProductWinNt
 

Function Documentation

◆ LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER()

VOID NTAPI LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER ( IN PLSAPR_ACCOUNT_ENUM_BUFFER  Ptr)

Definition at line 19 of file lsasrv.c.

21{
22 ULONG i;
23
24 if (Ptr == NULL)
25 return;
26
27 if (Ptr->Information != NULL)
28 {
29 for (i = 0; i < Ptr->EntriesRead; i++)
30 midl_user_free(Ptr->Information[i].Sid);
31
32 midl_user_free(Ptr->Information);
33 }
34
36}
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define midl_user_free
Definition: rpc.h:45
uint32_t ULONG
Definition: typedefs.h:59

◆ LsaIFree_LSAPR_CR_CIPHER_VALUE()

VOID NTAPI LsaIFree_LSAPR_CR_CIPHER_VALUE ( IN PLSAPR_CR_CIPHER_VALUE  Ptr)

Definition at line 41 of file lsasrv.c.

43{
44 if (Ptr != NULL)
46}

◆ LsaIFree_LSAPR_POLICY_INFORMATION()

VOID NTAPI LsaIFree_LSAPR_POLICY_INFORMATION ( IN POLICY_INFORMATION_CLASS  InformationClass,
IN PLSAPR_POLICY_INFORMATION  PolicyInformation 
)

Definition at line 51 of file lsasrv.c.

53{
54 if (PolicyInformation != NULL)
55 {
56 switch (InformationClass)
57 {
58 case PolicyAuditLogInformation: /* 1 */
59 break;
60
62 if (PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions != NULL)
63 midl_user_free(PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions);
64 break;
65
67 if (PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer != NULL)
68 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer);
69
70 if (PolicyInformation->PolicyPrimaryDomInfo.Sid != NULL)
71 midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Sid);
72 break;
73
74 case PolicyPdAccountInformation: /* 4 */
75 if (PolicyInformation->PolicyPdAccountInfo.Name.Buffer != NULL)
76 midl_user_free(PolicyInformation->PolicyPdAccountInfo.Name.Buffer);
77 break;
78
80 if (PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer != NULL)
81 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer);
82
83 if (PolicyInformation->PolicyAccountDomainInfo.Sid != NULL)
84 midl_user_free(PolicyInformation->PolicyAccountDomainInfo.Sid);
85 break;
86
88 break;
89
91 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer != NULL)
92 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer);
93
94 if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer != NULL)
95 midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer);
96 break;
97
99 break;
100
102 break;
103
104 case PolicyAuditFullSetInformation: /* 10 (0xA) */
105 break;
106
107 case PolicyAuditFullQueryInformation: /* 11 (0xB) */
108 break;
109
110 case PolicyDnsDomainInformation: /* 12 (0xC) */
111 if (PolicyInformation->PolicyDnsDomainInfo.Name.Buffer != NULL)
112 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Name.Buffer);
113
114 if (PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer != NULL)
115 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer);
116
117 if (PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer != NULL)
118 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer);
119
120 if (PolicyInformation->PolicyDnsDomainInfo.Sid != NULL)
121 midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Sid);
122 break;
123
124 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
125 if (PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer != NULL)
126 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer);
127
128 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer != NULL)
129 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer);
130
131 if (PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer != NULL)
132 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer);
133
134 if (PolicyInformation->PolicyDnsDomainInfoInt.Sid != NULL)
135 midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Sid);
136 break;
137
138 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
139 if (PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer != NULL)
140 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer);
141
142 if (PolicyInformation->PolicyLocalAccountDomainInfo.Sid != NULL)
143 midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.Sid);
144 break;
145
146 default:
147 ERR("Invalid InformationClass: %lu\n", InformationClass);
148 break;
149 }
150
151 midl_user_free(PolicyInformation);
152 }
153}
#define ERR(fmt,...)
Definition: precomp.h:57
_In_ FILTER_INFORMATION_CLASS InformationClass
Definition: fltkernel.h:1713
@ PolicyModificationInformation
Definition: ntsecapi.h:251
@ PolicyAuditEventsInformation
Definition: ntsecapi.h:244
@ PolicyDnsDomainInformationInt
Definition: ntsecapi.h:255
@ PolicyDefaultQuotaInformation
Definition: ntsecapi.h:250
@ PolicyReplicaSourceInformation
Definition: ntsecapi.h:249
@ PolicyLsaServerRoleInformation
Definition: ntsecapi.h:248
@ PolicyAuditFullSetInformation
Definition: ntsecapi.h:252
@ PolicyDnsDomainInformation
Definition: ntsecapi.h:254
@ PolicyPrimaryDomainInformation
Definition: ntsecapi.h:245
@ PolicyAuditLogInformation
Definition: ntsecapi.h:243
@ PolicyAuditFullQueryInformation
Definition: ntsecapi.h:253
@ PolicyLocalAccountDomainInformation
Definition: ntsecapi.h:256
@ PolicyPdAccountInformation
Definition: ntsecapi.h:246
@ PolicyAccountDomainInformation
Definition: ntsecapi.h:247

Referenced by DsRolepGetBasicInfo(), and GetAccountDomainSid().

◆ LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER()

VOID NTAPI LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER ( IN PLSAPR_PRIVILEGE_ENUM_BUFFER  Ptr)

Definition at line 158 of file lsasrv.c.

160{
161 ULONG i;
162
163 if (Ptr != NULL)
164 {
165 if (Ptr->Privileges != NULL)
166 {
167 for (i = 0; i < Ptr->Entries; i++)
168 {
169 if (Ptr->Privileges[i].Name.Buffer != NULL)
170 midl_user_free(Ptr->Privileges[i].Name.Buffer);
171 }
172
173 midl_user_free(Ptr->Privileges);
174 }
175 }
176}

◆ LsaIFree_LSAPR_PRIVILEGE_SET()

VOID NTAPI LsaIFree_LSAPR_PRIVILEGE_SET ( IN PLSAPR_PRIVILEGE_SET  Ptr)

Definition at line 181 of file lsasrv.c.

182{
183 if (Ptr != NULL)
184 {
186 }
187}

Referenced by LsapSetPrivileges().

◆ LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST()

VOID NTAPI LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST ( IN PLSAPR_REFERENCED_DOMAIN_LIST  Ptr)

Definition at line 192 of file lsasrv.c.

194{
195 ULONG i;
196
197 if (Ptr != NULL)
198 {
199 if (Ptr->Domains != NULL)
200 {
201 for (i = 0; i < Ptr->Entries; i++)
202 {
203 if (Ptr->Domains[i].Name.Buffer != NULL)
204 midl_user_free(Ptr->Domains[i].Name.Buffer);
205
206 if (Ptr->Domains[i].Sid != NULL)
207 midl_user_free(Ptr->Domains[i].Sid);
208 }
209
210 midl_user_free(Ptr->Domains);
211 }
212
214 }
215}

◆ LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR()

VOID NTAPI LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR ( IN PLSAPR_SR_SECURITY_DESCRIPTOR  Ptr)

Definition at line 220 of file lsasrv.c.

222{
223 if (Ptr != NULL)
224 {
225 if (Ptr->SecurityDescriptor != NULL)
226 midl_user_free(Ptr->SecurityDescriptor);
227
229 }
230}

◆ LsaIFree_LSAPR_TRANSLATED_NAMES()

VOID NTAPI LsaIFree_LSAPR_TRANSLATED_NAMES ( IN PLSAPR_TRANSLATED_NAMES  Ptr)

Definition at line 235 of file lsasrv.c.

237{
238 ULONG i;
239
240 if (Ptr != NULL)
241 {
242 if (Ptr->Names != NULL)
243 {
244 for (i = 0; i < Ptr->Entries; i++)
245 {
246 if (Ptr->Names[i].Name.Buffer != NULL)
247 midl_user_free(Ptr->Names[i].Name.Buffer);
248 }
249
250 midl_user_free(Ptr->Names);
251 }
252
254 }
255}

◆ LsaIFree_LSAPR_TRANSLATED_SIDS()

VOID NTAPI LsaIFree_LSAPR_TRANSLATED_SIDS ( IN PLSAPR_TRANSLATED_SIDS  Ptr)

Definition at line 260 of file lsasrv.c.

262{
263 if (Ptr != NULL)
264 {
265 if (Ptr->Sids != NULL)
266 midl_user_free(Ptr->Sids);
267
269 }
270}

◆ LsapInitLsa()

NTSTATUS WINAPI LsapInitLsa ( VOID  )

Definition at line 275 of file lsasrv.c.

276{
278 BOOLEAN PrivilegeEnabled;
279
280 TRACE("LsapInitLsa()\n");
281
282 /* Get the product type */
284
285 /* Initialize the well known SIDs */
286 LsapInitSids();
287
288 /* Initialize the SRM server */
290 if (!NT_SUCCESS(Status))
291 {
292 ERR("LsapRmInitializeServer() failed (Status 0x%08lx)\n", Status);
293 return Status;
294 }
295
296 /* Initialize the LSA database */
298
299 /* Initialize logon sessions */
301
302 /* Initialize the notification list */
304
305 /* Initialize registered authentication packages */
307 if (!NT_SUCCESS(Status))
308 {
309 ERR("LsapInitAuthPackages() failed (Status 0x%08lx)\n", Status);
310 return Status;
311 }
312
313 /* Enable the token creation privilege for the rest of our lifetime */
315 if (!NT_SUCCESS(Status))
316 {
317 ERR("RtlAdjustPrivilege(SE_CREATE_TOKEN_PRIVILEGE) failed, ignoring (Status 0x%08lx)\n", Status);
318 }
319
320 /* Start the authentication LPC port thread */
322 if (!NT_SUCCESS(Status))
323 {
324 ERR("StartAuthenticationPort() failed (Status 0x%08lx)\n", Status);
325 return Status;
326 }
327
328 /* Start the RPC server */
330 if (!NT_SUCCESS(Status))
331 {
332 ERR("LsarStartRpcServer() failed (Status 0x%08lx)\n", Status);
333 return Status;
334 }
335
336 return STATUS_SUCCESS;
337}
unsigned char BOOLEAN
NTSTATUS LsapInitAuthPackages(VOID)
Definition: authpackage.c:474
NTSTATUS StartAuthenticationPort(VOID)
Definition: authport.c:327
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
BOOLEAN NTAPI RtlGetNtProductType(_Out_ PNT_PRODUCT_TYPE ProductType)
Definition: version.c:96
NTSTATUS LsapInitDatabase(VOID)
Definition: database.c:539
NTSTATUS LsapInitSids(VOID)
Definition: lookup.c:182
VOID LsapInitNotificationList(VOID)
Definition: notify.c:28
VOID LsapInitLogonSessions(VOID)
Definition: session.c:36
NTSTATUS LsapRmInitializeServer(VOID)
Definition: srm.c:167
Status
Definition: gdiplustypes.h:25
NTSTATUS LsarStartRpcServer(VOID)
Definition: lsarpc.c:40
NT_PRODUCT_TYPE LsapProductType
Definition: lsasrv.c:13
#define SE_CREATE_TOKEN_PRIVILEGE
Definition: security.c:656
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by wWinMain().

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 340 of file lsasrv.c.

341{
342 return RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, len);
343}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 346 of file lsasrv.c.

347{
348 RtlFreeHeap(RtlGetProcessHeap(), 0, ptr);
349}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
static PVOID ptr
Definition: dispmode.c:27

Variable Documentation

◆ LsapProductType