xMRi
xMRi

Reputation: 15355

Reading / Enumerating registry path fails "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country/region List"

I want to enumerate the registry path.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country/region List

I can open and enumerate

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\

But enumerating the node

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country/region List

causes an error 2! Not found. Also enumerating the node

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\

doesn't show the subnode shown in RegEdit

ASSERT(CRegKey{}.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony"), KEY_ENUMERATE_SUB_KEYS)==ERROR_SUCCESS);
ASSERT(CRegKey{}.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country/region List\\1"), KEY_READ)==ERROR_SUCCESS);
ASSERT(CRegKey{}.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country/region List"), KEY_ENUMERATE_SUB_KEYS)==ERROR_SUCCESS);
    
    if (regKey.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony"), KEY_ENUMERATE_SUB_KEYS)==ERROR_SUCCESS)
//  if (regKey.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country/region List"), KEY_READ)==ERROR_SUCCESS)
    {
        // Loop over all entries
        for (DWORD dwIndex = 0; ; ++dwIndex)
        {
            TCHAR szCountry[64];
            DWORD dwLen = MfxCountOf(szCountry);
            if (regKey.EnumKey(dwIndex, szCountry, &dwLen)!=ERROR_SUCCESS)
                break;

What is the problem with this node?

Upvotes: -1

Views: 47

Answers (1)

xMRi
xMRi

Reputation: 15355

Oh man... the answer is simple. I have a 32bit program, and this node can't be read from 32bit. It isn't mapped.

I have to use the KEY_WOW64_64KEY flag to get access to it.

Upvotes: 0

Related Questions