SoundOpenDevicesKey

NTSTATUS
SoundOpenDevicesKey(

   IN PWSTR RegistryPathName,
   OUT PHANDLE DevicesKey
  
);

The SoundOpenDevicesKey function opens the Devices subkey under the specified registry path. If the Devices subkey does not exist, it is created.

Parameters

RegistryPathName

Pointer to a string representing the registry path to the device subkey. Use the path name created by either SoundEnumSubkeys or SoundSaveRegistryPath.

DevicesKey

Address of a location to receive a handle to the Devices subkey.

Return Value

Returns STATUS_SUCCESS if the operation succeeds. Otherwise returns an NTSTATUS error code.

Comments

A driver that calls SoundSaveDeviceName to save a device name in the registry must remove the created \Devices key, along with all device name subkeys, prior to being unloaded. To remove the \Devices key, a driver should:

·Call SoundOpenDevicesKey to obtain a handle to the \Devices key.

·Call ZwDeleteKey to delete the key.

·Call ZwClose to close the key handle.