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.

1188 lines
19 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. NullPP.c
  6. Abstract:
  7. Implements the NULL print providor.
  8. Author:
  9. Albert Ting (AlbertT) 16-Feb-95
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #include "precomp.h"
  15. #pragma hdrstop
  16. BOOL
  17. NullOpenPrinter(
  18. LPWSTR pPrinterName,
  19. LPHANDLE phPrinter,
  20. LPPRINTER_DEFAULTS pDefault
  21. )
  22. {
  23. SetLastError( ERROR_INVALID_NAME );
  24. return ROUTER_UNKNOWN;
  25. }
  26. BOOL
  27. NullOpenPrinterEx(
  28. LPWSTR pPrinterName,
  29. LPHANDLE phPrinter,
  30. LPPRINTER_DEFAULTS pDefault,
  31. LPBYTE pSplClientInfo,
  32. DWORD dwLevel
  33. )
  34. {
  35. SetLastError( ERROR_NOT_SUPPORTED );
  36. return ROUTER_UNKNOWN;
  37. }
  38. BOOL
  39. NullSetPort(
  40. LPWSTR pName,
  41. LPWSTR pPortName,
  42. DWORD dwLevel,
  43. LPBYTE pPortInfo
  44. )
  45. {
  46. SetLastError( ERROR_NOT_SUPPORTED );
  47. return FALSE;
  48. }
  49. BOOL
  50. NullSetJob(
  51. HANDLE hPrinter,
  52. DWORD JobId,
  53. DWORD Level,
  54. LPBYTE pJob,
  55. DWORD Command
  56. )
  57. {
  58. SetLastError( ERROR_NOT_SUPPORTED );
  59. return FALSE;
  60. }
  61. BOOL
  62. NullGetJob(
  63. HANDLE hPrinter,
  64. DWORD JobId,
  65. DWORD Level,
  66. LPBYTE pJob,
  67. DWORD cbBuf,
  68. LPDWORD pcbNeeded
  69. )
  70. {
  71. SetLastError( ERROR_NOT_SUPPORTED );
  72. return FALSE;
  73. }
  74. BOOL
  75. NullEnumJobs(
  76. HANDLE hPrinter,
  77. DWORD FirstJob,
  78. DWORD NoJobs,
  79. DWORD Level,
  80. LPBYTE pJob,
  81. DWORD cbBuf,
  82. LPDWORD pcbNeeded,
  83. LPDWORD pcReturned
  84. )
  85. {
  86. SetLastError( ERROR_NOT_SUPPORTED );
  87. return FALSE;
  88. }
  89. HANDLE
  90. NullAddPrinter(
  91. LPWSTR pName,
  92. DWORD Level,
  93. LPBYTE pPrinter
  94. )
  95. {
  96. SetLastError( ERROR_INVALID_NAME );
  97. return NULL;
  98. }
  99. HANDLE
  100. NullAddPrinterEx(
  101. LPWSTR pName,
  102. DWORD Level,
  103. LPBYTE pPrinter,
  104. LPBYTE pClientInfo,
  105. DWORD dwLevel
  106. )
  107. {
  108. SetLastError( ERROR_NOT_SUPPORTED );
  109. return NULL;
  110. }
  111. BOOL
  112. NullDeletePrinter(
  113. HANDLE hPrinter
  114. )
  115. {
  116. SetLastError( ERROR_NOT_SUPPORTED );
  117. return FALSE;
  118. }
  119. BOOL
  120. NullSetPrinter(
  121. HANDLE hPrinter,
  122. DWORD Level,
  123. LPBYTE pPrinter,
  124. DWORD Command
  125. )
  126. {
  127. SetLastError( ERROR_NOT_SUPPORTED );
  128. return FALSE;
  129. }
  130. BOOL
  131. NullGetPrinter(
  132. HANDLE hPrinter,
  133. DWORD Level,
  134. LPBYTE pPrinter,
  135. DWORD cbBuf,
  136. LPDWORD pcbNeeded
  137. )
  138. {
  139. SetLastError( ERROR_NOT_SUPPORTED );
  140. return FALSE;
  141. }
  142. BOOL
  143. NullEnumPrinters(
  144. DWORD Flags,
  145. LPWSTR Name,
  146. DWORD Level,
  147. LPBYTE pPrinterEnum,
  148. DWORD cbBuf,
  149. LPDWORD pcbNeeded,
  150. LPDWORD pcReturned
  151. )
  152. {
  153. SetLastError( ERROR_NOT_SUPPORTED );
  154. return FALSE;
  155. }
  156. BOOL
  157. NullAddPrinterDriver(
  158. LPWSTR pName,
  159. DWORD Level,
  160. LPBYTE pDriverInfo
  161. )
  162. {
  163. SetLastError( ERROR_INVALID_NAME );
  164. return FALSE;
  165. }
  166. BOOL
  167. NullAddPrinterDriverEx(
  168. LPWSTR pName,
  169. DWORD Level,
  170. LPBYTE pDriverInfo,
  171. DWORD dwFileCopyFlags
  172. )
  173. {
  174. SetLastError( ERROR_INVALID_NAME );
  175. return FALSE;
  176. }
  177. BOOL
  178. NullAddDriverCatalog(
  179. HANDLE hPrinter,
  180. DWORD dwLevel,
  181. VOID *pvDriverInfCatInfo,
  182. DWORD dwCatalogCopyFlags
  183. )
  184. {
  185. SetLastError( ERROR_INVALID_NAME );
  186. return FALSE;
  187. }
  188. BOOL
  189. NullEnumPrinterDrivers(
  190. LPWSTR pName,
  191. LPWSTR pEnvironment,
  192. DWORD Level,
  193. LPBYTE pDriverInfo,
  194. DWORD cbBuf,
  195. LPDWORD pcbNeeded,
  196. LPDWORD pcReturned
  197. )
  198. {
  199. SetLastError( ERROR_INVALID_NAME );
  200. return FALSE;
  201. }
  202. BOOL
  203. NullGetPrinterDriver(
  204. HANDLE hPrinter,
  205. LPWSTR pEnvironment,
  206. DWORD Level,
  207. LPBYTE pDriverInfo,
  208. DWORD cbBuf,
  209. LPDWORD pcbNeeded
  210. )
  211. {
  212. SetLastError( ERROR_NOT_SUPPORTED );
  213. return FALSE;
  214. }
  215. BOOL
  216. NullGetPrinterDriverDirectory(
  217. LPWSTR pName,
  218. LPWSTR pEnvironment,
  219. DWORD Level,
  220. LPBYTE pDriverDirectory,
  221. DWORD cbBuf,
  222. LPDWORD pcbNeeded
  223. )
  224. {
  225. SetLastError( ERROR_INVALID_NAME );
  226. return FALSE;
  227. }
  228. BOOL
  229. NullDeletePrinterDriver(
  230. LPWSTR pName,
  231. LPWSTR pEnvironment,
  232. LPWSTR pDriverName
  233. )
  234. {
  235. SetLastError( ERROR_INVALID_NAME );
  236. return FALSE;
  237. }
  238. BOOL
  239. NullDeletePrinterDriverEx(
  240. LPWSTR pName,
  241. LPWSTR pEnvironment,
  242. LPWSTR pDriverName,
  243. DWORD dwDeleteFlag,
  244. DWORD dwVersionNum
  245. )
  246. {
  247. SetLastError(ERROR_INVALID_NAME);
  248. return FALSE;
  249. }
  250. BOOL
  251. NullAddPerMachineConnection(
  252. LPCWSTR pServer,
  253. LPCWSTR pPrinterName,
  254. LPCWSTR pPrintServer,
  255. LPCWSTR pProvider
  256. )
  257. {
  258. SetLastError( ERROR_INVALID_NAME);
  259. return FALSE;
  260. }
  261. BOOL
  262. NullDeletePerMachineConnection(
  263. LPCWSTR pServer,
  264. LPCWSTR pPrinterName
  265. )
  266. {
  267. SetLastError( ERROR_INVALID_NAME);
  268. return FALSE;
  269. }
  270. BOOL
  271. NullEnumPerMachineConnections(
  272. LPCWSTR pServer,
  273. LPBYTE pPrinterEnum,
  274. DWORD cbBuf,
  275. LPDWORD pcbNeeded,
  276. LPDWORD pcReturned
  277. )
  278. {
  279. SetLastError( ERROR_INVALID_NAME);
  280. return FALSE;
  281. }
  282. BOOL
  283. NullAddPrintProcessor(
  284. LPWSTR pName,
  285. LPWSTR pEnvironment,
  286. LPWSTR pPathName,
  287. LPWSTR pPrintProcessorName
  288. )
  289. {
  290. SetLastError( ERROR_INVALID_NAME );
  291. return FALSE;
  292. }
  293. BOOL
  294. NullEnumPrintProcessors(
  295. LPWSTR pName,
  296. LPWSTR pEnvironment,
  297. DWORD Level,
  298. LPBYTE pPrintProcessorInfo,
  299. DWORD cbBuf,
  300. LPDWORD pcbNeeded,
  301. LPDWORD pcReturned
  302. )
  303. {
  304. SetLastError( ERROR_INVALID_NAME );
  305. return FALSE;
  306. }
  307. BOOL
  308. NullGetPrintProcessorDirectory(
  309. LPWSTR pName,
  310. LPWSTR pEnvironment,
  311. DWORD Level,
  312. LPBYTE pPrintProcessorInfo,
  313. DWORD cbBuf,
  314. LPDWORD pcbNeeded
  315. )
  316. {
  317. SetLastError( ERROR_INVALID_NAME );
  318. return FALSE;
  319. }
  320. BOOL
  321. NullDeletePrintProcessor(
  322. LPWSTR pName,
  323. LPWSTR pEnvironment,
  324. LPWSTR pPrintProcessorName
  325. )
  326. {
  327. SetLastError( ERROR_INVALID_NAME );
  328. return FALSE;
  329. }
  330. BOOL
  331. NullEnumPrintProcessorDatatypes(
  332. LPWSTR pName,
  333. LPWSTR pPrintProcessorName,
  334. DWORD Level,
  335. LPBYTE pDataypes,
  336. DWORD cbBuf,
  337. LPDWORD pcbNeeded,
  338. LPDWORD pcReturned
  339. )
  340. {
  341. SetLastError( ERROR_INVALID_NAME );
  342. return FALSE;
  343. }
  344. DWORD
  345. NullStartDocPrinter(
  346. HANDLE hPrinter,
  347. DWORD Level,
  348. LPBYTE pDocInfo
  349. )
  350. {
  351. SetLastError( ERROR_NOT_SUPPORTED );
  352. return 0;
  353. }
  354. BOOL
  355. NullStartPagePrinter(
  356. HANDLE hPrinter
  357. )
  358. {
  359. SetLastError( ERROR_NOT_SUPPORTED );
  360. return FALSE;
  361. }
  362. BOOL
  363. NullWritePrinter(
  364. HANDLE hPrinter,
  365. LPVOID pBuf,
  366. DWORD cbBuf,
  367. LPDWORD pcWritten
  368. )
  369. {
  370. SetLastError( ERROR_NOT_SUPPORTED );
  371. return FALSE;
  372. }
  373. BOOL
  374. NullEndPagePrinter(
  375. HANDLE hPrinter
  376. )
  377. {
  378. SetLastError( ERROR_NOT_SUPPORTED );
  379. return FALSE;
  380. }
  381. BOOL
  382. NullAbortPrinter(
  383. HANDLE hPrinter
  384. )
  385. {
  386. SetLastError( ERROR_NOT_SUPPORTED );
  387. return FALSE;
  388. }
  389. BOOL
  390. NullReadPrinter(
  391. HANDLE hPrinter,
  392. LPVOID pBuf,
  393. DWORD cbBuf,
  394. LPDWORD pNoBytesRead
  395. )
  396. {
  397. SetLastError( ERROR_NOT_SUPPORTED );
  398. return FALSE;
  399. }
  400. BOOL
  401. NullSplReadPrinter(
  402. HANDLE hPrinter,
  403. LPBYTE *pBuf,
  404. DWORD cbBuf
  405. )
  406. {
  407. SetLastError( ERROR_NOT_SUPPORTED );
  408. return FALSE;
  409. }
  410. BOOL
  411. NullSplDriverUnloadComplete(
  412. LPWSTR pDriverFile
  413. )
  414. {
  415. SetLastError( ERROR_NOT_SUPPORTED );
  416. return FALSE;
  417. }
  418. BOOL
  419. NullGetSpoolFileHandle(
  420. HANDLE hPrinter,
  421. LPWSTR *pSpoolDir,
  422. LPHANDLE phFile,
  423. HANDLE hSpoolerProcess,
  424. HANDLE hAppProcess)
  425. {
  426. SetLastError( ERROR_NOT_SUPPORTED );
  427. return FALSE;
  428. }
  429. BOOL
  430. NullCommitSpoolData(
  431. HANDLE hPrinter,
  432. DWORD cbCommit)
  433. {
  434. SetLastError( ERROR_NOT_SUPPORTED );
  435. return FALSE;
  436. }
  437. BOOL
  438. NullCloseSpoolFileHandle(
  439. HANDLE hPrinter)
  440. {
  441. SetLastError( ERROR_NOT_SUPPORTED );
  442. return FALSE;
  443. }
  444. BOOL
  445. NullEndDocPrinter(
  446. HANDLE hPrinter
  447. )
  448. {
  449. SetLastError( ERROR_NOT_SUPPORTED );
  450. return FALSE;
  451. }
  452. BOOL
  453. NullAddJob(
  454. HANDLE hPrinter,
  455. DWORD Level,
  456. LPBYTE pData,
  457. DWORD cbBuf,
  458. LPDWORD pcbNeeded
  459. )
  460. {
  461. SetLastError( ERROR_NOT_SUPPORTED );
  462. return FALSE;
  463. }
  464. BOOL
  465. NullScheduleJob(
  466. HANDLE hPrinter,
  467. DWORD JobId
  468. )
  469. {
  470. SetLastError( ERROR_NOT_SUPPORTED );
  471. return FALSE;
  472. }
  473. DWORD
  474. NullGetPrinterData(
  475. HANDLE hPrinter,
  476. LPWSTR pValueName,
  477. LPDWORD pType,
  478. LPBYTE pData,
  479. DWORD nSize,
  480. LPDWORD pcbNeeded
  481. )
  482. {
  483. return ERROR_NOT_SUPPORTED;
  484. }
  485. DWORD
  486. NullGetPrinterDataEx(
  487. HANDLE hPrinter,
  488. LPCWSTR pKeyName,
  489. LPCWSTR pValueName,
  490. LPDWORD pType,
  491. LPBYTE pData,
  492. DWORD nSize,
  493. LPDWORD pcbNeeded
  494. )
  495. {
  496. return ERROR_NOT_SUPPORTED;
  497. }
  498. DWORD
  499. NullEnumPrinterData(
  500. HANDLE hPrinter,
  501. DWORD dwIndex, // index of value to query
  502. LPWSTR pValueName, // address of buffer for value string
  503. DWORD cbValueName, // size of buffer for value string
  504. LPDWORD pcbValueName, // address for size of value buffer
  505. LPDWORD pType, // address of buffer for type code
  506. LPBYTE pData, // address of buffer for value data
  507. DWORD cbData, // size of buffer for value data
  508. LPDWORD pcbData // address for size of data buffer
  509. )
  510. {
  511. return ERROR_NOT_SUPPORTED;
  512. }
  513. DWORD
  514. NullEnumPrinterDataEx(
  515. HANDLE hPrinter,
  516. LPCWSTR pKeyName, // address of key name
  517. LPBYTE pEnumValues,
  518. DWORD cbEnumValues,
  519. LPDWORD pcbEnumValues,
  520. LPDWORD pnEnumValues
  521. )
  522. {
  523. return ERROR_NOT_SUPPORTED;
  524. }
  525. DWORD
  526. NullEnumPrinterKey(
  527. HANDLE hPrinter,
  528. LPCWSTR pKeyName, // address of key name
  529. LPWSTR pSubkey, // address of buffer for value string
  530. DWORD cbSubkey, // size of buffer for value string
  531. LPDWORD pcbSubkey // address for size of value buffer
  532. )
  533. {
  534. return ERROR_NOT_SUPPORTED;
  535. }
  536. DWORD
  537. NullDeletePrinterData(
  538. HANDLE hPrinter,
  539. LPWSTR pValueName
  540. )
  541. {
  542. return ERROR_NOT_SUPPORTED;
  543. }
  544. DWORD
  545. NullDeletePrinterDataEx(
  546. HANDLE hPrinter,
  547. LPCWSTR pKeyName,
  548. LPCWSTR pValueName
  549. )
  550. {
  551. return ERROR_NOT_SUPPORTED;
  552. }
  553. DWORD
  554. NullDeletePrinterKey(
  555. HANDLE hPrinter,
  556. LPCWSTR pKeyName
  557. )
  558. {
  559. return ERROR_NOT_SUPPORTED;
  560. }
  561. DWORD
  562. NullSetPrinterData(
  563. HANDLE hPrinter,
  564. LPWSTR pValueName,
  565. DWORD Type,
  566. LPBYTE pData,
  567. DWORD cbData
  568. )
  569. {
  570. return ERROR_NOT_SUPPORTED;
  571. }
  572. DWORD
  573. NullSetPrinterDataEx(
  574. HANDLE hPrinter,
  575. LPCWSTR pKeyName,
  576. LPCWSTR pValueName,
  577. DWORD Type,
  578. LPBYTE pData,
  579. DWORD cbData
  580. )
  581. {
  582. return ERROR_NOT_SUPPORTED;
  583. }
  584. DWORD
  585. NullWaitForPrinterChange(
  586. HANDLE hPrinter, DWORD Flags
  587. )
  588. {
  589. SetLastError( ERROR_NOT_SUPPORTED );
  590. return 0;
  591. }
  592. BOOL
  593. NullClosePrinter(
  594. HANDLE hPrinter
  595. )
  596. {
  597. SetLastError( ERROR_NOT_SUPPORTED );
  598. return FALSE;
  599. }
  600. BOOL
  601. NullAddForm(
  602. HANDLE hPrinter,
  603. DWORD Level,
  604. LPBYTE pForm
  605. )
  606. {
  607. SetLastError( ERROR_NOT_SUPPORTED );
  608. return FALSE;
  609. }
  610. BOOL
  611. NullDeleteForm(
  612. HANDLE hPrinter,
  613. LPWSTR pFormName
  614. )
  615. {
  616. SetLastError( ERROR_NOT_SUPPORTED );
  617. return FALSE;
  618. }
  619. BOOL
  620. NullGetForm(
  621. HANDLE hPrinter,
  622. LPWSTR pFormName,
  623. DWORD Level,
  624. LPBYTE pForm,
  625. DWORD cbBuf,
  626. LPDWORD pcbNeeded
  627. )
  628. {
  629. SetLastError( ERROR_NOT_SUPPORTED );
  630. return FALSE;
  631. }
  632. BOOL
  633. NullSetForm(
  634. HANDLE hPrinter,
  635. LPWSTR pFormName,
  636. DWORD Level,
  637. LPBYTE pForm
  638. )
  639. {
  640. SetLastError( ERROR_NOT_SUPPORTED );
  641. return FALSE;
  642. }
  643. BOOL
  644. NullEnumForms(
  645. HANDLE hPrinter,
  646. DWORD Level,
  647. LPBYTE pForm,
  648. DWORD cbBuf,
  649. LPDWORD pcbNeeded,
  650. LPDWORD pcReturned
  651. )
  652. {
  653. SetLastError( ERROR_NOT_SUPPORTED );
  654. return FALSE;
  655. }
  656. BOOL
  657. NullEnumMonitors(
  658. LPWSTR pName,
  659. DWORD Level,
  660. LPBYTE pMonitors,
  661. DWORD cbBuf,
  662. LPDWORD pcbNeeded,
  663. LPDWORD pcReturned
  664. )
  665. {
  666. SetLastError( ERROR_NOT_SUPPORTED );
  667. return FALSE;
  668. }
  669. BOOL
  670. NullEnumPorts(
  671. LPWSTR pName,
  672. DWORD Level,
  673. LPBYTE pPorts,
  674. DWORD cbBuf,
  675. LPDWORD pcbNeeded,
  676. LPDWORD pcReturned
  677. )
  678. {
  679. SetLastError( ERROR_NOT_SUPPORTED );
  680. return FALSE;
  681. }
  682. BOOL
  683. NullAddPort(
  684. LPWSTR pName,
  685. HWND hWnd,
  686. LPWSTR pMonitorName
  687. )
  688. {
  689. SetLastError( ERROR_NOT_SUPPORTED );
  690. return FALSE;
  691. }
  692. BOOL
  693. NullConfigurePort(
  694. LPWSTR pName,
  695. HWND hWnd,
  696. LPWSTR pPortName
  697. )
  698. {
  699. SetLastError( ERROR_NOT_SUPPORTED );
  700. return FALSE;
  701. }
  702. BOOL
  703. NullDeletePort(
  704. LPWSTR pName,
  705. HWND hWnd,
  706. LPWSTR pPortName
  707. )
  708. {
  709. SetLastError( ERROR_NOT_SUPPORTED );
  710. return FALSE;
  711. }
  712. HANDLE
  713. NullCreatePrinterIC(
  714. HANDLE hPrinter,
  715. LPDEVMODEW pDevMode
  716. )
  717. {
  718. SetLastError( ERROR_NOT_SUPPORTED );
  719. return NULL;
  720. }
  721. BOOL
  722. NullPlayGdiScriptOnPrinterIC(
  723. HANDLE hPrinterIC,
  724. LPBYTE pIn,
  725. DWORD cIn,
  726. LPBYTE pOut,
  727. DWORD cOut,
  728. DWORD ul
  729. )
  730. {
  731. SetLastError( ERROR_NOT_SUPPORTED );
  732. return FALSE;
  733. }
  734. BOOL
  735. NullDeletePrinterIC(
  736. HANDLE hPrinterIC
  737. )
  738. {
  739. SetLastError( ERROR_NOT_SUPPORTED );
  740. return FALSE;
  741. }
  742. BOOL
  743. NullAddPrinterConnection(
  744. LPWSTR pName
  745. )
  746. {
  747. SetLastError( ERROR_NOT_SUPPORTED );
  748. return FALSE;
  749. }
  750. BOOL
  751. NullDeletePrinterConnection(
  752. LPWSTR pName
  753. )
  754. {
  755. SetLastError( ERROR_INVALID_NAME );
  756. return FALSE;
  757. }
  758. DWORD
  759. NullPrinterMessageBox(
  760. HANDLE hPrinter,
  761. DWORD Error,
  762. HWND hWnd,
  763. LPWSTR pText,
  764. LPWSTR pCaption,
  765. DWORD dwType
  766. )
  767. {
  768. SetLastError( ERROR_NOT_SUPPORTED );
  769. return 0;
  770. }
  771. BOOL
  772. NullAddMonitor(
  773. LPWSTR pName,
  774. DWORD Level,
  775. LPBYTE pMonitorInfo
  776. )
  777. {
  778. SetLastError( ERROR_INVALID_NAME );
  779. return FALSE;
  780. }
  781. BOOL
  782. NullDeleteMonitor(
  783. LPWSTR pName,
  784. LPWSTR pEnvironment,
  785. LPWSTR pMonitorName
  786. )
  787. {
  788. SetLastError( ERROR_INVALID_NAME );
  789. return FALSE;
  790. }
  791. BOOL
  792. NullResetPrinter(
  793. HANDLE hPrinter,
  794. LPPRINTER_DEFAULTS pDefault
  795. )
  796. {
  797. SetLastError( ERROR_NOT_SUPPORTED );
  798. return FALSE;
  799. }
  800. BOOL
  801. NullFindFirstPrinterChangeNotification(
  802. HANDLE hPrinter,
  803. DWORD fdwFlags,
  804. DWORD fdwOptions,
  805. HANDLE hNotify,
  806. PDWORD pfdwStatus,
  807. PVOID pPrinterNotifyOptions,
  808. PVOID pPrinterNotifyInit
  809. )
  810. {
  811. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  812. return FALSE;
  813. }
  814. BOOL
  815. NullFindClosePrinterChangeNotification(
  816. HANDLE hPrinter
  817. )
  818. {
  819. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  820. return FALSE;
  821. }
  822. BOOL
  823. NullAddPortEx(
  824. LPWSTR pName,
  825. DWORD Level,
  826. LPBYTE lpBuffer,
  827. LPWSTR lpMonitorName
  828. )
  829. {
  830. SetLastError( ERROR_NOT_SUPPORTED );
  831. return FALSE;
  832. }
  833. BOOL
  834. NullShutDown(
  835. LPVOID pvReserved
  836. )
  837. {
  838. SetLastError( ERROR_NOT_SUPPORTED );
  839. return FALSE;
  840. }
  841. BOOL
  842. NullRefreshPrinterChangeNotification(
  843. HANDLE hPrinter,
  844. DWORD Reserved,
  845. PVOID pvReserved,
  846. PVOID pPrinterNotifyInfo
  847. )
  848. {
  849. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  850. return FALSE;
  851. }
  852. BOOL
  853. NullSeekPrinter(
  854. HANDLE hPrinter,
  855. LARGE_INTEGER liDistanceToMove,
  856. PLARGE_INTEGER pliNewPointer,
  857. DWORD dwMoveMethod,
  858. BOOL bWrite
  859. )
  860. {
  861. SetLastError( ERROR_NOT_SUPPORTED );
  862. return FALSE;
  863. }
  864. BOOL
  865. NullFlushPrinter(
  866. HANDLE hPrinter,
  867. LPBYTE pBuf,
  868. DWORD cbBuf,
  869. LPDWORD pcWritten,
  870. DWORD cSleep
  871. )
  872. {
  873. SetLastError( ERROR_NOT_SUPPORTED );
  874. return FALSE;
  875. }
  876. DWORD
  877. NullSendRecvBidiData(
  878. HANDLE hPrinter,
  879. LPCTSTR pAction,
  880. PBIDI_REQUEST_CONTAINER pReqData,
  881. PBIDI_RESPONSE_CONTAINER* ppResData
  882. )
  883. {
  884. return(ERROR_NOT_SUPPORTED);
  885. }
  886. BOOL
  887. NullClusterSplOpen(
  888. LPCTSTR pszServer,
  889. LPCTSTR pszResource,
  890. PHANDLE phSpooler,
  891. LPCTSTR pszName,
  892. LPCTSTR pszAddress
  893. )
  894. {
  895. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  896. return FALSE;
  897. }
  898. BOOL
  899. NullClusterSplClose(
  900. HANDLE hSpooler
  901. )
  902. {
  903. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  904. return FALSE;
  905. }
  906. BOOL
  907. NullClusterSplIsAlive(
  908. HANDLE hSpooler
  909. )
  910. {
  911. SetLastError( RPC_S_PROCNUM_OUT_OF_RANGE );
  912. return FALSE;
  913. }
  914. BOOL
  915. NullXcvData(
  916. HANDLE hXcv,
  917. PCWSTR pszDataName,
  918. PBYTE pInputData,
  919. DWORD cbInputData,
  920. PBYTE pOutputData,
  921. DWORD cbOutputData,
  922. PDWORD pcbOutputNeeded,
  923. PDWORD pdwStatus
  924. )
  925. {
  926. SetLastError( ERROR_NOT_SUPPORTED );
  927. return FALSE;
  928. }
  929. //
  930. // Note: If the providor structure changes to hold something other than
  931. // an array of function pointers, FixupOldProvidor must be changed.
  932. // We will get a compile time error in the definition of NullProvidor below
  933. // if the structure changes.
  934. //
  935. PRINTPROVIDOR NullProvidor = {
  936. NullOpenPrinter,
  937. NullSetJob,
  938. NullGetJob,
  939. NullEnumJobs,
  940. NullAddPrinter,
  941. NullDeletePrinter,
  942. NullSetPrinter,
  943. NullGetPrinter,
  944. NullEnumPrinters,
  945. NullAddPrinterDriver,
  946. NullEnumPrinterDrivers,
  947. NullGetPrinterDriver,
  948. NullGetPrinterDriverDirectory,
  949. NullDeletePrinterDriver,
  950. NullAddPrintProcessor,
  951. NullEnumPrintProcessors,
  952. NullGetPrintProcessorDirectory,
  953. NullDeletePrintProcessor,
  954. NullEnumPrintProcessorDatatypes,
  955. NullStartDocPrinter,
  956. NullStartPagePrinter,
  957. NullWritePrinter,
  958. NullEndPagePrinter,
  959. NullAbortPrinter,
  960. NullReadPrinter,
  961. NullEndDocPrinter,
  962. NullAddJob,
  963. NullScheduleJob,
  964. NullGetPrinterData,
  965. NullSetPrinterData,
  966. NullWaitForPrinterChange,
  967. NullClosePrinter,
  968. NullAddForm,
  969. NullDeleteForm,
  970. NullGetForm,
  971. NullSetForm,
  972. NullEnumForms,
  973. NullEnumMonitors,
  974. NullEnumPorts,
  975. NullAddPort,
  976. NullConfigurePort,
  977. NullDeletePort,
  978. NullCreatePrinterIC,
  979. NullPlayGdiScriptOnPrinterIC,
  980. NullDeletePrinterIC,
  981. NullAddPrinterConnection,
  982. NullDeletePrinterConnection,
  983. NullPrinterMessageBox,
  984. NullAddMonitor,
  985. NullDeleteMonitor,
  986. NullResetPrinter,
  987. //
  988. // If GetPrinterDriverEx doesn't exist, we'll call the old one.
  989. // Don't stub out.
  990. //
  991. NULL,
  992. NullFindFirstPrinterChangeNotification,
  993. NullFindClosePrinterChangeNotification,
  994. NullAddPortEx,
  995. NullShutDown,
  996. NullRefreshPrinterChangeNotification,
  997. NullOpenPrinterEx,
  998. NullAddPrinterEx,
  999. NullSetPort,
  1000. NullEnumPrinterData,
  1001. NullDeletePrinterData,
  1002. NullClusterSplOpen,
  1003. NullClusterSplClose,
  1004. NullClusterSplIsAlive,
  1005. NullSetPrinterDataEx,
  1006. NullGetPrinterDataEx,
  1007. NullEnumPrinterDataEx,
  1008. NullEnumPrinterKey,
  1009. NullDeletePrinterDataEx,
  1010. NullDeletePrinterKey,
  1011. NullSeekPrinter,
  1012. NullDeletePrinterDriverEx,
  1013. NullAddPerMachineConnection,
  1014. NullDeletePerMachineConnection,
  1015. NullEnumPerMachineConnections,
  1016. NullXcvData,
  1017. NullAddPrinterDriverEx,
  1018. NullSplReadPrinter,
  1019. NullSplDriverUnloadComplete,
  1020. NullGetSpoolFileHandle,
  1021. NullCommitSpoolData,
  1022. NullCloseSpoolFileHandle,
  1023. NullFlushPrinter,
  1024. NullSendRecvBidiData,
  1025. NullAddDriverCatalog,
  1026. };
  1027. VOID
  1028. FixupOldProvidor(
  1029. LPPRINTPROVIDOR pProvidor
  1030. )
  1031. /*++
  1032. Routine Description:
  1033. Fixup the providor function vector, adding stubs to any calls
  1034. that were not implemented by the providor.
  1035. Arguments:
  1036. pProvidor - Providor to fix up
  1037. Return Value:
  1038. Assumes:
  1039. PRINTPROVIDOR structure is an array of function vectors, and
  1040. nothing else.
  1041. --*/
  1042. {
  1043. UINT i;
  1044. FARPROC* pSource;
  1045. FARPROC* pDest;
  1046. for( i=0, pSource = (FARPROC*)&NullProvidor, pDest = (FARPROC*)pProvidor;
  1047. i < sizeof( NullProvidor ) / sizeof( NullProvidor.fpOpenPrinter );
  1048. i++, pSource++, pDest++ ){
  1049. if( !*pDest ){
  1050. *pDest = *pSource;
  1051. }
  1052. }
  1053. }