winspool.drv: Fix DocumentProperties with empty device name.

This commit is contained in:
Tatyana Fokina 2013-04-05 11:41:29 +04:00 committed by Alexandre Julliard
parent 401b75e3e9
commit f63d59d640
2 changed files with 5 additions and 1 deletions

View File

@ -2358,7 +2358,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
hWnd,hPrinter,pDeviceName,pDevModeOutput,pDevModeInput,fMode
);
if(!pDeviceName) {
if(!pDeviceName || !*pDeviceName) {
LPCWSTR lpNameW = get_opened_printer_name(hPrinter);
if(!lpNameW) {
ERR("no name from hPrinter?\n");

View File

@ -2653,6 +2653,7 @@ static void test_DocumentProperties(void)
HANDLE hprn;
LONG dm_size, ret;
DEVMODE *dm;
char empty_str[] = "";
if (!default_printer)
{
@ -2678,6 +2679,9 @@ static void test_DocumentProperties(void)
ret = DocumentProperties(0, hprn, NULL, dm, dm, DM_OUT_BUFFER);
ok(ret == IDOK, "DocumentProperties ret value %d != expected IDOK\n", ret);
ret = DocumentProperties(0, hprn, empty_str, dm, dm, DM_OUT_BUFFER);
ok(ret == IDOK, "DocumentProperties ret value %d != expected IDOK\n", ret);
test_DEVMODE(dm, dm_size, default_printer);
HeapFree(GetProcessHeap(), 0, dm);