kernel32/tests: Check what happens if QueryDosDeviceA() is given an insufficient buffer.
This commit is contained in:
parent
8e67930bd7
commit
db882bfb5d
|
@ -44,6 +44,12 @@ static void test_query_dos_deviceA(void)
|
||||||
DWORD ret, ret2, buflen=32768;
|
DWORD ret, ret2, buflen=32768;
|
||||||
BOOL found = FALSE;
|
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 );
|
buffer = HeapAlloc( GetProcessHeap(), 0, buflen );
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = QueryDosDeviceA( NULL, buffer, buflen );
|
ret = QueryDosDeviceA( NULL, buffer, buflen );
|
||||||
|
|
Loading…
Reference in New Issue