SoundSaveDeviceName

NTSTATUS
SoundSaveDeviceName(
IN PWSTR
RegistryPathName,
IN PLOCAL_DEVICE_INFO
pLDI
);

The SoundSaveDeviceName function writes a device's name and type into the registry.

Parameters

RegistryPathName

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

pLDI

Pointer to the device's LOCAL_DEVICE_INFO structure.

Return Value

Returns one of the following values.

Value Definition
STATUS_SUCCESS Success.
STATUS_INSUFFICIENT_RESOURCES Couldn't create a device name.

Comments

Under the specified registry path, the SoundSaveDeviceName function locates the \Devices subkey. Under this subkey, the function uses the device's name as a value name and uses the device's type as the value to associate with the name. The function creates a device name from the PrototypeName member of the device's SOUND_DEVICE_INIT structure. It obtains the device type from the DeviceType member of the passed LOCAL_DEVICE_INFO structure.

After the function is called, the registry should contain the entry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DriverName\Parameters\DeviceNumber\Devices\DeviceName, where the value of DeviceName is the device type.

Drivers that call SoundSaveDeviceName must remove the saved device name from the registry prior to being unloaded. Refer to SoundOpenDevicesKey.