mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Checked for null parameter in vigem_target_x360_get_user_index
Added error code VIGEM_ERROR_INVALID_PARAMETER
This commit is contained in:
@@ -63,7 +63,9 @@ extern "C" {
|
||||
VIGEM_ERROR_CALLBACK_NOT_FOUND = 0xE0000011,
|
||||
VIGEM_ERROR_BUS_ALREADY_CONNECTED = 0xE0000012,
|
||||
VIGEM_ERROR_BUS_INVALID_HANDLE = 0xE0000013,
|
||||
VIGEM_ERROR_XUSB_USERINDEX_OUT_OF_RANGE = 0xE0000014
|
||||
VIGEM_ERROR_XUSB_USERINDEX_OUT_OF_RANGE = 0xE0000014,
|
||||
VIGEM_ERROR_INVALID_PARAMETER = 0xE0000015
|
||||
|
||||
} VIGEM_ERROR;
|
||||
|
||||
/**
|
||||
|
||||
@@ -907,6 +907,9 @@ VIGEM_ERROR vigem_target_x360_get_user_index(
|
||||
if (target->SerialNo == 0 || target->Type != Xbox360Wired)
|
||||
return VIGEM_ERROR_INVALID_TARGET;
|
||||
|
||||
if (!index)
|
||||
return VIGEM_ERROR_INVALID_PARAMETER;
|
||||
|
||||
DWORD transferred = 0;
|
||||
OVERLAPPED lOverlapped = { 0 };
|
||||
lOverlapped.hEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
|
||||
Reference in New Issue
Block a user