Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: cloud_print/virtual_driver/win/virtual_driver_helpers.cc

Issue 2541123003: Resurrect the cloud printer driver. (Closed)
Patch Set: Remove cross-compiling option for the portmon dll. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "cloud_print/virtual_driver/win/virtual_driver_helpers.h"
6
7 #include <windows.h>
8 #include <winspool.h>
9
10 #include "base/files/file_util.h"
11 #include "base/logging.h"
12 #include "base/strings/string16.h"
13 #include "base/win/windows_version.h"
14 #include "cloud_print/common/win/cloud_print_utils.h"
15
16 namespace cloud_print {
17
18 void DisplayWindowsMessage(HWND hwnd,
19 HRESULT hr,
20 const base::string16& caption) {
21 ::MessageBox(hwnd, GetErrorMessage(hr).c_str(), caption.c_str(), MB_OK);
22 }
23
24 HRESULT GetPrinterDriverDir(base::FilePath* path) {
25 BYTE driver_dir_buffer[MAX_PATH * sizeof(wchar_t)];
26 DWORD needed = 0;
27 if (!GetPrinterDriverDirectory(NULL, NULL, 1, driver_dir_buffer,
28 MAX_PATH * sizeof(wchar_t), &needed)) {
29 // We could try to allocate a larger buffer if needed > MAX_PATH
30 // but that really shouldn't happen.
31 return cloud_print::GetLastHResult();
32 }
33 *path = base::FilePath(reinterpret_cast<wchar_t*>(driver_dir_buffer));
34
35 // The XPS driver is a "Level 3" driver
36 *path = path->Append(L"3");
37 return S_OK;
38 }
39 }
OLDNEW
« no previous file with comments | « cloud_print/virtual_driver/win/virtual_driver_helpers.h ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698