OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ |
| 6 #define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <windows.h> |
| 10 |
| 11 // Compatible structures and prototypes are also defined in the Windows DDK. |
| 12 // In order to use the DDK versions define USE_WIN_DDK. |
| 13 #ifdef USE_WIN_DDK |
| 14 |
| 15 #include <winsplp.h> |
| 16 |
| 17 #else |
| 18 |
| 19 typedef struct { |
| 20 DWORD size; |
| 21 BOOL (WINAPI *pfnEnumPorts)(HANDLE, |
| 22 wchar_t*, |
| 23 DWORD level, |
| 24 BYTE* ports, |
| 25 DWORD ports_size, |
| 26 DWORD* needed_bytes, |
| 27 DWORD* returned); |
| 28 |
| 29 BOOL (WINAPI *pfnOpenPort)(HANDLE monitor_data, wchar_t*, HANDLE* handle); |
| 30 |
| 31 void* pfnOpenPortEx; // Unused. |
| 32 |
| 33 BOOL (WINAPI *pfnStartDocPort)(HANDLE port_handle, |
| 34 wchar_t* printer_name, |
| 35 DWORD job_id, |
| 36 DWORD, |
| 37 BYTE*); |
| 38 |
| 39 BOOL (WINAPI *pfnWritePort)(HANDLE port, |
| 40 BYTE* buffer, |
| 41 DWORD buffer_size, |
| 42 DWORD* bytes_written); |
| 43 |
| 44 BOOL (WINAPI *pfnReadPort)(HANDLE, BYTE*, DWORD, DWORD* bytes_read); |
| 45 |
| 46 BOOL (WINAPI *pfnEndDocPort)(HANDLE port_handle); |
| 47 |
| 48 BOOL (WINAPI *pfnClosePort)(HANDLE port_handle); |
| 49 |
| 50 void* pfnAddPort; // Unused. |
| 51 |
| 52 void* pfnAddPortEx; // Unused. |
| 53 |
| 54 void* pfnConfigurePort; // Unused. |
| 55 |
| 56 void* pfnDeletePort; // Unused. |
| 57 |
| 58 void* pfnGetPrinterDataFromPort; // Unused. |
| 59 |
| 60 void* pfnSetPortTimeOuts; // Unusued. |
| 61 |
| 62 BOOL (WINAPI *pfnXcvOpenPort)(HANDLE monitor, |
| 63 const wchar_t*, |
| 64 ACCESS_MASK granted_access, |
| 65 HANDLE* handle); |
| 66 |
| 67 DWORD (WINAPI *pfnXcvDataPort)(HANDLE xcv_handle, |
| 68 const wchar_t* data_name, |
| 69 BYTE*, |
| 70 DWORD, |
| 71 BYTE* output_data, |
| 72 DWORD output_data_bytes, |
| 73 DWORD* output_data_bytes_needed); |
| 74 |
| 75 BOOL (WINAPI *pfnXcvClosePort)(HANDLE handle); |
| 76 |
| 77 VOID (WINAPI *pfnShutdown)(HANDLE monitor_handle); |
| 78 } MONITOR2; |
| 79 |
| 80 typedef struct { |
| 81 DWORD size; |
| 82 |
| 83 BOOL (WINAPI *pfnAddPortUI)(const wchar_t*, |
| 84 HWND hwnd, |
| 85 const wchar_t* monitor_name, |
| 86 wchar_t**); |
| 87 |
| 88 BOOL (WINAPI *pfnConfigurePortUI)(const wchar_t*, |
| 89 HWND hwnd, |
| 90 const wchar_t* port_name); |
| 91 |
| 92 BOOL (WINAPI *pfnDeletePortUI)(const wchar_t*, |
| 93 HWND hwnd, |
| 94 const wchar_t* port_name); |
| 95 } MONITORUI; |
| 96 |
| 97 typedef struct { |
| 98 DWORD cbSize; |
| 99 HANDLE hSpooler; |
| 100 HKEY hckRegistryRoot; |
| 101 void* pMonitorReg; // Unused |
| 102 BOOL bLocal; |
| 103 LPCWSTR pszServerName; |
| 104 } MONITORINIT; |
| 105 |
| 106 MONITOR2* WINAPI InitializePrintMonitor2(MONITORINIT* monitor_init, |
| 107 HANDLE* monitor_handle); |
| 108 |
| 109 MONITORUI* WINAPI InitializePrintMonitorUI(void); |
| 110 |
| 111 #endif // ifdef USE_WIN_DDK |
| 112 #endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ |
| 113 |
OLD | NEW |