LOCAL_DEVICE_INFO

typedef struct _LOCAL_DEVICE_INFO {

ULONG Key;

#define LDI_WAVE_IN_KEY (*(ULONG *)"LDWi")

#define LDI_WAVE_OUT_KEY (*(ULONG *)"LDWo")

#define LDI_MIDI_IN_KEY (*(ULONG *)"LDMi")

#define LDI_MIDI_OUT_KEY (*(ULONG *)"LDMo")

#define LDI_AUX_KEY (*(ULONG *)"LDAx")

#define LDI_MIX_KEY (*(ULONG *)"LDMx")

PVOID pGlobalInfo;

UCHAR DeviceType;

UCHAR DeviceNumber;

UCHAR DeviceIndex;

UCHAR CreationFlags;

#define SOUND_CREATION_NO_NAME_RANGE ((UCHAR)0x01)

#define SOUND_CREATION_NO_VOLUME ((UCHAR)0x02)

BOOLEAN PreventVolumeSetting;

UCHAR VolumeControlId;

PSOUND_LINE_NOTIFY LineNotify;

#ifndef SOUNDLIB_NO_OLD_VOLUME

WAVE_DD_VOLUME Volume;

#endif

#ifdef VOLUME_NOTIFY

LIST_ENTRY VolumeQueue;

struct _LOCAL_DEVICE_INFO * MixerDevice;

#endif

#ifdef MASTERVOLUME

BOOLEAN MasterVolume;

#endif

BOOLEAN VolumeChanged;

PVOID DeviceSpecificData;

PVOID HwContext;

ULONG State;

PCSOUND_DEVICE_INIT DeviceInit;

} LOCAL_DEVICE_INFO, *PLOCAL_DEVICE_INFO;

Within soundlib.lib, the LOCAL_DEVICE_INFO structure is used as the device extension for each device object created by IoCreateDevice. Device objects and device extensions are described in the Kernel-Mode Drivers Design Guide. The LOCAL_DEVICE_INFO structure is defined in devices.h. One LOCAL_DEVICE_INFO structure exists for each device created by SoundCreateDevice.

Members

Key

Internal only. Used for debugging. The value is copied from the Key member of SOUND_DEVICE_INIT.

pGlobalInfo

Pointer to a driver-defined structure containing device object-specific data. Specified by the pGDI parameter of SoundCreateDevice.

DeviceType

Copied from the DeviceType member of the SOUND_DEVICE_INIT structure.

DeviceNumber

Contains number to append to the end of the device name. Set to 0xFF within SoundCreateDevice if the SOUND_CREATION_NO_NAME_RANGE flag is specified.

DeviceIndex

For use by the driver. Contains the i parameter specified with SoundCreateDevice.

CreationFlags

Contains flags passed as CreationFlags parameter of SoundCreateDevice.

PreventVolumeSetting

Internal only. Used to prevent volume being shared for devices opened without shared write access. Set by SoundSetShareAccess.

VolumeControlId

Set by SoundSetVolumeControlId.

LineNotify

Address of a driver-supplied function called when a line status changes. The function type is PSOUND_LINE_NOTIFY. Set by SoundSetLineNotify.

Volume

Contains the device's volume setting.

VolumeQueue

IRP queue for SOUND_IOCTL_GET_CHANGED_VOLUME requests not completed.

MixerDevice

If the device object represents a mixer device, this member points to an additional LOCAL_DEVICE_INFO structure for the mixer device. This member must be set by the driver's mixer initialization code. It is not set by soundlib.lib.

MasterVolume

Set if this device is the master volume control device.

VolumeChanged

Internal only. If there is no mixer device, soundlib.lib sets this after a volume change, to indicate that volume settings need to be updated in the registry before system shutdown.

DeviceSpecificData

Contains the value passed as the DeviceSpecificData parameter of SoundCreateDevice.

HwContext

Contains the value passed as the pHw parameter of SoundCreateDevice.

State

Internal only Used by soundlib.lib to store the current device state.

DeviceInit

Contains the value passed as the DeviceInit parameter to SoundCreateDevice.

Comments

Drivers do not allocate LOCAL_DEVICE_INFO structures locally. When a driver calls SoundCreateDevice, a pointer to a DEVICE_OBJECT structure is returned. The structure's DeviceExtension member is used as the device's LOCAL_DEVICE_INFO structure.