ReactOS 0.4.15-dev-8064-gdaf8068
format.c File Reference
#include "precomp.h"
Include dependency graph for format.c:

Go to the source code of this file.

Functions

MMRESULT QueryWaveDeviceFormatSupport (IN PSOUND_DEVICE SoundDevice, IN LPWAVEFORMATEX Format, IN DWORD FormatSize)
 
MMRESULT SetWaveDeviceFormat (IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN DWORD DeviceId, IN LPWAVEFORMATEX Format, IN DWORD FormatSize)
 

Function Documentation

◆ QueryWaveDeviceFormatSupport()

MMRESULT QueryWaveDeviceFormatSupport ( IN PSOUND_DEVICE  SoundDevice,
IN LPWAVEFORMATEX  Format,
IN DWORD  FormatSize 
)

Definition at line 14 of file format.c.

18{
22
23 SND_TRACE(L"Querying wave format support\n");
24
27 VALIDATE_MMSYS_PARAMETER( FormatSize >= sizeof(WAVEFORMATEX) );
28
29 Result = GetSoundDeviceType(SoundDevice, &DeviceType);
31
32 /* Ensure we have a wave device (TODO: check if this applies to wavein as well) */
34
35 /* Obtain the function table */
38
39 if ( ! MMSUCCESS(Result) )
41
42 if ( ! FunctionTable->QueryWaveFormatSupport )
44
45 return FunctionTable->QueryWaveFormatSupport(SoundDevice, Format, FormatSize);
46}
DeviceType
Definition: mmdrv.h:42
BOOLEAN IsValidSoundDevice(IN PSOUND_DEVICE SoundDevice)
Definition: devicelist.c:87
#define VALIDATE_MMSYS_PARAMETER(parameter_condition)
Definition: mmebuddy.h:71
MMRESULT GetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, OUT PMMFUNCTION_TABLE *FunctionTable)
Definition: functiontable.c:47
UCHAR MMDEVICE_TYPE
Definition: mmebuddy.h:88
MMRESULT TranslateInternalMmResult(IN MMRESULT Result)
Definition: utility.c:132
MMRESULT GetSoundDeviceType(IN PSOUND_DEVICE SoundDevice, OUT PMMDEVICE_TYPE DeviceType)
Definition: devicelist.c:346
#define MMSUCCESS(result)
Definition: mmebuddy.h:80
#define SND_TRACE(...)
#define SND_ASSERT(condition)
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define L(x)
Definition: ntvdm.h:50
#define IS_WAVE_DEVICE_TYPE(x)
Definition: sndtypes.h:46
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:722
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by MmeOpenDevice().

◆ SetWaveDeviceFormat()

MMRESULT SetWaveDeviceFormat ( IN PSOUND_DEVICE_INSTANCE  SoundDeviceInstance,
IN DWORD  DeviceId,
IN LPWAVEFORMATEX  Format,
IN DWORD  FormatSize 
)

Definition at line 49 of file format.c.

54{
58 PSOUND_DEVICE SoundDevice;
59
60 SND_TRACE(L"Setting wave format\n");
61
63
64 Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice);
65 if ( ! MMSUCCESS(Result) )
67
68 Result = GetSoundDeviceType(SoundDevice, &DeviceType);
71 {
73 VALIDATE_MMSYS_PARAMETER( FormatSize >= sizeof(WAVEFORMATEX) );
74 }
75
76 /* Ensure we have a wave device (TODO: check if this applies to wavein as well) */
78
79 /* Obtain the function table */
82
83 if ( ! MMSUCCESS(Result) )
85
86 if ( ! FunctionTable->SetWaveFormat )
88
89 return FunctionTable->SetWaveFormat(SoundDeviceInstance, DeviceId, Format, FormatSize);
90}
MMRESULT GetSoundDeviceFromInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PSOUND_DEVICE *SoundDevice)
BOOLEAN IsValidSoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
@ WAVE_IN_DEVICE_TYPE
Definition: sndtypes.h:28
@ WAVE_OUT_DEVICE_TYPE
Definition: sndtypes.h:29
#define IS_MIDI_DEVICE_TYPE(x)
Definition: sndtypes.h:49
#define IS_MIXER_DEVICE_TYPE(x)
Definition: sndtypes.h:55

Referenced by MmeOpenDevice().