2015-07-17 10:57:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Print Spooler Service
|
2017-09-29 17:18:19 +00:00
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
2015-07-17 10:57:10 +00:00
|
|
|
* PURPOSE: Functions related to Print Providers
|
2017-09-29 17:18:19 +00:00
|
|
|
* COPYRIGHT: Copyright 2015 Colin Finck (colin@reactos.org)
|
2015-07-17 10:57:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
|
|
|
|
|
|
|
DWORD
|
|
|
|
_RpcAddPrintProvidor(WINSPOOL_HANDLE pName, WINSPOOL_PROVIDOR_CONTAINER* pProvidorContainer)
|
|
|
|
{
|
2020-08-26 22:12:20 +00:00
|
|
|
DWORD dwErrorCode;
|
|
|
|
|
|
|
|
dwErrorCode = RpcImpersonateClient(NULL);
|
|
|
|
if (dwErrorCode != ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
|
|
|
|
return dwErrorCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!AddPrintProvidorW(pName, pProvidorContainer->Level, (PBYTE)pProvidorContainer->ProvidorInfo.pProvidorInfo1))
|
|
|
|
dwErrorCode = GetLastError();
|
|
|
|
|
|
|
|
RpcRevertToSelf();
|
|
|
|
return dwErrorCode;
|
|
|
|
|
2015-07-17 10:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD
|
|
|
|
_RpcDeletePrintProvidor(WINSPOOL_HANDLE pName, WCHAR* pEnvironment, WCHAR* pPrintProviderName)
|
|
|
|
{
|
2020-08-26 22:12:20 +00:00
|
|
|
DWORD dwErrorCode;
|
|
|
|
|
|
|
|
dwErrorCode = RpcImpersonateClient(NULL);
|
|
|
|
if (dwErrorCode != ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
|
|
|
|
return dwErrorCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!DeletePrintProvidorW(pName, pEnvironment, pPrintProviderName))
|
|
|
|
dwErrorCode = GetLastError();
|
|
|
|
|
|
|
|
RpcRevertToSelf();
|
|
|
|
return dwErrorCode;
|
2015-07-17 10:57:10 +00:00
|
|
|
}
|