Commit 4723b6b8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

winspool.drv: Ignore device name if printer handle is passed in DocumentProperties.

parent 5fabd968
......@@ -1889,7 +1889,7 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
TRACE("(%p,%p,%s,%p,%p,%ld)\n",
hWnd, hPrinter, debugstr_w(pDeviceName), pDevModeOutput, pDevModeInput, fMode);
device = pDeviceName && pDeviceName[0] ? pDeviceName : get_opened_printer_name(hPrinter);
device = hPrinter ? get_opened_printer_name(hPrinter) : pDeviceName;
if (!device) {
ERR("no device name\n");
return -1;
......
......@@ -2679,6 +2679,7 @@ static void test_DocumentProperties(void)
LONG dm_size, ret;
DEVMODEA *dm;
char empty_str[] = "";
char non_existing_str[] = "non existing printer";
if (!default_printer)
{
......@@ -2707,6 +2708,9 @@ static void test_DocumentProperties(void)
ret = DocumentPropertiesA(0, hprn, empty_str, dm, dm, DM_OUT_BUFFER);
ok(ret == IDOK, "DocumentPropertiesA ret value %ld != expected IDOK\n", ret);
ret = DocumentPropertiesA(0, hprn, non_existing_str, dm, dm, DM_OUT_BUFFER);
ok(ret == IDOK, "DocumentPropertiesA ret value %ld != expected IDOK\n", ret);
test_DEVMODEA(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