@@ -531,6 +531,30 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT *
531
531
return count ;
532
532
}
533
533
534
+ static BOOL steam_input_get_vid_pid ( UINT slot , UINT16 * vid , UINT16 * pid )
535
+ {
536
+ const char * info = getenv ( "SteamVirtualGamepadInfo" );
537
+ char buffer [256 ];
538
+ UINT current ;
539
+ FILE * file ;
540
+
541
+ TRACE ( "reading SteamVirtualGamepadInfo %s\n" , debugstr_a (info ) );
542
+
543
+ if (!info || !(file = fopen ( info , "r" ))) return FALSE;
544
+ while (fscanf ( file , "%255[^\n]\n" , buffer ) == 1 )
545
+ {
546
+ if (sscanf ( buffer , "[slot %d]" , & current )) continue ;
547
+ if (current < slot ) continue ;
548
+ if (current > slot ) break ;
549
+ if (sscanf ( buffer , "VID=0x%hx" , vid )) continue ;
550
+ if (sscanf ( buffer , "PID=0x%hx" , pid )) continue ;
551
+ }
552
+
553
+ fclose ( file );
554
+
555
+ return TRUE;
556
+ }
557
+
534
558
/**********************************************************************
535
559
* NtUserGetRawInputDeviceInfo (win32u.@)
536
560
*/
@@ -590,9 +614,11 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data
590
614
buffer [size ] = 0 ;
591
615
if (sscanf ( buffer , "%02u" , & slot ) != 1 ) slot = 0 ;
592
616
593
- /* FIXME: Return the actual underlying device VID / PID somehow */
594
- vid = 0x045e ;
595
- pid = 0x028e ;
617
+ if (!steam_input_get_vid_pid ( slot , & vid , & pid ))
618
+ {
619
+ vid = 0x045e ;
620
+ pid = 0x028e ;
621
+ }
596
622
597
623
size = snprintf ( buffer , ARRAY_SIZE (buffer ), "\\\\.\\pipe\\HID#VID_045E&PID_028E&IG_00#%04X&%04X" , vid , pid );
598
624
if ((tmpW = wcschr ( device -> path + 29 , '&' )))
0 commit comments