forked from qt-creator/qt-creator
qtcdebugger: Register as post-mortem debugger for 64bit applications as well.
Add mode argument to registry access helpers allowing to access the 64bit registry from 32bit applications and vice versa using special REGSAM values, similar to the new QSettings formats introduced in Qt 5.7. This allows for setting the 64bit post-mortem debugger when running as a 32bit application on 64bit Windows. The -wow argument is extended to indicate accessing the 64bit node from 32bit. Task-number: QTCREATORBUG-16386 Change-Id: I7f003673777e4b8c1b259ba1905a4207b4ce0b43 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -98,6 +98,7 @@ bool openRegistryKey(HKEY category, // HKEY_LOCAL_MACHINE, etc.
|
||||
const WCHAR *key,
|
||||
bool readWrite,
|
||||
HKEY *keyHandle,
|
||||
AccessMode mode,
|
||||
QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(debuggerRegistryKeyC); // avoid warning from MinGW
|
||||
@@ -105,6 +106,16 @@ bool openRegistryKey(HKEY category, // HKEY_LOCAL_MACHINE, etc.
|
||||
REGSAM accessRights = KEY_READ;
|
||||
if (readWrite)
|
||||
accessRights |= KEY_SET_VALUE;
|
||||
switch (mode) {
|
||||
case RegistryAccess::DefaultAccessMode:
|
||||
break;
|
||||
case RegistryAccess::Registry32Mode:
|
||||
accessRights |= KEY_WOW64_32KEY;
|
||||
break;
|
||||
case RegistryAccess::Registry64Mode:
|
||||
accessRights |= KEY_WOW64_64KEY;
|
||||
break;
|
||||
}
|
||||
const LONG rc = RegOpenKeyEx(category, key, 0, accessRights, keyHandle);
|
||||
if (rc != ERROR_SUCCESS) {
|
||||
*errorMessage = msgFunctionFailed("RegOpenKeyEx", rc);
|
||||
|
||||
Reference in New Issue
Block a user