088da34437b7eeaaa390209a8b64f1d71df61755
[reactos.git] / dll / win32 / lsasrv / lsasrv.c
1 #define WIN32_NO_STATUS
2 #include <windows.h>
3 #define NTOS_MODE_USER
4 #include <ndk/ntndk.h>
5
6 #include "lsasrv.h"
7
8 #include "wine/debug.h"
9
10 WINE_DEFAULT_DEBUG_CHANNEL(lsasrv);
11
12
13 NTSTATUS WINAPI
14 LsapInitLsa(VOID)
15 {
16 HANDLE hEvent;
17 DWORD dwError;
18
19 TRACE("LsapInitLsa()\n");
20
21 /* Start the RPC server */
22 LsarStartRpcServer();
23
24 /* Notify the service manager */
25 hEvent = CreateEventW(NULL,
26 TRUE,
27 FALSE,
28 L"LSA_RPC_SERVER_ACTIVE");
29 if (hEvent == NULL)
30 {
31 dwError = GetLastError();
32 TRACE("Failed to create the notication event (Error %lu)\n", dwError);
33
34 if (dwError == ERROR_ALREADY_EXISTS)
35 {
36 hEvent = OpenEventW(GENERIC_WRITE,
37 FALSE,
38 L"LSA_RPC_SERVER_ACTIVE");
39 if (hEvent != NULL)
40 {
41 ERR("Could not open the notification event!");
42 }
43 }
44 }
45
46 SetEvent(hEvent);
47
48 /* NOTE: Do not close the event handle!!!! */
49
50 return STATUS_SUCCESS;
51 }
52
53
54 void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len)
55 {
56 return RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, len);
57 }
58
59
60 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
61 {
62 RtlFreeHeap(RtlGetProcessHeap(), 0, ptr);
63 }
64
65 /* EOF */