Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/xinput1_1/Makefile.in | 1 - dlls/xinput1_2/Makefile.in | 1 - dlls/xinput1_3/Makefile.in | 1 - dlls/xinput1_3/main.c | 85 +++++++++++++++++++----------------- dlls/xinput1_4/Makefile.in | 1 - dlls/xinput9_1_0/Makefile.in | 1 - 6 files changed, 44 insertions(+), 46 deletions(-)
diff --git a/dlls/xinput1_1/Makefile.in b/dlls/xinput1_1/Makefile.in index 14053b0050a..cc2825d0d19 100644 --- a/dlls/xinput1_1/Makefile.in +++ b/dlls/xinput1_1/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = xinput1_1.dll IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 diff --git a/dlls/xinput1_2/Makefile.in b/dlls/xinput1_2/Makefile.in index 508bc3860d1..1c4b48cdbda 100644 --- a/dlls/xinput1_2/Makefile.in +++ b/dlls/xinput1_2/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = xinput1_2.dll IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 diff --git a/dlls/xinput1_3/Makefile.in b/dlls/xinput1_3/Makefile.in index cbbbedc6b7d..a1c58a7452a 100644 --- a/dlls/xinput1_3/Makefile.in +++ b/dlls/xinput1_3/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = xinput1_3.dll IMPORTLIB = xinput IMPORTS = hid setupapi advapi32 user32 diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 506802d142a..7917b9f7af2 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -168,7 +168,7 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d
if (!(button_caps = malloc(sizeof(*button_caps) * controller->hid.caps.NumberInputButtonCaps))) return FALSE; status = HidP_GetButtonCaps(HidP_Input, button_caps, &controller->hid.caps.NumberInputButtonCaps, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetButtonCaps returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetButtonCaps returned %#lx\n", status); else for (i = 0; i < controller->hid.caps.NumberInputButtonCaps; i++) { if (button_caps[i].UsagePage != HID_USAGE_PAGE_BUTTON) @@ -185,7 +185,7 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d
if (!(value_caps = malloc(sizeof(*value_caps) * controller->hid.caps.NumberInputValueCaps))) return FALSE; status = HidP_GetValueCaps(HidP_Input, value_caps, &controller->hid.caps.NumberInputValueCaps, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetValueCaps returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetValueCaps returned %#lx\n", status); else for (i = 0; i < controller->hid.caps.NumberInputValueCaps; i++) { HIDP_VALUE_CAPS *caps = value_caps + i; @@ -214,7 +214,7 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d collections_count = controller->hid.caps.NumberLinkCollectionNodes; if (!(collections = malloc(sizeof(*collections) * controller->hid.caps.NumberLinkCollectionNodes))) return FALSE; status = HidP_GetLinkCollectionNodes(collections, &collections_count, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetLinkCollectionNodes returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetLinkCollectionNodes returned %#lx\n", status); else for (i = 0; i < collections_count; ++i) { if (collections[i].LinkUsagePage != HID_USAGE_PAGE_HAPTICS) continue; @@ -232,15 +232,15 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d status = HidP_GetSpecificValueCaps(HidP_Feature, HID_USAGE_PAGE_ORDINAL, waveform_list, 3, &waveform_cap, &caps_count, preparsed); if (status != HIDP_STATUS_SUCCESS || !caps_count) { - WARN("could not find haptics waveform list report id, status %#x\n", status); + WARN("could not find haptics waveform list report id, status %#lx\n", status); return TRUE; }
status = HidP_InitializeReportForID(HidP_Feature, waveform_cap.ReportID, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#lx\n", status); if (!HidD_GetFeature(device, report_buf, report_len)) { - WARN("failed to get waveform list report, error %u\n", GetLastError()); + WARN("failed to get waveform list report, error %lu\n", GetLastError()); return TRUE; }
@@ -251,7 +251,7 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d ULONG waveform = 0; status = HidP_GetUsageValue(HidP_Feature, HID_USAGE_PAGE_ORDINAL, waveform_list, i, &waveform, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue returned %#lx\n", status); else if (waveform == HID_USAGE_HAPTICS_WAVEFORM_BUZZ) controller->hid.haptics_buzz_index = i; else if (waveform == HID_USAGE_HAPTICS_WAVEFORM_RUMBLE) controller->hid.haptics_rumble_index = i; } @@ -263,7 +263,7 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d caps_count = 1; status = HidP_GetSpecificValueCaps(HidP_Output, HID_USAGE_PAGE_HAPTICS, 0, HID_USAGE_HAPTICS_MANUAL_TRIGGER, &waveform_cap, &caps_count, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetSpecificValueCaps MANUAL_TRIGGER returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetSpecificValueCaps MANUAL_TRIGGER returned %#lx\n", status); else if (!caps_count) WARN("haptics manual trigger not supported\n"); else { @@ -293,31 +293,31 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO
/* send haptics rumble report (left motor) */ status = HidP_InitializeReportForID(HidP_Output, report_id, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#lx\n", status); status = HidP_SetUsageValue(HidP_Output, HID_USAGE_PAGE_HAPTICS, 0, HID_USAGE_HAPTICS_INTENSITY, state->wLeftMotorSpeed, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue INTENSITY returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue INTENSITY returned %#lx\n", status); status = HidP_SetUsageValue(HidP_Output, HID_USAGE_PAGE_HAPTICS, 0, HID_USAGE_HAPTICS_MANUAL_TRIGGER, controller->hid.haptics_rumble_index, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue MANUAL_TRIGGER returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue MANUAL_TRIGGER returned %#lx\n", status); if (!HidD_SetOutputReport(controller->device, report_buf, report_len)) { - WARN("HidD_SetOutputReport failed with error %u\n", GetLastError()); + WARN("HidD_SetOutputReport failed with error %lu\n", GetLastError()); return GetLastError(); }
/* send haptics buzz report (right motor) */ status = HidP_InitializeReportForID(HidP_Output, report_id, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_InitializeReportForID returned %#lx\n", status); status = HidP_SetUsageValue(HidP_Output, HID_USAGE_PAGE_HAPTICS, 0, HID_USAGE_HAPTICS_INTENSITY, state->wRightMotorSpeed, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue INTENSITY returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue INTENSITY returned %#lx\n", status); status = HidP_SetUsageValue(HidP_Output, HID_USAGE_PAGE_HAPTICS, 0, HID_USAGE_HAPTICS_MANUAL_TRIGGER, controller->hid.haptics_buzz_index, preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue MANUAL_TRIGGER returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_SetUsageValue MANUAL_TRIGGER returned %#lx\n", status); if (!HidD_SetOutputReport(controller->device, report_buf, report_len)) { - WARN("HidD_SetOutputReport failed with error %u\n", GetLastError()); + WARN("HidD_SetOutputReport failed with error %lu\n", GetLastError()); return GetLastError(); }
@@ -475,9 +475,9 @@ static void update_controller_list(void)
preparsed = NULL; if (!HidD_GetPreparsedData(device, &preparsed)) - WARN("ignoring HID device, HidD_GetPreparsedData failed with error %u\n", GetLastError()); + WARN("ignoring HID device, HidD_GetPreparsedData failed with error %lu\n", GetLastError()); else if ((status = HidP_GetCaps(preparsed, &caps)) != HIDP_STATUS_SUCCESS) - WARN("ignoring HID device, HidP_GetCaps returned %#x\n", status); + WARN("ignoring HID device, HidP_GetCaps returned %#lx\n", status); else if (caps.UsagePage != HID_USAGE_PAGE_GENERIC) WARN("ignoring HID device, unsupported usage page %04x\n", caps.UsagePage); else if (caps.Usage != HID_USAGE_GENERIC_GAMEPAD && caps.Usage != HID_USAGE_GENERIC_JOYSTICK && @@ -561,13 +561,13 @@ static void read_controller_state(struct xinput_controller *controller) { if (GetLastError() == ERROR_OPERATION_ABORTED) return; if (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_INVALID_HANDLE) controller_destroy(controller, TRUE); - else ERR("Failed to read input report, GetOverlappedResult failed with error %u\n", GetLastError()); + else ERR("Failed to read input report, GetOverlappedResult failed with error %lu\n", GetLastError()); return; }
button_length = ARRAY_SIZE(buttons); status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, 0, buttons, &button_length, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsages HID_USAGE_PAGE_BUTTON returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsages HID_USAGE_PAGE_BUTTON returned %#lx\n", status);
state.Gamepad.wButtons = 0; for (i = 0; i < button_length; i++) @@ -589,7 +589,7 @@ static void read_controller_state(struct xinput_controller *controller) }
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_HATSWITCH, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_HATSWITCH returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_HATSWITCH returned %#lx\n", status); else switch (value) { /* 8 1 2 @@ -607,27 +607,27 @@ static void read_controller_state(struct xinput_controller *controller) }
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_X, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_X returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_X returned %#lx\n", status); else state.Gamepad.sThumbLX = scale_value(value, &controller->hid.lx_caps, -32768, 32767);
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Y, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_Y returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_Y returned %#lx\n", status); else state.Gamepad.sThumbLY = -scale_value(value, &controller->hid.ly_caps, -32768, 32767) - 1;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RX, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RX returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RX returned %#lx\n", status); else state.Gamepad.sThumbRX = scale_value(value, &controller->hid.rx_caps, -32768, 32767);
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RY, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RY returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RY returned %#lx\n", status); else state.Gamepad.sThumbRY = -scale_value(value, &controller->hid.ry_caps, -32768, 32767) - 1;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RZ, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RZ returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_RZ returned %#lx\n", status); else state.Gamepad.bRightTrigger = scale_value(value, &controller->hid.rt_caps, 0, 255);
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Z, &value, controller->hid.preparsed, report_buf, report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_Z returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue HID_USAGE_PAGE_GENERIC / HID_USAGE_GENERIC_Z returned %#lx\n", status); else state.Gamepad.bLeftTrigger = scale_value(value, &controller->hid.lt_caps, 0, 255);
EnterCriticalSection(&controller->crit); @@ -708,7 +708,7 @@ static DWORD WINAPI hid_update_thread_proc(void *param) DestroyWindow(hwnd); UnregisterClassW(cls.lpszClassName, xinput_instance);
- if (ret != count - 1) ERR("update thread exited unexpectedly, ret %u\n", ret); + if (ret != count - 1) ERR("update thread exited unexpectedly, ret %lu\n", ret); SetEvent(done_event); return ret; } @@ -718,19 +718,19 @@ static BOOL WINAPI start_update_thread_once( INIT_ONCE *once, void *param, void HANDLE thread;
start_event = CreateEventA(NULL, FALSE, FALSE, NULL); - if (!start_event) ERR("failed to create start event, error %u\n", GetLastError()); + if (!start_event) ERR("failed to create start event, error %lu\n", GetLastError());
stop_event = CreateEventA(NULL, FALSE, FALSE, NULL); - if (!stop_event) ERR("failed to create stop event, error %u\n", GetLastError()); + if (!stop_event) ERR("failed to create stop event, error %lu\n", GetLastError());
done_event = CreateEventA(NULL, FALSE, FALSE, NULL); - if (!done_event) ERR("failed to create done event, error %u\n", GetLastError()); + if (!done_event) ERR("failed to create done event, error %lu\n", GetLastError());
update_event = CreateEventA(NULL, FALSE, FALSE, NULL); - if (!update_event) ERR("failed to create update event, error %u\n", GetLastError()); + if (!update_event) ERR("failed to create update event, error %lu\n", GetLastError());
thread = CreateThread(NULL, 0, hid_update_thread_proc, NULL, 0, NULL); - if (!thread) ERR("failed to create update thread, error %u\n", GetLastError()); + if (!thread) ERR("failed to create update thread, error %lu\n", GetLastError()); CloseHandle(thread);
WaitForSingleObject(start_event, INFINITE); @@ -765,6 +765,8 @@ static void controller_unlock(struct xinput_controller *controller)
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { + TRACE("inst %p, reason %lu, reserved %p.\n", inst, reason, reserved); + switch (reason) { case DLL_PROCESS_ATTACH: @@ -783,7 +785,7 @@ void WINAPI DECLSPEC_HOTPATCH XInputEnable(BOOL enable) { int index;
- TRACE("(enable %d)\n", enable); + TRACE("enable %d.\n", enable);
/* Setting to false will stop messages from XInputSetState being sent to the controllers. Setting to true will send the last vibration @@ -804,7 +806,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION *vib { DWORD ret;
- TRACE("(index %u, vibration %p)\n", index, vibration); + TRACE("index %lu, vibration %p.\n", index, vibration);
start_update_thread();
@@ -839,7 +841,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE *state) { DWORD ret;
- TRACE("(index %u, state %p)!\n", index, state); + TRACE("index %lu, state %p.\n", index, state);
ret = xinput_get_state(index, state); if (ret != ERROR_SUCCESS) return ret; @@ -852,7 +854,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE *state)
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx(DWORD index, XINPUT_STATE *state) { - TRACE("(index %u, state %p)!\n", index, state); + TRACE("index %lu, state %p.\n", index, state);
return xinput_get_state(index, state); } @@ -1052,7 +1054,7 @@ done:
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetKeystroke(DWORD index, DWORD reserved, PXINPUT_KEYSTROKE keystroke) { - TRACE("(index %u, reserved %u, keystroke %p)\n", index, reserved, keystroke); + TRACE("index %lu, reserved %lu, keystroke %p.\n", index, reserved, keystroke);
if (index >= XUSER_MAX_COUNT && index != XUSER_INDEX_ANY) return ERROR_BAD_ARGUMENTS;
@@ -1070,7 +1072,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetKeystroke(DWORD index, DWORD reserved, P
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilities(DWORD index, DWORD flags, XINPUT_CAPABILITIES *capabilities) { - TRACE("(index %u, flags 0x%x, capabilities %p)\n", index, flags, capabilities); + TRACE("index %lu, flags %#lx, capabilities %p.\n", index, flags, capabilities);
start_update_thread();
@@ -1093,7 +1095,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilities(DWORD index, DWORD flags, X
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetDSoundAudioDeviceGuids(DWORD index, GUID *render_guid, GUID *capture_guid) { - FIXME("(index %u, render guid %p, capture guid %p) Stub!\n", index, render_guid, capture_guid); + FIXME("index %lu, render_guid %s, capture_guid %s stub!\n", index, debugstr_guid(render_guid), + debugstr_guid(capture_guid));
if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controllers[index].device) return ERROR_DEVICE_NOT_CONNECTED; @@ -1105,7 +1108,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetBatteryInformation(DWORD index, BYTE typ { static int once;
- if (!once++) FIXME("(index %u, type %u, battery %p) Stub!\n", index, type, battery); + if (!once++) FIXME("index %lu, type %u, battery %p.\n", index, type, battery);
if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controllers[index].device) return ERROR_DEVICE_NOT_CONNECTED; diff --git a/dlls/xinput1_4/Makefile.in b/dlls/xinput1_4/Makefile.in index d7d2d687743..393a416af9e 100644 --- a/dlls/xinput1_4/Makefile.in +++ b/dlls/xinput1_4/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = xinput1_4.dll IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 diff --git a/dlls/xinput9_1_0/Makefile.in b/dlls/xinput9_1_0/Makefile.in index 5a9c7d997d1..55ea44ba666 100644 --- a/dlls/xinput9_1_0/Makefile.in +++ b/dlls/xinput9_1_0/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = xinput9_1_0.dll IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.gaming.input/Makefile.in | 1 - dlls/windows.gaming.input/main.c | 28 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/windows.gaming.input/Makefile.in b/dlls/windows.gaming.input/Makefile.in index db009015e88..fab3c4e62d5 100644 --- a/dlls/windows.gaming.input/Makefile.in +++ b/dlls/windows.gaming.input/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = windows.gaming.input.dll IMPORTS = combase uuid
diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index e8048ec440c..5278ec261bd 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -60,7 +60,7 @@ static inline struct gamepad_vector *impl_from_IVectorView_Gamepad(IVectorView_G static HRESULT STDMETHODCALLTYPE vector_view_gamepad_QueryInterface( IVectorView_Gamepad *iface, REFIID iid, void **out) { - TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IInspectable) || @@ -82,7 +82,7 @@ static ULONG STDMETHODCALLTYPE vector_view_gamepad_AddRef( { struct gamepad_vector *impl = impl_from_IVectorView_Gamepad(iface); ULONG ref = InterlockedIncrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p increasing refcount to %lu.\n", iface, ref); return ref; }
@@ -91,7 +91,7 @@ static ULONG STDMETHODCALLTYPE vector_view_gamepad_Release( { struct gamepad_vector *impl = impl_from_IVectorView_Gamepad(iface); ULONG ref = InterlockedDecrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p decreasing refcount to %lu.\n", iface, ref); return ref; }
@@ -119,7 +119,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetTrustLevel( static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetAt( IVectorView_Gamepad *iface, UINT32 index, IGamepad **value) { - FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); + FIXME("iface %p, index %u, value %p stub!\n", iface, index, value); *value = NULL; return E_BOUNDS; } @@ -145,7 +145,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany( IVectorView_Gamepad *iface, UINT32 start_index, UINT32 items_size, IGamepad **items, UINT *value) { - FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); + FIXME("iface %p, start_index %u, items_size %u, items %p, value %p stub!\n", iface, start_index, + items_size, items, value); *value = 0; return E_BOUNDS; } @@ -186,7 +187,7 @@ static inline struct raw_game_controller_vector *impl_from_IVectorView_RawGameCo static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_QueryInterface( IVectorView_RawGameController *iface, REFIID iid, void **out) { - TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IInspectable) || @@ -208,7 +209,7 @@ static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_AddRef( { struct raw_game_controller_vector *impl = impl_from_IVectorView_RawGameController(iface); ULONG ref = InterlockedIncrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p increasing refcount to %lu.\n", iface, ref); return ref; }
@@ -217,7 +218,7 @@ static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_Release( { struct raw_game_controller_vector *impl = impl_from_IVectorView_RawGameController(iface); ULONG ref = InterlockedDecrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p decreasing refcount to %lu.\n", iface, ref); return ref; }
@@ -245,7 +246,7 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetTrustLevel( static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt( IVectorView_RawGameController *iface, UINT32 index, IRawGameController **value) { - FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); + FIXME("iface %p, index %u, value %p stub!\n", iface, index, value); *value = NULL; return E_BOUNDS; } @@ -271,7 +272,8 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany( IVectorView_RawGameController *iface, UINT32 start_index, UINT32 items_size, IRawGameController **items, UINT *value) { - FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); + FIXME("iface %p, start_index %u, items_size %u, items %p, value %p stub!\n", iface, start_index, + items_size, items, value); *value = 0; return E_BOUNDS; } @@ -326,7 +328,7 @@ static HRESULT STDMETHODCALLTYPE windows_gaming_input_QueryInterface( { struct windows_gaming_input *impl = impl_from_IActivationFactory(iface);
- TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IInspectable) || @@ -362,7 +364,7 @@ static ULONG STDMETHODCALLTYPE windows_gaming_input_AddRef( { struct windows_gaming_input *impl = impl_from_IActivationFactory(iface); ULONG ref = InterlockedIncrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p increasing refcount to %lu.\n", iface, ref); return ref; }
@@ -371,7 +373,7 @@ static ULONG STDMETHODCALLTYPE windows_gaming_input_Release( { struct windows_gaming_input *impl = impl_from_IActivationFactory(iface); ULONG ref = InterlockedDecrement(&impl->ref); - TRACE("iface %p, ref %u.\n", iface, ref); + TRACE("iface %p decreasing refcount to %lu.\n", iface, ref); return ref; }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winexinput.sys/Makefile.in | 1 - dlls/winexinput.sys/main.c | 42 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/dlls/winexinput.sys/Makefile.in b/dlls/winexinput.sys/Makefile.in index ce98960de9b..e115235920a 100644 --- a/dlls/winexinput.sys/Makefile.in +++ b/dlls/winexinput.sys/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winexinput.sys IMPORTS = ntoskrnl hidparse EXTRADLLFLAGS = -Wl,--subsystem,native diff --git a/dlls/winexinput.sys/main.c b/dlls/winexinput.sys/main.c index 339db17817c..e0ffb71440f 100644 --- a/dlls/winexinput.sys/main.c +++ b/dlls/winexinput.sys/main.c @@ -124,7 +124,7 @@ struct device { BOOL is_fdo; BOOL is_gamepad; - BOOL removed; + LONG removed; WCHAR device_id[MAX_DEVICE_ID_LEN]; };
@@ -204,28 +204,28 @@ static void translate_report_to_xinput_state(struct func_device *fdo) count = ARRAY_SIZE(usages); status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, 0, usages, &count, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsages returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsages returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_HATSWITCH, &hat, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue hat returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue hat returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_X, &lx, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue x returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue x returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Y, &ly, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue y returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue y returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Z, <, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue z returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue z returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RX, &rx, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue rx returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue rx returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RY, &ry, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue ry returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue ry returned %#lx\n", status); status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RZ, &rt, preparsed, fdo->report_buf, fdo->report_len); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue rz returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetUsageValue rz returned %#lx\n", status);
if (hat < 1 || hat > 8) fdo->xinput_state.buttons = 0; else fdo->xinput_state.buttons = hat << 10; @@ -322,7 +322,7 @@ static NTSTATUS WINAPI gamepad_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) ULONG code = stack->Parameters.DeviceIoControl.IoControlCode; struct func_device *fdo = fdo_from_DEVICE_OBJECT(device);
- TRACE("device %p, irp %p, code %#x, bus_device %p.\n", device, irp, code, fdo->bus_device); + TRACE("device %p, irp %p, code %#lx, bus_device %p.\n", device, irp, code, fdo->bus_device);
switch (code) { @@ -397,7 +397,7 @@ static NTSTATUS WINAPI internal_ioctl(DEVICE_OBJECT *device, IRP *irp) return STATUS_DELETE_PENDING; }
- TRACE("device %p, irp %p, code %#x, bus_device %p.\n", device, irp, code, fdo->bus_device); + TRACE("device %p, irp %p, code %#lx, bus_device %p.\n", device, irp, code, fdo->bus_device);
if (code == IOCTL_HID_READ_REPORT) return try_complete_pending_read(device, irp); if (impl->is_gamepad) return gamepad_internal_ioctl(device, irp); @@ -465,7 +465,7 @@ static NTSTATUS WINAPI pdo_pnp(DEVICE_OBJECT *device, IRP *irp) IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); struct func_device *fdo = fdo_from_DEVICE_OBJECT(device); struct device *impl = impl_from_DEVICE_OBJECT(device); - ULONG code = stack->MinorFunction; + UCHAR code = stack->MinorFunction; NTSTATUS status; IRP *pending;
@@ -568,7 +568,7 @@ static NTSTATUS create_child_pdos(DEVICE_OBJECT *device) if ((status = IoCreateDevice(device->DriverObject, sizeof(struct phys_device), &name_str, 0, 0, FALSE, &gamepad_device))) { - ERR("failed to create gamepad device, status %#x.\n", status); + ERR("failed to create gamepad device, status %#lx.\n", status); return status; }
@@ -579,7 +579,7 @@ static NTSTATUS create_child_pdos(DEVICE_OBJECT *device) if ((status = IoCreateDevice(device->DriverObject, sizeof(struct phys_device), &name_str, 0, 0, FALSE, &xinput_device))) { - ERR("failed to create xinput device, status %#x.\n", status); + ERR("failed to create xinput device, status %#lx.\n", status); IoDeleteDevice(gamepad_device); return status; } @@ -641,7 +641,7 @@ static void check_value_caps(struct func_device *fdo, USHORT usage, HIDP_VALUE_C static NTSTATUS initialize_device(DEVICE_OBJECT *device) { struct func_device *fdo = fdo_from_DEVICE_OBJECT(device); - ULONG i, u, button_count, report_desc_len, report_count; + UINT i, u, button_count, report_desc_len, report_count; PHIDP_REPORT_DESCRIPTOR report_desc; PHIDP_PREPARSED_DATA preparsed; HIDP_BUTTON_CAPS *button_caps; @@ -669,7 +669,7 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device) button_count = 0; if (!(button_caps = malloc(sizeof(*button_caps) * caps.NumberInputButtonCaps))) return STATUS_NO_MEMORY; status = HidP_GetButtonCaps(HidP_Input, button_caps, &caps.NumberInputButtonCaps, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetButtonCaps returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetButtonCaps returned %#lx\n", status); else for (i = 0; i < caps.NumberInputButtonCaps; i++) { if (button_caps[i].UsagePage != HID_USAGE_PAGE_BUTTON) continue; @@ -682,7 +682,7 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device)
if (!(value_caps = malloc(sizeof(*value_caps) * caps.NumberInputValueCaps))) return STATUS_NO_MEMORY; status = HidP_GetValueCaps(HidP_Input, value_caps, &caps.NumberInputValueCaps, preparsed); - if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetValueCaps returned %#x\n", status); + if (status != HIDP_STATUS_SUCCESS) WARN("HidP_GetValueCaps returned %#lx\n", status); else for (i = 0; i < caps.NumberInputValueCaps; i++) { HIDP_VALUE_CAPS *caps = value_caps + i; @@ -721,7 +721,7 @@ static NTSTATUS WINAPI fdo_pnp(DEVICE_OBJECT *device, IRP *irp) { IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); struct func_device *fdo = fdo_from_DEVICE_OBJECT(device); - ULONG code = stack->MinorFunction; + UCHAR code = stack->MinorFunction; DEVICE_RELATIONS *devices; DEVICE_OBJECT *child; NTSTATUS status; @@ -839,7 +839,7 @@ static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_devi
if ((status = get_device_id(bus_device, BusQueryDeviceID, bus_id))) { - ERR("failed to get bus device id, status %#x.\n", status); + ERR("failed to get bus device id, status %#lx.\n", status); return status; }
@@ -852,14 +852,14 @@ static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_devi
if ((status = get_device_id(bus_device, BusQueryInstanceID, instance_id))) { - ERR("failed to get bus device instance id, status %#x.\n", status); + ERR("failed to get bus device instance id, status %#lx.\n", status); return status; }
if ((status = IoCreateDevice(driver, sizeof(struct func_device), NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &device))) { - ERR("failed to create bus FDO, status %#x.\n", status); + ERR("failed to create bus FDO, status %#lx.\n", status); return status; }