| Index: chrome/service/cloud_print/print_system_win.cc
|
| diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
|
| index 048a3ab2f89efd4e3c0d25af4848bcf23ce2c679..453544a91dbd828a3c80974983de0fa671f41698 100644
|
| --- a/chrome/service/cloud_print/print_system_win.cc
|
| +++ b/chrome/service/cloud_print/print_system_win.cc
|
| @@ -228,30 +228,17 @@ class PrintSystemWatcherWin : public base::win::ObjectWatcher::Delegate {
|
| if (!printer_.IsValid())
|
| return false;
|
|
|
| - DWORD bytes_needed = 0;
|
| - bool ret = false;
|
| - GetPrinter(printer_, 2, NULL, 0, &bytes_needed);
|
| - if (0 != bytes_needed) {
|
| - scoped_array<BYTE> printer_info_buffer(new BYTE[bytes_needed]);
|
| - if (GetPrinter(printer_, 2, printer_info_buffer.get(),
|
| - bytes_needed, &bytes_needed)) {
|
| - PRINTER_INFO_2* printer_info_win =
|
| - reinterpret_cast<PRINTER_INFO_2*>(printer_info_buffer.get());
|
| - printer_info->printer_name = WideToUTF8(printer_info_win->pPrinterName);
|
| - if (printer_info_win->pComment)
|
| - printer_info->printer_description =
|
| - WideToUTF8(printer_info_win->pComment);
|
| - if (printer_info_win->pLocation)
|
| - printer_info->options[kLocationTagName] =
|
| - WideToUTF8(printer_info_win->pLocation);
|
| - if (printer_info_win->pDriverName)
|
| - printer_info->options[kDriverNameTagName] =
|
| - WideToUTF8(printer_info_win->pDriverName);
|
| - printer_info->printer_status = printer_info_win->Status;
|
| - ret = true;
|
| - }
|
| - }
|
| - return ret;
|
| + scoped_array<BYTE> printer_info_buffer;
|
| + const PRINTER_INFO_2* printer_info_2 =
|
| + GetPrinterInfo2(printer_, &printer_info_buffer);
|
| + if (!printer_info_2)
|
| + return false;
|
| +
|
| + scoped_array<BYTE> driver_info_buffer;
|
| + InitBasicPrinterInfo(printer_info_2,
|
| + GetDriverInfo6(printer_, &driver_info_buffer),
|
| + printer_info);
|
| + return true;
|
| }
|
|
|
| private:
|
|
|