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.

1369 lines
35 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. WinSplp.h
  5. Abstract:
  6. Internal Header file for Print APIs
  7. Author:
  8. Revision History:
  9. --*/
  10. #ifndef _WINSPLP_
  11. #define _WINSPLP_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif /* __cplusplus */
  15. #define PRINTER_NOTIFY_STATUS_ENDPOINT 1
  16. #define PRINTER_NOTIFY_STATUS_POLL 2
  17. #define PRINTER_NOTIFY_STATUS_INFO 4
  18. #define ROUTER_UNKNOWN 0
  19. #define ROUTER_SUCCESS 1
  20. #define ROUTER_STOP_ROUTING 2
  21. #ifndef __ATTRIBUTE_INFO_3__
  22. #define __ATTRIBUTE_INFO_3__
  23. typedef struct _ATTRIBUTE_INFO_3 {
  24. DWORD dwJobNumberOfPagesPerSide;
  25. DWORD dwDrvNumberOfPagesPerSide;
  26. DWORD dwNupBorderFlags;
  27. DWORD dwJobPageOrderFlags;
  28. DWORD dwDrvPageOrderFlags;
  29. DWORD dwJobNumberOfCopies;
  30. DWORD dwDrvNumberOfCopies;
  31. DWORD dwColorOptimization; // Added for monochrome optimization
  32. short dmPrintQuality; // Added for monochrome optimization
  33. short dmYResolution; // Added for monochrome optimization
  34. } ATTRIBUTE_INFO_3, *PATTRIBUTE_INFO_3;
  35. #endif
  36. typedef struct _PRINTER_NOTIFY_INIT {
  37. DWORD Size;
  38. DWORD Reserved;
  39. DWORD PollTime;
  40. } PRINTER_NOTIFY_INIT, *PPRINTER_NOTIFY_INIT, *LPPRINTER_NOTIFY_INIT;
  41. typedef struct _SPLCLIENT_INFO_1{
  42. DWORD dwSize;
  43. LPWSTR pMachineName;
  44. LPWSTR pUserName;
  45. DWORD dwBuildNum;
  46. DWORD dwMajorVersion;
  47. DWORD dwMinorVersion;
  48. WORD wProcessorArchitecture;
  49. } SPLCLIENT_INFO_1, *PSPLCLIENT_INFO_1, *LPSPLCLIENT_INFO_1;
  50. // This definition is used in the private spooler RPC interface (RpcSplOpenPrinter)
  51. // The handle returned in the struct is the Server Side hPrinter which will used in
  52. // making direct API calls from the client to the server side w/o the overhead of
  53. // RPC. The performance boost is observed mainly in calls to Read/WritePrinter made from
  54. // within the spooler (gdi32.dll during playback)
  55. //
  56. //
  57. typedef struct _SPLCLIENT_INFO_2{
  58. #ifdef _WIN64
  59. DWORD64 hSplPrinter; // Server side handle to be used for direct calls
  60. #else
  61. DWORD32 hSplPrinter; // Server side handle to be used for direct calls
  62. #endif
  63. } SPLCLIENT_INFO_2, *PSPLCLIENT_INFO_2, *LPSPLCLIENT_INFO_2;
  64. typedef struct _PRINTPROVIDOR {
  65. BOOL (*fpOpenPrinter)(LPWSTR pPrinterName,
  66. LPHANDLE phPrinter,
  67. LPPRINTER_DEFAULTS pDefault);
  68. BOOL (*fpSetJob)(HANDLE hPrinter,
  69. DWORD JobId,
  70. DWORD Level,
  71. LPBYTE pJob,
  72. DWORD Command);
  73. BOOL (*fpGetJob)(HANDLE hPrinter,
  74. DWORD JobId,
  75. DWORD Level,
  76. LPBYTE pJob,
  77. DWORD cbBuf,
  78. LPDWORD pcbNeeded);
  79. BOOL (*fpEnumJobs)(HANDLE hPrinter,
  80. DWORD FirstJob,
  81. DWORD NoJobs,
  82. DWORD Level,
  83. LPBYTE pJob,
  84. DWORD cbBuf,
  85. LPDWORD pcbNeeded,
  86. LPDWORD pcReturned);
  87. HANDLE (*fpAddPrinter)(LPWSTR pName,
  88. DWORD Level,
  89. LPBYTE pPrinter);
  90. BOOL (*fpDeletePrinter)(HANDLE hPrinter);
  91. BOOL (*fpSetPrinter)(HANDLE hPrinter,
  92. DWORD Level,
  93. LPBYTE pPrinter,
  94. DWORD Command);
  95. BOOL (*fpGetPrinter)(HANDLE hPrinter,
  96. DWORD Level,
  97. LPBYTE pPrinter,
  98. DWORD cbBuf,
  99. LPDWORD pcbNeeded);
  100. BOOL (*fpEnumPrinters)(DWORD Flags,
  101. LPWSTR Name,
  102. DWORD Level,
  103. LPBYTE pPrinterEnum,
  104. DWORD cbBuf,
  105. LPDWORD pcbNeeded,
  106. LPDWORD pcReturned);
  107. BOOL (*fpAddPrinterDriver)(LPWSTR pName,
  108. DWORD Level,
  109. LPBYTE pDriverInfo);
  110. BOOL (*fpEnumPrinterDrivers)(LPWSTR pName,
  111. LPWSTR pEnvironment,
  112. DWORD Level,
  113. LPBYTE pDriverInfo,
  114. DWORD cbBuf,
  115. LPDWORD pcbNeeded,
  116. LPDWORD pcReturned);
  117. BOOL (*fpGetPrinterDriver)(HANDLE hPrinter,
  118. LPWSTR pEnvironment,
  119. DWORD Level,
  120. LPBYTE pDriverInfo,
  121. DWORD cbBuf,
  122. LPDWORD pcbNeeded);
  123. BOOL (*fpGetPrinterDriverDirectory)(LPWSTR pName,
  124. LPWSTR pEnvironment,
  125. DWORD Level,
  126. LPBYTE pDriverDirectory,
  127. DWORD cbBuf,
  128. LPDWORD pcbNeeded);
  129. BOOL (*fpDeletePrinterDriver)(LPWSTR pName,
  130. LPWSTR pEnvironment,
  131. LPWSTR pDriverName);
  132. BOOL (*fpAddPrintProcessor)(LPWSTR pName,
  133. LPWSTR pEnvironment,
  134. LPWSTR pPathName,
  135. LPWSTR pPrintProcessorName);
  136. BOOL (*fpEnumPrintProcessors)(LPWSTR pName,
  137. LPWSTR pEnvironment,
  138. DWORD Level,
  139. LPBYTE pPrintProcessorInfo,
  140. DWORD cbBuf,
  141. LPDWORD pcbNeeded,
  142. LPDWORD pcReturned);
  143. BOOL (*fpGetPrintProcessorDirectory)(LPWSTR pName,
  144. LPWSTR pEnvironment,
  145. DWORD Level,
  146. LPBYTE pPrintProcessorInfo,
  147. DWORD cbBuf,
  148. LPDWORD pcbNeeded);
  149. BOOL (*fpDeletePrintProcessor)(LPWSTR pName,
  150. LPWSTR pEnvironment,
  151. LPWSTR pPrintProcessorName);
  152. BOOL (*fpEnumPrintProcessorDatatypes)(LPWSTR pName,
  153. LPWSTR pPrintProcessorName,
  154. DWORD Level,
  155. LPBYTE pDataypes,
  156. DWORD cbBuf,
  157. LPDWORD pcbNeeded,
  158. LPDWORD pcReturned);
  159. DWORD (*fpStartDocPrinter)(HANDLE hPrinter,
  160. DWORD Level,
  161. LPBYTE pDocInfo);
  162. BOOL (*fpStartPagePrinter)(HANDLE hPrinter);
  163. BOOL (*fpWritePrinter)(HANDLE hPrinter,
  164. LPVOID pBuf,
  165. DWORD cbBuf,
  166. LPDWORD pcWritten);
  167. BOOL (*fpEndPagePrinter)(HANDLE hPrinter);
  168. BOOL (*fpAbortPrinter)(HANDLE hPrinter);
  169. BOOL (*fpReadPrinter)(HANDLE hPrinter,
  170. LPVOID pBuf,
  171. DWORD cbBuf,
  172. LPDWORD pNoBytesRead);
  173. BOOL (*fpEndDocPrinter)(HANDLE hPrinter);
  174. BOOL (*fpAddJob)(HANDLE hPrinter,
  175. DWORD Level,
  176. LPBYTE pData,
  177. DWORD cbBuf,
  178. LPDWORD pcbNeeded);
  179. BOOL (*fpScheduleJob)(HANDLE hPrinter,
  180. DWORD JobId);
  181. DWORD (*fpGetPrinterData)(HANDLE hPrinter,
  182. LPWSTR pValueName,
  183. LPDWORD pType,
  184. LPBYTE pData,
  185. DWORD nSize,
  186. LPDWORD pcbNeeded);
  187. DWORD (*fpSetPrinterData)(HANDLE hPrinter,
  188. LPWSTR pValueName,
  189. DWORD Type,
  190. LPBYTE pData,
  191. DWORD cbData);
  192. DWORD (*fpWaitForPrinterChange)(HANDLE hPrinter, DWORD Flags);
  193. BOOL (*fpClosePrinter)(HANDLE hPrinter);
  194. BOOL (*fpAddForm)(HANDLE hPrinter,
  195. DWORD Level,
  196. LPBYTE pForm);
  197. BOOL (*fpDeleteForm)(HANDLE hPrinter,
  198. LPWSTR pFormName);
  199. BOOL (*fpGetForm)(HANDLE hPrinter,
  200. LPWSTR pFormName,
  201. DWORD Level,
  202. LPBYTE pForm,
  203. DWORD cbBuf,
  204. LPDWORD pcbNeeded);
  205. BOOL (*fpSetForm)(HANDLE hPrinter,
  206. LPWSTR pFormName,
  207. DWORD Level,
  208. LPBYTE pForm);
  209. BOOL (*fpEnumForms)(HANDLE hPrinter,
  210. DWORD Level,
  211. LPBYTE pForm,
  212. DWORD cbBuf,
  213. LPDWORD pcbNeeded,
  214. LPDWORD pcReturned);
  215. BOOL (*fpEnumMonitors)(LPWSTR pName,
  216. DWORD Level,
  217. LPBYTE pMonitors,
  218. DWORD cbBuf,
  219. LPDWORD pcbNeeded,
  220. LPDWORD pcReturned);
  221. BOOL (*fpEnumPorts)(LPWSTR pName,
  222. DWORD Level,
  223. LPBYTE pPorts,
  224. DWORD cbBuf,
  225. LPDWORD pcbNeeded,
  226. LPDWORD pcReturned);
  227. BOOL (*fpAddPort)(LPWSTR pName,
  228. HWND hWnd,
  229. LPWSTR pMonitorName);
  230. BOOL (*fpConfigurePort)(LPWSTR pName,
  231. HWND hWnd,
  232. LPWSTR pPortName);
  233. BOOL (*fpDeletePort)(LPWSTR pName,
  234. HWND hWnd,
  235. LPWSTR pPortName);
  236. HANDLE (*fpCreatePrinterIC)(HANDLE hPrinter,
  237. LPDEVMODEW pDevMode);
  238. BOOL (*fpPlayGdiScriptOnPrinterIC)(HANDLE hPrinterIC,
  239. LPBYTE pIn,
  240. DWORD cIn,
  241. LPBYTE pOut,
  242. DWORD cOut,
  243. DWORD ul);
  244. BOOL (*fpDeletePrinterIC)(HANDLE hPrinterIC);
  245. BOOL (*fpAddPrinterConnection)(LPWSTR pName);
  246. BOOL (*fpDeletePrinterConnection)(LPWSTR pName);
  247. DWORD (*fpPrinterMessageBox)(HANDLE hPrinter,
  248. DWORD Error,
  249. HWND hWnd,
  250. LPWSTR pText,
  251. LPWSTR pCaption,
  252. DWORD dwType);
  253. BOOL (*fpAddMonitor)(LPWSTR pName,
  254. DWORD Level,
  255. LPBYTE pMonitorInfo);
  256. BOOL (*fpDeleteMonitor)(LPWSTR pName,
  257. LPWSTR pEnvironment,
  258. LPWSTR pMonitorName);
  259. BOOL (*fpResetPrinter)(HANDLE hPrinter,
  260. LPPRINTER_DEFAULTS pDefault);
  261. BOOL (*fpGetPrinterDriverEx)(HANDLE hPrinter,
  262. LPWSTR pEnvironment,
  263. DWORD Level,
  264. LPBYTE pDriverInfo,
  265. DWORD cbBuf,
  266. LPDWORD pcbNeeded,
  267. DWORD dwClientMajorVersion,
  268. DWORD dwClientMinorVersion,
  269. PDWORD pdwServerMajorVersion,
  270. PDWORD pdwServerMinorVersion);
  271. BOOL (*fpFindFirstPrinterChangeNotification)(
  272. HANDLE hPrinter,
  273. DWORD fdwFlags,
  274. DWORD fdwOptions,
  275. HANDLE hNotify,
  276. PDWORD pfdwStatus,
  277. PVOID pPrinterNotifyOptions,
  278. PVOID pPrinterNotifyInit);
  279. BOOL (*fpFindClosePrinterChangeNotification)(HANDLE hPrinter);
  280. BOOL (*fpAddPortEx)(LPWSTR pName,
  281. DWORD Level,
  282. LPBYTE lpBuffer,
  283. LPWSTR lpMonitorName);
  284. BOOL (*fpShutDown)(LPVOID pvReserved);
  285. BOOL (*fpRefreshPrinterChangeNotification)(HANDLE hPrinter,
  286. DWORD Reserved,
  287. PVOID pvReserved,
  288. PVOID pPrinterNotifyInfo);
  289. BOOL (*fpOpenPrinterEx)(LPWSTR pPrinterName,
  290. LPHANDLE phPrinter,
  291. LPPRINTER_DEFAULTS pDefault,
  292. LPBYTE pClientInfo,
  293. DWORD Level);
  294. HANDLE (*fpAddPrinterEx)(LPWSTR pName,
  295. DWORD Level,
  296. LPBYTE pPrinter,
  297. LPBYTE pClientInfo,
  298. DWORD ClientInfoLevel);
  299. BOOL (*fpSetPort)(LPWSTR pName,
  300. LPWSTR pPortName,
  301. DWORD Level,
  302. LPBYTE pPortInfo);
  303. DWORD (*fpEnumPrinterData)(HANDLE hPrinter,
  304. DWORD dwIndex,
  305. LPWSTR pValueName,
  306. DWORD cbValueName,
  307. LPDWORD pcbValueName,
  308. LPDWORD pType,
  309. LPBYTE pData,
  310. DWORD cbData,
  311. LPDWORD pcbData);
  312. DWORD (*fpDeletePrinterData)(HANDLE hPrinter,
  313. LPWSTR pValueName);
  314. DWORD (*fpClusterSplOpen)( LPCTSTR pszServer,
  315. LPCTSTR pszResource,
  316. PHANDLE phSpooler,
  317. LPCTSTR pszName,
  318. LPCTSTR pszAddress );
  319. DWORD (*fpClusterSplClose)( HANDLE hSpooler );
  320. DWORD (*fpClusterSplIsAlive)( HANDLE hSpooler );
  321. DWORD (*fpSetPrinterDataEx)( HANDLE hPrinter,
  322. LPCWSTR pKeyName,
  323. LPCWSTR pValueName,
  324. DWORD Type,
  325. LPBYTE pData,
  326. DWORD cbData);
  327. DWORD (*fpGetPrinterDataEx)(HANDLE hPrinter,
  328. LPCWSTR pKeyName,
  329. LPCWSTR pValueName,
  330. LPDWORD pType,
  331. LPBYTE pData,
  332. DWORD nSize,
  333. LPDWORD pcbNeeded);
  334. DWORD (*fpEnumPrinterDataEx)( HANDLE hPrinter,
  335. LPCWSTR pKeyName,
  336. LPBYTE pEnumValues,
  337. DWORD cbEnumValues,
  338. LPDWORD pcbEnumValues,
  339. LPDWORD pnEnumValues);
  340. DWORD (*fpEnumPrinterKey)( HANDLE hPrinter,
  341. LPCWSTR pKeyName,
  342. LPWSTR pSubkey,
  343. DWORD cbSubkey,
  344. LPDWORD pcbSubkey);
  345. DWORD (*fpDeletePrinterDataEx)( HANDLE hPrinter,
  346. LPCWSTR pKeyName,
  347. LPCWSTR pValueName);
  348. DWORD (*fpDeletePrinterKey)( HANDLE hPrinter,
  349. LPCWSTR pKeyName);
  350. BOOL (*fpSeekPrinter)( HANDLE hPrinter,
  351. LARGE_INTEGER liDistanceToMove,
  352. PLARGE_INTEGER pliNewPointer,
  353. DWORD dwMoveMethod,
  354. BOOL bWrite );
  355. BOOL (*fpDeletePrinterDriverEx)(LPWSTR pName,
  356. LPWSTR pEnvironment,
  357. LPWSTR pDriverName,
  358. DWORD dwDeleteFlag,
  359. DWORD dwVersionNum);
  360. BOOL (*fpAddPerMachineConnection)(LPCWSTR pServer,
  361. LPCWSTR pPrinterName,
  362. LPCWSTR pPrintServer,
  363. LPCWSTR pProvider);
  364. BOOL (*fpDeletePerMachineConnection)(LPCWSTR pServer,
  365. LPCWSTR pPrinterName);
  366. BOOL (*fpEnumPerMachineConnections)(LPCWSTR pServer,
  367. LPBYTE pPrinterEnum,
  368. DWORD cbBuf,
  369. LPDWORD pcbNeeded,
  370. LPDWORD pcReturned);
  371. BOOL (*fpXcvData)( HANDLE hXcv,
  372. LPCWSTR pszDataName,
  373. PBYTE pInputData,
  374. DWORD cbInputData,
  375. PBYTE pOutputData,
  376. DWORD cbOutputData,
  377. PDWORD pcbOutputNeeded,
  378. PDWORD pdwStatus
  379. );
  380. BOOL (*fpAddPrinterDriverEx)(LPWSTR pName,
  381. DWORD Level,
  382. LPBYTE pDriverInfo,
  383. DWORD dwFileCopyFlags);
  384. BOOL (*fpSplReadPrinter)(HANDLE hPrinter,
  385. LPBYTE *pBuf,
  386. DWORD cbBuf);
  387. BOOL (*fpDriverUnloadComplete)(LPWSTR pDriverFile);
  388. BOOL (*fpGetSpoolFileInfo)(HANDLE hPrinter,
  389. LPWSTR *pSpoolDir,
  390. LPHANDLE phFile,
  391. HANDLE hSpoolerProcess,
  392. HANDLE hAppProcess);
  393. BOOL (*fpCommitSpoolData)(HANDLE hPrinter,
  394. DWORD cbCommit);
  395. BOOL (*fpCloseSpoolFileHandle)(HANDLE hPrinter);
  396. BOOL (*fpFlushPrinter)(HANDLE hPrinter,
  397. LPBYTE pBuf,
  398. DWORD cbBuf,
  399. LPDWORD pcWritten,
  400. DWORD cSleep);
  401. DWORD (*fpSendRecvBidiData)(HANDLE hPrinter,
  402. LPCWSTR pAction,
  403. PBIDI_REQUEST_CONTAINER pReqData,
  404. PBIDI_RESPONSE_CONTAINER* ppResData);
  405. BOOL (*fpAddDriverCatalog)(HANDLE hPrinter,
  406. DWORD dwLevel,
  407. VOID *pvDriverInfCatInfo,
  408. DWORD dwCatalogCopyFlags);
  409. } PRINTPROVIDOR, *LPPRINTPROVIDOR;
  410. BOOL
  411. InitializePrintProvidor(
  412. LPPRINTPROVIDOR pPrintProvidor,
  413. DWORD cbPrintProvidor,
  414. LPWSTR pFullRegistryPath
  415. );
  416. typedef struct _PRINTPROCESSOROPENDATA {
  417. PDEVMODE pDevMode;
  418. LPWSTR pDatatype;
  419. LPWSTR pParameters;
  420. LPWSTR pDocumentName;
  421. DWORD JobId;
  422. LPWSTR pOutputFile;
  423. LPWSTR pPrinterName;
  424. } PRINTPROCESSOROPENDATA, *PPRINTPROCESSOROPENDATA, *LPPRINTPROCESSOROPENDATA;
  425. HANDLE
  426. OpenPrintProcessor(
  427. LPWSTR pPrinterName,
  428. PPRINTPROCESSOROPENDATA pPrintProcessorOpenData
  429. );
  430. BOOL
  431. PrintDocumentOnPrintProcessor(
  432. HANDLE hPrintProcessor,
  433. LPWSTR pDocumentName
  434. );
  435. BOOL
  436. ClosePrintProcessor(
  437. HANDLE hPrintProcessor
  438. );
  439. BOOL
  440. ControlPrintProcessor(
  441. HANDLE hPrintProcessor,
  442. DWORD Command
  443. );
  444. DWORD
  445. GetPrintProcessorCapabilities(
  446. LPTSTR pValueName,
  447. DWORD dwAttributes,
  448. LPBYTE pData,
  449. DWORD nSize,
  450. LPDWORD pcbNeeded
  451. );
  452. BOOL
  453. GetJobAttributes(
  454. LPWSTR pPrinterName,
  455. LPDEVMODEW pDevmode,
  456. PATTRIBUTE_INFO_3 pAttributeInfo
  457. );
  458. BOOL
  459. InitializeMonitor(
  460. LPWSTR pRegistryRoot
  461. );
  462. BOOL
  463. OpenPort(
  464. LPWSTR pName,
  465. PHANDLE pHandle
  466. );
  467. BOOL
  468. WritePort(
  469. HANDLE hPort,
  470. LPBYTE pBuffer,
  471. DWORD cbBuf,
  472. LPDWORD pcbWritten
  473. );
  474. BOOL
  475. ReadPort(
  476. HANDLE hPort,
  477. LPBYTE pBuffer,
  478. DWORD cbBuffer,
  479. LPDWORD pcbRead
  480. );
  481. BOOL
  482. ClosePort(
  483. HANDLE hPort
  484. );
  485. BOOL
  486. XcvOpenPort(
  487. LPCWSTR pszObject,
  488. ACCESS_MASK GrantedAccess,
  489. PHANDLE phXcv
  490. );
  491. DWORD
  492. XcvDataPort(
  493. HANDLE hXcv,
  494. LPCWSTR pszDataName,
  495. PBYTE pInputData,
  496. DWORD cbInputData,
  497. PBYTE pOutputData,
  498. DWORD cbOutputData,
  499. PDWORD pcbOutputNeeded
  500. );
  501. BOOL
  502. XcvClosePort(
  503. HANDLE hXcv
  504. );
  505. BOOL
  506. AddPortUI
  507. (
  508. PCWSTR pszServer,
  509. HWND hWnd,
  510. PCWSTR pszMonitorNameIn,
  511. PWSTR *ppszPortNameOut
  512. );
  513. BOOL
  514. ConfigurePortUI
  515. (
  516. PCWSTR pszServer,
  517. HWND hWnd,
  518. PCWSTR pszPortName
  519. );
  520. BOOL
  521. DeletePortUI
  522. (
  523. PCWSTR pszServer,
  524. HWND hWnd,
  525. PCWSTR pszPortName
  526. );
  527. BOOL
  528. SplDeleteSpoolerPortStart(
  529. PCWSTR pPortName
  530. );
  531. BOOL
  532. SplDeleteSpoolerPortEnd(
  533. PCWSTR pName,
  534. BOOL bDeletePort
  535. );
  536. typedef struct _MONITORREG {
  537. DWORD cbSize;
  538. LONG
  539. (WINAPI *fpCreateKey)(
  540. HANDLE hcKey,
  541. LPCTSTR pszSubKey,
  542. DWORD dwOptions,
  543. REGSAM samDesired,
  544. PSECURITY_ATTRIBUTES pSecurityAttributes,
  545. PHANDLE phckResult,
  546. PDWORD pdwDisposition,
  547. HANDLE hSpooler
  548. );
  549. LONG
  550. (WINAPI *fpOpenKey)(
  551. HANDLE hcKey,
  552. LPCTSTR pszSubKey,
  553. REGSAM samDesired,
  554. PHANDLE phkResult,
  555. HANDLE hSpooler
  556. );
  557. LONG
  558. (WINAPI *fpCloseKey)(
  559. HANDLE hcKey,
  560. HANDLE hSpooler
  561. );
  562. LONG
  563. (WINAPI *fpDeleteKey)(
  564. HANDLE hcKey,
  565. LPCTSTR pszSubKey,
  566. HANDLE hSpooler
  567. );
  568. LONG
  569. (WINAPI *fpEnumKey)(
  570. HANDLE hcKey,
  571. DWORD dwIndex,
  572. LPTSTR pszName,
  573. PDWORD pcchName,
  574. PFILETIME pftLastWriteTime,
  575. HANDLE hSpooler
  576. );
  577. LONG
  578. (WINAPI *fpQueryInfoKey)(
  579. HANDLE hcKey,
  580. PDWORD pcSubKeys,
  581. PDWORD pcbKey,
  582. PDWORD pcValues,
  583. PDWORD pcbValue,
  584. PDWORD pcbData,
  585. PDWORD pcbSecurityDescriptor,
  586. PFILETIME pftLastWriteTime,
  587. HANDLE hSpooler
  588. );
  589. LONG
  590. (WINAPI *fpSetValue)(
  591. HANDLE hcKey,
  592. LPCTSTR pszValue,
  593. DWORD dwType,
  594. const BYTE* pData,
  595. DWORD cbData,
  596. HANDLE hSpooler
  597. );
  598. LONG
  599. (WINAPI *fpDeleteValue)(
  600. HANDLE hcKey,
  601. LPCTSTR pszValue,
  602. HANDLE hSpooler
  603. );
  604. LONG
  605. (WINAPI *fpEnumValue)(
  606. HANDLE hcKey,
  607. DWORD dwIndex,
  608. LPTSTR pszValue,
  609. PDWORD pcbValue,
  610. PDWORD pType,
  611. PBYTE pData,
  612. PDWORD pcbData,
  613. HANDLE hSpooler
  614. );
  615. LONG
  616. (WINAPI *fpQueryValue)(
  617. HANDLE hcKey,
  618. LPCTSTR pszValue,
  619. PDWORD pType,
  620. PBYTE pData,
  621. PDWORD pcbData,
  622. HANDLE hSpooler
  623. );
  624. } MONITORREG, *PMONITORREG;
  625. typedef struct _MONITORINIT {
  626. DWORD cbSize;
  627. HANDLE hSpooler;
  628. HANDLE hckRegistryRoot;
  629. PMONITORREG pMonitorReg;
  630. BOOL bLocal;
  631. LPCWSTR pszServerName;
  632. } MONITORINIT, *PMONITORINIT;
  633. typedef struct _MONITOR
  634. {
  635. BOOL (WINAPI *pfnEnumPorts)
  636. (
  637. LPWSTR pName,
  638. DWORD Level,
  639. LPBYTE pPorts,
  640. DWORD cbBuf,
  641. LPDWORD pcbNeeded,
  642. LPDWORD pcReturned
  643. );
  644. BOOL (WINAPI *pfnOpenPort)
  645. (
  646. LPWSTR pName,
  647. PHANDLE pHandle
  648. );
  649. BOOL (WINAPI *pfnOpenPortEx)
  650. (
  651. LPWSTR pPortName,
  652. LPWSTR pPrinterName,
  653. PHANDLE pHandle,
  654. struct _MONITOR FAR *pMonitor
  655. );
  656. BOOL (WINAPI *pfnStartDocPort)
  657. (
  658. HANDLE hPort,
  659. LPWSTR pPrinterName,
  660. DWORD JobId,
  661. DWORD Level,
  662. LPBYTE pDocInfo
  663. );
  664. BOOL (WINAPI *pfnWritePort)
  665. (
  666. HANDLE hPort,
  667. LPBYTE pBuffer,
  668. DWORD cbBuf,
  669. LPDWORD pcbWritten
  670. );
  671. BOOL (WINAPI *pfnReadPort)
  672. (
  673. HANDLE hPort,
  674. LPBYTE pBuffer,
  675. DWORD cbBuffer,
  676. LPDWORD pcbRead
  677. );
  678. BOOL (WINAPI *pfnEndDocPort)
  679. (
  680. HANDLE hPort
  681. );
  682. BOOL (WINAPI *pfnClosePort)
  683. (
  684. HANDLE hPort
  685. );
  686. BOOL (WINAPI *pfnAddPort)
  687. (
  688. LPWSTR pName,
  689. HWND hWnd,
  690. LPWSTR pMonitorName
  691. );
  692. BOOL (WINAPI *pfnAddPortEx)
  693. (
  694. LPWSTR pName,
  695. DWORD Level,
  696. LPBYTE lpBuffer,
  697. LPWSTR lpMonitorName
  698. );
  699. BOOL (WINAPI *pfnConfigurePort)
  700. (
  701. LPWSTR pName,
  702. HWND hWnd,
  703. LPWSTR pPortName
  704. );
  705. BOOL (WINAPI *pfnDeletePort)
  706. (
  707. LPWSTR pName,
  708. HWND hWnd,
  709. LPWSTR pPortName
  710. );
  711. BOOL (WINAPI *pfnGetPrinterDataFromPort)
  712. (
  713. HANDLE hPort,
  714. DWORD ControlID,
  715. LPWSTR pValueName,
  716. LPWSTR lpInBuffer,
  717. DWORD cbInBuffer,
  718. LPWSTR lpOutBuffer,
  719. DWORD cbOutBuffer,
  720. LPDWORD lpcbReturned
  721. );
  722. BOOL (WINAPI *pfnSetPortTimeOuts)
  723. (
  724. HANDLE hPort,
  725. LPCOMMTIMEOUTS lpCTO,
  726. DWORD reserved // must be set to 0
  727. );
  728. BOOL (WINAPI *pfnXcvOpenPort)
  729. (
  730. LPCWSTR pszObject,
  731. ACCESS_MASK GrantedAccess,
  732. PHANDLE phXcv
  733. );
  734. DWORD (WINAPI *pfnXcvDataPort)
  735. (
  736. HANDLE hXcv,
  737. LPCWSTR pszDataName,
  738. PBYTE pInputData,
  739. DWORD cbInputData,
  740. PBYTE pOutputData,
  741. DWORD cbOutputData,
  742. PDWORD pcbOutputNeeded
  743. );
  744. BOOL (WINAPI *pfnXcvClosePort)
  745. (
  746. HANDLE hXcv
  747. );
  748. } MONITOR, FAR *LPMONITOR;
  749. typedef struct _MONITOREX
  750. {
  751. DWORD dwMonitorSize;
  752. MONITOR Monitor;
  753. } MONITOREX, FAR *LPMONITOREX;
  754. typedef struct _MONITOR2
  755. {
  756. DWORD cbSize;
  757. BOOL (WINAPI *pfnEnumPorts)
  758. (
  759. HANDLE hMonitor,
  760. LPWSTR pName,
  761. DWORD Level,
  762. LPBYTE pPorts,
  763. DWORD cbBuf,
  764. LPDWORD pcbNeeded,
  765. LPDWORD pcReturned
  766. );
  767. BOOL (WINAPI *pfnOpenPort)
  768. (
  769. HANDLE hMonitor,
  770. LPWSTR pName,
  771. PHANDLE pHandle
  772. );
  773. BOOL (WINAPI *pfnOpenPortEx)
  774. (
  775. HANDLE hMonitor,
  776. HANDLE hMonitorPort,
  777. LPWSTR pPortName,
  778. LPWSTR pPrinterName,
  779. PHANDLE pHandle,
  780. struct _MONITOR2 FAR *pMonitor2
  781. );
  782. BOOL (WINAPI *pfnStartDocPort)
  783. (
  784. HANDLE hPort,
  785. LPWSTR pPrinterName,
  786. DWORD JobId,
  787. DWORD Level,
  788. LPBYTE pDocInfo
  789. );
  790. BOOL (WINAPI *pfnWritePort)
  791. (
  792. HANDLE hPort,
  793. LPBYTE pBuffer,
  794. DWORD cbBuf,
  795. LPDWORD pcbWritten
  796. );
  797. BOOL (WINAPI *pfnReadPort)
  798. (
  799. HANDLE hPort,
  800. LPBYTE pBuffer,
  801. DWORD cbBuffer,
  802. LPDWORD pcbRead
  803. );
  804. BOOL (WINAPI *pfnEndDocPort)
  805. (
  806. HANDLE hPort
  807. );
  808. BOOL (WINAPI *pfnClosePort)
  809. (
  810. HANDLE hPort
  811. );
  812. BOOL (WINAPI *pfnAddPort)
  813. (
  814. HANDLE hMonitor,
  815. LPWSTR pName,
  816. HWND hWnd,
  817. LPWSTR pMonitorName
  818. );
  819. BOOL (WINAPI *pfnAddPortEx)
  820. (
  821. HANDLE hMonitor,
  822. LPWSTR pName,
  823. DWORD Level,
  824. LPBYTE lpBuffer,
  825. LPWSTR lpMonitorName
  826. );
  827. BOOL (WINAPI *pfnConfigurePort)
  828. (
  829. HANDLE hMonitor,
  830. LPWSTR pName,
  831. HWND hWnd,
  832. LPWSTR pPortName
  833. );
  834. BOOL (WINAPI *pfnDeletePort)
  835. (
  836. HANDLE hMonitor,
  837. LPWSTR pName,
  838. HWND hWnd,
  839. LPWSTR pPortName
  840. );
  841. BOOL (WINAPI *pfnGetPrinterDataFromPort)
  842. (
  843. HANDLE hPort,
  844. DWORD ControlID,
  845. LPWSTR pValueName,
  846. LPWSTR lpInBuffer,
  847. DWORD cbInBuffer,
  848. LPWSTR lpOutBuffer,
  849. DWORD cbOutBuffer,
  850. LPDWORD lpcbReturned
  851. );
  852. BOOL (WINAPI *pfnSetPortTimeOuts)
  853. (
  854. HANDLE hPort,
  855. LPCOMMTIMEOUTS lpCTO,
  856. DWORD reserved // must be set to 0
  857. );
  858. BOOL (WINAPI *pfnXcvOpenPort)
  859. (
  860. HANDLE hMonitor,
  861. LPCWSTR pszObject,
  862. ACCESS_MASK GrantedAccess,
  863. PHANDLE phXcv
  864. );
  865. DWORD (WINAPI *pfnXcvDataPort)
  866. (
  867. HANDLE hXcv,
  868. LPCWSTR pszDataName,
  869. PBYTE pInputData,
  870. DWORD cbInputData,
  871. PBYTE pOutputData,
  872. DWORD cbOutputData,
  873. PDWORD pcbOutputNeeded
  874. );
  875. BOOL (WINAPI *pfnXcvClosePort)
  876. (
  877. HANDLE hXcv
  878. );
  879. VOID (WINAPI *pfnShutdown)
  880. (
  881. HANDLE hMonitor
  882. );
  883. DWORD (WINAPI *pfnSendRecvBidiDataFromPort)
  884. (
  885. HANDLE hPort,
  886. DWORD dwAccessBit,
  887. LPCWSTR pAction,
  888. PBIDI_REQUEST_CONTAINER pReqData,
  889. PBIDI_RESPONSE_CONTAINER* ppResData
  890. );
  891. } MONITOR2, *PMONITOR2, FAR *LPMONITOR2;
  892. #define MONITOR2_SIZE_WIN2K ( sizeof(DWORD) + (sizeof(PVOID)*18) )
  893. typedef struct _MONITORUI
  894. {
  895. DWORD dwMonitorUISize;
  896. BOOL (WINAPI *pfnAddPortUI)
  897. (
  898. PCWSTR pszServer,
  899. HWND hWnd,
  900. PCWSTR pszMonitorNameIn,
  901. PWSTR *ppszPortNameOut
  902. );
  903. BOOL (WINAPI *pfnConfigurePortUI)
  904. (
  905. PCWSTR pName,
  906. HWND hWnd,
  907. PCWSTR pPortName
  908. );
  909. BOOL (WINAPI *pfnDeletePortUI)
  910. (
  911. PCWSTR pszServer,
  912. HWND hWnd,
  913. PCWSTR pszPortName
  914. );
  915. } MONITORUI, FAR *PMONITORUI;
  916. HANDLE
  917. CreatePrinterIC(
  918. HANDLE hPrinter,
  919. LPDEVMODEW pDevMode
  920. );
  921. BOOL
  922. PlayGdiScriptOnPrinterIC(
  923. HANDLE hPrinterIC,
  924. LPBYTE pIn,
  925. DWORD cIn,
  926. LPBYTE pOut,
  927. DWORD cOut,
  928. DWORD ul
  929. );
  930. BOOL
  931. DeletePrinterIC(
  932. HANDLE hPrinterIC
  933. );
  934. BOOL
  935. DevQueryPrint(
  936. HANDLE hPrinter,
  937. LPDEVMODE pDevMode,
  938. DWORD *pResID
  939. );
  940. HANDLE
  941. RevertToPrinterSelf(
  942. VOID
  943. );
  944. BOOL
  945. ImpersonatePrinterClient(
  946. HANDLE hToken
  947. );
  948. BOOL
  949. ReplyPrinterChangeNotification(
  950. HANDLE hNotify,
  951. DWORD fdwFlags,
  952. PDWORD pdwResult,
  953. PVOID pPrinterNotifyInfo
  954. );
  955. BOOL
  956. PartialReplyPrinterChangeNotification(
  957. HANDLE hNotify,
  958. PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc
  959. );
  960. PPRINTER_NOTIFY_INFO
  961. RouterAllocPrinterNotifyInfo(
  962. DWORD cPrinterNotifyInfoData
  963. );
  964. BOOL
  965. RouterFreePrinterNotifyInfo(
  966. PPRINTER_NOTIFY_INFO pInfo
  967. );
  968. PBIDI_RESPONSE_CONTAINER
  969. RouterAllocBidiResponseContainer(
  970. DWORD Count
  971. );
  972. PVOID
  973. RouterAllocBidiMem (
  974. IN size_t NumBytes
  975. );
  976. VOID
  977. RouterFreeBidiMem (
  978. IN PVOID pMemPointer
  979. );
  980. #define PRINTER_NOTIFY_INFO_DATA_COMPACT 1
  981. BOOL
  982. AppendPrinterNotifyInfoData(
  983. PPRINTER_NOTIFY_INFO pInfoDest,
  984. PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc,
  985. DWORD fdwFlags
  986. );
  987. DWORD
  988. CallRouterFindFirstPrinterChangeNotification(
  989. HANDLE hPrinter,
  990. DWORD fdwFlags,
  991. DWORD fdwOptions,
  992. HANDLE hNotify,
  993. PVOID pvReserved);
  994. BOOL
  995. ProvidorFindFirstPrinterChangeNotification(
  996. HANDLE hPrinter,
  997. DWORD fdwFlags,
  998. DWORD fdwOptions,
  999. HANDLE hNotify,
  1000. PVOID pvReserved0,
  1001. PVOID pvReserved1);
  1002. BOOL
  1003. ProvidorFindClosePrinterChangeNotification(
  1004. HANDLE hPrinter);
  1005. BOOL
  1006. SpoolerFindFirstPrinterChangeNotification(
  1007. HANDLE hPrinter,
  1008. DWORD fdwFlags,
  1009. DWORD fdwOptions,
  1010. PHANDLE phEvent,
  1011. PVOID pPrinterNotifyOptions,
  1012. PVOID pvReserved);
  1013. BOOL
  1014. SpoolerFindNextPrinterChangeNotification(
  1015. HANDLE hPrinter,
  1016. LPDWORD pfdwChange,
  1017. PVOID pvReserved0,
  1018. PVOID ppPrinterNotifyInfo);
  1019. VOID
  1020. SpoolerFreePrinterNotifyInfo(
  1021. PPRINTER_NOTIFY_INFO pInfo);
  1022. BOOL
  1023. SpoolerFindClosePrinterChangeNotification(
  1024. HANDLE hPrinter);
  1025. LPMONITOR2
  1026. WINAPI
  1027. InitializePrintMonitor2(
  1028. PMONITORINIT pMonitorInit,
  1029. PHANDLE phMonitor
  1030. );
  1031. BOOL
  1032. WINAPI
  1033. InitializeMonitorEx(
  1034. LPWSTR pRegistryRoot,
  1035. LPMONITOR pMonitor
  1036. );
  1037. LPMONITOREX
  1038. WINAPI
  1039. InitializePrintMonitor(
  1040. LPWSTR pRegistryRoot
  1041. );
  1042. PMONITORUI
  1043. WINAPI
  1044. InitializePrintMonitorUI(
  1045. VOID
  1046. );
  1047. //
  1048. // The following is added for new point-and-print support which allows
  1049. // specific files to be associated with a print queue (instead of a printer
  1050. // driver) using SetPrinterDataEx under the key "CopyFiles"
  1051. //
  1052. #define COPYFILE_EVENT_SET_PRINTER_DATAEX 1
  1053. #define COPYFILE_EVENT_DELETE_PRINTER 2
  1054. #define COPYFILE_EVENT_ADD_PRINTER_CONNECTION 3
  1055. #define COPYFILE_EVENT_DELETE_PRINTER_CONNECTION 4
  1056. #define COPYFILE_EVENT_FILES_CHANGED 5
  1057. BOOL
  1058. WINAPI
  1059. SpoolerCopyFileEvent(
  1060. LPWSTR pszPrinterName,
  1061. LPWSTR pszKey,
  1062. DWORD dwCopyFileEvent
  1063. );
  1064. #define COPYFILE_FLAG_CLIENT_SPOOLER 0x00000001
  1065. #define COPYFILE_FLAG_SERVER_SPOOLER 0x00000002
  1066. DWORD
  1067. WINAPI
  1068. GenerateCopyFilePaths(
  1069. IN LPCWSTR pszPrinterName,
  1070. IN LPCWSTR pszDirectory,
  1071. IN LPBYTE pSplClientInfo,
  1072. IN DWORD dwLevel,
  1073. IN OUT LPWSTR pszSourceDir,
  1074. IN OUT LPDWORD pcchSourceDirSize,
  1075. IN OUT LPWSTR pszTargetDir,
  1076. IN OUT LPDWORD pcchTargetDirSize,
  1077. IN DWORD dwFlags
  1078. );
  1079. typedef enum {
  1080. kMessageBox = 0
  1081. } UI_TYPE;
  1082. typedef struct {
  1083. DWORD cbSize; // sizeof(MESSAGEBOX_PARAMS)
  1084. LPWSTR pTitle; // Pointer to a null-terminated string for the title bar of the message box.
  1085. LPWSTR pMessage; // Pointer to a null-terminated string containing the message to display.
  1086. DWORD Style; // Specifies the contents and behavior of the message box
  1087. DWORD dwTimeout; // If bWait is TRUE, Timeout specifies the time, in seconds, that the function waits for the user's response.
  1088. BOOL bWait; // If TRUE, SplPromptUIInUsersSession does not return until the user responds or the time-out interval elapses.
  1089. // If Timeout is zero, SplPromptUIInUsersSession doesn't return until the user responds.
  1090. // If FALSE, the function returns immediately and pResponse returns IDASYNC.
  1091. } MESSAGEBOX_PARAMS, *PMESSAGEBOX_PARAMS;
  1092. typedef struct {
  1093. UI_TYPE UIType;
  1094. union {
  1095. MESSAGEBOX_PARAMS MessageBoxParams;
  1096. };
  1097. } SHOWUIPARAMS, *PSHOWUIPARAMS;
  1098. BOOL
  1099. SplPromptUIInUsersSession(
  1100. IN HANDLE hPrinter,
  1101. IN DWORD JobId,
  1102. IN PSHOWUIPARAMS pUIParams,
  1103. OUT DWORD *pResponse
  1104. );
  1105. DWORD
  1106. SplIsSessionZero(
  1107. IN HANDLE hPrinter,
  1108. IN DWORD JobId,
  1109. OUT BOOL *pIsSessionZero
  1110. );
  1111. #ifdef __cplusplus
  1112. } /* End of extern "C" { */
  1113. #endif /* __cplusplus */
  1114. #endif // _WINSPLP_