summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-10-26 04:38:18 +0100
committer hap <happppp@users.noreply.github.com>2015-10-26 04:39:00 +0100
commit0095fa01e62e233f71b2c1d19ac73f969310904b (patch)
tree3f970144b86a86431e5e7e24ce7e5364cecd9b80 /src/osd
parent1e2904037e167d463aa4040aafa18c053682e190 (diff)
windows rawinput: allow nameless input devices
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/windows/input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index 6afca302c27..3099f5e5f20 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -1826,13 +1826,13 @@ static device_info *rawinput_device_create(running_machine &machine, device_info
{
device_info *devinfo = NULL;
TCHAR *tname = NULL;
- INT name_length;
+ INT name_length = 0;
- // determine the length of the device name, allocate it, and fetch it
+ // determine the length of the device name, allocate it, and fetch it if not nameless
if ((*get_rawinput_device_info)(device->hDevice, RIDI_DEVICENAME, NULL, &name_length) != 0)
goto error;
- tname = global_alloc_array(TCHAR, name_length);
- if ((*get_rawinput_device_info)(device->hDevice, RIDI_DEVICENAME, tname, &name_length) == -1)
+ tname = global_alloc_array_clear(TCHAR, name_length+1);
+ if (name_length != 1 && (*get_rawinput_device_info)(device->hDevice, RIDI_DEVICENAME, tname, &name_length) == -1)
goto error;
// if this is an RDP name, skip it