Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
6.4 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: ntgdispl.h
  3. *
  4. * Created: 21-Feb-1995 10:05:31
  5. * Author: Eric Kutter [erick]
  6. *
  7. * Copyright (c) Microsoft Corporation. All rights reserved.
  8. *
  9. \**************************************************************************/
  10. #define GDISPOOL_API 0x80000000
  11. #ifndef W32KAPI
  12. #define W32KAPI DECLSPEC_ADDRSAFE
  13. #endif
  14. // NON-API GDISPOOL calls must NOT have MSB set
  15. #define GDISPOOL_TERMINATETHREAD 0x00000000
  16. #define GDISPOOL_INPUT2SMALL 0x00000001
  17. #define GDISPOOL_GETPATHNAME 0x00000002
  18. #define GDISPOOL_UNLOADDRIVER_COMPLETE 0x00000003
  19. // API GDISPOOL messages MUST have MSB set
  20. #define GDISPOOL_WRITE 0x80000000
  21. #define GDISPOOL_OPENPRINTER 0x80000001
  22. #define GDISPOOL_CLOSEPRINTER 0x80000002
  23. #define GDISPOOL_ABORTPRINTER 0x80000003
  24. #define GDISPOOL_STARTDOCPRINTER 0x80000004
  25. #define GDISPOOL_STARTPAGEPRINTER 0x80000005
  26. #define GDISPOOL_ENDPAGEPRINTER 0x80000006
  27. #define GDISPOOL_ENDDOCPRINTER 0x80000007
  28. #define GDISPOOL_GETPRINTERDRIVER 0x80000008
  29. #define GDISPOOL_GETPRINTERDATA 0x80000009
  30. #define GDISPOOL_SETPRINTERDATA 0x8000000a
  31. #define GDISPOOL_ENUMFORMS 0x8000000b
  32. #define GDISPOOL_GETFORM 0x8000000c
  33. #define GDISPOOL_GETPRINTER 0x8000000d
  34. DECLARE_HANDLE(HSPOOLOBJ);
  35. /*********************************Class************************************\
  36. * SPOOLESC
  37. *
  38. * structure used to communicate between the kernel and spooler process
  39. *
  40. *
  41. * History:
  42. * 27-Mar-1995 -by- Eric Kutter [erick]
  43. * Wrote it.
  44. \**************************************************************************/
  45. typedef struct _SPOOLESC
  46. {
  47. ULONG cj; // size of this structure including ajData[]
  48. ULONG iMsg; // message index GDISPOOL_...
  49. HANDLE hSpool; // spoolss spooler handle
  50. ULONG cjOut; // required size of output buffer
  51. HSPOOLOBJ hso; // kernel spool obj
  52. ULONG ulRet; // return value from spooler API
  53. BYTE ajData[1];
  54. } SPOOLESC, *PSPOOLESC;
  55. /****************************************************************************
  56. * GREOPENPRINTER
  57. * GRESTARTDOCPRINTER
  58. * GREWRITEPRINTER
  59. * GREGETPRINTERDATA
  60. *
  61. * The following structures are used package up the data unique to each
  62. * spooler API
  63. *
  64. *
  65. * History:
  66. * 5/1/1995 by Gerrit van Wingerden [gerritv]
  67. * Wrote it.
  68. *****************************************************************************/
  69. typedef struct _GREOPENPRINTER
  70. {
  71. LONG cj;
  72. LONG cjName;
  73. LONG cjDatatype;
  74. LONG cjDevMode;
  75. PRINTER_DEFAULTSW pd;
  76. LONG alData[1];
  77. } GREOPENPRINTER;
  78. typedef struct _GREGETPRINTERDRIVER
  79. {
  80. LONG cj;
  81. LONG cjEnv;
  82. DWORD dwLevel;
  83. LONG cjData;
  84. LONG alData[1];
  85. } GREGETPRINTERDRIVER;
  86. typedef struct _GRESTARTDOCPRINTER
  87. {
  88. LONG cj;
  89. LONG cjDocName;
  90. LONG cjOutputFile;
  91. HANDLE hFile;
  92. DWORD TargetProcessID;
  93. LONG cjDatatype;
  94. LONG cjData;
  95. LONG alData[1];
  96. } GRESTARTDOCPRINTER;
  97. typedef struct _GREWRITEPRINTER
  98. {
  99. LONG cj;
  100. PULONG pUserModeData;
  101. ULONG cjUserModeData;
  102. LONG cjData;
  103. LONG alData[1];
  104. } GREWRITEPRINTER;
  105. typedef struct _GREGETPRINTERDATA
  106. {
  107. LONG cj;
  108. LONG cjValueName;
  109. DWORD dwType;
  110. DWORD dwNeeded;
  111. LONG cjData;
  112. LONG alData[1];
  113. } GREGETPRINTERDATA;
  114. typedef struct _GRESETPRINTERDATA
  115. {
  116. LONG cj;
  117. LONG cjType;
  118. LONG cjPrinterData;
  119. DWORD dwType;
  120. LONG alData[1];
  121. } GRESETPRINTERDATA;
  122. typedef struct _GREENUMFORMS
  123. {
  124. LONG cj;
  125. DWORD dwLevel;
  126. LONG cjData;
  127. LONG nForms;
  128. LONG alData[1];
  129. } GREENUMFORMS;
  130. typedef struct _GREGETPRINTER
  131. {
  132. LONG cj;
  133. DWORD dwLevel;
  134. LONG cjData;
  135. LONG alData[1];
  136. } GREGETPRINTER;
  137. typedef struct _GREGETFORM
  138. {
  139. LONG cj;
  140. LONG cjFormName;
  141. DWORD dwLevel;
  142. LONG cjData;
  143. LONG alData[1];
  144. } GREGETFORM;
  145. typedef struct _GREINPUT2SMALL
  146. {
  147. LONG cj;
  148. DWORD dwNeeded;
  149. BYTE *pjPsm;
  150. } GREINPUT2SMALL;
  151. typedef struct _GETPATHNAME
  152. {
  153. LONG cj;
  154. WCHAR awcPath[MAX_PATH+1];
  155. } GREGETPATHNAME;
  156. /**************************************************************************\
  157. *
  158. * gre internal spooler entry points
  159. *
  160. \**************************************************************************/
  161. ULONG GreGetSpoolMessage(PSPOOLESC, PBYTE, ULONG, PULONG, ULONG);
  162. BOOL WINAPI
  163. GreEnumFormsW(
  164. HANDLE hSpool,
  165. GREENUMFORMS *pEnumForms,
  166. GREENUMFORMS *pEnumFormsReturn,
  167. LONG cjOut );
  168. BOOL
  169. GreGenericW(
  170. HANDLE hSpool,
  171. PULONG pX,
  172. PULONG pXReturn,
  173. LONG cjOut,
  174. LONG MessageID,
  175. ULONG ulFlag );
  176. BOOL WINAPI
  177. GreGetPrinterDriverW(
  178. HANDLE hSpool,
  179. GREGETPRINTERDRIVER *pGetPrinterDriver,
  180. GREGETPRINTERDRIVER *pGetPrinterDriverReturn,
  181. LONG cjOut );
  182. DWORD
  183. GreStartDocPrinterW(
  184. HANDLE hSpool,
  185. GRESTARTDOCPRINTER *pStartDocPrinter,
  186. GRESTARTDOCPRINTER *pStartDocPrinterReturn
  187. );
  188. BOOL
  189. WINAPI
  190. GreOpenPrinterW(
  191. GREOPENPRINTER *pOpenPrinter,
  192. LPHANDLE phPrinter);
  193. ULONG
  194. GreWritePrinter(
  195. HANDLE hSpool,
  196. GREWRITEPRINTER *pWritePrinter);
  197. BOOL
  198. GrePrinterDriverUnloadW(
  199. LPWSTR pDriverName);
  200. W32KAPI
  201. BOOL APIENTRY
  202. NtGdiInitSpool();
  203. W32KAPI
  204. ULONG APIENTRY
  205. NtGdiGetSpoolMessage(
  206. PSPOOLESC psesc,
  207. ULONG cjMsg,
  208. PULONG pulOut,
  209. ULONG cjOut);
  210. ULONG APIENTRY
  211. SendSimpleMessage(
  212. HANDLE hSpool,
  213. ULONG iMsg,
  214. DWORD dwSpoolInstance);
  215. BOOL APIENTRY
  216. GdiInitSpool();
  217. ULONG APIENTRY
  218. GdiGetSpoolMessage(
  219. PSPOOLESC psesc,
  220. ULONG cjMsg,
  221. PULONG pulOut,
  222. ULONG cjOut);
  223. ULONG APIENTRY
  224. GdiSpoolEsc(
  225. HANDLE hSpool,
  226. ULONG iMsg,
  227. PBYTE pjIn,
  228. ULONG cjIn,
  229. PBYTE pjOut,
  230. ULONG cjOut);