SetupDiOpenDeviceInterfaceRegKey function

The SetupDiOpenDeviceInterfaceRegKey function opens the registry subkey that is used by applications and drivers to store information that is specific to a device interface.

Syntax


HKEY SetupDiOpenDeviceInterfaceRegKey(
  _In_       HDEVINFO                  DeviceInfoSet,
  _In_       PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  _Reserved_ DWORD                     Reserved,
  _In_       REGSAM                    samDesired
);

Parameters

DeviceInfoSet [in]

A pointer to a device information set that contains the device interface for which to open a registry subkey.

DeviceInterfaceData [in]

A pointer to an SP_DEVICE_INTERFACE_DATA structure that specifies the device interface. This pointer can be returned by SetupDiCreateDeviceInterface or SetupDiEnumDeviceInterfaces.

Reserved

Reserved. Must be zero.

samDesired [in]

The requested registry security access to the registry subkey. For information about registry security access values of type REGSAM, see the Microsoft Windows SDK documentation.

Return value

SetupDiOpenDeviceInterfaceRegKey returns a handle to the opened registry key. If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

Depending on the value that is passed in the samDesired parameter, it might be necessary for the caller of this function to be a member of the Administrators group.

Close the handle returned from by function by calling RegCloseKey.

Requirements

Target platform

For universal, call CM_Open_Device_Interface_Key

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

DLL

Setupapi.dll

See also

SetupDiCreateDeviceInterface
SetupDiCreateDeviceInterfaceRegKey
SetupDiEnumDeviceInterfaces

 

 

Send comments about this topic to Microsoft

Show: