diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 22:26:26 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 22:26:26 +0000 |
commit | 93543752960447decfc8f0ca38ef9f44f7209cfd (patch) | |
tree | fc31d2875f43ed52b2318c4dc6c333311c3b3385 /printing | |
parent | e91e120c82d7750ba7c0bd1cbe3dde47bf9f2f69 (diff) | |
download | chromium_src-93543752960447decfc8f0ca38ef9f44f7209cfd.zip chromium_src-93543752960447decfc8f0ca38ef9f44f7209cfd.tar.gz chromium_src-93543752960447decfc8f0ca38ef9f44f7209cfd.tar.bz2 |
Printing Backend: Check the results from a DocumentProperties() call.
BUG=94138
TEST=Print preview works again on vandebo's machine.
Review URL: http://codereview.chromium.org/7741003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/backend/print_backend_win.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/printing/backend/print_backend_win.cc b/printing/backend/print_backend_win.cc index dbbb270..39f085e 100644 --- a/printing/backend/print_backend_win.cc +++ b/printing/backend/print_backend_win.cc @@ -137,10 +137,11 @@ bool PrintBackendWin::GetPrinterCapsAndDefaults( NULL); DCHECK(printer_handle); if (printer_handle) { - DWORD devmode_size = DocumentProperties( + LONG devmode_size = DocumentProperties( NULL, printer_handle, const_cast<LPTSTR>(printer_name_wide.c_str()), NULL, NULL, 0); - DCHECK_NE(0U, devmode_size); + if (devmode_size <= 0) + return false; scoped_ptr<BYTE> devmode_out_buffer(new BYTE[devmode_size]); DEVMODE* devmode_out = reinterpret_cast<DEVMODE*>(devmode_out_buffer.get()); |