2015-06-22 14:31:47 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Spooler Router
|
2017-09-29 17:18:19 +00:00
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
2015-06-22 14:31:47 +00:00
|
|
|
* PURPOSE: Functions related to Print Processors
|
2017-09-29 17:18:19 +00:00
|
|
|
* COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org)
|
2015-06-22 14:31:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
2020-08-26 22:12:20 +00:00
|
|
|
#include <prtprocenv.h>
|
|
|
|
|
|
|
|
BOOL WINAPI
|
|
|
|
AddPrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPathName, PWSTR pPrintProcessorName)
|
|
|
|
{
|
|
|
|
if (!pEnvironment || !*pEnvironment)
|
|
|
|
pEnvironment = (PWSTR)wszCurrentEnvironment;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI
|
|
|
|
DeletePrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPrintProcessorName)
|
|
|
|
{
|
|
|
|
if (!pEnvironment || !*pEnvironment)
|
|
|
|
pEnvironment = (PWSTR)wszCurrentEnvironment;
|
|
|
|
return FALSE;
|
|
|
|
}
|
2015-06-22 14:31:47 +00:00
|
|
|
|
|
|
|
BOOL WINAPI
|
2015-07-07 17:06:48 +00:00
|
|
|
EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
|
2015-06-22 14:31:47 +00:00
|
|
|
{
|
2017-06-27 07:25:04 +00:00
|
|
|
PSPOOLSS_PRINT_PROVIDER pPrintProvider;
|
|
|
|
|
|
|
|
// Sanity checks
|
|
|
|
if (cbBuf && !pDatatypes)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-08-26 22:12:20 +00:00
|
|
|
if ( cbBuf && !pDatatypes )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2015-07-07 17:06:48 +00:00
|
|
|
// Always call this function on the Local Spooler.
|
2017-06-27 07:25:04 +00:00
|
|
|
pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
|
2015-07-07 17:06:48 +00:00
|
|
|
return pPrintProvider->PrintProvider.fpEnumPrintProcessorDatatypes(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned);
|
2015-06-22 14:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI
|
2015-07-07 17:06:48 +00:00
|
|
|
EnumPrintProcessorsW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
|
2015-06-22 14:31:47 +00:00
|
|
|
{
|
2015-07-07 17:06:48 +00:00
|
|
|
// Always call this function on the Local Spooler.
|
2016-11-24 14:38:39 +00:00
|
|
|
PSPOOLSS_PRINT_PROVIDER pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
|
2020-08-26 22:12:20 +00:00
|
|
|
|
|
|
|
if ( cbBuf && !pPrintProcessorInfo )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2015-07-07 17:06:48 +00:00
|
|
|
return pPrintProvider->PrintProvider.fpEnumPrintProcessors(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded, pcReturned);
|
2015-06-22 14:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI
|
2015-07-07 17:06:48 +00:00
|
|
|
GetPrintProcessorDirectoryW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded)
|
2015-06-22 14:31:47 +00:00
|
|
|
{
|
2016-11-24 19:35:08 +00:00
|
|
|
PSPOOLSS_PRINT_PROVIDER pPrintProvider;
|
|
|
|
|
2016-11-24 19:24:27 +00:00
|
|
|
// Sanity checks
|
|
|
|
if (cbBuf && !pPrintProcessorInfo)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-08-26 22:12:20 +00:00
|
|
|
if ( cbBuf && !pPrintProcessorInfo )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2015-07-07 17:06:48 +00:00
|
|
|
// Always call this function on the Local Spooler.
|
2016-11-24 19:35:08 +00:00
|
|
|
pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
|
2015-07-07 17:06:48 +00:00
|
|
|
return pPrintProvider->PrintProvider.fpGetPrintProcessorDirectory(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded);
|
2015-06-22 14:31:47 +00:00
|
|
|
}
|