ReactOS  0.4.15-dev-976-g0f66c66
printprocessors.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Spooler Router
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Functions related to Print Processors
5  * COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org)
6  */
7 
8 #include "precomp.h"
9 #include <prtprocenv.h>
10 
12 AddPrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPathName, PWSTR pPrintProcessorName)
13 {
14  if (!pEnvironment || !*pEnvironment)
15  pEnvironment = (PWSTR)wszCurrentEnvironment;
16  return FALSE;
17 }
18 
20 DeletePrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPrintProcessorName)
21 {
22  if (!pEnvironment || !*pEnvironment)
23  pEnvironment = (PWSTR)wszCurrentEnvironment;
24  return FALSE;
25 }
26 
28 EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
29 {
30  PSPOOLSS_PRINT_PROVIDER pPrintProvider;
31 
32  // Sanity checks
33  if (cbBuf && !pDatatypes)
34  {
36  return FALSE;
37  }
38 
39  if ( cbBuf && !pDatatypes )
40  {
42  return FALSE;
43  }
44 
45  // Always call this function on the Local Spooler.
47  return pPrintProvider->PrintProvider.fpEnumPrintProcessorDatatypes(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned);
48 }
49 
51 EnumPrintProcessorsW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
52 {
53  // Always call this function on the Local Spooler.
55 
56  if ( cbBuf && !pPrintProcessorInfo )
57  {
59  return FALSE;
60  }
61 
62  return pPrintProvider->PrintProvider.fpEnumPrintProcessors(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded, pcReturned);
63 }
64 
66 GetPrintProcessorDirectoryW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded)
67 {
68  PSPOOLSS_PRINT_PROVIDER pPrintProvider;
69 
70  // Sanity checks
71  if (cbBuf && !pPrintProcessorInfo)
72  {
74  return FALSE;
75  }
76 
77  if ( cbBuf && !pPrintProcessorInfo )
78  {
80  return FALSE;
81  }
82 
83  // Always call this function on the Local Spooler.
85  return pPrintProvider->PrintProvider.fpGetPrintProcessorDirectory(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded);
86 }
BOOL WINAPI DeletePrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPrintProcessorName)
uint16_t * PWSTR
Definition: typedefs.h:56
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
const WCHAR wszCurrentEnvironment[]
Definition: prtprocenv.h:11
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static LPSTR pName
Definition: security.c:75
#define WINAPI
Definition: msvc.h:6
LIST_ENTRY PrintProviderList
Definition: main.c:12
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI GetPrintProcessorDirectoryW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded)
#define SetLastError(x)
Definition: compat.h:500
BOOL WINAPI AddPrintProcessorW(PWSTR pName, PWSTR pEnvironment, PWSTR pPathName, PWSTR pPrintProcessorName)
_In_ DWORD _Out_ PDWORD pcbNeeded
Definition: winddi.h:3827
DWORD * PDWORD
Definition: pedump.c:68
BOOL WINAPI EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
PRINTPROVIDOR PrintProvider
Definition: precomp.h:36
BYTE * PBYTE
Definition: pedump.c:66
base of all file and directory entries
Definition: entries.h:82
BOOL WINAPI EnumPrintProcessorsW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)