1c2c66affSColin Finck /* 2c2c66affSColin Finck * PROJECT: ReactOS Local Spooler 3c2c66affSColin Finck * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) 4c2c66affSColin Finck * PURPOSE: Precompiled Header for all source files 5c2c66affSColin Finck * COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org) 6c2c66affSColin Finck */ 7c2c66affSColin Finck 8c2c66affSColin Finck #ifndef _PRECOMP_H 9c2c66affSColin Finck #define _PRECOMP_H 10c2c66affSColin Finck 11c2c66affSColin Finck #define WIN32_NO_STATUS 12c2c66affSColin Finck #include <limits.h> 13c2c66affSColin Finck #include <stdlib.h> 14c2c66affSColin Finck #include <wchar.h> 15c2c66affSColin Finck 16c2c66affSColin Finck #include <lmcons.h> 17c2c66affSColin Finck #include <rpc.h> 18c2c66affSColin Finck #include <strsafe.h> 19c2c66affSColin Finck #include <windef.h> 20c2c66affSColin Finck #include <winbase.h> 21c2c66affSColin Finck #include <wingdi.h> 22c2c66affSColin Finck #include <winreg.h> 23c2c66affSColin Finck #include <winspool.h> 24c2c66affSColin Finck #include <winsplp.h> 25c2c66affSColin Finck #include <dsrole.h> 26c2c66affSColin Finck #include <secext.h> 27c2c66affSColin Finck #include <ndk/rtlfuncs.h> 28c2c66affSColin Finck 29c2c66affSColin Finck #define SKIPLIST_LEVELS 16 30c2c66affSColin Finck #include <skiplist.h> 31c2c66affSColin Finck #include <spoolss.h> 32c2c66affSColin Finck 33c2c66affSColin Finck #include <wine/debug.h> 34c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(localspl); 35c2c66affSColin Finck 36c2c66affSColin Finck // Macros 37c2c66affSColin Finck #define IS_VALID_JOB_ID(ID) (ID >= 1 && ID <= 99999) 38c2c66affSColin Finck #define IS_VALID_PRIORITY(P) (P >= MIN_PRIORITY && P <= MAX_PRIORITY) 39c2c66affSColin Finck 40c2c66affSColin Finck // Constants 41c2c66affSColin Finck #define SHD_WIN2003_SIGNATURE 0x4968 42c2c66affSColin Finck 43c2c66affSColin Finck // Function pointers 44c2c66affSColin Finck typedef BOOL (WINAPI *PClosePrintProcessor)(HANDLE); 45c2c66affSColin Finck typedef BOOL (WINAPI *PControlPrintProcessor)(HANDLE, DWORD); 46c2c66affSColin Finck typedef BOOL (WINAPI *PEnumPrintProcessorDatatypesW)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD); 47c2c66affSColin Finck typedef DWORD (WINAPI *PGetPrintProcessorCapabilities)(LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD); 48c2c66affSColin Finck typedef HANDLE (WINAPI *POpenPrintProcessor)(LPWSTR, PPRINTPROCESSOROPENDATA); 49c2c66affSColin Finck typedef BOOL (WINAPI *PPrintDocumentOnPrintProcessor)(HANDLE, LPWSTR); 50c2c66affSColin Finck typedef LPMONITOREX(WINAPI *PInitializePrintMonitor)(PWSTR); 51c2c66affSColin Finck typedef LPMONITOR2(WINAPI *PInitializePrintMonitor2)(PMONITORINIT, PHANDLE); 52c2c66affSColin Finck 53c2c66affSColin Finck // Forward declarations 54c2c66affSColin Finck typedef struct _LOCAL_HANDLE LOCAL_HANDLE, *PLOCAL_HANDLE; 55c2c66affSColin Finck typedef struct _LOCAL_JOB LOCAL_JOB, *PLOCAL_JOB; 56c2c66affSColin Finck typedef struct _LOCAL_PORT LOCAL_PORT, *PLOCAL_PORT; 57c2c66affSColin Finck typedef struct _LOCAL_PORT_HANDLE LOCAL_PORT_HANDLE, *PLOCAL_PORT_HANDLE; 58c2c66affSColin Finck typedef struct _LOCAL_PRINT_MONITOR LOCAL_PRINT_MONITOR, *PLOCAL_PRINT_MONITOR; 59c2c66affSColin Finck typedef struct _LOCAL_PRINT_PROCESSOR LOCAL_PRINT_PROCESSOR, *PLOCAL_PRINT_PROCESSOR; 60c2c66affSColin Finck typedef struct _LOCAL_PRINTER LOCAL_PRINTER, *PLOCAL_PRINTER; 61c2c66affSColin Finck typedef struct _LOCAL_PRINTER_HANDLE LOCAL_PRINTER_HANDLE, *PLOCAL_PRINTER_HANDLE; 62c2c66affSColin Finck typedef struct _LOCAL_XCV_HANDLE LOCAL_XCV_HANDLE, *PLOCAL_XCV_HANDLE; 63c2c66affSColin Finck typedef struct _SHD_HEADER SHD_HEADER, *PSHD_HEADER; 64c2c66affSColin Finck 65c2c66affSColin Finck // Structures 66c2c66affSColin Finck /** 67c2c66affSColin Finck * Describes a Print Monitor. 68c2c66affSColin Finck */ 69c2c66affSColin Finck struct _LOCAL_PRINT_MONITOR 70c2c66affSColin Finck { 71c2c66affSColin Finck LIST_ENTRY Entry; 72c2c66affSColin Finck PWSTR pwszName; /** Name of the Print Monitor as read from the registry. */ 73c2c66affSColin Finck PWSTR pwszFileName; /** DLL File Name of the Print Monitor. */ 74c2c66affSColin Finck BOOL bIsLevel2; /** Whether this Print Monitor supplies an InitializePrintMonitor2 API (preferred) instead of InitializePrintMonitor. */ 75c2c66affSColin Finck PVOID pMonitor; /** For bIsLevel2 == TRUE: LPMONITOR2 pointer returned by InitializePrintMonitor2. 76c2c66affSColin Finck For bIsLevel2 == FALSE: LPMONITOREX pointer returned by InitializePrintMonitor. */ 77c2c66affSColin Finck HANDLE hMonitor; /** Only used when bIsLevel2 == TRUE: Handle returned by InitializePrintMonitor2. */ 78c2c66affSColin Finck }; 79c2c66affSColin Finck 80c2c66affSColin Finck /** 81c2c66affSColin Finck * Describes a Port handled by a Print Monitor. 82c2c66affSColin Finck */ 83c2c66affSColin Finck struct _LOCAL_PORT 84c2c66affSColin Finck { 85c2c66affSColin Finck LIST_ENTRY Entry; 86c2c66affSColin Finck PWSTR pwszName; /** The name of the port (including the trailing colon). */ 87c2c66affSColin Finck PLOCAL_PRINT_MONITOR pPrintMonitor; /** The Print Monitor handling this port. */ 88c2c66affSColin Finck PLOCAL_JOB pNextJobToProcess; /** The Print Job that will be processed by the next created Port handle. */ 89c2c66affSColin Finck }; 90c2c66affSColin Finck 91c2c66affSColin Finck /** 92c2c66affSColin Finck * Describes a Print Processor. 93c2c66affSColin Finck */ 94c2c66affSColin Finck struct _LOCAL_PRINT_PROCESSOR 95c2c66affSColin Finck { 96c2c66affSColin Finck LIST_ENTRY Entry; 97c2c66affSColin Finck PWSTR pwszName; 98c2c66affSColin Finck PDATATYPES_INFO_1W pDatatypesInfo1; 99c2c66affSColin Finck DWORD dwDatatypeCount; 100c2c66affSColin Finck PClosePrintProcessor pfnClosePrintProcessor; 101c2c66affSColin Finck PControlPrintProcessor pfnControlPrintProcessor; 102c2c66affSColin Finck PEnumPrintProcessorDatatypesW pfnEnumPrintProcessorDatatypesW; 103c2c66affSColin Finck PGetPrintProcessorCapabilities pfnGetPrintProcessorCapabilities; 104c2c66affSColin Finck POpenPrintProcessor pfnOpenPrintProcessor; 105c2c66affSColin Finck PPrintDocumentOnPrintProcessor pfnPrintDocumentOnPrintProcessor; 106c2c66affSColin Finck }; 107c2c66affSColin Finck 108c2c66affSColin Finck /** 109c2c66affSColin Finck * Describes a printer and manages its print jobs. 110c2c66affSColin Finck * Created once for every printer at startup. 111c2c66affSColin Finck */ 112c2c66affSColin Finck struct _LOCAL_PRINTER 113c2c66affSColin Finck { 114c2c66affSColin Finck // This sort key must be the first element for LookupElementSkiplist to work! 115c2c66affSColin Finck PWSTR pwszPrinterName; 116c2c66affSColin Finck 117c2c66affSColin Finck DWORD dwAttributes; 118c2c66affSColin Finck DWORD dwStatus; 119c2c66affSColin Finck PWSTR pwszLocation; 120c2c66affSColin Finck PWSTR pwszPrinterDriver; 121c2c66affSColin Finck PWSTR pwszDescription; 122c2c66affSColin Finck PWSTR pwszDefaultDatatype; 123c2c66affSColin Finck PDEVMODEW pDefaultDevMode; 124c2c66affSColin Finck PLOCAL_PRINT_PROCESSOR pPrintProcessor; 125c2c66affSColin Finck PLOCAL_PORT pPort; 126c2c66affSColin Finck SKIPLIST JobList; 127c2c66affSColin Finck }; 128c2c66affSColin Finck 129c2c66affSColin Finck /** 130c2c66affSColin Finck * Describes an entire print job associated to a specific printer through the Printer member. 131c2c66affSColin Finck * Created with every valid call to LocalStartDocPrinter. 132c2c66affSColin Finck */ 133c2c66affSColin Finck struct _LOCAL_JOB 134c2c66affSColin Finck { 135c2c66affSColin Finck // This sort key must be the first element for LookupElementSkiplist to work! 136c2c66affSColin Finck DWORD dwJobID; /** Internal and external ID of this Job */ 137c2c66affSColin Finck 138c2c66affSColin Finck BOOL bAddedJob : 1; /** Whether AddJob has already been called on this Job. */ 139c2c66affSColin Finck HANDLE hPrintProcessor; /** Handle returned by OpenPrintProcessor while the Job is printing. */ 140c2c66affSColin Finck PLOCAL_PRINTER pPrinter; /** Associated Printer to this Job */ 141c2c66affSColin Finck PLOCAL_PRINT_PROCESSOR pPrintProcessor; /** Associated Print Processor to this Job */ 142c2c66affSColin Finck DWORD dwPriority; /** Priority of this Job from MIN_PRIORITY to MAX_PRIORITY, default being DEF_PRIORITY */ 143c2c66affSColin Finck SYSTEMTIME stSubmitted; /** Time of the submission of this Job */ 144c2c66affSColin Finck PWSTR pwszUserName; /** Optional; User that submitted the Job */ 145c2c66affSColin Finck PWSTR pwszNotifyName; /** Optional; User that shall be notified about the status of the Job */ 146c2c66affSColin Finck PWSTR pwszDocumentName; /** Optional; Name of the Document that is printed */ 147c2c66affSColin Finck PWSTR pwszDatatype; /** Datatype of the Document */ 148c2c66affSColin Finck PWSTR pwszOutputFile; /** Output File to spool the Job to */ 149c2c66affSColin Finck PWSTR pwszPrintProcessorParameters; /** Optional; Parameters for the chosen Print Processor */ 150c2c66affSColin Finck PWSTR pwszStatus; /** Optional; a Status Message for the Job */ 151c2c66affSColin Finck DWORD dwTotalPages; /** Total pages of the Document */ 152c2c66affSColin Finck DWORD dwPagesPrinted; /** Number of pages that have already been printed */ 153c2c66affSColin Finck DWORD dwStartTime; /** Earliest time in minutes since 12:00 AM UTC when this document can be printed */ 154c2c66affSColin Finck DWORD dwUntilTime; /** Latest time in minutes since 12:00 AM UTC when this document can be printed */ 155c2c66affSColin Finck DWORD dwStatus; /** JOB_STATUS_* flags of the Job */ 156c2c66affSColin Finck PWSTR pwszMachineName; /** Name of the machine that submitted the Job (prepended with two backslashes) */ 157c2c66affSColin Finck PDEVMODEW pDevMode; /** Associated Device Mode to this Job */ 158c2c66affSColin Finck }; 159c2c66affSColin Finck 160c2c66affSColin Finck /** 161c2c66affSColin Finck * Specific handle returned by LocalOpenPrinter for every valid call that opens a Printer or Print Job. 162c2c66affSColin Finck */ 163c2c66affSColin Finck struct _LOCAL_PRINTER_HANDLE 164c2c66affSColin Finck { 165c2c66affSColin Finck BOOL bStartedDoc : 1; /** Whether StartDocPrinter has already been called. */ 166c2c66affSColin Finck HANDLE hSPLFile; /** Handle to an opened SPL file for Printer Job handles. */ 167c2c66affSColin Finck PLOCAL_PRINTER pPrinter; /** Printer associated with this handle. */ 168c2c66affSColin Finck PLOCAL_JOB pJob; /** Print Job associated with this handle. This can be the specified Job if this is a Print Job handle or the started job through LocalStartDocPrinter. */ 169c2c66affSColin Finck PWSTR pwszDatatype; /** Datatype used for newly started jobs. */ 170c2c66affSColin Finck PDEVMODEW pDevMode; /** DevMode used for newly started jobs. */ 171c2c66affSColin Finck }; 172c2c66affSColin Finck 173c2c66affSColin Finck /** 174c2c66affSColin Finck * Specific handle returned by LocalOpenPrinter for every valid call that opens a Port. 175c2c66affSColin Finck */ 176c2c66affSColin Finck struct _LOCAL_PORT_HANDLE 177c2c66affSColin Finck { 178c2c66affSColin Finck HANDLE hPort; /** Handle returned by pfnOpenPort. */ 179c2c66affSColin Finck PLOCAL_PORT pPort; /** Port associated with this handle. */ 180c2c66affSColin Finck }; 181c2c66affSColin Finck 182c2c66affSColin Finck /** 183c2c66affSColin Finck * Specific handle returned by LocalOpenPrinter for every valid call that opens an XcvMonitor or XcvPort. 184c2c66affSColin Finck */ 185c2c66affSColin Finck struct _LOCAL_XCV_HANDLE 186c2c66affSColin Finck { 187c2c66affSColin Finck HANDLE hXcv; /** Handle returned by pfnXcvOpenPort. */ 188c2c66affSColin Finck PLOCAL_PRINT_MONITOR pPrintMonitor; /** Print Monitor associated with this handle. */ 189c2c66affSColin Finck }; 190c2c66affSColin Finck 191c2c66affSColin Finck /** 192c2c66affSColin Finck * Describes a handle returned by LocalOpenPrinter. 193c2c66affSColin Finck * Suitable for all things that can be opened through LocalOpenPrinter. 194c2c66affSColin Finck */ 195c2c66affSColin Finck struct _LOCAL_HANDLE 196c2c66affSColin Finck { 197c2c66affSColin Finck enum { 198c2c66affSColin Finck HandleType_Port, /** pSpecificHandle is a PLOCAL_PORT_HANDLE. */ 199c2c66affSColin Finck HandleType_Printer, /** pSpecificHandle is a PLOCAL_PRINTER_HANDLE. */ 200c2c66affSColin Finck HandleType_PrintServer, /** pSpecificHandle is NULL (no additional information needed for a handle to the Print Server) */ 201c2c66affSColin Finck HandleType_Xcv /** pSpecificHandle is a PLOCAL_XCV_HANDLE. */ 202c2c66affSColin Finck } 203c2c66affSColin Finck HandleType; 204c2c66affSColin Finck PVOID pSpecificHandle; 205c2c66affSColin Finck }; 206c2c66affSColin Finck 207c2c66affSColin Finck /** 208c2c66affSColin Finck * Describes the header of a print job serialized into a shadow file (.SHD) 209c2c66affSColin Finck * Documented in http://www.undocprint.org/formats/winspool/shd 210c2c66affSColin Finck * Compatible with Windows Server 2003 211c2c66affSColin Finck */ 212c2c66affSColin Finck struct _SHD_HEADER 213c2c66affSColin Finck { 214c2c66affSColin Finck DWORD dwSignature; 215c2c66affSColin Finck DWORD cbHeader; 216c2c66affSColin Finck WORD wStatus; 217c2c66affSColin Finck WORD wUnknown1; 218c2c66affSColin Finck DWORD dwJobID; 219c2c66affSColin Finck DWORD dwPriority; 220c2c66affSColin Finck DWORD offUserName; 221c2c66affSColin Finck DWORD offNotifyName; 222c2c66affSColin Finck DWORD offDocumentName; 223c2c66affSColin Finck DWORD offPort; 224c2c66affSColin Finck DWORD offPrinterName; 225c2c66affSColin Finck DWORD offDriverName; 226c2c66affSColin Finck DWORD offDevMode; 227c2c66affSColin Finck DWORD offPrintProcessor; 228c2c66affSColin Finck DWORD offDatatype; 229c2c66affSColin Finck DWORD offPrintProcessorParameters; 230c2c66affSColin Finck SYSTEMTIME stSubmitted; 231c2c66affSColin Finck DWORD dwStartTime; 232c2c66affSColin Finck DWORD dwUntilTime; 233c2c66affSColin Finck DWORD dwUnknown6; 234c2c66affSColin Finck DWORD dwTotalPages; 235c2c66affSColin Finck DWORD cbSecurityDescriptor; 236c2c66affSColin Finck DWORD offSecurityDescriptor; 237c2c66affSColin Finck DWORD dwUnknown3; 238c2c66affSColin Finck DWORD dwUnknown4; 239c2c66affSColin Finck DWORD dwUnknown5; 240c2c66affSColin Finck DWORD offMachineName; 241c2c66affSColin Finck DWORD dwSPLSize; 242c2c66affSColin Finck }; 243c2c66affSColin Finck 244c2c66affSColin Finck // jobs.c 245c2c66affSColin Finck extern SKIPLIST GlobalJobList; 246c2c66affSColin Finck DWORD WINAPI CreateJob(PLOCAL_PRINTER_HANDLE pPrinterHandle); 247c2c66affSColin Finck void FreeJob(PLOCAL_JOB pJob); 248c2c66affSColin Finck DWORD GetJobFilePath(PCWSTR pwszExtension, DWORD dwJobID, PWSTR pwszOutput); 249d56c9a89SAmine Khaldi BOOL InitializeGlobalJobList(VOID); 250c2c66affSColin Finck void InitializePrinterJobList(PLOCAL_PRINTER pPrinter); 251c2c66affSColin Finck BOOL WINAPI LocalAddJob(HANDLE hPrinter, DWORD Level, LPBYTE pData, DWORD cbBuf, LPDWORD pcbNeeded); 252c2c66affSColin Finck BOOL WINAPI LocalEnumJobs(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs, DWORD Level, PBYTE pStart, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); 253c2c66affSColin Finck BOOL WINAPI LocalGetJob(HANDLE hPrinter, DWORD JobId, DWORD Level, PBYTE pStart, DWORD cbBuf, LPDWORD pcbNeeded); 254c2c66affSColin Finck BOOL WINAPI LocalScheduleJob(HANDLE hPrinter, DWORD dwJobID); 255c2c66affSColin Finck BOOL WINAPI LocalSetJob(HANDLE hPrinter, DWORD JobId, DWORD Level, PBYTE pJobInfo, DWORD Command); 256c2c66affSColin Finck PLOCAL_JOB ReadJobShadowFile(PCWSTR pwszFilePath); 257c2c66affSColin Finck BOOL WriteJobShadowFile(PWSTR pwszFilePath, const PLOCAL_JOB pJob); 258c2c66affSColin Finck 259c2c66affSColin Finck // main.c 260c2c66affSColin Finck extern const WCHAR wszCurrentEnvironment[]; 261c2c66affSColin Finck extern const DWORD cbCurrentEnvironment; 262c2c66affSColin Finck extern const DWORD dwSpoolerMajorVersion; 263c2c66affSColin Finck extern const DWORD dwSpoolerMinorVersion; 264c2c66affSColin Finck extern const WCHAR wszDefaultDocumentName[]; 265c2c66affSColin Finck extern HKEY hPrintKey; 266c2c66affSColin Finck extern HKEY hPrintersKey; 2672e4457f2SMark Jansen extern PCWSTR wszPrintProviderInfo[3]; 268c2c66affSColin Finck extern WCHAR wszJobDirectory[MAX_PATH]; 269c2c66affSColin Finck extern DWORD cchJobDirectory; 270c2c66affSColin Finck extern WCHAR wszSpoolDirectory[MAX_PATH]; 271c2c66affSColin Finck extern DWORD cchSpoolDirectory; 272c2c66affSColin Finck 273c2c66affSColin Finck // monitors.c 274c2c66affSColin Finck extern LIST_ENTRY PrintMonitorList; 275c2c66affSColin Finck PLOCAL_PRINT_MONITOR FindPrintMonitor(PCWSTR pwszName); 276c2c66affSColin Finck BOOL InitializePrintMonitorList(void); 277c2c66affSColin Finck BOOL WINAPI LocalEnumMonitors(PWSTR pName, DWORD Level, PBYTE pMonitors, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned); 278c2c66affSColin Finck 279c2c66affSColin Finck // ports.c 280c2c66affSColin Finck PLOCAL_PORT FindPort(PCWSTR pwszName); 281c2c66affSColin Finck BOOL InitializePortList(void); 282c2c66affSColin Finck BOOL WINAPI LocalEnumPorts(PWSTR pName, DWORD Level, PBYTE pPorts, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned); 283c2c66affSColin Finck 284c2c66affSColin Finck // printerdata.c 285c2c66affSColin Finck DWORD WINAPI LocalGetPrinterData(HANDLE hPrinter, PWSTR pValueName, PDWORD pType, PBYTE pData, DWORD nSize, PDWORD pcbNeeded); 286c2c66affSColin Finck DWORD WINAPI LocalGetPrinterDataEx(HANDLE hPrinter, PCWSTR pKeyName, PCWSTR pValueName, PDWORD pType, PBYTE pData, DWORD nSize, PDWORD pcbNeeded); 287c2c66affSColin Finck DWORD WINAPI LocalSetPrinterData(HANDLE hPrinter, PWSTR pValueName, DWORD Type, PBYTE pData, DWORD cbData); 288c2c66affSColin Finck DWORD WINAPI LocalSetPrinterDataEx(HANDLE hPrinter, LPCWSTR pKeyName, LPCWSTR pValueName, DWORD Type, LPBYTE pData, DWORD cbData); 289c2c66affSColin Finck 290796dd5f5SMark Jansen // printerdriver.c 291796dd5f5SMark Jansen BOOL WINAPI LocalGetPrinterDriver(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded); 292796dd5f5SMark Jansen 293796dd5f5SMark Jansen 294c2c66affSColin Finck // printers.c 295c2c66affSColin Finck extern SKIPLIST PrinterList; 296c2c66affSColin Finck BOOL InitializePrinterList(void); 297c2c66affSColin Finck BOOL WINAPI LocalEnumPrinters(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); 298c2c66affSColin Finck BOOL WINAPI LocalGetPrinter(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, DWORD cbBuf, LPDWORD pcbNeeded); 299c2c66affSColin Finck BOOL WINAPI LocalOpenPrinter(PWSTR lpPrinterName, HANDLE* phPrinter, PPRINTER_DEFAULTSW pDefault); 300c2c66affSColin Finck BOOL WINAPI LocalReadPrinter(HANDLE hPrinter, PVOID pBuf, DWORD cbBuf, PDWORD pNoBytesRead); 301c2c66affSColin Finck DWORD WINAPI LocalStartDocPrinter(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo); 302c2c66affSColin Finck BOOL WINAPI LocalStartPagePrinter(HANDLE hPrinter); 303c2c66affSColin Finck BOOL WINAPI LocalWritePrinter(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, LPDWORD pcWritten); 304c2c66affSColin Finck BOOL WINAPI LocalEndPagePrinter(HANDLE hPrinter); 305c2c66affSColin Finck BOOL WINAPI LocalEndDocPrinter(HANDLE hPrinter); 306c2c66affSColin Finck BOOL WINAPI LocalClosePrinter(HANDLE hPrinter); 307c2c66affSColin Finck 308c2c66affSColin Finck // printingthread.c 309c2c66affSColin Finck DWORD WINAPI PrintingThreadProc(PLOCAL_JOB pJob); 310c2c66affSColin Finck 311c2c66affSColin Finck // printprocessors.c 312c2c66affSColin Finck BOOL FindDatatype(const PLOCAL_PRINT_PROCESSOR pPrintProcessor, PCWSTR pwszDatatype); 313c2c66affSColin Finck PLOCAL_PRINT_PROCESSOR FindPrintProcessor(PCWSTR pwszName); 314c2c66affSColin Finck BOOL InitializePrintProcessorList(void); 315c2c66affSColin Finck BOOL WINAPI LocalEnumPrintProcessorDatatypes(LPWSTR pName, LPWSTR pPrintProcessorName, DWORD Level, LPBYTE pDatatypes, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); 316c2c66affSColin Finck BOOL WINAPI LocalEnumPrintProcessors(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); 317c2c66affSColin Finck BOOL WINAPI LocalGetPrintProcessorDirectory(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded); 318c2c66affSColin Finck 319*89e716a7SJames Tabor // spoolfile.c 320*89e716a7SJames Tabor BOOL WINAPI LocalGetSpoolFileInfo(HANDLE hPrinter,LPWSTR *pSpoolDir,LPHANDLE phFile,HANDLE hSpoolerProcess,HANDLE hAppProcess); 321*89e716a7SJames Tabor BOOL WINAPI LocalCommitSpoolData(HANDLE hPrinter,DWORD cbCommit); 322*89e716a7SJames Tabor BOOL WINAPI LocalCloseSpoolFileHandle(HANDLE hPrinter); 323*89e716a7SJames Tabor 324c2c66affSColin Finck // tools.c 325c2c66affSColin Finck PWSTR AllocAndRegQueryWSZ(HKEY hKey, PCWSTR pwszValueName); 326c2c66affSColin Finck PDEVMODEW DuplicateDevMode(PDEVMODEW pInput); 327c2c66affSColin Finck 328c2c66affSColin Finck #endif 329