C++/MFC
RegOpenKeyEx 32bit 응용프로그램에서 64bit Registry 접근 예제
Hwoarang757
2023. 6. 22. 22:35
출처 : winapi - C++ read a Registry entry in SOFTWARE\WOW6432 from a 64-bit app - Stack Overflow
C++ read a Registry entry in SOFTWARE\WOW6432 from a 64-bit app
I've got some 32-bit C++ code to read a Key/Value pair from the Registry as follows: // Get a handle to the required key HKEY hKey; if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\
stackoverflow.com
Registry Key : HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall 로 접근 시에 항시
x86 응용프로그램에서는 HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall 로
접근이 되었습니다.
x86 응용프로그램에서 registry 64bit HKLM\Software 접근 방법이 있었습니다..!! 다행입니다!!!!!!!!!!!!
위의 명시 해놓은 출처와 같이 OPTION의 매개변수를 이용하여 접근 할 수 있었습니다. [KEY_WOW64_64KEY]
std::wstring m_strProductGUID = L"{123456-7890-9876-5432-67AB2CD3071F}";
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
, 0
, KEY_ALL_ACCESS | KEY_WOW64_64KEY
, &pKey) == ERROR_SUCCESS)
{
Log(L"%s Founded Registry=SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
__FUNCTIONW__);
if (RegOpenKey(pKey, m_strProductGUID.c_str(), &pKey ) == ERROR_SUCCESS) {
Log(L"Key Found");
}
}