Author: tfaber
Date: Tue Jun 26 06:08:38 2012
New Revision: 56804
URL:
http://svn.reactos.org/svn/reactos?rev=56804&view=rev
Log:
[APITESTS] - Add wininet and winhttp tests for Winsock loading and initialization
behavior
[WS2_32_APITEST] - Make WSAStartup test more robust and stricter
Added:
trunk/rostests/apitests/winhttp/
trunk/rostests/apitests/winhttp/CMakeLists.txt (with props)
trunk/rostests/apitests/winhttp/WinHttpOpen.c (with props)
trunk/rostests/apitests/winhttp/testlist.c (with props)
trunk/rostests/apitests/wininet/
trunk/rostests/apitests/wininet/CMakeLists.txt (with props)
trunk/rostests/apitests/wininet/InternetOpen.c (with props)
trunk/rostests/apitests/wininet/testlist.c (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt
trunk/rostests/apitests/ws2_32/WSAStartup.c
Modified: trunk/rostests/apitests/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?r…
==============================================================================
--- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -14,4 +14,6 @@
add_subdirectory(w32kdll)
add_subdirectory(w32knapi)
endif()
+add_subdirectory(winhttp)
+add_subdirectory(wininet)
add_subdirectory(ws2_32)
Added: trunk/rostests/apitests/winhttp/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/winhttp/CMakeLis…
==============================================================================
--- trunk/rostests/apitests/winhttp/CMakeLists.txt (added)
+++ trunk/rostests/apitests/winhttp/CMakeLists.txt [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,12 @@
+
+list(APPEND SOURCE
+ WinHttpOpen.c
+ testlist.c)
+
+add_executable(winhttp_apitest ${SOURCE})
+target_link_libraries(winhttp_apitest wine)
+set_module_type(winhttp_apitest win32cui)
+add_importlibs(winhttp_apitest msvcrt kernel32 ntdll)
+#add_delay_importlibs(winhttp_apitest winhttp)
+
+add_cd_file(TARGET winhttp_apitest DESTINATION reactos/bin FOR all)
Propchange: trunk/rostests/apitests/winhttp/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/winhttp/WinHttpOpen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/winhttp/WinHttpO…
==============================================================================
--- trunk/rostests/apitests/winhttp/WinHttpOpen.c (added)
+++ trunk/rostests/apitests/winhttp/WinHttpOpen.c [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,124 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Test for WinHttpOpen
+ * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de>
+ */
+
+#define UNICODE
+#include <winsock2.h>
+#include <wine/test.h>
+#include <winhttp.h>
+
+struct hostent *(WINAPI *pgethostbyname)(const char *);
+int (WINAPI *pWSACancelBlockingCall)(void);
+int (WINAPI *pWSAGetLastError)(void);
+
+HINTERNET (WINAPI *pWinHttpOpen)(LPCWSTR, DWORD, LPCWSTR, LPCWSTR, DWORD);
+BOOL (WINAPI *pWinHttpCloseHandle)(HINTERNET);
+
+static
+PVOID
+GetProc(
+ PCSTR FunctionName)
+{
+ HMODULE ModuleHandle;
+
+ ModuleHandle = GetModuleHandle(L"ws2_32");
+ if (!ModuleHandle)
+ return NULL;
+ return GetProcAddress(ModuleHandle, FunctionName);
+}
+
+#define PROC(name) (p##name = GetProc(#name))
+
+static
+BOOLEAN
+IsWinsockLoaded(VOID)
+{
+ return GetModuleHandle(L"ws2_32") != NULL;
+}
+
+static
+BOOLEAN
+IsWininetLoaded(VOID)
+{
+ return GetModuleHandle(L"wininet") != NULL;
+}
+
+static
+BOOLEAN
+IsWinsockInitialized(VOID)
+{
+ struct hostent *Hostent;
+
+ if (!PROC(gethostbyname) || !PROC(WSAGetLastError))
+ return FALSE;
+
+ Hostent = pgethostbyname("localhost");
+ if (!Hostent)
+ ok_dec(pWSAGetLastError(), WSANOTINITIALISED);
+ return Hostent != NULL;
+}
+
+static
+BOOLEAN
+AreLegacyFunctionsSupported(VOID)
+{
+ int Error;
+
+ if (!PROC(WSACancelBlockingCall) || !PROC(WSAGetLastError))
+ return FALSE;
+
+ Error = pWSACancelBlockingCall();
+ ok(Error == SOCKET_ERROR, "Error = %d\n", Error);
+ ok(pWSAGetLastError() == WSAEOPNOTSUPP ||
+ pWSAGetLastError() == WSAEINVAL, "WSAGetLastError = %d\n",
pWSAGetLastError());
+
+ return pWSAGetLastError() != WSAEOPNOTSUPP;
+}
+
+START_TEST(WinHttpOpen)
+{
+ HMODULE ModuleHandle;
+ HINTERNET InternetHandle;
+ BOOL Success;
+
+ ok(!IsWinsockLoaded(), "Winsock loaded on startup\n");
+ ok(!IsWinsockInitialized(), "Winsock initialized on startup\n");
+ ok(!IsWininetLoaded(), "Wininet loaded on startup\n");
+
+ ModuleHandle = GetModuleHandle(L"winhttp");
+ ok_ptr(ModuleHandle, NULL);
+ ModuleHandle = LoadLibrary(L"winhttp");
+ ok(ModuleHandle != NULL, "LoadLibrary failed, error %lu\n",
GetLastError());
+
+ pWinHttpOpen = (PVOID)GetProcAddress(ModuleHandle, "WinHttpOpen");
+ pWinHttpCloseHandle = (PVOID)GetProcAddress(ModuleHandle,
"WinHttpCloseHandle");
+
+ ok(!IsWinsockLoaded(), "Winsock loaded after winhttp load\n");
+ ok(!IsWinsockInitialized(), "Winsock initialized after winhttp load\n");
+ ok(!IsWininetLoaded(), "Wininet loaded after winhttp load\n");
+
+ InternetHandle = pWinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0);
+ ok(InternetHandle != NULL, "InternetHandle = NULL\n");
+
+ if (InternetHandle != NULL)
+ {
+ ok(IsWinsockLoaded(), "Winsock not loaded after WinHttpOpen\n");
+ ok(IsWinsockInitialized(), "Winsock not initialized after
WinHttpOpen\n");
+ ok(!IsWininetLoaded(), "Wininet loaded after WinHttpOpen\n");
+ ok(AreLegacyFunctionsSupported(), "Winsock initialized with version
2\n");
+ Success = pWinHttpCloseHandle(InternetHandle);
+ ok(Success, "WinHttpCloseHandle failed, error %lu\n", GetLastError());
+ }
+
+ ok(IsWinsockLoaded(), "Winsock unloaded after handle close\n");
+ ok(IsWinsockInitialized(), "Winsock uninitialized after handle close\n");
+
+ FreeLibrary(ModuleHandle);
+
+ ok(IsWinsockLoaded(), "Winsock unloaded after winhttp unload\n");
+ trace("Winsock %sinitialized after winhttp unload (should be uninitialized in
2003, still initialized in 7)\n",
+ IsWinsockInitialized() ? "" : "un");
+}
Propchange: trunk/rostests/apitests/winhttp/WinHttpOpen.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/winhttp/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/winhttp/testlist…
==============================================================================
--- trunk/rostests/apitests/winhttp/testlist.c (added)
+++ trunk/rostests/apitests/winhttp/testlist.c [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,15 @@
+#define WIN32_LEAN_AND_MEAN
+#define __ROS_LONG64__
+#include <windows.h>
+
+#define STANDALONE
+#include "wine/test.h"
+
+extern void func_WinHttpOpen(void);
+
+const struct test winetest_testlist[] =
+{
+ { "WinHttpOpen", func_WinHttpOpen },
+
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/winhttp/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/wininet/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/wininet/CMakeLis…
==============================================================================
--- trunk/rostests/apitests/wininet/CMakeLists.txt (added)
+++ trunk/rostests/apitests/wininet/CMakeLists.txt [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,12 @@
+
+list(APPEND SOURCE
+ InternetOpen.c
+ testlist.c)
+
+add_executable(wininet_apitest ${SOURCE})
+target_link_libraries(wininet_apitest wine)
+set_module_type(wininet_apitest win32cui)
+add_importlibs(wininet_apitest msvcrt kernel32 ntdll)
+#add_delay_importlibs(wininet_apitest wininet)
+
+add_cd_file(TARGET wininet_apitest DESTINATION reactos/bin FOR all)
Propchange: trunk/rostests/apitests/wininet/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/wininet/InternetOpen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/wininet/Internet…
==============================================================================
--- trunk/rostests/apitests/wininet/InternetOpen.c (added)
+++ trunk/rostests/apitests/wininet/InternetOpen.c [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,114 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Test for InternetOpen
+ * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de>
+ */
+
+#define UNICODE
+#include <winsock2.h>
+#include <wine/test.h>
+#include <wininet.h>
+
+struct hostent *(WINAPI *pgethostbyname)(const char *);
+int (WINAPI *pWSACancelBlockingCall)(void);
+int (WINAPI *pWSAGetLastError)(void);
+
+HINTERNET (WINAPI *pInternetOpen)(LPCTSTR, DWORD, LPCTSTR, LPCTSTR, DWORD);
+BOOL (WINAPI *pInternetCloseHandle)(HINTERNET);
+
+static
+PVOID
+GetProc(
+ PCSTR FunctionName)
+{
+ HMODULE ModuleHandle;
+
+ ModuleHandle = GetModuleHandle(L"ws2_32");
+ if (!ModuleHandle)
+ return NULL;
+ return GetProcAddress(ModuleHandle, FunctionName);
+}
+
+#define PROC(name) (p##name = GetProc(#name))
+
+static
+BOOLEAN
+IsWinsockLoaded(VOID)
+{
+ return GetModuleHandle(L"ws2_32") != NULL;
+}
+
+static
+BOOLEAN
+IsWinsockInitialized(VOID)
+{
+ struct hostent *Hostent;
+
+ if (!PROC(gethostbyname) || !PROC(WSAGetLastError))
+ return FALSE;
+
+ Hostent = pgethostbyname("localhost");
+ if (!Hostent)
+ ok_dec(pWSAGetLastError(), WSANOTINITIALISED);
+ return Hostent != NULL;
+}
+
+static
+BOOLEAN
+AreLegacyFunctionsSupported(VOID)
+{
+ int Error;
+
+ if (!PROC(WSACancelBlockingCall) || !PROC(WSAGetLastError))
+ return FALSE;
+
+ Error = pWSACancelBlockingCall();
+ ok(Error == SOCKET_ERROR, "Error = %d\n", Error);
+ ok(pWSAGetLastError() == WSAEOPNOTSUPP ||
+ pWSAGetLastError() == WSAEINVAL, "WSAGetLastError = %d\n",
pWSAGetLastError());
+
+ return pWSAGetLastError() != WSAEOPNOTSUPP;
+}
+
+START_TEST(InternetOpen)
+{
+ HMODULE ModuleHandle;
+ HINTERNET InternetHandle;
+ BOOL Success;
+
+ ok(!IsWinsockLoaded(), "Winsock loaded on startup\n");
+ ok(!IsWinsockInitialized(), "Winsock initialized on startup\n");
+
+ ModuleHandle = GetModuleHandle(L"wininet");
+ ok_ptr(ModuleHandle, NULL);
+ ModuleHandle = LoadLibrary(L"wininet");
+ ok(ModuleHandle != NULL, "LoadLibrary failed, error %lu\n",
GetLastError());
+
+ pInternetOpen = (PVOID)GetProcAddress(ModuleHandle, "InternetOpenW");
+ pInternetCloseHandle = (PVOID)GetProcAddress(ModuleHandle,
"InternetCloseHandle");
+
+ ok(!IsWinsockLoaded(), "Winsock loaded after wininet load\n");
+ ok(!IsWinsockInitialized(), "Winsock initialized after wininet load\n");
+
+ InternetHandle = pInternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
+ ok(InternetHandle != NULL, "InternetHandle = NULL\n");
+
+ if (InternetHandle != NULL)
+ {
+ ok(IsWinsockLoaded(), "Winsock not loaded after InternetOpen\n");
+ ok(IsWinsockInitialized(), "Winsock not initialized after
InternetOpen\n");
+ ok(!AreLegacyFunctionsSupported(), "Winsock initialized with version
1\n");
+ Success = pInternetCloseHandle(InternetHandle);
+ ok(Success, "InternetCloseHandle failed, error %lu\n",
GetLastError());
+ }
+
+ ok(IsWinsockLoaded(), "Winsock unloaded after handle close\n");
+ ok(IsWinsockInitialized(), "Winsock uninitialized after handle close\n");
+
+ FreeLibrary(ModuleHandle);
+
+ ok(IsWinsockLoaded(), "Winsock unloaded after wininet unload\n");
+ trace("Winsock %sinitialized after wininet unload (should be uninitialized in
2003, still initialized in 7)\n",
+ IsWinsockInitialized() ? "" : "un");
+}
Propchange: trunk/rostests/apitests/wininet/InternetOpen.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/wininet/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/wininet/testlist…
==============================================================================
--- trunk/rostests/apitests/wininet/testlist.c (added)
+++ trunk/rostests/apitests/wininet/testlist.c [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -1,0 +1,15 @@
+#define WIN32_LEAN_AND_MEAN
+#define __ROS_LONG64__
+#include <windows.h>
+
+#define STANDALONE
+#include "wine/test.h"
+
+extern void func_InternetOpen(void);
+
+const struct test winetest_testlist[] =
+{
+ { "InternetOpen", func_InternetOpen },
+
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/wininet/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/ws2_32/WSAStartup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ws2_32/WSAStartu…
==============================================================================
--- trunk/rostests/apitests/ws2_32/WSAStartup.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ws2_32/WSAStartup.c [iso-8859-1] Tue Jun 26 06:08:38 2012
@@ -64,7 +64,50 @@
static
BOOLEAN
-IsInitialized(VOID)
+CheckStringBuffer(
+ PCSTR Buffer,
+ SIZE_T MaximumLength,
+ PCSTR Expected,
+ UCHAR Fill)
+{
+ SIZE_T Length = strlen(Expected);
+ SIZE_T EqualLength;
+ BOOLEAN Result = TRUE;
+ SIZE_T i;
+
+ EqualLength = RtlCompareMemory(Buffer, Expected, Length);
+ if (EqualLength != Length)
+ {
+ ok(0, "String is '%S', expected '%S'\n", Buffer,
Expected);
+ Result = FALSE;
+ }
+
+ if (Buffer[Length] != ANSI_NULL)
+ {
+ ok(0, "Not null terminated\n");
+ Result = FALSE;
+ }
+
+ /* The function nulls the rest of the buffer! */
+ for (i = Length + 1; i < MaximumLength; i++)
+ {
+ UCHAR Char = ((PUCHAR)Buffer)[i];
+ if (Char != Fill)
+ {
+ ok(0, "Found 0x%x at offset %lu, expected 0x%x\n", Char, (ULONG)i,
Fill);
+ /* Don't count this as a failure unless the string was actually wrong */
+ //Result = FALSE;
+ /* Don't flood the log */
+ break;
+ }
+ }
+
+ return Result;
+}
+
+static
+BOOLEAN
+IsWinsockInitialized(VOID)
{
struct hostent *Hostent;
@@ -91,6 +134,7 @@
START_TEST(WSAStartup)
{
NTSTATUS ExceptionStatus;
+ BOOLEAN Okay;
LPWSADATA WsaData;
int Error;
struct
@@ -125,7 +169,7 @@
const INT TestCount = sizeof(Tests) / sizeof(Tests[0]);
INT i;
- ok(!IsInitialized(), "Winsock unexpectedly initialized\n");
+ ok(!IsWinsockInitialized(), "Winsock unexpectedly initialized\n");
/* parameter checks */
StartSeh()
@@ -138,7 +182,7 @@
ok_dec(Error, WSAEFAULT);
ok_dec(WSAGetLastError(), WSANOTINITIALISED);
EndSeh(STATUS_SUCCESS);
- ok(!IsInitialized(), "Winsock unexpectedly initialized\n");
+ ok(!IsWinsockInitialized(), "Winsock unexpectedly initialized\n");
WsaData = AllocateGuarded(sizeof(*WsaData));
if (!WsaData)
@@ -162,27 +206,35 @@
ok(!Tests[i].ExpectedSuccess, "WSAStartup failed unexpectedly\n");
ok_dec(Error, WSAVERNOTSUPPORTED);
ok_dec(WSAGetLastError(), WSANOTINITIALISED);
- ok(!IsInitialized(), "Winsock unexpectedly initialized\n");
+ ok(!IsWinsockInitialized(), "Winsock unexpectedly initialized\n");
}
else
{
ok(Tests[i].ExpectedSuccess, "WSAStartup succeeded
unexpectedly\n");
ok_dec(WSAGetLastError(), 0);
- ok(IsInitialized(), "Winsock not initialized despite success\n");
+ ok(IsWinsockInitialized(), "Winsock not initialized despite
success\n");
if (LOBYTE(Tests[i].Version) < 2)
ok(AreLegacyFunctionsSupported(), "Legacy function failed\n");
else
ok(!AreLegacyFunctionsSupported(), "Legacy function
succeeded\n");
WSACleanup();
- ok(!IsInitialized(), "Winsock still initialized after cleanup\n");
+ ok(!IsWinsockInitialized(), "Winsock still initialized after
cleanup\n");
}
if (Tests[i].ExpectedVersion)
ok_hex(WsaData->wVersion, Tests[i].ExpectedVersion);
else
ok_hex(WsaData->wVersion, Tests[i].Version);
ok_hex(WsaData->wHighVersion, MAKEWORD(2, 2));
- ok_str(WsaData->szDescription, "WinSock 2.0");
- ok_str(WsaData->szSystemStatus, "Running");
+ Okay = CheckStringBuffer(WsaData->szDescription,
+ sizeof(WsaData->szDescription),
+ "WinSock 2.0",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
+ Okay = CheckStringBuffer(WsaData->szSystemStatus,
+ sizeof(WsaData->szSystemStatus),
+ "Running",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
if (LOBYTE(WsaData->wVersion) >= 2)
{
ok_dec(WsaData->iMaxSockets, 0);
@@ -203,12 +255,20 @@
ok_dec(WSAGetLastError(), 0);
ok_hex(WsaData->wVersion, MAKEWORD(1, 1));
ok_hex(WsaData->wHighVersion, MAKEWORD(2, 2));
- ok_str(WsaData->szDescription, "WinSock 2.0");
- ok_str(WsaData->szSystemStatus, "Running");
+ Okay = CheckStringBuffer(WsaData->szDescription,
+ sizeof(WsaData->szDescription),
+ "WinSock 2.0",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
+ Okay = CheckStringBuffer(WsaData->szSystemStatus,
+ sizeof(WsaData->szSystemStatus),
+ "Running",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
ok_dec(WsaData->iMaxSockets, 32767);
ok_dec(WsaData->iMaxUdpDg, 65467);
ok_ptr(WsaData->lpVendorInfo, (PVOID)0x5555555555555555ULL);
- ok(IsInitialized(), "Winsock not initialized\n");
+ ok(IsWinsockInitialized(), "Winsock not initialized\n");
if (!Error)
{
ok(AreLegacyFunctionsSupported(), "Legacy function failed\n");
@@ -217,8 +277,16 @@
ok_dec(Error, 0);
ok_hex(WsaData->wVersion, MAKEWORD(2, 2));
ok_hex(WsaData->wHighVersion, MAKEWORD(2, 2));
- ok_str(WsaData->szDescription, "WinSock 2.0");
- ok_str(WsaData->szSystemStatus, "Running");
+ Okay = CheckStringBuffer(WsaData->szDescription,
+ sizeof(WsaData->szDescription),
+ "WinSock 2.0",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
+ Okay = CheckStringBuffer(WsaData->szSystemStatus,
+ sizeof(WsaData->szSystemStatus),
+ "Running",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
ok_dec(WsaData->iMaxSockets, 0);
ok_dec(WsaData->iMaxUdpDg, 0);
ok_ptr(WsaData->lpVendorInfo, (PVOID)0x5555555555555555ULL);
@@ -226,10 +294,10 @@
{
ok(AreLegacyFunctionsSupported(), "Legacy function failed\n");
WSACleanup();
- ok(IsInitialized(), "Winsock prematurely uninitialized\n");
+ ok(IsWinsockInitialized(), "Winsock prematurely uninitialized\n");
}
WSACleanup();
- ok(!IsInitialized(), "Winsock still initialized after cleanup\n");
+ ok(!IsWinsockInitialized(), "Winsock still initialized after
cleanup\n");
}
/* downgrade the version */
@@ -239,12 +307,20 @@
ok_dec(WSAGetLastError(), 0);
ok_hex(WsaData->wVersion, MAKEWORD(2, 2));
ok_hex(WsaData->wHighVersion, MAKEWORD(2, 2));
- ok_str(WsaData->szDescription, "WinSock 2.0");
- ok_str(WsaData->szSystemStatus, "Running");
+ Okay = CheckStringBuffer(WsaData->szDescription,
+ sizeof(WsaData->szDescription),
+ "WinSock 2.0",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
+ Okay = CheckStringBuffer(WsaData->szSystemStatus,
+ sizeof(WsaData->szSystemStatus),
+ "Running",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
ok_dec(WsaData->iMaxSockets, 0);
ok_dec(WsaData->iMaxUdpDg, 0);
ok_ptr(WsaData->lpVendorInfo, (PVOID)0x5555555555555555ULL);
- ok(IsInitialized(), "Winsock not initialized\n");
+ ok(IsWinsockInitialized(), "Winsock not initialized\n");
if (!Error)
{
ok(!AreLegacyFunctionsSupported(), "Legacy function succeeded\n");
@@ -253,8 +329,16 @@
ok_dec(Error, 0);
ok_hex(WsaData->wVersion, MAKEWORD(1, 1));
ok_hex(WsaData->wHighVersion, MAKEWORD(2, 2));
- ok_str(WsaData->szDescription, "WinSock 2.0");
- ok_str(WsaData->szSystemStatus, "Running");
+ Okay = CheckStringBuffer(WsaData->szDescription,
+ sizeof(WsaData->szDescription),
+ "WinSock 2.0",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
+ Okay = CheckStringBuffer(WsaData->szSystemStatus,
+ sizeof(WsaData->szSystemStatus),
+ "Running",
+ 0x55);
+ ok(Okay, "CheckStringBuffer failed\n");
ok_dec(WsaData->iMaxSockets, 32767);
ok_dec(WsaData->iMaxUdpDg, 65467);
ok_ptr(WsaData->lpVendorInfo, (PVOID)0x5555555555555555ULL);
@@ -262,10 +346,10 @@
{
ok(AreLegacyFunctionsSupported(), "Legacy function failed\n");
WSACleanup();
- ok(IsInitialized(), "Winsock prematurely uninitialized\n");
+ ok(IsWinsockInitialized(), "Winsock prematurely uninitialized\n");
}
WSACleanup();
- ok(!IsInitialized(), "Winsock still initialized after cleanup\n");
+ ok(!IsWinsockInitialized(), "Winsock still initialized after
cleanup\n");
}
FreeGuarded(WsaData);