Francois Gouget : kernel32/tests: Check what happens if QueryDosDeviceA() is given an insufficient buffer.
Alexandre Julliard
julliard at winehq.org
Mon Oct 3 17:21:26 CDT 2011
Module: wine
Branch: master
Commit: db882bfb5d2f24b427019a11ccd463fc92f50282
URL: http://source.winehq.org/git/wine.git/?a=commit;h=db882bfb5d2f24b427019a11ccd463fc92f50282
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Oct 3 23:39:10 2011 +0200
kernel32/tests: Check what happens if QueryDosDeviceA() is given an insufficient buffer.
---
dlls/kernel32/tests/volume.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c
index 6f0fd67..2755af5 100644
--- a/dlls/kernel32/tests/volume.c
+++ b/dlls/kernel32/tests/volume.c
@@ -44,6 +44,12 @@ static void test_query_dos_deviceA(void)
DWORD ret, ret2, buflen=32768;
BOOL found = FALSE;
+ /* callers must guess the buffer size */
+ SetLastError(0xdeadbeef);
+ ret = QueryDosDeviceA( NULL, NULL, 0 );
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+ "QueryDosDeviceA(no buffer): returned %u, le=%u\n", ret, GetLastError());
+
buffer = HeapAlloc( GetProcessHeap(), 0, buflen );
SetLastError(0xdeadbeef);
ret = QueryDosDeviceA( NULL, buffer, buflen );
More information about the wine-cvs
mailing list