OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <windows.h> | 5 #include <windows.h> |
6 #include <setupapi.h> // Must be included after windows.h | 6 #include <setupapi.h> // Must be included after windows.h |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 base::win::Version version = base::win::GetVersion(); | 226 base::win::Version version = base::win::GetVersion(); |
227 if (version >= base::win::VERSION_VISTA) { | 227 if (version >= base::win::VERSION_VISTA) { |
228 // GetCorePrinterDrivers and GetPrinterDriverPackagePath only exist on | 228 // GetCorePrinterDrivers and GetPrinterDriverPackagePath only exist on |
229 // Vista and later. Winspool.drv must be delayloaded so these calls don't | 229 // Vista and later. Winspool.drv must be delayloaded so these calls don't |
230 // create problems on XP. | 230 // create problems on XP. |
231 DWORD size = MAX_PATH; | 231 DWORD size = MAX_PATH; |
232 wchar_t package_path[MAX_PATH] = {0}; | 232 wchar_t package_path[MAX_PATH] = {0}; |
233 CORE_PRINTER_DRIVER driver; | 233 CORE_PRINTER_DRIVER driver; |
234 GetCorePrinterDrivers(NULL, | 234 GetCorePrinterDrivers(NULL, |
235 NULL, | 235 NULL, |
236 L"{D20EA372-DD35-4950-9ED8-A6335AFE79F0}", | 236 L"{D20EA372-DD35-4950-9ED8-A6335AFE79F5}", |
237 1, | 237 1, |
238 &driver); | 238 &driver); |
239 GetPrinterDriverPackagePath(NULL, | 239 GetPrinterDriverPackagePath(NULL, |
240 NULL, | 240 NULL, |
241 NULL, | 241 NULL, |
242 driver.szPackageID, | 242 driver.szPackageID, |
243 package_path, | 243 package_path, |
244 MAX_PATH, | 244 MAX_PATH, |
245 &size); | 245 &size); |
246 SetupIterateCabinet(package_path, | 246 SetupIterateCabinet(package_path, |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 580 } |
581 } | 581 } |
582 } | 582 } |
583 // Installer is silent by default as required by Omaha. | 583 // Installer is silent by default as required by Omaha. |
584 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { | 584 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { |
585 cloud_print::DisplayWindowsMessage(NULL, retval, | 585 cloud_print::DisplayWindowsMessage(NULL, retval, |
586 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); | 586 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); |
587 } | 587 } |
588 return retval; | 588 return retval; |
589 } | 589 } |
OLD | NEW |