winspool.drv: Do not try to check the registry if opening the printer fails (valgrind).

This commit is contained in:
Bruno Jesus 2014-05-29 22:04:56 -03:00 committed by Alexandre Julliard
parent dbdb244d13
commit 2728066152
1 changed files with 2 additions and 3 deletions

View File

@ -2530,6 +2530,7 @@ BOOL WINAPI OpenPrinterA(LPSTR lpPrinterName,HANDLE *phPrinter,
*/ */
BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter, LPPRINTER_DEFAULTSW pDefault) BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter, LPPRINTER_DEFAULTSW pDefault)
{ {
HKEY key;
TRACE("(%s, %p, %p)\n", debugstr_w(lpPrinterName), phPrinter, pDefault); TRACE("(%s, %p, %p)\n", debugstr_w(lpPrinterName), phPrinter, pDefault);
@ -2542,12 +2543,10 @@ BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter, LPPRINTER_DEFAU
/* Get the unique handle of the printer or Printserver */ /* Get the unique handle of the printer or Printserver */
*phPrinter = get_opened_printer_entry(lpPrinterName, pDefault); *phPrinter = get_opened_printer_entry(lpPrinterName, pDefault);
if (*phPrinter) if (*phPrinter && WINSPOOL_GetOpenedPrinterRegKey( *phPrinter, &key ) == ERROR_SUCCESS)
{ {
HKEY key;
DWORD deleting = 0, size = sizeof( deleting ), type; DWORD deleting = 0, size = sizeof( deleting ), type;
DWORD status; DWORD status;
WINSPOOL_GetOpenedPrinterRegKey( *phPrinter, &key );
RegQueryValueExW( key, May_Delete_Value, NULL, &type, (LPBYTE)&deleting, &size ); RegQueryValueExW( key, May_Delete_Value, NULL, &type, (LPBYTE)&deleting, &size );
WaitForSingleObject( init_mutex, INFINITE ); WaitForSingleObject( init_mutex, INFINITE );
status = get_dword_from_reg( key, StatusW ); status = get_dword_from_reg( key, StatusW );