Commit f63d59d6 authored by Tatyana Fokina's avatar Tatyana Fokina Committed by Alexandre Julliard

winspool.drv: Fix DocumentProperties with empty device name.

parent 401b75e3
......@@ -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");
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment