rasapi32: Return error on invalid parameters.

This commit is contained in:
Alistair Leslie-Hughes 2011-09-06 22:51:44 +10:00 committed by Alexandre Julliard
parent 33736bb871
commit 7025db431b
2 changed files with 4 additions and 4 deletions

View File

@ -250,6 +250,10 @@ DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD l
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
FIXME("(%p,%p,%p),stub!\n",lpRasDevinfo,lpcb,lpcDevices); FIXME("(%p,%p,%p),stub!\n",lpRasDevinfo,lpcb,lpcDevices);
if(lpRasDevinfo && lpRasDevinfo->dwSize != sizeof(RASDEVINFOA))
return ERROR_INVALID_SIZE;
if (!lpRasDevinfo || (*lpcb < sizeof(RASDEVINFOA))) { if (!lpRasDevinfo || (*lpcb < sizeof(RASDEVINFOA))) {
*lpcb = sizeof(RASDEVINFOA); *lpcb = sizeof(RASDEVINFOA);
return ERROR_BUFFER_TOO_SMALL; return ERROR_BUFFER_TOO_SMALL;

View File

@ -85,7 +85,6 @@ static void test_rasenum(void)
rasDevInfo[0].dwSize = 0; rasDevInfo[0].dwSize = 0;
cb = bufsize; cb = bufsize;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
todo_wine
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@ -93,7 +92,6 @@ static void test_rasenum(void)
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1; rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1;
cb = bufsize; cb = bufsize;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
todo_wine
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@ -101,7 +99,6 @@ static void test_rasenum(void)
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1; rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1;
cb = bufsize; cb = bufsize;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
todo_wine
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@ -151,7 +148,6 @@ static void test_rasenum(void)
cb = 0; cb = 0;
rasDevInfo[0].dwSize = 0; rasDevInfo[0].dwSize = 0;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
todo_wine
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */ broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08d\n", result);