kernel32/tests: Check what happens if QueryDosDeviceA() is given an insufficient buffer.

This commit is contained in:
Francois Gouget 2011-10-03 23:39:10 +02:00 committed by Alexandre Julliard
parent 8e67930bd7
commit db882bfb5d
1 changed files with 6 additions and 0 deletions

View File

@ -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 );