From 4b5b074b8189a2aea39175f8dc6c8177f5008630 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 10 Apr 2010 14:39:54 +0000 Subject: [PATCH] sanchez's patch for real wiimote pair-up, unexpected disconnect, and wiiuse resource leakage. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5313 8ced0084-cf51-0410-be5f-012b33b47a6e --- Externals/WiiUse/Win32/wiiuse.dll | Bin 27136 -> 27136 bytes Externals/WiiUse/Win32/wiiuse.lib | Bin 8610 -> 8610 bytes Externals/WiiUse/X64/wiiuse.dll | Bin 31744 -> 31744 bytes Externals/WiiUse/X64/wiiuse.lib | Bin 8462 -> 8462 bytes Externals/WiiUseSrc/Src/io_win.c | 40 ++++++++++++++++-- Externals/WiiUseSrc/Src/wiiuse.c | 15 ++++--- .../Plugin_Wiimote/Src/wiimote_real.cpp | 16 ++++--- 7 files changed, 56 insertions(+), 15 deletions(-) diff --git a/Externals/WiiUse/Win32/wiiuse.dll b/Externals/WiiUse/Win32/wiiuse.dll index 83062f77abca2d2a850361f842ab5c760b174f6c..6a7d581c08cc1c8bcdb4516fdf7d9bc51056cb83 100644 GIT binary patch delta 6482 zcmeHLjayXJy5D;kU=(n+IeeHSjx@?3r1P<7W)BQ77y>H6z`zWKf|hcS{HPqvQ|WLU zr@-Bqr=>l8S$3|TtYhbJ!UNWmh2jzQ@uqe9kVFr5y|vXcwNlDkbAM|OmiOGA=iWcy z?uXyr>s{+z?|whmeuuUX*|rbaO+%BP5_{(|Bi9h4n4G|lVwgFY&_*ZUB`iB5>p~sN zDC7x_Velv4fVii>RgCJV#4 zrAD$s`F8#-1q>5Bkl1(hzg^dkd(}OrDUqKd5p~aT@!)Oyn>vaV2?xb1*FL`OAjZn3 zjPlS_MVR!eWdrCqP;SHLrIK&QhRBfy1TcdSkI}u z51+*2RIG6k!*!JFxxw!T4i7Y{=;Z0k1C5F5?v%FA3fp}t>h2O&U)Wxn3b`!gLUvr+ znSb=2SByTQ?)IfZyuN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38c57a979f8e26b47 100644 GIT binary patch delta 945 zcmZ{i&r1S99L3ixl#CYLaYy&(cu~lUq@hblfk%sOMK|vr@*2^tTLjUZB7)FE1Vx0G zI<+188@wuX?bszR&FnbrcZK%&-uHd?GjFEf>bEY9WWC~5yhd%E_A>fQV?PlQhL4F3 zP<##3vZ}_f&i!Fi{fWU@jA|YcUuStIwxF<~_A9-~xb!Uj1t*I^{yO7=ysxcsm40jW za8!zi2#CbM^ciWv^e6JdX>QnAEye#!6h(C)u?fr6Glo0 zYhmJ8k0b>0M2B=(h`ShyjBJ3#?l;_w{#4SGbCKPcN*bD*qp^ut70Yi#S4pD_4PMK8 zUer=zwXCvQCQCN`%{yV57&B~R3yMK9X!^rwg$A!g(s|}TboVBp;}BC*V5hCQe;irb z3cs`>qeDtkp?=(?4;HvJ9)EI0d}?imBxF{1*9LX7hfIAN1>7UM9Zqv&+Y!crGiUfS zW8{F7%3k)|Ic7!^FuRP|bEY8RNbpJ>TA^o?Pc}njs3-lFuY&v z0L9lZt*C19=_@mAsy_)hi&4!Z;_EE!B<2)0)PA8?S(lz=KH+33$X{k%koUD!uF`L9 zJsg$dAp#;XFnvT?F#UnNaGD!-PD}Iu5=BvxN{Zgh>vV$baEPDaJSWnFTs3N(=7o{g z!CII&)*}glJkcQ?7UC|3A|o4MvHKM_qd%22m3(A3rjmx{V>C7qs}hBJbd@x^(BQSa z6+|s%R?7;jWwKz?-+~jSi7~@AwxAd!gQnk&R%q}_B%NpeLw9QeIu0>41$M@Y{o}~e zmieWX7#&hl3iXpFy|cir@%V!);!|rgBq6i9yEdqsJ!IuV0Ia^$(hG#M8__ul$Rtgq)I>+JtDfkCXtsQM70PG!jCPV`bn|; E2OMVzf&c&j diff --git a/Externals/WiiUse/X64/wiiuse.dll b/Externals/WiiUse/X64/wiiuse.dll index eaaef0f4cbfdcaa217bc3177382a1618c3b564e1..3eb2c29b985c6aa99dd815b3af4541a189e4c012 100644 GIT binary patch delta 8339 zcmeHMdsJ1`x}R&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FyI|i0d<(+tcLL{BVPk`5xkx8u>^d?^Nkmvufr64;T-S6` zjT8woc3tO$6-&8J!&AI2w6>$JV@*d>$L5Z$9j|n>ckJre-LbEuGq&Lz$C3XA1`i;W diff --git a/Externals/WiiUse/X64/wiiuse.lib b/Externals/WiiUse/X64/wiiuse.lib index 6716f24c58da5605cf5b37662570947cabe9e4ad..fe5e434aaa661bc84e91a41d02bf99089ab17a9b 100644 GIT binary patch delta 957 zcmaKqy-EW?6opp}M9q)cWHXcOKMDz0Xdns6B0-E*NTWVM3c*GM5zAnwSQv$QfdtD` znnD{vOACF4SQy04#wrNT?Cd&s6`b;(d++(?%yjCV`h_}ODL92{rCcH(GPEfZ`g~h zN)A(H(drk6u*evSO3LkSD30h(sF?IT;YL{z0-G46`9wZl3<_VE3+L%dQ1BSOb1cu)GWJ>)`3Th|>*qkUIU(q+}>AcGGAGY$jYA$_#tR zWtv2WY#N9xMP#yPnxc)l6}>DP=6X=@LwYa+Aql>+72p#Oa%q7KUMvnCv%!D$zkS;V Ko$%Yg+4*n4SP6vy delta 957 zcmaKqy-EW?6opp}M9q(GvYAQtAB6-g6xpo0NDyNc(&!tc5Nt#cu?%*Cg;AInNU%&H znnD{3OACF4SQsRoja3kw+1YjODmdjm_uli(nQ2v9)k}5K^~x*mvg48u8QrX*c%;zV zkK3TqMwoQdGZWWCx%ZI%9D}`BDSI|Qjp^Ofafvq7?}?VNNKAf%okf4XkST%rZF_-L z$#K>dtzoebi;TfhvVM0>@kIBmib*FB?v!;Qu!%vAPn2>_RQSSNxX7(Wg>Yg7Cn!;Z z-Ak1uDK5oGBZ7<`{Mcoud=0o%Qp_J)LJ@pTz zr2$Ijb)<2xGYzD|gh3#TG~mYsE4c8X4xYY^I9*={snh>V%7)@&*NvLMX2PwZOtFVt zqDkb*j)BNxLM8{MDcYEu6J${{x1vHA(xVv(N$|N=gik!kl?5_*wK#an2LCnu_Dvgf K!f*d>m%afmjtgr5 diff --git a/Externals/WiiUseSrc/Src/io_win.c b/Externals/WiiUseSrc/Src/io_win.c index 29f261f02d..ab08183ba9 100644 --- a/Externals/WiiUseSrc/Src/io_win.c +++ b/Externals/WiiUseSrc/Src/io_win.c @@ -112,7 +112,10 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout) { /* try to set the output report to see if the device is actually connected */ if (!wiiuse_set_report_type(wm[found])) { + Sleep(10); WIIMOTE_DISABLE_STATE(wm[found], WIIMOTE_STATE_CONNECTED); + if (wm[found]->event == WIIUSE_UNEXPECTED_DISCONNECT) + break; continue; } @@ -181,6 +184,7 @@ int wiiuse_io_read(struct wiimote_t* wm) { if ((b == ERROR_HANDLE_EOF) || (b == ERROR_DEVICE_NOT_CONNECTED)) { /* remote disconnect */ wiiuse_disconnected(wm); + wm->event = WIIUSE_UNEXPECTED_DISCONNECT; return 0; } @@ -214,7 +218,7 @@ int wiiuse_io_read(struct wiimote_t* wm) { int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) { - DWORD bytes; + DWORD bytes, dw; int i; if (!wm || !WIIMOTE_IS_CONNECTED(wm)) @@ -235,12 +239,42 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) { return i; } - WIIUSE_ERROR("Unable to determine bluetooth stack type."); + /*-------------------------------------------------------------- + dw = GetLastError(); //checking for 121 = timeout on semaphore/device off/disconnected to avoid trouble with other stacks toshiba/widcomm + //995 = The I/O operation has been aborted because of either a thread exit or an application request. + + if ( (dw == 121) || (dw == 995) ) { + WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT"); + wiiuse_disconnected(wm); + wm->event = WIIUSE_UNEXPECTED_DISCONNECT; + } + else WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw); + --------------------------------------------------------------*/ + + //If the part below causes trouble on WIDCOMM/TOSHIBA stack uncomment the lines above, and comment out the 3 lines below instead. + + WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT - time out"); + wiiuse_disconnected(wm); + wm->event = WIIUSE_UNEXPECTED_DISCONNECT; + + //WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: Unable to determine bluetooth stack type || Wiimote timed out."); return 0; } case WIIUSE_STACK_MS: - return HidD_SetOutputReport(wm->dev_handle, buf + 1, len - 1); + i = HidD_SetOutputReport(wm->dev_handle, buf + 1, len - 1); + dw = GetLastError(); + + if (dw == 121) { // semaphore timeout + WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT"); + wiiuse_disconnected(wm); + wm->event = WIIUSE_UNEXPECTED_DISCONNECT; + return 0; + }/* else if (dw) + WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw); + */ + // it is not important to catch all errors here at this place, rest will be covered by io_reads. + return i; case WIIUSE_STACK_BLUESOLEIL: return WriteFile(wm->dev_handle, buf + 1, 22, &bytes, &wm->hid_overlap); diff --git a/Externals/WiiUseSrc/Src/wiiuse.c b/Externals/WiiUseSrc/Src/wiiuse.c index 186b71d1c4..de8006d6a4 100644 --- a/Externals/WiiUseSrc/Src/wiiuse.c +++ b/Externals/WiiUseSrc/Src/wiiuse.c @@ -172,13 +172,6 @@ void wiiuse_disconnected(struct wiimote_t* wm) { WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED); /* reset a bunch of stuff */ - #ifndef WIN32 - wm->out_sock = -1; - wm->in_sock = -1; - #else - wm->dev_handle = 0; - #endif - wm->leds = 0; wm->state = WIIMOTE_INIT_STATES; wm->read_req = NULL; @@ -188,6 +181,14 @@ void wiiuse_disconnected(struct wiimote_t* wm) { wm->btns_released = 0; memset(wm->event_buf, 0, sizeof(wm->event_buf)); + #ifndef WIN32 + wm->out_sock = -1; + wm->in_sock = -1; + #else + CloseHandle(wm->dev_handle); + wm->dev_handle = 0; + #endif + wm->event = WIIUSE_DISCONNECT; } diff --git a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp index fd22e3562f..2ead6f15d7 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp @@ -140,7 +140,11 @@ void ReadData() //DEBUG_LOG(WIIMOTE, "Writing data to the Wiimote"); SEvent& rEvent = m_EventWriteQueue.front(); wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, rEvent._Size); - m_EventWriteQueue.pop(); + if (m_pWiiMote->event == WIIUSE_UNEXPECTED_DISCONNECT) + { + NOTICE_LOG(WIIMOTE, "wiiuse_io_write: unexpected disconnect. handle: %08x", m_pWiiMote->dev_handle); + } + m_EventWriteQueue.pop(); // InterruptDebugging(false, rEvent.m_PayLoad); } @@ -176,6 +180,10 @@ void ReadData() m_pCriticalSection->Leave(); } } + else if (m_pWiiMote->event == WIIUSE_UNEXPECTED_DISCONNECT) + { + NOTICE_LOG(WIIMOTE, "wiiuse_io_read: unexpected disconnect. handle: %08x", m_pWiiMote->dev_handle); + } }; @@ -339,6 +347,8 @@ int Initialize() // and also connecting in Linux/OSX. // Windows connects to Wiimote in the wiiuse_find function g_pReadThread = new Common::Thread(ReadWiimote_ThreadFunc, NULL); + // Don't run the Wiimote thread if no wiimotes were found + g_Shutdown = false; NeedsConnect.Set(); Connected.Wait(); } @@ -384,10 +394,6 @@ int Initialize() wiiuse_read_data(g_WiiMotesFromWiiUse[i], data, 0, sizeof(WiiMoteEmu::EepromData_0)); } - // Don't run the Wiimote thread if no wiimotes were found - if (g_NumberOfWiiMotes > 0) - g_Shutdown = false; - // Initialized, even if we didn't find a Wiimote g_RealWiiMoteInitialized = true;