From a8ff7220ccfe4e1c21190555496e5814fba94680 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Sun, 23 Aug 2009 10:50:52 +0000 Subject: [PATCH] Windows port: re-add WSA init/deinit code. (yup, sockets will be needed for wifi adhoc interface) --- desmume/src/windows/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index f68d95daf..7b5354946 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1482,12 +1482,20 @@ static void ExitRunLoop() class WinDriver : public BaseDriver { - virtual bool WIFI_Host_InitSystem() { + virtual bool WIFI_Host_InitSystem() + { #ifdef EXPERIMENTAL_WIFI + WSADATA wsaData; + WORD version = MAKEWORD(1,1); + if (WSAStartup(version, &wsaData)) + { + printf("Failed initializing WSA.\n"); + return false ; + } //require wpcap.dll HMODULE temp = LoadLibrary("wpcap.dll"); if(temp == NULL) { - printf("Failed initializing wpcap.dll - softAP support disabled\n"); + printf("Failed initializing wpcap.dll - SoftAP support disabled.\n"); return false; } FreeLibrary(temp); @@ -1496,7 +1504,11 @@ class WinDriver : public BaseDriver return false ; #endif } - virtual void WIFI_Host_ShutdownSystem() { + virtual void WIFI_Host_ShutdownSystem() + { + #ifdef EXPERIMENTAL_WIFI + WSACleanup(); + #endif } virtual bool AVI_IsRecording()