From 2cbb9a1ee5bca8c0e83d769391469c66aaf7b351 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Thu, 17 Jun 2010 00:38:24 +0200 Subject: [PATCH] winspool/tests: Handle the Windows bug in GetPrinterDataEx. --- dlls/winspool.drv/tests/info.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c index b86d36787be..b81bde44fee 100644 --- a/dlls/winspool.drv/tests/info.c +++ b/dlls/winspool.drv/tests/info.c @@ -2461,8 +2461,19 @@ static void test_GetPrinterDataEx(void) needed = 0xdeadbeef; SetLastError(0xdeadbeef); + /* vista and w2k8 have a bug in GetPrinterDataEx: + the current LastError value is returned as result */ res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed); - ok( (res == ERROR_MORE_DATA) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), + ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeadbeef)) && + ((needed == len) || (needed == (len * sizeof(WCHAR)))), + "got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)\n", + res, needed, len, len * sizeof(WCHAR)); + + needed = 0xdeadbeef; + SetLastError(0xdeaddead); + res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed); + ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeaddead)) && + ((needed == len) || (needed == (len * sizeof(WCHAR)))), "got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)\n", res, needed, len, len * sizeof(WCHAR)); -- 2.11.4.GIT