[PRINTING]
[reactos.git] / reactos / win32ss / printing / base / spoolss / printprocessors.c
1 /*
2 * PROJECT: ReactOS Spooler Router
3 * LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation
4 * PURPOSE: Functions related to Print Processors
5 * COPYRIGHT: Copyright 2015-2017 Colin Finck <colin@reactos.org>
6 */
7
8 #include "precomp.h"
9
10 BOOL WINAPI
11 EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
12 {
13 PSPOOLSS_PRINT_PROVIDER pPrintProvider;
14
15 // Sanity checks
16 if (cbBuf && !pDatatypes)
17 {
18 SetLastError(ERROR_INVALID_USER_BUFFER);
19 return FALSE;
20 }
21
22 // Always call this function on the Local Spooler.
23 pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
24 return pPrintProvider->PrintProvider.fpEnumPrintProcessorDatatypes(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned);
25 }
26
27 BOOL WINAPI
28 EnumPrintProcessorsW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
29 {
30 // Always call this function on the Local Spooler.
31 PSPOOLSS_PRINT_PROVIDER pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
32 return pPrintProvider->PrintProvider.fpEnumPrintProcessors(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded, pcReturned);
33 }
34
35 BOOL WINAPI
36 GetPrintProcessorDirectoryW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded)
37 {
38 PSPOOLSS_PRINT_PROVIDER pPrintProvider;
39
40 // Sanity checks
41 if (cbBuf && !pPrintProcessorInfo)
42 {
43 SetLastError(ERROR_INVALID_USER_BUFFER);
44 return FALSE;
45 }
46
47 // Always call this function on the Local Spooler.
48 pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry);
49 return pPrintProvider->PrintProvider.fpGetPrintProcessorDirectory(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded);
50 }