Reactos
1/*
2 * PROJECT: ReactOS Printing Include files
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Undocumented APIs of the Spooler Router "spoolss.dll" and internally shared interfaces
5 * COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org)
6 */
7
8#ifndef _REACTOS_SPOOLSS_H
9#define _REACTOS_SPOOLSS_H
10
11#define RESETPRINTERDEFAULTDATATYPE 0x0001
12#define RESETPRINTERDEFAULTDEVMODE 0x0002
13
14#define PORT_IS_UNKNOWN 0
15#define PORT_IS_LPT 1
16#define PORT_IS_COM 2
17#define PORT_IS_FILE 3
18#define PORT_IS_FILENAME 4
19#define PORT_IS_WINE 5
20#define PORT_IS_UNIXNAME 5
21#define PORT_IS_PIPE 6
22#define PORT_IS_VNET 7
23#define PORT_IS_XPS 8
24
25
26// Constants
27#define MAX_PRINTER_NAME 220
28
29typedef struct _MARSHALL_DOWN_INFO
30{
31 DWORD dwOffset; /** Byte offset of this element within the structure or MAXDWORD to indicate the end of the array */
32 DWORD cbSize; /** Total size of this element in bytes under Windows. Unused here, I don't know what we need this number for. */
33 DWORD cbPerElementSize; /** If this element is a structure itself, this field gives the size in bytes of each element of the structure.
34 Otherwise, this is the same as cbTotalSize. E.g. for SYSTEMTIME, cbSize would be 16 and cbPerElementSize would be 2.
35 Unused here, I don't know what we need this number for. */
36 BOOL bAdjustAddress; /** TRUE if MarshallDownStructure shall adjust the address of this element, FALSE if it shall leave this element untouched. */
37}
38MARSHALL_DOWN_INFO, *PMARSHALL_DOWN_INFO;
39
40/** From MS-RPRN, 2.2.1.10.1 */
41typedef struct _PRINTER_INFO_STRESS
42{
43 PWSTR pPrinterName;
44 PWSTR pServerName;
45 DWORD cJobs;
46 DWORD cTotalJobs;
47 DWORD cTotalBytes;
48 SYSTEMTIME stUpTime;
49 DWORD MaxcRef;
50 DWORD cTotalPagesPrinted;
51 DWORD dwGetVersion;
52 DWORD fFreeBuild;
53 DWORD cSpooling;
54 DWORD cMaxSpooling;
55 DWORD cRef;
56 DWORD cErrorOutOfPaper;
57 DWORD cErrorNotReady;
58 DWORD cJobError;
59 DWORD dwNumberOfProcessors;
60 DWORD dwProcessorType;
61 DWORD dwHighPartTotalBytes;
62 DWORD cChangeID;
63 DWORD dwLastError;
64 DWORD Status;
65 DWORD cEnumerateNetworkPrinters;
66 DWORD cAddNetPrinters;
67 USHORT wProcessorArchitecture;
68 USHORT wProcessorLevel;
69 DWORD cRefIC;
70 DWORD dwReserved2;
71 DWORD dwReserved3;
72}
73PRINTER_INFO_STRESS, *PPRINTER_INFO_STRESS;
74
75typedef struct _FILE_INFO_1
76{
77 BOOL bInheritHandle;
78 HANDLE hSpoolFileHandle;
79 DWORD dwOptions;
80} FILE_INFO_1, *PFILE_INFO_1;
81
82BOOL WINAPI AddPortExW(LPWSTR, DWORD, LPBYTE, LPWSTR);
83PVOID WINAPI AlignRpcPtr(PVOID pBuffer, PDWORD pcbBuffer);
84PWSTR WINAPI AllocSplStr(PCWSTR pwszInput);
85PVOID WINAPI DllAllocSplMem(DWORD dwBytes);
86BOOL WINAPI DllFreeSplMem(PVOID pMem);
87BOOL WINAPI DllFreeSplStr(PWSTR pwszString);
88BOOL WINAPI InitializeRouter(HANDLE SpoolerStatusHandle);
89PBYTE WINAPI PackStrings(PCWSTR* pSource, PBYTE pDest, const DWORD* DestOffsets, PBYTE pEnd);
90PVOID WINAPI ReallocSplMem(PVOID pOldMem, DWORD cbOld, DWORD cbNew);
91BOOL WINAPI ReallocSplStr(PWSTR* ppwszString, PCWSTR pwszInput);
92BOOL WINAPI SeekPrinter(HANDLE hPrinter,LARGE_INTEGER liDistanceToMove,PLARGE_INTEGER pliNewPointer,DWORD dwMoveMethod,BOOL bWrite);
93BOOL WINAPI SplInitializeWinSpoolDrv(PVOID* pTable);
94BOOL WINAPI SpoolerInit(VOID);
95PDWORD WINAPI UndoAlignRpcPtr(PVOID pDestinationBuffer, PVOID pSourceBuffer, DWORD cbBuffer, PDWORD pcbNeeded);
96BOOL WINAPI SplGetSpoolFileInfo(HANDLE hPrinter,HANDLE hProcessHandle,DWORD Level,FILE_INFO_1 *pFileInfo,DWORD dwSize,DWORD* dwNeeded );
97BOOL WINAPI SplCommitSpoolData(HANDLE hPrinter,HANDLE hProcessHandle,DWORD cbCommit,DWORD Level,FILE_INFO_1 *pFileInfo,DWORD dwSize,DWORD* dwNeeded);
98BOOL WINAPI SplCloseSpoolFileHandle( HANDLE hPrinter );
99BOOL WINAPI GetPrinterDriverExW(HANDLE hPrinter,LPWSTR pEnvironment,DWORD Level,LPBYTE pDriverInfo,DWORD cbBuf,LPDWORD pcbNeeded,DWORD dwClientMajorVersion,DWORD dwClientMinorVersion,PDWORD pdwServerMajorVersion,PDWORD pdwServerMinorVersion );
100
101#endif