1 /*
2  * PROJECT:     ReactOS Print Spooler Service
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     RPC Server Thread
5  * COPYRIGHT:   Copyright 2015 Colin Finck (colin@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 DWORD WINAPI
LrpcThreadProc(LPVOID lpParameter)11 LrpcThreadProc(LPVOID lpParameter)
12 {
13     RPC_STATUS Status;
14 
15     Status = RpcServerUseProtseqEpW(L"ncalrpc", 20, L"spoolss", NULL);
16     if (Status != RPC_S_OK)
17     {
18         ERR("RpcServerUseProtseqEpW failed with status %ld!\n", Status);
19         return 0;
20     }
21 
22     Status = RpcServerRegisterIf(winspool_v1_0_s_ifspec, NULL, NULL);
23     if (Status != RPC_S_OK)
24     {
25         ERR("RpcServerRegisterIf failed with status %ld!\n", Status);
26         return 0;
27     }
28 
29     Status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, 0);
30     if (Status != RPC_S_OK)
31     {
32         ERR("RpcServerListen() failed with status %ld!\n", Status);
33     }
34 
35     return 0;
36 }
37 
38 void __RPC_FAR* __RPC_USER
midl_user_allocate(SIZE_T len)39 midl_user_allocate(SIZE_T len)
40 {
41     return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
42 }
43 
44 void __RPC_USER
midl_user_free(void __RPC_FAR * ptr)45 midl_user_free(void __RPC_FAR* ptr)
46 {
47     HeapFree(GetProcessHeap(), 0, ptr);
48 }
49 
50 void __RPC_USER
WINSPOOL_GDI_HANDLE_rundown(WINSPOOL_GDI_HANDLE hGdiHandle)51 WINSPOOL_GDI_HANDLE_rundown(WINSPOOL_GDI_HANDLE hGdiHandle)
52 {
53 }
54 
55 void __RPC_USER
WINSPOOL_PRINTER_HANDLE_rundown(WINSPOOL_PRINTER_HANDLE hPrinter)56 WINSPOOL_PRINTER_HANDLE_rundown(WINSPOOL_PRINTER_HANDLE hPrinter)
57 {
58 }
59