2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: dll/win32/secur32/lsalpc.c
5 * PURPOSE: LSA LPC port functions
8 /* INCLUDES ******************************************************************/
12 #include <ndk/lpctypes.h>
13 #include <ndk/lpcfuncs.h>
14 #include <ndk/mmfuncs.h>
15 #include <ndk/rtlfuncs.h>
16 #include <ndk/obfuncs.h>
17 #include <psdk/ntsecapi.h>
18 #include <lsass/lsass.h>
20 #include <wine/debug.h>
21 WINE_DEFAULT_DEBUG_CHANNEL(secur32
);
24 /* GLOBALS *******************************************************************/
28 extern HANDLE Secur32Heap
;
31 /* FUNCTIONS *****************************************************************/
41 LsapCloseLsaPort(VOID
)
43 if (LsaPortHandle
!= NULL
)
45 NtClose(LsaPortHandle
);
54 UNICODE_STRING PortName
;
55 SECURITY_QUALITY_OF_SERVICE SecurityQos
;
56 LSA_CONNECTION_INFO ConnectInfo
;
57 ULONG ConnectInfoLength
;
60 TRACE("LsapOpenLsaPort()\n");
62 if (LsaPortHandle
!= NULL
)
63 return STATUS_SUCCESS
;
65 RtlInitUnicodeString(&PortName
,
66 L
"\\LsaAuthenticationPort");
68 SecurityQos
.Length
= sizeof(SecurityQos
);
69 SecurityQos
.ImpersonationLevel
= SecurityIdentification
;
70 SecurityQos
.ContextTrackingMode
= SECURITY_DYNAMIC_TRACKING
;
71 SecurityQos
.EffectiveOnly
= TRUE
;
73 RtlZeroMemory(&ConnectInfo
,
76 ConnectInfo
.CreateContext
= FALSE
;
78 ConnectInfoLength
= sizeof(LSA_CONNECTION_INFO
);
79 Status
= NtConnectPort(&LsaPortHandle
,
87 if (!NT_SUCCESS(Status
))
89 TRACE("NtConnectPort failed (Status 0x%08lx)\n", Status
);
94 if (!NT_SUCCESS(ConnectInfo.Status))
96 DPRINT1("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status);
99 return ConnectInfo.Status;
104 /* PUBLIC FUNCTIONS **********************************************************/
111 LsaEnumerateLogonSessions(PULONG LogonSessionCount
,
112 PLUID
*LogonSessionList
)
114 LSA_API_MSG ApiMessage
;
117 TRACE("LsaEnumerateLogonSessions(%p %p)\n", LogonSessionCount
, LogonSessionList
);
119 Status
= LsapOpenLsaPort();
120 if (!NT_SUCCESS(Status
))
123 ApiMessage
.ApiNumber
= LSASS_REQUEST_ENUM_LOGON_SESSIONS
;
124 ApiMessage
.h
.u1
.s1
.DataLength
= LSA_PORT_DATA_SIZE(ApiMessage
.EnumLogonSessions
);
125 ApiMessage
.h
.u1
.s1
.TotalLength
= LSA_PORT_MESSAGE_SIZE
;
126 ApiMessage
.h
.u2
.ZeroInit
= 0;
128 Status
= NtRequestWaitReplyPort(LsaPortHandle
,
129 (PPORT_MESSAGE
)&ApiMessage
,
130 (PPORT_MESSAGE
)&ApiMessage
);
131 if (!NT_SUCCESS(Status
))
133 ERR("NtRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status
);
137 if (!NT_SUCCESS(ApiMessage
.Status
))
139 ERR("NtRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage
.Status
);
140 return ApiMessage
.Status
;
143 *LogonSessionCount
= ApiMessage
.EnumLogonSessions
.Reply
.LogonSessionCount
;
144 *LogonSessionList
= ApiMessage
.EnumLogonSessions
.Reply
.LogonSessionBuffer
;
155 LsaGetLogonSessionData(PLUID LogonId
,
156 PSECURITY_LOGON_SESSION_DATA
*ppLogonSessionData
)
159 return STATUS_NOT_IMPLEMENTED
;
168 LsaRegisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass
,
169 HANDLE NotificationEventHandle
)
172 return STATUS_NOT_IMPLEMENTED
;
181 LsaUnregisterPolicyChangeNotification(POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass
,
182 HANDLE NotificationEventHandle
)
185 return STATUS_NOT_IMPLEMENTED
;