winsplp.h
上传用户:looem2003
上传日期:2014-07-20
资源大小:13733k
文件大小:21k
源码类别:

打印编程

开发平台:

Visual C++

  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.     Dave Snipp (DaveSn) 15-Mar-1991
  9. Revision History:
  10. --*/
  11. #ifndef _WINSPLP_
  12. #define _WINSPLP_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif /* __cplusplus */
  16. #define PRINTER_NOTIFY_STATUS_ENDPOINT 1
  17. #define PRINTER_NOTIFY_STATUS_POLL     2
  18. #define PRINTER_NOTIFY_STATUS_INFO     4
  19. #define ROUTER_UNKNOWN      0
  20. #define ROUTER_SUCCESS      1
  21. #define ROUTER_STOP_ROUTING 2
  22. typedef struct _PRINTER_NOTIFY_INIT {
  23.     DWORD Size;
  24.     DWORD Reserved;
  25.     DWORD PollTime;
  26. } PRINTER_NOTIFY_INIT, *PPRINTER_NOTIFY_INIT, *LPPRINTER_NOTIFY_INIT;
  27. typedef struct _SPLCLIENT_INFO_1{
  28.     DWORD       dwSize;
  29.     LPWSTR      pMachineName;
  30.     LPWSTR      pUserName;
  31.     DWORD       dwBuildNum;
  32.     DWORD       dwMajorVersion;
  33.     DWORD       dwMinorVersion;
  34.     WORD        wProcessorArchitecture;
  35. } SPLCLIENT_INFO_1, *PSPLCLIENT_INFO_1, *LPSPLCLIENT_INFO_1;
  36. typedef struct _PRINTPROVIDOR {
  37.    BOOL (*fpOpenPrinter)(LPWSTR   pPrinterName,
  38.                          LPHANDLE phPrinter,
  39.                          LPPRINTER_DEFAULTS pDefault);
  40.    BOOL (*fpSetJob)(HANDLE hPrinter,
  41.                     DWORD JobId,
  42.                     DWORD Level,
  43.                     LPBYTE pJob,
  44.                     DWORD Command);
  45.    BOOL (*fpGetJob)(HANDLE   hPrinter,
  46.                     DWORD    JobId,
  47.                     DWORD    Level,
  48.                     LPBYTE   pJob,
  49.                     DWORD    cbBuf,
  50.                     LPDWORD  pcbNeeded);
  51.    BOOL (*fpEnumJobs)(HANDLE  hPrinter,
  52.                       DWORD   FirstJob,
  53.                       DWORD   NoJobs,
  54.                       DWORD   Level,
  55.                       LPBYTE  pJob,
  56.                       DWORD   cbBuf,
  57.                       LPDWORD pcbNeeded,
  58.                       LPDWORD pcReturned);
  59.    HANDLE (*fpAddPrinter)(LPWSTR  pName,
  60.                           DWORD   Level,
  61.                           LPBYTE  pPrinter);
  62.    BOOL (*fpDeletePrinter)(HANDLE   hPrinter);
  63.    BOOL (*fpSetPrinter)(HANDLE  hPrinter,
  64.                         DWORD   Level,
  65.                         LPBYTE  pPrinter,
  66.                         DWORD   Command);
  67.    BOOL (*fpGetPrinter)(HANDLE  hPrinter,
  68.                         DWORD   Level,
  69.                         LPBYTE  pPrinter,
  70.                         DWORD   cbBuf,
  71.                         LPDWORD pcbNeeded);
  72.    BOOL (*fpEnumPrinters)(DWORD   Flags,
  73.                           LPWSTR  Name,
  74.                           DWORD   Level,
  75.                           LPBYTE  pPrinterEnum,
  76.                           DWORD   cbBuf,
  77.                           LPDWORD pcbNeeded,
  78.                           LPDWORD pcReturned);
  79.    BOOL (*fpAddPrinterDriver)(LPWSTR  pName,
  80.                               DWORD   Level,
  81.                               LPBYTE  pDriverInfo);
  82.    BOOL (*fpEnumPrinterDrivers)(LPWSTR  pName,
  83.                                 LPWSTR  pEnvironment,
  84.                                 DWORD   Level,
  85.                                 LPBYTE  pDriverInfo,
  86.                                 DWORD   cbBuf,
  87.                                 LPDWORD pcbNeeded,
  88.                                 LPDWORD pcReturned);
  89.    BOOL (*fpGetPrinterDriver)(HANDLE  hPrinter,
  90.                               LPWSTR  pEnvironment,
  91.                               DWORD   Level,
  92.                               LPBYTE  pDriverInfo,
  93.                               DWORD   cbBuf,
  94.                               LPDWORD pcbNeeded);
  95.    BOOL (*fpGetPrinterDriverDirectory)(LPWSTR  pName,
  96.                                        LPWSTR  pEnvironment,
  97.                                        DWORD   Level,
  98.                                        LPBYTE  pDriverDirectory,
  99.                                        DWORD   cbBuf,
  100.                                        LPDWORD pcbNeeded);
  101.    BOOL (*fpDeletePrinterDriver)(LPWSTR   pName,
  102.                                  LPWSTR   pEnvironment,
  103.                                  LPWSTR   pDriverName);
  104.    BOOL (*fpAddPrintProcessor)(LPWSTR  pName,
  105.                                LPWSTR  pEnvironment,
  106.                                LPWSTR  pPathName,
  107.                                LPWSTR  pPrintProcessorName);
  108.    BOOL (*fpEnumPrintProcessors)(LPWSTR  pName,
  109.                                  LPWSTR  pEnvironment,
  110.                                  DWORD   Level,
  111.                                  LPBYTE  pPrintProcessorInfo,
  112.                                  DWORD   cbBuf,
  113.                                  LPDWORD pcbNeeded,
  114.                                  LPDWORD pcReturned);
  115.    BOOL (*fpGetPrintProcessorDirectory)(LPWSTR  pName,
  116.                                         LPWSTR  pEnvironment,
  117.                                         DWORD   Level,
  118.                                         LPBYTE  pPrintProcessorInfo,
  119.                                         DWORD   cbBuf,
  120.                                         LPDWORD pcbNeeded);
  121.    BOOL (*fpDeletePrintProcessor)(LPWSTR  pName,
  122.                                   LPWSTR  pEnvironment,
  123.                                   LPWSTR  pPrintProcessorName);
  124.    BOOL (*fpEnumPrintProcessorDatatypes)(LPWSTR  pName,
  125.                                          LPWSTR  pPrintProcessorName,
  126.                                          DWORD   Level,
  127.                                          LPBYTE  pDataypes,
  128.                                          DWORD   cbBuf,
  129.                                          LPDWORD pcbNeeded,
  130.                                          LPDWORD pcReturned);
  131.    DWORD (*fpStartDocPrinter)(HANDLE  hPrinter,
  132.                              DWORD   Level,
  133.                              LPBYTE  pDocInfo);
  134.    BOOL (*fpStartPagePrinter)(HANDLE  hPrinter);
  135.    BOOL (*fpWritePrinter)(HANDLE  hPrinter,
  136.                           LPVOID  pBuf,
  137.                           DWORD   cbBuf,
  138.                           LPDWORD pcWritten);
  139.    BOOL (*fpEndPagePrinter)(HANDLE   hPrinter);
  140.    BOOL (*fpAbortPrinter)(HANDLE   hPrinter);
  141.    BOOL (*fpReadPrinter)(HANDLE  hPrinter,
  142.                          LPVOID  pBuf,
  143.                          DWORD   cbBuf,
  144.                          LPDWORD pNoBytesRead);
  145.    BOOL (*fpEndDocPrinter)(HANDLE   hPrinter);
  146.    BOOL (*fpAddJob)(HANDLE  hPrinter,
  147.                     DWORD   Level,
  148.                     LPBYTE  pData,
  149.                     DWORD   cbBuf,
  150.                     LPDWORD pcbNeeded);
  151.    BOOL (*fpScheduleJob)(HANDLE  hPrinter,
  152.                          DWORD   JobId);
  153.    DWORD (*fpGetPrinterData)(HANDLE   hPrinter,
  154.                              LPWSTR   pValueName,
  155.                              LPDWORD  pType,
  156.                              LPBYTE   pData,
  157.                              DWORD    nSize,
  158.                              LPDWORD  pcbNeeded);
  159.    DWORD (*fpSetPrinterData)(HANDLE  hPrinter,
  160.                              LPWSTR  pValueName,
  161.                              DWORD   Type,
  162.                              LPBYTE  pData,
  163.                              DWORD   cbData);
  164.    DWORD (*fpWaitForPrinterChange)(HANDLE hPrinter, DWORD Flags);
  165.    BOOL (*fpClosePrinter)(HANDLE hPrinter);
  166.    BOOL (*fpAddForm)(HANDLE  hPrinter,
  167.                      DWORD   Level,
  168.                      LPBYTE  pForm);
  169.    BOOL (*fpDeleteForm)(HANDLE  hPrinter,
  170.                         LPWSTR  pFormName);
  171.    BOOL (*fpGetForm)(HANDLE  hPrinter,
  172.                      LPWSTR  pFormName,
  173.                      DWORD   Level,
  174.                      LPBYTE  pForm,
  175.                      DWORD   cbBuf,
  176.                      LPDWORD pcbNeeded);
  177.    BOOL (*fpSetForm)(HANDLE  hPrinter,
  178.                      LPWSTR  pFormName,
  179.                      DWORD   Level,
  180.                      LPBYTE  pForm);
  181.    BOOL (*fpEnumForms)(HANDLE  hPrinter,
  182.                        DWORD   Level,
  183.                        LPBYTE  pForm,
  184.                        DWORD   cbBuf,
  185.                        LPDWORD pcbNeeded,
  186.                        LPDWORD pcReturned);
  187.    BOOL (*fpEnumMonitors)(LPWSTR  pName,
  188.                           DWORD   Level,
  189.                           LPBYTE  pMonitors,
  190.                           DWORD   cbBuf,
  191.                           LPDWORD pcbNeeded,
  192.                           LPDWORD pcReturned);
  193.    BOOL (*fpEnumPorts)(LPWSTR  pName,
  194.                        DWORD   Level,
  195.                        LPBYTE  pPorts,
  196.                        DWORD   cbBuf,
  197.                        LPDWORD pcbNeeded,
  198.                        LPDWORD pcReturned);
  199.    BOOL (*fpAddPort)(LPWSTR  pName,
  200.                      HWND    hWnd,
  201.                      LPWSTR  pMonitorName);
  202.    BOOL (*fpConfigurePort)(LPWSTR  pName,
  203.                            HWND    hWnd,
  204.                            LPWSTR  pPortName);
  205.    BOOL (*fpDeletePort)(LPWSTR  pName,
  206.                         HWND    hWnd,
  207.                         LPWSTR  pPortName);
  208.    HANDLE (*fpCreatePrinterIC)(HANDLE  hPrinter,
  209.                                LPDEVMODEW   pDevMode);
  210.    BOOL (*fpPlayGdiScriptOnPrinterIC)(HANDLE  hPrinterIC,
  211.                                       LPBYTE  pIn,
  212.                                       DWORD   cIn,
  213.                                       LPBYTE  pOut,
  214.                                       DWORD   cOut,
  215.                                       DWORD   ul);
  216.    BOOL (*fpDeletePrinterIC)(HANDLE  hPrinterIC);
  217.    BOOL (*fpAddPrinterConnection)(LPWSTR  pName);
  218.    BOOL (*fpDeletePrinterConnection)(LPWSTR pName);
  219.    DWORD (*fpPrinterMessageBox)(HANDLE  hPrinter,
  220.                                 DWORD   Error,
  221.                                 HWND    hWnd,
  222.                                 LPWSTR  pText,
  223.                                 LPWSTR  pCaption,
  224.                                 DWORD   dwType);
  225.    BOOL (*fpAddMonitor)(LPWSTR  pName,
  226.                         DWORD   Level,
  227.                         LPBYTE  pMonitorInfo);
  228.    BOOL (*fpDeleteMonitor)(LPWSTR  pName,
  229.                            LPWSTR  pEnvironment,
  230.                            LPWSTR  pMonitorName);
  231.    BOOL (*fpResetPrinter)(HANDLE hPrinter,
  232.                           LPPRINTER_DEFAULTS pDefault);
  233.    BOOL (*fpGetPrinterDriverEx)(HANDLE  hPrinter,
  234.                               LPWSTR  pEnvironment,
  235.                               DWORD   Level,
  236.                               LPBYTE  pDriverInfo,
  237.                               DWORD   cbBuf,
  238.                               LPDWORD pcbNeeded,
  239.                               DWORD   dwClientMajorVersion,
  240.                               DWORD   dwClientMinorVersion,
  241.                               PDWORD  pdwServerMajorVersion,
  242.                               PDWORD  pdwServerMinorVersion);
  243.    BOOL (*fpFindFirstPrinterChangeNotification)(
  244.             HANDLE hPrinter,
  245.             DWORD fdwFlags,
  246.             DWORD fdwOptions,
  247.             HANDLE hNotify,
  248.             PDWORD pfdwStatus,
  249.             PVOID pPrinterNotifyOptions,
  250.             PVOID pPrinterNotifyInit);
  251.    BOOL (*fpFindClosePrinterChangeNotification)(HANDLE hPrinter);
  252.    BOOL (*fpAddPortEx)(LPWSTR   pName,
  253.                        DWORD    Level,
  254.                        LPBYTE   lpBuffer,
  255.                        LPWSTR   lpMonitorName);
  256.    BOOL (*fpShutDown)(LPVOID pvReserved);
  257.    BOOL (*fpRefreshPrinterChangeNotification)(HANDLE hPrinter,
  258.                                               DWORD  Reserved,
  259.                                               PVOID pvReserved,
  260.                                               PVOID pPrinterNotifyInfo);
  261.    BOOL (*fpOpenPrinterEx)(LPWSTR     pPrinterName,
  262.                            LPHANDLE   phPrinter,
  263.                            LPPRINTER_DEFAULTS pDefault,
  264.                            LPBYTE     pClientInfo,
  265.                            DWORD      Level);
  266.    HANDLE (*fpAddPrinterEx)(LPWSTR  pName,
  267.                             DWORD   Level,
  268.                             LPBYTE  pPrinter,
  269.                             LPBYTE  pClientInfo,
  270.                             DWORD   ClientInfoLevel);
  271.    BOOL (*fpSetPort)(LPWSTR     pName,
  272.                      LPWSTR     pPortName,
  273.                      DWORD      Level,
  274.                      LPBYTE     pPortInfo);
  275.    DWORD (*fpEnumPrinterData)(HANDLE   hPrinter,
  276.                               DWORD    dwIndex,
  277.                               LPWSTR   pValueName,
  278.                               DWORD    cbValueName,
  279.                               LPDWORD  pcbValueName,
  280.                               LPDWORD  pType,
  281.                               LPBYTE   pData,
  282.                               DWORD    cbData,
  283.                               LPDWORD  pcbData);
  284.    DWORD (*fpDeletePrinterData)(HANDLE   hPrinter,
  285.                                 LPWSTR   pValueName);
  286.    } PRINTPROVIDOR, *LPPRINTPROVIDOR;
  287. BOOL
  288. InitializePrintProvidor(
  289.    LPPRINTPROVIDOR  pPrintProvidor,
  290.    DWORD    cbPrintProvidor,
  291.    LPWSTR   pFullRegistryPath
  292. );
  293. typedef struct _PRINTPROCESSOROPENDATA {
  294.     PDEVMODE  pDevMode;
  295.     LPWSTR    pDatatype;
  296.     LPWSTR    pParameters;
  297.     LPWSTR    pDocumentName;
  298.     DWORD     JobId;
  299.     LPWSTR    pOutputFile;
  300.     LPWSTR    pPrinterName;
  301. } PRINTPROCESSOROPENDATA, *PPRINTPROCESSOROPENDATA, *LPPRINTPROCESSOROPENDATA;
  302. HANDLE
  303. OpenPrintProcessor(
  304.     LPWSTR  pPrinterName,
  305.     PPRINTPROCESSOROPENDATA pPrintProcessorOpenData
  306. );
  307. BOOL
  308. PrintDocumentOnPrintProcessor(
  309.     HANDLE  hPrintProcessor,
  310.     LPWSTR  pDocumentName
  311. );
  312. BOOL
  313. ClosePrintProcessor(
  314.     HANDLE  hPrintProcessor
  315. );
  316. BOOL
  317. ControlPrintProcessor(
  318.     HANDLE  hPrintProcessor,
  319.     DWORD   Command
  320. );
  321. BOOL
  322. InstallPrintProcessor(
  323.     HWND    hWnd
  324. );
  325. BOOL
  326. InitializeMonitor(
  327.     LPWSTR  pRegistryRoot
  328. );
  329. BOOL
  330. OpenPort(
  331.     LPWSTR  pName,
  332.     PHANDLE pHandle
  333. );
  334. BOOL
  335. WritePort(
  336.     HANDLE  hPort,
  337.     LPBYTE  pBuffer,
  338.     DWORD   cbBuf,
  339.     LPDWORD pcbWritten
  340. );
  341. BOOL
  342. ReadPort(
  343.     HANDLE hPort,
  344.     LPBYTE pBuffer,
  345.     DWORD  cbBuffer,
  346.     LPDWORD pcbRead
  347. );
  348. BOOL
  349. ClosePort(
  350.     HANDLE  hPort
  351. );
  352. typedef struct _MONITOR
  353. {
  354.     BOOL (WINAPI *pfnEnumPorts)
  355.     (
  356.     LPWSTR   pName,
  357.     DWORD   Level,
  358.     LPBYTE  pPorts,
  359.     DWORD   cbBuf,
  360.     LPDWORD pcbNeeded,
  361.     LPDWORD pcReturned
  362.     );
  363.     BOOL (WINAPI *pfnOpenPort)
  364.     (
  365.     LPWSTR  pName,
  366.     PHANDLE pHandle
  367.     );
  368.     BOOL (WINAPI *pfnOpenPortEx)
  369.     (
  370.     LPWSTR  pPortName,
  371.     LPWSTR  pPrinterName,
  372.     PHANDLE pHandle,
  373.     struct _MONITOR FAR *pMonitor
  374.     );
  375.     BOOL (WINAPI *pfnStartDocPort)
  376.     (
  377.     HANDLE  hPort,
  378.     LPWSTR  pPrinterName,
  379.     DWORD   JobId,
  380.     DWORD   Level,
  381.     LPBYTE  pDocInfo
  382.     );
  383.     BOOL (WINAPI *pfnWritePort)
  384.     (
  385.     HANDLE  hPort,
  386.     LPBYTE  pBuffer,
  387.     DWORD   cbBuf,
  388.     LPDWORD pcbWritten
  389.     );
  390.     BOOL (WINAPI *pfnReadPort)
  391.     (
  392.     HANDLE hPort,
  393.     LPBYTE pBuffer,
  394.     DWORD  cbBuffer,
  395.     LPDWORD pcbRead
  396.     );
  397.     BOOL (WINAPI *pfnEndDocPort)
  398.     (
  399.     HANDLE   hPort
  400.     );
  401.     BOOL (WINAPI *pfnClosePort)
  402.     (
  403.         HANDLE  hPort
  404.     );
  405.     BOOL (WINAPI *pfnAddPort)
  406.     (
  407.     LPWSTR   pName,
  408.     HWND    hWnd,
  409.     LPWSTR   pMonitorName
  410.     );
  411.     BOOL (WINAPI *pfnAddPortEx)
  412.     (
  413.     LPWSTR   pName,
  414.     DWORD    Level,
  415.     LPBYTE   lpBuffer,
  416.     LPWSTR   lpMonitorName
  417.     );
  418.     BOOL (WINAPI *pfnConfigurePort)
  419.     (
  420.     LPWSTR   pName,
  421.     HWND  hWnd,
  422.     LPWSTR pPortName
  423.     );
  424.     BOOL (WINAPI *pfnDeletePort)
  425.     (
  426.     LPWSTR   pName,
  427.     HWND    hWnd,
  428.     LPWSTR   pPortName
  429.     );
  430.     BOOL (WINAPI *pfnGetPrinterDataFromPort)
  431.     (
  432.     HANDLE  hPort,
  433.     DWORD   ControlID,
  434.     LPWSTR  pValueName,
  435.     LPWSTR  lpInBuffer,
  436.     DWORD   cbInBuffer,
  437.     LPWSTR  lpOutBuffer,
  438.     DWORD   cbOutBuffer,
  439.     LPDWORD lpcbReturned
  440.     );
  441.     BOOL (WINAPI *pfnSetPortTimeOuts)
  442.     (
  443.     HANDLE  hPort,
  444.     LPCOMMTIMEOUTS lpCTO,
  445.     DWORD   reserved    // must be set to 0
  446.     );
  447. } MONITOR, FAR *LPMONITOR;
  448. typedef struct _MONITOREX
  449. {
  450.     DWORD       dwMonitorSize;
  451.     MONITOR     Monitor;
  452. } MONITOREX, FAR *LPMONITOREX;
  453. HANDLE
  454. CreatePrinterIC(
  455.     HANDLE  hPrinter,
  456.     LPDEVMODEW  pDevMode
  457. );
  458. BOOL
  459. PlayGdiScriptOnPrinterIC(
  460.     HANDLE  hPrinterIC,
  461.     LPBYTE  pIn,
  462.     DWORD   cIn,
  463.     LPBYTE  pOut,
  464.     DWORD   cOut,
  465.     DWORD   ul
  466. );
  467. BOOL
  468. DeletePrinterIC(
  469.     HANDLE  hPrinterIC
  470. );
  471. BOOL
  472. DevQueryPrint(
  473.     HANDLE      hPrinter,
  474.     LPDEVMODE   pDevMode,
  475.     DWORD      *pResID
  476. );
  477. HANDLE
  478. RevertToPrinterSelf(
  479.     VOID
  480. );
  481. BOOL
  482. ImpersonatePrinterClient(
  483.     HANDLE  hToken
  484. );
  485. BOOL
  486. OpenPrinterToken(
  487.     PHANDLE phToken
  488. );
  489. BOOL
  490. SetPrinterToken(
  491.     HANDLE  hToken
  492. );
  493. BOOL
  494. ClosePrinterToken(
  495.     HANDLE  hToken
  496. );
  497. BOOL
  498. ReplyPrinterChangeNotification(
  499.     HANDLE hNotify,
  500.     DWORD fdwFlags,
  501.     PDWORD pdwResult,
  502.     PVOID pPrinterNotifyInfo
  503. );
  504. BOOL
  505. PartialReplyPrinterChangeNotification(
  506.     HANDLE hNotify,
  507.     PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc
  508. );
  509. PPRINTER_NOTIFY_INFO
  510. RouterAllocPrinterNotifyInfo(
  511.     DWORD cPrinterNotifyInfoData
  512. );
  513. BOOL
  514. RouterFreePrinterNotifyInfo(
  515.     PPRINTER_NOTIFY_INFO pInfo
  516. );
  517. #define PRINTER_NOTIFY_INFO_DATA_COMPACT 1
  518. BOOL
  519. AppendPrinterNotifyInfoData(
  520.     PPRINTER_NOTIFY_INFO pInfoDest,
  521.     PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc,
  522.     DWORD fdwFlags
  523. );
  524. DWORD
  525. CallRouterFindFirstPrinterChangeNotification(
  526.     HANDLE hPrinter,
  527.     DWORD fdwFlags,
  528.     DWORD fdwOptions,
  529.     HANDLE hNotify,
  530.     PVOID pvReserved);
  531. BOOL
  532. ProvidorFindFirstPrinterChangeNotification(
  533.     HANDLE hPrinter,
  534.     DWORD fdwFlags,
  535.     DWORD fdwOptions,
  536.     HANDLE hNotify,
  537.     PVOID pvReserved0,
  538.     PVOID pvReserved1);
  539. BOOL
  540. ProvidorFindClosePrinterChangeNotification(
  541.     HANDLE hPrinter);
  542. BOOL
  543. SpoolerFindFirstPrinterChangeNotification(
  544.     HANDLE hPrinter,
  545.     DWORD fdwFlags,
  546.     DWORD fdwOptions,
  547.     PHANDLE phEvent,
  548.     PVOID pPrinterNotifyOptions,
  549.     PVOID pvReserved);
  550. BOOL
  551. SpoolerFindNextPrinterChangeNotification(
  552.     HANDLE hPrinter,
  553.     LPDWORD pfdwChange,
  554.     PVOID pvReserved0,
  555.     PVOID ppPrinterNotifyInfo);
  556. VOID
  557. SpoolerFreePrinterNotifyInfo(
  558.     PPRINTER_NOTIFY_INFO pInfo);
  559. BOOL
  560. SpoolerFindClosePrinterChangeNotification(
  561.     HANDLE hPrinter);
  562. BOOL
  563. WINAPI
  564. InitializeMonitorEx(
  565.     LPWSTR      pRegistryRoot,
  566.     LPMONITOR   pMonitor
  567. );
  568. LPMONITOREX
  569. WINAPI
  570. InitializePrintMonitor(
  571.     LPWSTR      pRegistryRoot
  572. );
  573. //for vista
  574. typedef struct _BINARY_CONTAINER {
  575.   DWORD  cbBuf;
  576.   LPBYTE  pData;
  577. } BINARY_CONTAINER, *PBINARY_CONTAINER;
  578. typedef struct _BIDI_DATA {
  579.   DWORD  dwBidiType;
  580.   union {
  581.      BOOL  bData;
  582.      INT  iData;
  583.      LPWSTR  sData;
  584.      FLOAT  fData;
  585.      BINARY_CONTAINER  biData;
  586.   } u;
  587. } BIDI_DATA, *PBIDI_DATA, *LPBIDI_DATA;
  588. typedef struct _BIDI_RESPONSE_DATA {
  589.   DWORD  dwResult;
  590.   DWORD  dwReqNumber;
  591.   LPWSTR  pSchema;
  592.   BIDI_DATA  data;
  593. } BIDI_RESPONSE_DATA, *PBIDI_RESPONSE_DATA, *LPBIDI_RESPONSE_DATA;
  594. typedef struct _BIDI_RESPONSE_CONTAINER {
  595.   DWORD  Version;
  596.   DWORD  Flags;
  597.   DWORD  Count;
  598.   BIDI_RESPONSE_DATA aData[1];
  599. } BIDI_RESPONSE_CONTAINER, *PBIDI_RESPONSE_CONTAINER, *LPBIDI_RESPONSE_CONTAINER; 
  600. typedef struct _BIDI_REQUEST_DATA {
  601.   DWORD  dwReqNumber;
  602.   LPWSTR  pSchema;
  603.   BIDI_DATA  data;
  604. } BIDI_REQUEST_DATA, *PBIDI_REQUEST_DATA, *LPBIDI_REQUEST_DATA;
  605. typedef struct _BIDI_REQUEST_CONTAINER {
  606.   DWORD  Version;
  607.   DWORD  Flags;
  608.   DWORD  Count;
  609.   BIDI_REQUEST_DATA aData[1];
  610. } BIDI_REQUEST_CONTAINER, *PBIDI_REQUEST_CONTAINER, *LPBIDI_REQUEST_CONTAINER;
  611. typedef struct _MONITORREG {
  612.   DWORD cbSize;
  613.   LONG (*fpCreateKey)(
  614.       HANDLE hcKey,
  615.       LPCTSTR pszSubKey,
  616.       DWORD dwOptions,
  617.       REGSAM samDesired,
  618.       PSECURITY_ATTRIBUTES pSecurityAttributes,
  619.       PHANDLE phckResult,
  620.       PDWORD pdwDisposition,
  621.       HANDLE hSpooler
  622.       );
  623.   LONG (*fpOpenKey)(
  624.       HANDLE hcKey,
  625.       LPCTSTR pszSubKey,
  626.       REGSAM samDesired,
  627.       PHANDLE phkResult,
  628.       HANDLE hSpooler
  629.       );
  630.   LONG (*fpCloseKey)(
  631.       HANDLE hcKey,
  632.       HANDLE hSpooler
  633.       );
  634.   LONG (*fpDeleteKey)(
  635.       HANDLE hcKey,
  636.       LPCTSTR pszSubKey,
  637.       HANDLE hSpooler
  638.       );
  639.   LONG (*fpEnumKey)(
  640.       HANDLE hcKey,
  641.       DWORD dwIndex,
  642.       LPTSTR pszName,
  643.       PDWORD pcchName,
  644.       PFILETIME pftLastWriteTime,
  645.       HANDLE hSpooler
  646.       );
  647.   LONG (*fpQueryInfoKey)(
  648.       HANDLE hcKey,
  649.       PDWORD pcSubKeys,
  650.       PDWORD pcbKey,
  651.       PDWORD pcValues,
  652.       PDWORD pcbValue,
  653.       PDWORD pcbData,
  654.       PDWORD pcbSecurityDescriptor,
  655.       PFILETIME pftLastWriteTime,
  656.       HANDLE hSpooler
  657.       );
  658.   LONG (*fpSetValue)(
  659.       HANDLE hcKey,
  660.       LPCTSTR pszValue,
  661.       DWORD dwType,
  662.       const BYTE* pData,
  663.       DWORD cbData,
  664.       HANDLE hSpooler
  665.       );
  666.   LONG (*fpDeleteValue)(
  667.       HANDLE hcKey,
  668.       LPCTSTR pszValue,
  669.       HANDLE hSpooler
  670.       );
  671.   LONG (*fpEnumValue)(
  672.       HANDLE hcKey,
  673.       DWORD dwIndex,
  674.       LPTSTR pszValue,
  675.       PDWORD pcbValue,
  676.       PDWORD pType,
  677.       PBYTE pData,
  678.       PDWORD pcbData,
  679.       HANDLE hSpooler
  680.       );
  681.   LONG (*fpQueryValue)(
  682.       HANDLE hcKey,
  683.       LPCTSTR pszValue,
  684.       PDWORD pType,
  685.       PBYTE pData,
  686.       PDWORD pcbData,
  687.       HANDLE hSpooler
  688.       );
  689. } MONITORREG, *PMONITORREG;
  690. typedef struct _MONITORINIT {
  691.   DWORD  cbSize;
  692.   HANDLE  hSpooler;
  693.   HANDLE  hckRegistryRoot;
  694.   PMONITORREG  pMonitorReg;
  695.   BOOL  bLocal;
  696.   LPCWSTR  pszServerName;
  697. } MONITORINIT, *PMONITORINIT;
  698. #ifdef __cplusplus
  699. }                   /* End of extern "C" { */
  700. #endif              /* __cplusplus */
  701. #endif // _WINSPLP_