mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
winspool: Update the default settings when deleting the default printer.
This commit is contained in:
parent
c0140118be
commit
1aa5696c93
@ -2812,6 +2812,8 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
|
||||
{
|
||||
LPCWSTR lpNameW = get_opened_printer_name(hPrinter);
|
||||
HKEY hkeyPrinters, hkey;
|
||||
WCHAR def[MAX_PATH];
|
||||
DWORD size = sizeof( def ) / sizeof( def[0] );
|
||||
|
||||
if(!lpNameW) {
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
@ -2833,6 +2835,18 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
|
||||
RegDeleteValueW(hkey, lpNameW);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
if (GetDefaultPrinterW( def, &size ) && !strcmpW( def, lpNameW ))
|
||||
{
|
||||
WriteProfileStringW( windowsW, deviceW, NULL );
|
||||
if (!RegCreateKeyW( HKEY_CURRENT_USER, user_default_reg_key, &hkey ))
|
||||
{
|
||||
RegDeleteValueW( hkey, deviceW );
|
||||
RegCloseKey( hkey );
|
||||
}
|
||||
SetDefaultPrinterW( NULL );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user