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.
77{
80 WCHAR IndexStringBuffer[5];
83
84
86 {
87 DPRINT(
"Unexpected NULL parameter");
89 }
90
91
93 {
96 }
97
98
100
101
103 sizeof(IndexStringBuffer) +
105
106
109
111 {
112 DPRINT(
"Couldn't allocate memory for device name string");
114 }
115
116
118
119
120 UnicodeIndex.
Buffer = IndexStringBuffer;
122
125
126
129
131}
PRTL_UNICODE_STRING_BUFFER Path
#define ExAllocatePool(type, size)
#define SOUND_MAX_DEVICES
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Referenced by ConstructSoundDeviceNames(), and DestroySoundDevice().
◆ ConstructSoundDeviceNames()
Definition at line 207 of file devname.c.
213{
215
216
217 if ( ( ! DeviceNameBody ) || ( ! DosDeviceNameBody ) ||
218 ( ! FullDeviceName ) || ( ! FullDosDeviceName ) )
219 {
220 DPRINT(
"Unexpected NULL parameter");
222 }
223
224
226 {
229 }
230
232
234 {
235
237 }
238
240
242 {
243
246 }
247
249}
NTSTATUS ConstructDeviceName(IN PCWSTR Path, IN UCHAR Index, OUT PUNICODE_STRING DeviceName)
VOID FreeUnicodeStringBuffer(IN PUNICODE_STRING String)
#define NT_SUCCESS(StatCode)
Referenced by CreateSoundDevice().
◆ CreateSoundDevice()
Definition at line 261 of file devname.c.
268{
270
273
274
276 ( ! WideDeviceName ) || ( ! WideDosDeviceName ) )
277 {
278 DPRINT(
"Unexpected NULL parameter");
280 }
281
282
284 {
287 }
288
289
291 WideDosDeviceName,
295
297 {
299 }
300
302
303
308 0,
311
313 {
314
317
319 }
320
322
323
325
327 {
329
330
333
335 }
336
338}
NTSTATUS ConstructSoundDeviceNames(IN PCWSTR DeviceNameBody, IN PCWSTR DosDeviceNameBody, IN UCHAR Index, OUT PUNICODE_STRING FullDeviceName, OUT PUNICODE_STRING FullDosDeviceName)
static char DosDeviceName[DEVICE_SIZE]
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)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
#define FILE_DEVICE_SOUND
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Referenced by CreateSoundDeviceWithDefaultName().
◆ CreateSoundDeviceWithDefaultName()
Definition at line 349 of file devname.c.
355{
359
360
362 {
363 DPRINT(
"Unexpected NULL parameter");
365 }
366
367
369 {
372 }
373
374
376 &WideDeviceName,
377 &WideDosDeviceName);
378
380 {
382 }
383
384
386 WideDeviceName,
387 WideDosDeviceName,
391
393 {
394
396 }
397
399}
NTSTATUS CreateSoundDevice(IN PDRIVER_OBJECT DriverObject, IN PCWSTR WideDeviceName, IN PCWSTR WideDosDeviceName, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject)
NTSTATUS GetDefaultSoundDeviceNameBodies(IN UCHAR DeviceType, OUT PCWSTR *DeviceNameBody, OUT PCWSTR *DosDeviceNameBody)
◆ DestroySoundDevice()
Definition at line 402 of file devname.c.
406{
409
410
412 {
413 DPRINT(
"Unexpected NULL parameter");
415 }
416
417
419 {
422 }
423
425
427 {
429 }
430
432
434 DPRINT(
"Status of symlink deletion is 0x%08x\n",
Status);
435
436
437
438
440
442}
NTSTATUS NTAPI IoDeleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName)
Referenced by DestroySoundDeviceWithDefaultName().
◆ DestroySoundDeviceWithDefaultName()
Definition at line 445 of file devname.c.
449{
452
453
455 {
456 DPRINT(
"Unexpected NULL parameter");
458 }
459
460
462 {
465 }
466
467
470 &WideDosDeviceName);
471
473 {
475 }
476
477 DPRINT(
"DOS device name at %p\n", WideDosDeviceName);
478
479 DPRINT(
"DOS device name is based on %ws\n", WideDosDeviceName);
480
482}
NTSTATUS DestroySoundDevice(IN PDEVICE_OBJECT DeviceObject, IN PCWSTR WideDosDeviceName, IN UCHAR Index)
◆ FreeUnicodeStringBuffer()
◆ GetDefaultSoundDeviceNameBodies()