Skip to content

Commit 52146cf

Browse files
committed
Fixed raw input device GUIDs changing randomly between runs
On Windows 11, apparently HidD_GetManufacturerString() and HidD_GetProductString() can return TRUE without actually filling in any string data. Fixes #12566 (cherry picked from commit 4fc9509)
1 parent 46a51b4 commit 52146cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/joystick/windows/SDL_rawinputjoystick.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,11 @@ static void RAWINPUT_AddDevice(HANDLE hDevice)
908908
char *product_string = NULL;
909909
WCHAR string[128];
910910

911+
string[0] = 0;
911912
if (SDL_HidD_GetManufacturerString(hFile, string, sizeof(string))) {
912913
manufacturer_string = WIN_StringToUTF8W(string);
913914
}
915+
string[0] = 0;
914916
if (SDL_HidD_GetProductString(hFile, string, sizeof(string))) {
915917
product_string = WIN_StringToUTF8W(string);
916918
}

0 commit comments

Comments
 (0)