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

Unified Diff: printing/backend/print_backend_win.cc

Issue 7741003: Printing Backend: Check the results from a DocumentProperties() call. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/backend/print_backend_win.cc
===================================================================
--- printing/backend/print_backend_win.cc (revision 98089)
+++ printing/backend/print_backend_win.cc (working copy)
@@ -137,10 +137,11 @@
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698