src/video/win32/SDL_win32mouse.c
changeset 2980 8789e4b0e0e7
parent 2974 d2f68ec8c1d0
child 2990 502adab079a4
equal deleted inserted replaced
2979:d578ae900755 2980:8789e4b0e0e7
    83         if (GetRawInputDeviceInfoA
    83         if (GetRawInputDeviceInfoA
    84             (deviceList[i].hDevice, RIDI_DEVICENAME, NULL, &tmp) < 0) {
    84             (deviceList[i].hDevice, RIDI_DEVICENAME, NULL, &tmp) < 0) {
    85             continue;
    85             continue;
    86         }
    86         }
    87         buffer = SDL_malloc((tmp + 1) * sizeof(char));
    87         buffer = SDL_malloc((tmp + 1) * sizeof(char));
    88         key_name = SDL_malloc(tmp + sizeof(reg_key_root) * sizeof(char));
    88         key_name = SDL_malloc((tmp + SDL_strlen(reg_key_root) + 1) * sizeof(char));
    89 
    89 
    90         /* we're getting the device registry path and polishing it to get it's name,
    90         /* we're getting the device registry path and polishing it to get it's name,
    91            surely there must be an easier way, but we haven't found it yet */
    91            surely there must be an easier way, but we haven't found it yet */
    92         if (GetRawInputDeviceInfoA
    92         if (GetRawInputDeviceInfoA
    93             (deviceList[i].hDevice, RIDI_DEVICENAME, buffer, &tmp) < 0) {
    93             (deviceList[i].hDevice, RIDI_DEVICENAME, buffer, &tmp) < 0) {
   123                     is_rdp = 1;
   123                     is_rdp = 1;
   124                     break;
   124                     break;
   125                 }
   125                 }
   126             }
   126             }
   127         }
   127         }
       
   128 
       
   129 		buffer -= 4;
       
   130 
   128         if (is_rdp == 1) {
   131         if (is_rdp == 1) {
   129             SDL_free(buffer);
   132             SDL_free(buffer);
   130             SDL_free(key_name);
   133             SDL_free(key_name);
   131             SDL_free(device_name);
   134             SDL_free(device_name);
   132             is_rdp = 0;
   135             is_rdp = 0;