0

The key I want right now is the GPU DeviceDesc key, but it seems that every regedit path to the key is unique, for instance:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\PCI\VEN_10DE&DEV_1C03&SUBSYS_85B61043&REV_A1\4&1c3d25bb&0&0019

Which doesn't seems like the path everyone is getting.

Image

grooveplex
  • 2,492
  • 4
  • 28
  • 30
Plozy
  • 17
  • 3
  • Why not using the username? – Charlie Jan 26 '19 at 20:24
  • @Charlie , you still need a unique path for it – Plozy Jan 26 '19 at 20:25
  • for what? Do you want to save something in an unique path per user? Where do you save those paths? Do you only need some unique identifier? Did you consider using a random Guid? Did you consider creating your own key in the regedit (with c#)? – Charlie Jan 26 '19 at 20:30
  • @Charlie i just wanna know how to get the path of the user where the DeviceDesc is located, i didn't save this path or whatever. you can go to the same path like me and you'll probably see that your path is different – Plozy Jan 26 '19 at 20:35
  • VEN_10DE is the Vendor Nvidia. This path is not available on my OS. DEV_1C03 is an Id of an Intel chip. – Charlie Jan 26 '19 at 20:38
  • How is this even a programming question? RegEdit is a program used to edit the system registry. It doesnt have keys. – Ňɏssa Pøngjǣrdenlarp Jan 26 '19 at 20:45
  • I think this is best moved to Super User instead of Stack Overflow? – Smankusors Jan 26 '19 at 20:51

1 Answers1

0

According to the microsoft documentation:

The HKLM\SYSTEM\CurrentControlSet\Enum registry tree contains information about the devices on the system. The PnP manager creates a subkey for each device, with a name in the form of HKLM\SYSTEM\CurrentControlSet\Enum\Enumerator\deviceID. Under each of these keys is a subkey for each device instance present on the system. This subkey has information such as the device description, hardware IDs, compatible IDs, and resource requirements.

The Enum tree is reserved for use by operating system components, and its layout is subject to change. Drivers and user-mode Device Installation Components must use system-supplied functions, such as IoGetDeviceProperty and SetupDiGetDeviceRegistryProperty, to extract information from this tree. Drivers and Windows applications must not access the Enum tree directly. You can view the Enum tree directly by using Registry Editor when you debug drivers.

Source: https://learn.microsoft.com/en-us/windows-hardware/drivers/install/hklm-system-currentcontrolset-enum-registry-tree

You can search for keys as follow:

RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey(@"HKLM\SYSTEM\CurrentControlSet\Enum", true);

foreach (string Keyname in OurKey.GetSubKeyNames())
{
    RegistryKey key = OurKey.OpenSubKey(Keyname);

    MessageBox.Show(key.GetValue("KEY_NAME").ToString()); // Replace KEY_NAME with what you're looking for
} 
Community
  • 1
  • 1
Charlie
  • 1,169
  • 2
  • 16
  • 31