mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
set svn:eol-type=native for **.c
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1439 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
30
Externals/WiiUseSrc/Src/io_win.c
vendored
30
Externals/WiiUseSrc/Src/io_win.c
vendored
@ -32,14 +32,14 @@
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <hidsdi.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
|
||||
#include "definitions.h"
|
||||
#include "wiiuse_internal.h"
|
||||
#include "io.h"
|
||||
@ -176,8 +176,8 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
||||
|
||||
if (!ReadFile(wm->dev_handle, wm->event_buf, sizeof(wm->event_buf), &b, &wm->hid_overlap)) {
|
||||
/* partial read */
|
||||
b = GetLastError();
|
||||
|
||||
b = GetLastError();
|
||||
|
||||
if ((b == ERROR_HANDLE_EOF) || (b == ERROR_DEVICE_NOT_CONNECTED)) {
|
||||
/* remote disconnect */
|
||||
wiiuse_disconnected(wm);
|
||||
@ -186,11 +186,11 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
||||
|
||||
r = WaitForSingleObject(wm->hid_overlap.hEvent, wm->timeout);
|
||||
if (r == WAIT_TIMEOUT) {
|
||||
/* timeout - cancel and continue */
|
||||
|
||||
if (*wm->event_buf)
|
||||
WIIUSE_WARNING("Packet ignored. This may indicate a problem (timeout is %i ms).", wm->timeout);
|
||||
|
||||
/* timeout - cancel and continue */
|
||||
|
||||
if (*wm->event_buf)
|
||||
WIIUSE_WARNING("Packet ignored. This may indicate a problem (timeout is %i ms).", wm->timeout);
|
||||
|
||||
CancelIo(wm->dev_handle);
|
||||
ResetEvent(wm->hid_overlap.hEvent);
|
||||
return 0;
|
||||
@ -203,25 +203,25 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ResetEvent(wm->hid_overlap.hEvent);
|
||||
ResetEvent(wm->hid_overlap.hEvent);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
||||
DWORD bytes;
|
||||
int i;
|
||||
|
||||
int i;
|
||||
|
||||
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
||||
switch (wm->stack) {
|
||||
case WIIUSE_STACK_UNKNOWN:
|
||||
{
|
||||
/* try to auto-detect the stack type */
|
||||
if (i = WriteFile(wm->dev_handle, buf, 22, &bytes, &wm->hid_overlap)) {
|
||||
/* bluesoleil will always return 1 here, even if it's not connected */
|
||||
wm->stack = WIIUSE_STACK_BLUESOLEIL;
|
||||
wm->stack = WIIUSE_STACK_BLUESOLEIL;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user