ReactOS 0.4.15-dev-7958-gcd0bb1a
printproviders.c
Go to the documentation of this file.
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
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
26 return dwErrorCode;
27
28}
29
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
46 return dwErrorCode;
47}
#define ERR(fmt,...)
Definition: debug.h:110
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
static LPSTR pName
Definition: security.c:75
BYTE * PBYTE
Definition: pedump.c:66
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1463
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1056
BOOL WINAPI DeletePrintProvidorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPrintProviderName)
BOOL WINAPI AddPrintProvidorW(PWSTR pName, DWORD Level, PBYTE pProviderInfo)
DWORD _RpcDeletePrintProvidor(WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pPrintProviderName)
DWORD _RpcAddPrintProvidor(WINSPOOL_HANDLE pName, WINSPOOL_PROVIDOR_CONTAINER *pProvidorContainer)
WINSPOOL_PROVIDOR_INFO_1 * pProvidorInfo1
Definition: winspool.idl:727
union _WINSPOOL_PROVIDOR_CONTAINER::@3447 ProvidorInfo
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WCHAR * WINSPOOL_HANDLE
Definition: winspool.idl:15
__wchar_t WCHAR
Definition: xmlstorage.h:180