From ff42312b444a0b2aaf732a8772d4fe039262f6fb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 20 Dec 2005 20:26:11 +0000 Subject: [PATCH] use RegistryAccess::GetRegValue --- .../arch/InputHandler/InputHandler_DirectInput.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp index e5b470b1cf..7692307993 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -52,19 +52,13 @@ static BOOL CALLBACK EnumDevices( const DIDEVICEINSTANCE *pdidInstance, void *pC static void CheckForDirectInputDebugMode() { - HKEY hkey; - if (RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\DirectInput", &hkey) != ERROR_SUCCESS) - return; - - long val; - DWORD nSize = sizeof(val); - if( RegQueryValueEx(hkey, "emulation", NULL, NULL, (LPBYTE)&val, &nSize) == ERROR_SUCCESS ) + int iVal; + if( RegistryAccess::GetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\DirectInput", "emulation", iVal) ) { - if( val&0x8 ) + if( iVal & 0x8 ) LOG->Warn("DirectInput keyboard debug mode appears to be enabled. This reduces\n" "input timing accuracy significantly. Disabling this is strongly recommended." ); } - RegCloseKey(hkey); } static int GetNumUsbHidDevices()