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.

273 lines
7.0 KiB

  1. /*++
  2. Copyright (c) 1990-1998 Microsoft Corporation
  3. Module Name:
  4. WinSpolp.h
  5. Abstract:
  6. Header file for Print APIs
  7. Revision History:
  8. --*/
  9. #ifndef _WINSPOLP_
  10. #define _WINSPOLP_
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define PRINTER_ATTRIBUTE_UPDATEWININI 0x80000000
  15. typedef struct _ADDJOB_INFO_2W {
  16. LPWSTR pData;
  17. DWORD JobId;
  18. } ADDJOB_INFO_2W, *PADDJOB_INFO_2W, *LPADDJOB_INFO_2W;
  19. #define DRIVER_INFO_PRIVATE_LEVEL 100
  20. #define DRIVER_INFO_VERSION_LEVEL DRIVER_INFO_PRIVATE_LEVEL + 1
  21. //
  22. // You must change RPC_DRIVER_INFCAT_INFO_1 in winspl.idl if you
  23. // want to change structure DRIVER_INFCAT_INFO_1
  24. //
  25. typedef struct _DRIVER_FINFCAT_INFO_1 {
  26. PCWSTR pszCatPath; // full path to the dirver cat file
  27. PCWSTR pszCatNameOnSystem; // new cat name used under CatRoot
  28. } DRIVER_INFCAT_INFO_1;
  29. //
  30. // You must change RPC_DRIVER_INFCAT_INFO_2 in winspl.idl if you
  31. // want to change structure DRIVER_INFCAT_INFO_2
  32. //
  33. typedef struct _DRIVER_INFCAT_INFO_2 {
  34. PCWSTR pszCatPath; // full path to the dirver cat file
  35. PCWSTR pszInfPath; // full path to the dirver INF file
  36. PCWSTR pszSrcLoc; // Information abou the Source Inf
  37. DWORD dwMediaType; // Source Media Type
  38. DWORD dwCopyStyle; // Copy Style
  39. } DRIVER_INFCAT_INFO_2;
  40. typedef enum {
  41. DRIVER_FILE = 0,
  42. CONFIG_FILE = 1,
  43. DATA_FILE = 2,
  44. HELP_FILE = 3,
  45. DEPENDENT_FILE = 4
  46. } DRIVER_FILE_TYPE;
  47. typedef struct _DRIVER_FILE_INFO {
  48. DWORD FileNameOffset;
  49. DRIVER_FILE_TYPE FileType;
  50. DWORD FileVersion;
  51. } DRIVER_FILE_INFO, *PDRIVER_FILE_INFO, *LPDRIVER_FILE_INFO;
  52. typedef struct _DRIVER_INFO_VERSION {
  53. DWORD cVersion;
  54. LPWSTR pName;
  55. LPWSTR pEnvironment;
  56. LPDRIVER_FILE_INFO pFileInfo;
  57. DWORD dwFileCount;
  58. LPWSTR pMonitorName;
  59. LPWSTR pDefaultDataType;
  60. LPWSTR pszzPreviousNames;
  61. FILETIME ftDriverDate;
  62. DWORDLONG dwlDriverVersion;
  63. LPWSTR pszMfgName;
  64. LPWSTR pszOEMUrl;
  65. LPWSTR pszHardwareID;
  66. LPWSTR pszProvider;
  67. } DRIVER_INFO_VERSION, *PDRIVER_INFO_VERSION, *LPDRIVER_INFO_VERSION;
  68. #define APD_DONT_COPY_FILES_TO_CLUSTER 0x00001000
  69. #define APD_COPY_TO_ALL_SPOOLERS 0x00002000
  70. #define APD_NO_UI 0x00004000
  71. #define APD_INSTALL_WARNED_DRIVER 0x00008000
  72. #define APD_RETURN_BLOCKING_STATUS_CODE 0x00010000
  73. #define APD_DONT_SET_CHECKPOINT 0x00020000
  74. // FLAGS for AddDriverCatalog
  75. #define APDC_NONE 0x00000000
  76. #define APDC_USE_ORIGINAL_CAT_NAME 0x00000001
  77. #define EPD_ALL_LOCAL_AND_CLUSTER TEXT("AllCluster")
  78. //Internal for printprocessor interface
  79. #define DI_CHANNEL_WRITE 2 // Direct write only - background read thread ok
  80. #define PRINTER_ENUM_CLUSTER 0x00000800
  81. typedef struct _SPOOL_FILE_INFO_1 {
  82. DWORD dwVersion;
  83. HANDLE hSpoolFile;
  84. DWORD dwAttributes;
  85. } SPOOL_FILE_INFO_1, *PSPOOL_FILE_INFO_1;
  86. HANDLE
  87. WINAPI
  88. GetSpoolFileHandle(
  89. HANDLE hPrinter
  90. );
  91. HANDLE
  92. WINAPI
  93. CommitSpoolData(
  94. HANDLE hPrinter,
  95. HANDLE hSpoolFile,
  96. DWORD cbCommit
  97. );
  98. BOOL
  99. WINAPI
  100. CloseSpoolFileHandle(
  101. HANDLE hPrinter,
  102. HANDLE hSpoolFile
  103. );
  104. BOOL
  105. WINAPI
  106. AddDriverCatalog(
  107. IN HANDLE hPrinter,
  108. IN DWORD Level,
  109. IN VOID *pvDriverInfCatInfo,
  110. IN DWORD dwCatalogCopyFiles
  111. );
  112. BOOL
  113. WINAPI
  114. AddPerMachineConnectionA(
  115. IN LPCSTR pServer,
  116. IN LPCSTR pPrinterName,
  117. IN LPCSTR pPrintServer,
  118. IN LPCSTR pProvider
  119. );
  120. BOOL
  121. WINAPI
  122. AddPerMachineConnectionW(
  123. IN LPCWSTR pServer,
  124. IN LPCWSTR pPrinterName,
  125. IN LPCWSTR pPrintServer,
  126. IN LPCWSTR pProvider
  127. );
  128. #ifdef UNICODE
  129. #define AddPerMachineConnection AddPerMachineConnectionW
  130. #else
  131. #define AddPerMachineConnection AddPerMachineConnectionA
  132. #endif // !UNICODE
  133. BOOL
  134. WINAPI
  135. DeletePerMachineConnectionA(
  136. IN LPCSTR pServer,
  137. IN LPCSTR pPrinterName
  138. );
  139. BOOL
  140. WINAPI
  141. DeletePerMachineConnectionW(
  142. IN LPCWSTR pServer,
  143. IN LPCWSTR pPrinterName
  144. );
  145. #ifdef UNICODE
  146. #define DeletePerMachineConnection DeletePerMachineConnectionW
  147. #else
  148. #define DeletePerMachineConnection DeletePerMachineConnectionA
  149. #endif // !UNICODE
  150. BOOL
  151. WINAPI
  152. EnumPerMachineConnectionsA(
  153. IN LPCSTR pServer,
  154. OUT LPBYTE pPrinterEnum,
  155. IN DWORD cbBuf,
  156. OUT LPDWORD pcbNeeded,
  157. OUT LPDWORD pcReturned
  158. );
  159. BOOL
  160. WINAPI
  161. EnumPerMachineConnectionsW(
  162. IN LPCWSTR pServer,
  163. OUT LPBYTE pPrinterEnum,
  164. IN DWORD cbBuf,
  165. OUT LPDWORD pcbNeeded,
  166. OUT LPDWORD pcReturned
  167. );
  168. #ifdef UNICODE
  169. #define EnumPerMachineConnections EnumPerMachineConnectionsW
  170. #else
  171. #define EnumPerMachineConnections EnumPerMachineConnectionsA
  172. #endif // !UNICODE
  173. BOOL
  174. WINAPI
  175. SeekPrinter(
  176. IN HANDLE hPrinter,
  177. IN LARGE_INTEGER liDistanceToMove,
  178. OUT PLARGE_INTEGER pliNewPointer,
  179. IN DWORD dwMoveMethod,
  180. IN BOOL bWrite
  181. );
  182. BOOL
  183. WINAPI
  184. SplReadPrinter(
  185. HANDLE hPrinter,
  186. LPBYTE *pBuf,
  187. DWORD cbBuf
  188. );
  189. BOOL
  190. WINAPI
  191. EnumPrinterPropertySheets(
  192. IN HANDLE hPrinter,
  193. IN HWND hWnd,
  194. IN LPFNADDPROPSHEETPAGE lpfnAdd,
  195. IN LPARAM lParam
  196. );
  197. #define ENUMPRINTERPROPERTYSHEETS_ORD 100
  198. BOOL
  199. WINAPI
  200. PublishPrinterA(
  201. IN HWND hwnd,
  202. IN LPCSTR pszUNCName,
  203. IN LPCSTR pszDN,
  204. IN LPCSTR pszCN,
  205. OUT LPSTR *ppszDN,
  206. IN DWORD dwAction
  207. );
  208. BOOL
  209. WINAPI
  210. PublishPrinterW(
  211. IN HWND hwnd,
  212. IN LPCWSTR pszUNCName,
  213. IN LPCWSTR pszDN,
  214. IN LPCWSTR pszCN,
  215. OUT LPWSTR *ppszDN,
  216. IN DWORD dwAction
  217. );
  218. #define PUBLISHPRINTER_QUERY 1
  219. #define PUBLISHPRINTER_DELETE_DUPLICATES 2
  220. #define PUBLISHPRINTER_FAIL_ON_DUPLICATE 3
  221. #define PUBLISHPRINTER_IGNORE_DUPLICATES 4
  222. BOOL
  223. ClusterSplOpen(
  224. IN LPCTSTR pszServer,
  225. IN LPCTSTR pszResource,
  226. OUT PHANDLE phSpooler,
  227. IN LPCTSTR pszName,
  228. IN LPCTSTR pszAddress
  229. );
  230. BOOL
  231. ClusterSplClose(
  232. IN HANDLE hSpooler
  233. );
  234. BOOL
  235. ClusterSplIsAlive(
  236. IN HANDLE hSpooler
  237. );
  238. #define SPLREG_NO_REMOTE_PRINTER_DRIVERS TEXT("NoRemotePrinterDrivers")
  239. #define SPLREG_NON_RAW_TO_MASQ_PRINTERS TEXT("NonRawToMasqPrinters")
  240. #define SPLREG_CHANGE_ID TEXT("ChangeId")
  241. #define SPLREG_CLUSTER_LOCAL_ROOT_KEY TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Cluster")
  242. #define SPLREG_CLUSTER_UPGRADE_KEY TEXT("ClusterUpgrade")
  243. #define SPLREG_CLUSTER_DRIVER_DIRECTORY TEXT("ClusterDriverDirectory")
  244. BOOL
  245. SpoolerInit(
  246. VOID
  247. );
  248. #ifdef __cplusplus
  249. }
  250. #endif
  251. #endif // _WINSPOLP_