diff options
| author | 2015-10-26 04:38:18 +0100 | |
|---|---|---|
| committer | 2015-10-26 04:39:00 +0100 | |
| commit | 0095fa01e62e233f71b2c1d19ac73f969310904b (patch) | |
| tree | 3f970144b86a86431e5e7e24ce7e5364cecd9b80 /src/osd | |
| parent | 1e2904037e167d463aa4040aafa18c053682e190 (diff) | |
windows rawinput: allow nameless input devices
Diffstat (limited to 'src/osd')
| -rw-r--r-- | src/osd/windows/input.c | 8 |
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 |
