Source code of Windows XP (NT5)
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.

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