Changeset 95763 in vbox for trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
- Timestamp:
- Jul 20, 2022 7:33:58 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r95326 r95763 605 605 } 606 606 607 DWORD xres = atoi(argv[0]);608 DWORD yres = atoi(argv[1]);609 DWORD bpp = atoi(argv[2]);607 DWORD xres = RTStrToUInt32(argv[0]); 608 DWORD yres = RTStrToUInt32(argv[1]); 609 DWORD bpp = RTStrToUInt32(argv[2]); 610 610 DWORD scr = 0; 611 611 if (argc == 4) 612 scr = atoi(argv[3]);612 scr = RTStrToUInt32(argv[3]); 613 613 614 614 HMODULE hmodUser = GetModuleHandle("user32.dll"); … … 720 720 for (iDevice = 0; iDevice < cDevices; iDevice++) 721 721 { 722 charszValueName[64];723 RT StrPrintf(szValueName, sizeof(szValueName), "\\Device\\Video%u", adwObjectNumberList[iDevice]);724 725 charszVideoLocation[256];726 cbValue = sizeof( szVideoLocation);727 status = RegQueryValueEx A(hkeyDeviceMap, szValueName, NULL, &dwKeyType, (LPBYTE)&szVideoLocation[0], &cbValue);722 RTUTF16 wszValueName[64]; 723 RTUtf16Printf(wszValueName, RT_ELEMENTS(wszValueName), "\\Device\\Video%u", adwObjectNumberList[iDevice]); 724 725 RTUTF16 wszVideoLocation[256]; 726 cbValue = sizeof(wszVideoLocation); 727 status = RegQueryValueExW(hkeyDeviceMap, wszValueName, NULL, &dwKeyType, (LPBYTE)&wszVideoLocation[0], &cbValue); 728 728 729 729 /* This value starts with '\REGISTRY\Machine' */ 730 730 if ( status == ERROR_SUCCESS 731 731 && dwKeyType == REG_SZ 732 && _strnicmp(szVideoLocation, "\\REGISTRY\\Machine", 17) == 0)733 { 734 status = RegOpenKeyEx A(HKEY_LOCAL_MACHINE, &szVideoLocation[18], 0,732 && RTUtf16NICmpAscii(wszVideoLocation, RT_STR_TUPLE("\\REGISTRY\\Machine")) == 0) 733 { 734 status = RegOpenKeyExW(HKEY_LOCAL_MACHINE, &wszVideoLocation[18], 0, 735 735 KEY_READ | (writable ? KEY_WRITE : 0), &hkeyVideo); 736 736 if (status == ERROR_SUCCESS) … … 1084 1084 } 1085 1085 1086 DWORD xres = atoi(argv[0]);1087 DWORD yres = atoi(argv[1]);1088 DWORD bpp = atoi(argv[2]);1086 DWORD xres = RTStrToUInt32(argv[0]); 1087 DWORD yres = RTStrToUInt32(argv[1]); 1088 DWORD bpp = RTStrToUInt32(argv[2]); 1089 1089 1090 1090 /** @todo better check including xres mod 8 = 0! */ … … 1145 1145 } 1146 1146 1147 DWORD xres = atoi(argv[0]);1148 DWORD yres = atoi(argv[1]);1149 DWORD bpp = atoi(argv[2]);1147 DWORD xres = RTStrToUInt32(argv[0]); 1148 DWORD yres = RTStrToUInt32(argv[1]); 1149 DWORD bpp = RTStrToUInt32(argv[2]); 1150 1150 1151 1151 HKEY hkeyVideo = getVideoKey(true);
Note:
See TracChangeset
for help on using the changeset viewer.