Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Connect to Registry

Connect to Registry

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminsecurityhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mila025
    wrote on last edited by
    #1

    Is there any way to connect to the system registry in Windows XP Home Edition ? RegConnectRegistry doesn't work because bypasses the authentication layer - so how to get around this problem ? Mila

    R R 2 Replies Last reply
    0
    • M Mila025

      Is there any way to connect to the system registry in Windows XP Home Edition ? RegConnectRegistry doesn't work because bypasses the authentication layer - so how to get around this problem ? Mila

      R Offline
      R Offline
      RadioOpa
      wrote on last edited by
      #2

      Have you tried something like this: if(::RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Example Company\\Example Program\\VersionBuilt", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { // Get version //dwSize = sizeof(dwValue); DWORD nType = REG_SZ; unsigned char pRegData[256]; DWORD nBuffLen = 256; char* pLocation = "VersionBuilt"; RegQueryValueEx(hKey, pLocation, NULL, &nType, pRegData, &nBuffLen); ::RegCloseKey(hKey); csVersion.Format( "%s", &pRegData[ 5]); }

      1 Reply Last reply
      0
      • M Mila025

        Is there any way to connect to the system registry in Windows XP Home Edition ? RegConnectRegistry doesn't work because bypasses the authentication layer - so how to get around this problem ? Mila

        R Offline
        R Offline
        Roger Stoltz
        wrote on last edited by
        #3

        Are you really trying to connect to a registry on a remote machine running WinXP Home Edition? If 'yes' then forget about it since the function to use is the one you mentioned, ::RegConnectRegistry, and will always fail on the Home Edition. What you perhaps can do is write an application that acts as a server that you can connect to using sockets and develop your own protocol for reading and/or writing the registry on the remote machine. If you are trying to read and/or write the local registry you should use ::RegOpenKeyEx or ::RegCreateKeyEx instead. However, in either case, depending on what access rights the user have running the application that desires access to the registry, the operation might fail due to lack of access rights. -- Roger

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups