Go to the source code of this file.
|
NTSTATUS | ConstructDeviceName (IN PCWSTR Path, IN UCHAR Index, OUT PUNICODE_STRING DeviceName) |
|
VOID | FreeUnicodeStringBuffer (IN PUNICODE_STRING String) |
|
NTSTATUS | GetDefaultSoundDeviceNameBodies (IN UCHAR DeviceType, OUT PCWSTR *DeviceNameBody, OUT PCWSTR *DosDeviceNameBody) |
|
NTSTATUS | ConstructSoundDeviceNames (IN PCWSTR DeviceNameBody, IN PCWSTR DosDeviceNameBody, IN UCHAR Index, OUT PUNICODE_STRING FullDeviceName, OUT PUNICODE_STRING FullDosDeviceName) |
|
NTSTATUS | CreateSoundDevice (IN PDRIVER_OBJECT DriverObject, IN PCWSTR WideDeviceName, IN PCWSTR WideDosDeviceName, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject) |
|
NTSTATUS | CreateSoundDeviceWithDefaultName (IN PDRIVER_OBJECT DriverObject, IN UCHAR DeviceType, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject) |
|
NTSTATUS | DestroySoundDevice (IN PDEVICE_OBJECT DeviceObject, IN PCWSTR WideDosDeviceName, IN UCHAR Index) |
|
NTSTATUS | DestroySoundDeviceWithDefaultName (IN PDEVICE_OBJECT DeviceObject, IN UCHAR DeviceType, IN UCHAR Index) |
|
◆ ConstructDeviceName()
Definition at line 73 of file devname.c.
80 WCHAR IndexStringBuffer[5];
87 DPRINT(
"Unexpected NULL parameter");
103 sizeof(IndexStringBuffer) +
112 DPRINT(
"Couldn't allocate memory for device name string");
120 UnicodeIndex.
Buffer = IndexStringBuffer;
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_INVALID_PARAMETER
IN PVOID IN PVOID IN USHORT IN USHORT Size
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
_In_ WDFCOLLECTION _In_ ULONG Index
#define SOUND_MAX_DEVICES
#define ExAllocatePool(type, size)
PRTL_UNICODE_STRING_BUFFER Path
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
Referenced by ConstructSoundDeviceNames(), and DestroySoundDevice().
◆ ConstructSoundDeviceNames()
Definition at line 207 of file devname.c.
217 if ( ( ! DeviceNameBody ) || ( ! DosDeviceNameBody ) ||
218 ( ! FullDeviceName ) || ( ! FullDosDeviceName ) )
220 DPRINT(
"Unexpected NULL parameter");
#define STATUS_INVALID_PARAMETER
VOID FreeUnicodeStringBuffer(IN PUNICODE_STRING String)
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
#define SOUND_MAX_DEVICES
NTSTATUS ConstructDeviceName(IN PCWSTR Path, IN UCHAR Index, OUT PUNICODE_STRING DeviceName)
Referenced by CreateSoundDevice().
◆ CreateSoundDevice()
Definition at line 261 of file devname.c.
276 ( ! WideDeviceName ) || ( ! WideDosDeviceName ) )
278 DPRINT(
"Unexpected NULL parameter");
#define STATUS_INVALID_PARAMETER
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
VOID FreeUnicodeStringBuffer(IN PUNICODE_STRING String)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
static char DosDeviceName[DEVICE_SIZE]
#define SOUND_MAX_DEVICES
NTSTATUS ConstructSoundDeviceNames(IN PCWSTR DeviceNameBody, IN PCWSTR DosDeviceNameBody, IN UCHAR Index, OUT PUNICODE_STRING FullDeviceName, OUT PUNICODE_STRING FullDosDeviceName)
#define FILE_DEVICE_SOUND
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Referenced by CreateSoundDeviceWithDefaultName().
◆ CreateSoundDeviceWithDefaultName()
Definition at line 349 of file devname.c.
363 DPRINT(
"Unexpected NULL parameter");
#define STATUS_INVALID_PARAMETER
NTSTATUS CreateSoundDevice(IN PDRIVER_OBJECT DriverObject, IN PCWSTR WideDeviceName, IN PCWSTR WideDosDeviceName, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject)
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
#define SOUND_MAX_DEVICES
NTSTATUS GetDefaultSoundDeviceNameBodies(IN UCHAR DeviceType, OUT PCWSTR *DeviceNameBody, OUT PCWSTR *DosDeviceNameBody)
◆ DestroySoundDevice()
Definition at line 402 of file devname.c.
413 DPRINT(
"Unexpected NULL parameter");
434 DPRINT(
"Status of symlink deletion is 0x%08x\n",
Status);
#define STATUS_INVALID_PARAMETER
NTSTATUS NTAPI IoDeleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName)
_In_ PDEVICE_OBJECT DeviceObject
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
static char DosDeviceName[DEVICE_SIZE]
#define SOUND_MAX_DEVICES
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS ConstructDeviceName(IN PCWSTR Path, IN UCHAR Index, OUT PUNICODE_STRING DeviceName)
Referenced by DestroySoundDeviceWithDefaultName().
◆ DestroySoundDeviceWithDefaultName()
Definition at line 445 of file devname.c.
456 DPRINT(
"Unexpected NULL parameter");
477 DPRINT(
"DOS device name at %p\n", WideDosDeviceName);
479 DPRINT(
"DOS device name is based on %ws\n", WideDosDeviceName);
#define STATUS_INVALID_PARAMETER
_In_ PDEVICE_OBJECT DeviceObject
#define NT_SUCCESS(StatCode)
_In_ WDFCOLLECTION _In_ ULONG Index
#define SOUND_MAX_DEVICES
NTSTATUS DestroySoundDevice(IN PDEVICE_OBJECT DeviceObject, IN PCWSTR WideDosDeviceName, IN UCHAR Index)
NTSTATUS GetDefaultSoundDeviceNameBodies(IN UCHAR DeviceType, OUT PCWSTR *DeviceNameBody, OUT PCWSTR *DosDeviceNameBody)
◆ FreeUnicodeStringBuffer()
◆ GetDefaultSoundDeviceNameBodies()