/* * Display the bad results in qemu */ #include #include #include int main(int argc, char ** argv) { LPBYTE buffer = NULL; DWORD cbBuf = 0; DWORD pcbNeeded = 0; DWORD res; SetLastError(0x00dead00); res = GetPrinterDriverDirectoryA( NULL, NULL, 1, NULL, 0, &cbBuf); printf("first call returned 0x%x, size 0x%lx/%ld\n", res, cbBuf, cbBuf); if (!cbBuf) return 1; buffer = HeapAlloc(GetProcessHeap(), 0, cbBuf*2); if (buffer == NULL) { printf("No buffer (need %ld bytes)\n", cbBuf*2); return 1 ; } SetLastError(0x00dead00); res = GetPrinterDriverDirectoryA( NULL, NULL, 1, NULL, cbBuf, &pcbNeeded); printf("expected '0' with ERROR_INVALID_USER_BUFFER " "or '!=0' with ERROR_INVALID_PARAMETER " "got %d with lasterror == %ld\n", res, GetLastError()); SetLastError(0x00dead00); res = GetPrinterDriverDirectoryA( NULL, NULL, 1, NULL, cbBuf, NULL); printf("expected '0' with RPC_X_NULL_REF_POINTER " "or '!=0' with ERROR_INVALID_PARAMETER " "got %d with lasterror == %ld\n", res, GetLastError()); HeapFree(GetProcessHeap(), 0, buffer); return 0; }