1 // Copyright (c) 2012 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.
5 #ifndef CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_
6 #define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_
10 #include "base/file_util.h"
11 #include "base/process/process.h"
12 #include "base/strings/string16.h"
14 namespace cloud_print {
16 // Returns path to be used for launching Chrome.
17 base::FilePath GetChromeExePath();
19 // Returns path to user profile to be used for launching Chrome.
20 base::FilePath GetChromeProfilePath();
22 // Implementations for the function pointers in the MONITOR2 structure
23 // returned by InitializePrintMonitor2. The prototypes and behaviors
24 // are as described in the MONITOR2 documentation from Microsoft.
26 BOOL WINAPI Monitor2EnumPorts(HANDLE,
34 BOOL WINAPI Monitor2OpenPort(HANDLE monitor_data, wchar_t*, HANDLE* handle);
36 BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle,
37 wchar_t* printer_name,
42 BOOL WINAPI Monitor2WritePort(HANDLE port,
45 DWORD* bytes_written);
47 BOOL WINAPI Monitor2ReadPort(HANDLE, BYTE*, DWORD, DWORD* bytes_read);
49 BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle);
51 BOOL WINAPI Monitor2ClosePort(HANDLE port_handle);
53 VOID WINAPI Monitor2Shutdown(HANDLE monitor_handle);
55 BOOL WINAPI Monitor2XcvOpenPort(HANDLE monitor,
57 ACCESS_MASK granted_access,
60 DWORD WINAPI Monitor2XcvDataPort(HANDLE xcv_handle,
61 const wchar_t* data_name,
65 DWORD output_data_bytes,
66 DWORD* output_data_bytes_needed);
68 BOOL WINAPI Monitor2XcvClosePort(HANDLE handle);
70 // Implementations for the function pointers in the MONITORUI structure
71 // returned by InitializePrintMonitorUI. The prototypes and behaviors
72 // are as described in the MONITORUI documentation from Microsoft.
74 BOOL WINAPI MonitorUiAddPortUi(const wchar_t*,
76 const wchar_t* monitor_name,
79 BOOL WINAPI MonitorUiConfigureOrDeletePortUI(const wchar_t*,
81 const wchar_t* port_name);
83 extern const wchar_t kChromeExePath[];
84 extern const wchar_t kChromeExePathRegValue[];
85 extern const wchar_t kChromeProfilePathRegValue[];
86 extern const bool kIsUnittest;
88 } // namespace cloud_print
90 #endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_