ReactOS 0.4.15-dev-7953-g1f49173
devname.h
Go to the documentation of this file.
1/*
2 ReactOS Sound System
3 Device naming & creation helper routines
4
5 Author:
6 Andrew Greenwood (silverblade@reactos.org)
7
8 History:
9 25 May 2008 - Created
10*/
11
12#ifndef ROS_DEVNAME
13#define ROS_DEVNAME
14
15/*
16 ConstructDeviceName
17
18 This takes a wide-character string containing the device name body (for
19 example, "\\Device\\WaveOut") and appends the device index, forming a
20 string like "\\Device\\WaveOut0", and so on.
21
22 The resulting device name is a unicode string.
23*/
24
30
31
32/*
33 FreeUnicodeStringBuffer
34
35 A small helper routine to free a unicode string buffer, nullify the
36 buffer and reset the lengths to zero.
37*/
38
39VOID
41
42
43/*
44 GetDefaultSoundDeviceNameBodies
45
46 Simply accesses the SoundDeviceNameBodies struct defined earlier and
47 fills the DeviceNameBody and DosDeviceNameBody parameters accordingly.
48
49 Basically a "safe" way to access the array and perform two assignments
50 with one call, as this will assign the name and DOS name if a valid
51 DeviceType is passed, otherwise it will fail with STATUS_INVALID_PARAMETER.
52*/
53
57 OUT PCWSTR* DeviceNameBody,
58 OUT PCWSTR* DosDeviceNameBody);
59
60
61/*
62 ConstructSoundDeviceNames
63
64 Given two wide-character strings and a device index, convert these into
65 two unicode strings with the index appended to the end.
66
67 This is intended for converting a device name and a DOS device name at
68 the same time.
69*/
70
73 IN PCWSTR DeviceNameBody,
74 IN PCWSTR DosDeviceNameBody,
76 OUT PUNICODE_STRING FullDeviceName,
77 OUT PUNICODE_STRING FullDosDeviceName);
78
79
80/*
81 CreateSoundDevice
82
83 Creates a device and symbolically-links a DOS device to this. Use this
84 when you want to specify alternative device names to the defaults
85 (eg: "\\Device\\MySoundDev" rather than "\\Device\\WaveOut")
86*/
87
91 IN PCWSTR WideDeviceName,
92 IN PCWSTR WideDosDeviceName,
94 IN ULONG ExtensionSize,
96
97
98/*
99 CreateSoundDeviceWithDefaultName
100
101 Similar to CreateSoundDevice, except this uses the default device names
102 ("\\Device\\WaveOut" etc.) based on the DeviceType parameter.
103*/
104
109 IN UCHAR Index,
110 IN ULONG ExtensionSize,
112
113
114/*
115 DestroySoundDevice
116
117 Destroy a device and its symbolic link
118*/
122 IN PCWSTR WideDosDeviceName,
123 IN UCHAR Index);
124
125
126/*
127 DestroySoundDeviceWithDefaultName
128
129 Similar to DestroySoundDevice, but operating on one of the
130 default device names.
131*/
136 IN UCHAR Index);
137
138#endif
PRTL_UNICODE_STRING_BUFFER Path
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS CreateSoundDeviceWithDefaultName(IN PDRIVER_OBJECT DriverObject, IN UCHAR DeviceType, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject)
Definition: devname.c:349
NTSTATUS CreateSoundDevice(IN PDRIVER_OBJECT DriverObject, IN PCWSTR WideDeviceName, IN PCWSTR WideDosDeviceName, IN UCHAR Index, IN ULONG ExtensionSize, OUT PDEVICE_OBJECT *DeviceObject)
Definition: devname.c:261
NTSTATUS GetDefaultSoundDeviceNameBodies(IN UCHAR DeviceType, OUT PCWSTR *DeviceNameBody, OUT PCWSTR *DosDeviceNameBody)
Definition: devname.c:167
NTSTATUS ConstructDeviceName(IN PCWSTR Path, IN UCHAR Index, OUT PUNICODE_STRING DeviceName)
Definition: devname.c:73
NTSTATUS DestroySoundDevice(IN PDEVICE_OBJECT DeviceObject, IN PCWSTR WideDosDeviceName, IN UCHAR Index)
Definition: devname.c:402
NTSTATUS ConstructSoundDeviceNames(IN PCWSTR DeviceNameBody, IN PCWSTR DosDeviceNameBody, IN UCHAR Index, OUT PUNICODE_STRING FullDeviceName, OUT PUNICODE_STRING FullDosDeviceName)
Definition: devname.c:207
VOID FreeUnicodeStringBuffer(IN PUNICODE_STRING String)
Definition: devname.c:142
NTSTATUS DestroySoundDeviceWithDefaultName(IN PDEVICE_OBJECT DeviceObject, IN UCHAR DeviceType, IN UCHAR Index)
Definition: devname.c:445
DeviceType
Definition: mmdrv.h:42
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
unsigned char UCHAR
Definition: xmlstorage.h:181