Commit 7025db43 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

rasapi32: Return error on invalid parameters.

parent 33736bb8
...@@ -250,6 +250,10 @@ DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD l ...@@ -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;
......
...@@ -85,7 +85,6 @@ static void test_rasenum(void) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment