Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendevname.h
Go to the documentation of this file.
00001 /* 00002 ReactOS Sound System 00003 Device naming & creation helper routines 00004 00005 Author: 00006 Andrew Greenwood (silverblade@reactos.org) 00007 00008 History: 00009 25 May 2008 - Created 00010 */ 00011 00012 #ifndef ROS_DEVNAME 00013 #define ROS_DEVNAME 00014 00015 /* 00016 ConstructDeviceName 00017 00018 This takes a wide-character string containing the device name body (for 00019 example, "\\Device\\WaveOut") and appends the device index, forming a 00020 string like "\\Device\\WaveOut0", and so on. 00021 00022 The resulting device name is a unicode string. 00023 */ 00024 00025 NTSTATUS 00026 ConstructDeviceName( 00027 IN PCWSTR Path, 00028 IN UCHAR Index, 00029 OUT PUNICODE_STRING DeviceName); 00030 00031 00032 /* 00033 FreeUnicodeStringBuffer 00034 00035 A small helper routine to free a unicode string buffer, nullify the 00036 buffer and reset the lengths to zero. 00037 */ 00038 00039 VOID 00040 FreeUnicodeStringBuffer(IN PUNICODE_STRING String); 00041 00042 00043 /* 00044 GetDefaultSoundDeviceNameBodies 00045 00046 Simply accesses the SoundDeviceNameBodies struct defined earlier and 00047 fills the DeviceNameBody and DosDeviceNameBody parameters accordingly. 00048 00049 Basically a "safe" way to access the array and perform two assignments 00050 with one call, as this will assign the name and DOS name if a valid 00051 DeviceType is passed, otherwise it will fail with STATUS_INVALID_PARAMETER. 00052 */ 00053 00054 NTSTATUS 00055 GetDefaultSoundDeviceNameBodies( 00056 IN UCHAR DeviceType, 00057 OUT PCWSTR* DeviceNameBody, 00058 OUT PCWSTR* DosDeviceNameBody); 00059 00060 00061 /* 00062 ConstructSoundDeviceNames 00063 00064 Given two wide-character strings and a device index, convert these into 00065 two unicode strings with the index appended to the end. 00066 00067 This is intended for converting a device name and a DOS device name at 00068 the same time. 00069 */ 00070 00071 NTSTATUS 00072 ConstructSoundDeviceNames( 00073 IN PCWSTR DeviceNameBody, 00074 IN PCWSTR DosDeviceNameBody, 00075 IN UCHAR Index, 00076 OUT PUNICODE_STRING FullDeviceName, 00077 OUT PUNICODE_STRING FullDosDeviceName); 00078 00079 00080 /* 00081 CreateSoundDevice 00082 00083 Creates a device and symbolically-links a DOS device to this. Use this 00084 when you want to specify alternative device names to the defaults 00085 (eg: "\\Device\\MySoundDev" rather than "\\Device\\WaveOut") 00086 */ 00087 00088 NTSTATUS 00089 CreateSoundDevice( 00090 IN PDRIVER_OBJECT DriverObject, 00091 IN PCWSTR WideDeviceName, 00092 IN PCWSTR WideDosDeviceName, 00093 IN UCHAR Index, 00094 IN ULONG ExtensionSize, 00095 OUT PDEVICE_OBJECT* DeviceObject); 00096 00097 00098 /* 00099 CreateSoundDeviceWithDefaultName 00100 00101 Similar to CreateSoundDevice, except this uses the default device names 00102 ("\\Device\\WaveOut" etc.) based on the DeviceType parameter. 00103 */ 00104 00105 NTSTATUS 00106 CreateSoundDeviceWithDefaultName( 00107 IN PDRIVER_OBJECT DriverObject, 00108 IN UCHAR DeviceType, 00109 IN UCHAR Index, 00110 IN ULONG ExtensionSize, 00111 OUT PDEVICE_OBJECT* DeviceObject); 00112 00113 00114 /* 00115 DestroySoundDevice 00116 00117 Destroy a device and its symbolic link 00118 */ 00119 NTSTATUS 00120 DestroySoundDevice( 00121 IN PDEVICE_OBJECT DeviceObject, 00122 IN PCWSTR WideDosDeviceName, 00123 IN UCHAR Index); 00124 00125 00126 /* 00127 DestroySoundDeviceWithDefaultName 00128 00129 Similar to DestroySoundDevice, but operating on one of the 00130 default device names. 00131 */ 00132 NTSTATUS 00133 DestroySoundDeviceWithDefaultName( 00134 IN PDEVICE_OBJECT DeviceObject, 00135 IN UCHAR DeviceType, 00136 IN UCHAR Index); 00137 00138 #endif Generated on Sat May 26 2012 04:32:04 for ReactOS by
1.7.6.1
|