1 /*
2  * PROJECT:     ReactOS Print Spooler Service
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     Functions related to Print Providers
5  * COPYRIGHT:   Copyright 2015 Colin Finck (colin@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 DWORD
11 _RpcAddPrintProvidor(WINSPOOL_HANDLE pName, WINSPOOL_PROVIDOR_CONTAINER* pProvidorContainer)
12 {
13     DWORD dwErrorCode;
14 
15     dwErrorCode = RpcImpersonateClient(NULL);
16     if (dwErrorCode != ERROR_SUCCESS)
17     {
18         ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
19         return dwErrorCode;
20     }
21 
22     if (!AddPrintProvidorW(pName, pProvidorContainer->Level, (PBYTE)pProvidorContainer->ProvidorInfo.pProvidorInfo1))
23         dwErrorCode = GetLastError();
24 
25     RpcRevertToSelf();
26     return dwErrorCode;
27 
28 }
29 
30 DWORD
31 _RpcDeletePrintProvidor(WINSPOOL_HANDLE pName, WCHAR* pEnvironment, WCHAR* pPrintProviderName)
32 {
33     DWORD dwErrorCode;
34 
35     dwErrorCode = RpcImpersonateClient(NULL);
36     if (dwErrorCode != ERROR_SUCCESS)
37     {
38         ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
39         return dwErrorCode;
40     }
41 
42     if (!DeletePrintProvidorW(pName, pEnvironment, pPrintProviderName))
43         dwErrorCode = GetLastError();
44 
45     RpcRevertToSelf();
46     return dwErrorCode;
47 }
48