>From e55ab7871019c7cb8e2c12d95da1c074f235a491 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 6 Sep 2011 22:51:44 +1000
Subject: [PATCH] Return error on invalid parameters
To: wine-patches <wine-patches@winehq.org>

---
 dlls/rasapi32/rasapi.c       |    4 ++++
 dlls/rasapi32/tests/rasapi.c |    4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/rasapi32/rasapi.c b/dlls/rasapi32/rasapi.c
index 704a8bc..2184a22 100644
--- a/dlls/rasapi32/rasapi.c
+++ b/dlls/rasapi32/rasapi.c
@@ -250,6 +250,10 @@ DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD l
             return ERROR_INVALID_PARAMETER;
 
 	FIXME("(%p,%p,%p),stub!\n",lpRasDevinfo,lpcb,lpcDevices);
+
+	if(lpRasDevinfo && lpRasDevinfo->dwSize != sizeof(RASDEVINFOA))
+		return ERROR_INVALID_SIZE;
+
 	if (!lpRasDevinfo || (*lpcb < sizeof(RASDEVINFOA))) {
 		*lpcb = sizeof(RASDEVINFOA);
 		return ERROR_BUFFER_TOO_SMALL;
diff --git a/dlls/rasapi32/tests/rasapi.c b/dlls/rasapi32/tests/rasapi.c
index d25c741..e0ff25f 100644
--- a/dlls/rasapi32/tests/rasapi.c
+++ b/dlls/rasapi32/tests/rasapi.c
@@ -85,7 +85,6 @@ static void test_rasenum(void)
     rasDevInfo[0].dwSize = 0;
     cb = bufsize;
     result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
-    todo_wine
     ok(result == ERROR_INVALID_SIZE ||
     result == ERROR_INVALID_USER_BUFFER, /* win98 */
     "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@@ -93,7 +92,6 @@ static void test_rasenum(void)
     rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1;
     cb = bufsize;
     result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
-    todo_wine
     ok(result == ERROR_INVALID_SIZE ||
     result == ERROR_INVALID_USER_BUFFER, /* win98 */
     "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@@ -101,7 +99,6 @@ static void test_rasenum(void)
     rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1;
     cb = bufsize;
     result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
-    todo_wine
     ok(result == ERROR_INVALID_SIZE ||
     result == ERROR_INVALID_USER_BUFFER, /* win98 */
     "Expected ERROR_INVALID_SIZE, got %08d\n", result);
@@ -151,7 +148,6 @@ static void test_rasenum(void)
     cb = 0;
     rasDevInfo[0].dwSize = 0;
     result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
-    todo_wine
     ok(result == ERROR_INVALID_SIZE ||
     broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */
     "Expected ERROR_INVALID_SIZE, got %08d\n", result);
-- 
1.7.4.1

