Commit 2feb43f5 authored by Jeremy White's avatar Jeremy White Committed by Alexandre Julliard

winspool: Add a test showing Windows behavior wrt size and GetPrinterDriverA.

This behavior was discovered by Huw Davies.
parent abb23d8b
......@@ -70,6 +70,7 @@ static BOOL (WINAPI * pGetDefaultPrinterA)(LPSTR, LPDWORD);
static BOOL (WINAPI * pSetDefaultPrinterA)(LPCSTR);
static DWORD (WINAPI * pXcvDataW)(HANDLE, LPCWSTR, PBYTE, DWORD, PBYTE, DWORD, PDWORD, PDWORD);
static BOOL (WINAPI * pAddPortExA)(LPSTR, DWORD, LPBYTE, LPSTR);
static BOOL (WINAPI * pGetPrinterDriverW)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD);
/* ################################ */
......@@ -2260,6 +2261,15 @@ static void test_GetPrinterDriver(void)
continue;
}
/* GetPrinterDriverA returns the same number of bytes as GetPrinterDriverW */
if (! ret && pGetPrinterDriverW)
{
DWORD double_needed;
ret = pGetPrinterDriverW(hprn, NULL, level, NULL, 0, &double_needed);
todo_wine
ok(double_needed == needed, "GetPrinterDriverA returned different size %d than GetPrinterDriverW (%d)\n", needed, double_needed);
}
buf = HeapAlloc(GetProcessHeap(), 0, needed);
SetLastError(0xdeadbeef);
......@@ -2536,6 +2546,7 @@ START_TEST(info)
hwinspool = GetModuleHandleA("winspool.drv");
pGetDefaultPrinterA = (void *) GetProcAddress(hwinspool, "GetDefaultPrinterA");
pSetDefaultPrinterA = (void *) GetProcAddress(hwinspool, "SetDefaultPrinterA");
pGetPrinterDriverW = (void *) GetProcAddress(hwinspool, "GetPrinterDriverW");
pXcvDataW = (void *) GetProcAddress(hwinspool, "XcvDataW");
pAddPortExA = (void *) GetProcAddress(hwinspool, "AddPortExA");
......
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