ReactOS  0.4.15-dev-5461-g062a8f2
shared.h File Reference
#include <portcls.h>
#include <stdunk.h>
#include "ichreg.h"
#include "ac97reg.h"
#include "debug.h"
Include dependency graph for shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PC_IMPLEMENTATION   1
 
#define WIN9X_COMPAT_SPINLOCK
 
#define GZCALL
 

Typedefs

typedef IAC97MiniportTopology * PAC97MINIPORTTOPOLOGY
 
typedef IAC97AdapterCommon * PADAPTERCOMMON
 

Enumerations

enum  TopoPinConfig {
  PINC_PCBEEP_PRESENT = 0, PINC_PHONE_PRESENT, PINC_MIC2_PRESENT, PINC_VIDEO_PRESENT,
  PINC_AUX_PRESENT, PINC_HPOUT_PRESENT, PINC_MONOOUT_PRESENT, PINC_MICIN_PRESENT,
  PINC_MIC_PRESENT, PINC_LINEIN_PRESENT, PINC_CD_PRESENT, PINC_SURROUND_PRESENT,
  PINC_CENTER_LFE_PRESENT, PINC_TOP_ELEMENT
}
 
enum  TopoNodeConfig {
  NODEC_3D_PRESENT = 0, NODEC_TONE_PRESENT, NODEC_LOUDNESS_PRESENT, NODEC_SIMUL_STEREO_PRESENT,
  NODEC_6BIT_MASTER_VOLUME, NODEC_6BIT_HPOUT_VOLUME, NODEC_6BIT_MONOOUT_VOLUME, NODEC_6BIT_SURROUND_VOLUME,
  NODEC_6BIT_CENTER_LFE_VOLUME, NODEC_3D_CENTER_ADJUSTABLE, NODEC_3D_DEPTH_ADJUSTABLE, NODEC_PCM_VARIABLERATE_SUPPORTED,
  NODEC_PCM_VSR_INDEPENDENT_RATES, NODEC_PCM_DOUBLERATE_SUPPORTED, NODEC_MIC_VARIABLERATE_SUPPORTED, NODEC_CENTER_DAC_PRESENT,
  NODEC_SURROUND_DAC_PRESENT, NODEC_LFE_DAC_PRESENT, NODEC_TOP_ELEMENT
}
 
enum  TopoPins {
  PIN_WAVEOUT_SOURCE = 0, PIN_PCBEEP_SOURCE, PIN_PHONE_SOURCE, PIN_MIC_SOURCE,
  PIN_LINEIN_SOURCE, PIN_CD_SOURCE, PIN_VIDEO_SOURCE, PIN_AUX_SOURCE,
  PIN_VIRT_3D_CENTER_SOURCE, PIN_VIRT_3D_DEPTH_SOURCE, PIN_VIRT_3D_MIX_MONO_SOURCE, PIN_VIRT_TONE_MIX_SOURCE,
  PIN_VIRT_TONE_MIX_MONO_SOURCE, PIN_VIRT_SURROUND_SOURCE, PIN_VIRT_CENTER_SOURCE, PIN_VIRT_LFE_SOURCE,
  PIN_VIRT_FRONT_SOURCE, PIN_MASTEROUT_DEST, PIN_HPOUT_SOURCE, PIN_MONOOUT_DEST,
  PIN_WAVEIN_DEST, PIN_MICIN_DEST, PIN_TOP_ELEMENT, PIN_INVALID
}
 
enum  TopoNodes {
  NODE_WAVEOUT_VOLUME = 0, NODE_WAVEOUT_MUTE, NODE_VIRT_WAVEOUT_3D_BYPASS, NODE_PCBEEP_VOLUME,
  NODE_PCBEEP_MUTE, NODE_PHONE_VOLUME, NODE_PHONE_MUTE, NODE_MIC_SELECT,
  NODE_MIC_BOOST, NODE_MIC_VOLUME, NODE_MIC_MUTE, NODE_LINEIN_VOLUME,
  NODE_LINEIN_MUTE, NODE_CD_VOLUME, NODE_CD_MUTE, NODE_VIDEO_VOLUME,
  NODE_VIDEO_MUTE, NODE_AUX_VOLUME, NODE_AUX_MUTE, NODE_MAIN_MIX,
  NODE_VIRT_3D_CENTER, NODE_VIRT_3D_DEPTH, NODE_VIRT_3D_ENABLE, NODE_BEEP_MIX,
  NODE_BASS, NODE_TREBLE, NODE_LOUDNESS, NODE_SIMUL_STEREO,
  NODE_MASTEROUT_VOLUME, NODE_MASTEROUT_MUTE, NODE_HPOUT_VOLUME, NODE_HPOUT_MUTE,
  NODE_MONOOUT_SELECT, NODE_VIRT_MONOOUT_VOLUME1, NODE_VIRT_MONOOUT_VOLUME2, NODE_WAVEIN_SELECT,
  NODE_VIRT_MASTER_INPUT_VOLUME1, NODE_VIRT_MASTER_INPUT_VOLUME2, NODE_VIRT_MASTER_INPUT_VOLUME3, NODE_VIRT_MASTER_INPUT_VOLUME4,
  NODE_VIRT_MASTER_INPUT_VOLUME5, NODE_VIRT_MASTER_INPUT_VOLUME6, NODE_VIRT_MASTER_INPUT_VOLUME7, NODE_VIRT_MASTER_INPUT_VOLUME8,
  NODE_MICIN_VOLUME, NODE_MICIN_MUTE, NODE_SURROUND_VOLUME, NODE_SURROUND_MUTE,
  NODE_CENTER_VOLUME, NODE_CENTER_MUTE, NODE_LFE_VOLUME, NODE_LFE_MUTE,
  NODE_FRONT_VOLUME, NODE_FRONT_MUTE, NODE_VIRT_MASTERMONO_VOLUME, NODE_VIRT_MASTERMONO_MUTE,
  NODE_TOP_ELEMENT, NODE_INVALID
}
 
enum  WavePins {
  PIN_WAVEOUT = 0, PIN_WAVEOUT_BRIDGE, PIN_WAVEIN, PIN_WAVEIN_BRIDGE,
  PIN_MICIN, PIN_MICIN_BRIDGE
}
 
enum  WaveNodes { NODE_WAVEOUT_DAC, NODE_WAVEIN_ADC, NODE_MICIN_ADC }
 

Functions

NTSTATUS NewAdapterCommon (OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, _When_((PoolType &NonPagedPoolMustSucceed) !=0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) IN POOL_TYPE PoolType)
 
 DECLARE_INTERFACE_ (IAC97MiniportTopology, IMiniportTopology)
 
 DECLARE_INTERFACE_ (IAC97AdapterCommon, IUnknown)
 
 DEFINE_GUID (IID_IAC97AdapterCommon, 0x77481fa0, 0x1ef2, 0x11d2, 0x88, 0x3a, 0x0, 0x80, 0xc7, 0x65, 0x64, 0x7d)
 
 DEFINE_GUID (IID_IAC97MiniportTopology, 0x245ae964, 0x49c8, 0x11d2, 0x95, 0xd7, 0x0, 0xc0, 0x4f, 0xb9, 0x25, 0xd3)
 

Variables

const ULONG PoolTag = '79CA'
 

Macro Definition Documentation

◆ GZCALL

#define GZCALL

Definition at line 46 of file shared.h.

◆ PC_IMPLEMENTATION

#define PC_IMPLEMENTATION   1

Definition at line 13 of file shared.h.

◆ WIN9X_COMPAT_SPINLOCK

#define WIN9X_COMPAT_SPINLOCK

Definition at line 18 of file shared.h.

Typedef Documentation

◆ PAC97MINIPORTTOPOLOGY

typedef IAC97MiniportTopology* PAC97MINIPORTTOPOLOGY

Definition at line 378 of file shared.h.

◆ PADAPTERCOMMON

typedef IAC97AdapterCommon* PADAPTERCOMMON

Definition at line 486 of file shared.h.

Enumeration Type Documentation

◆ TopoNodeConfig

Enumerator
NODEC_3D_PRESENT 
NODEC_TONE_PRESENT 
NODEC_LOUDNESS_PRESENT 
NODEC_SIMUL_STEREO_PRESENT 
NODEC_6BIT_MASTER_VOLUME 
NODEC_6BIT_HPOUT_VOLUME 
NODEC_6BIT_MONOOUT_VOLUME 
NODEC_6BIT_SURROUND_VOLUME 
NODEC_6BIT_CENTER_LFE_VOLUME 
NODEC_3D_CENTER_ADJUSTABLE 
NODEC_3D_DEPTH_ADJUSTABLE 
NODEC_PCM_VARIABLERATE_SUPPORTED 
NODEC_PCM_VSR_INDEPENDENT_RATES 
NODEC_PCM_DOUBLERATE_SUPPORTED 
NODEC_MIC_VARIABLERATE_SUPPORTED 
NODEC_CENTER_DAC_PRESENT 
NODEC_SURROUND_DAC_PRESENT 
NODEC_LFE_DAC_PRESENT 
NODEC_TOP_ELEMENT 

Definition at line 83 of file shared.h.

84 {
85  NODEC_3D_PRESENT = 0,
103  NODEC_TOP_ELEMENT // number of NODES's
104 };

◆ TopoNodes

Enumerator
NODE_WAVEOUT_VOLUME 
NODE_WAVEOUT_MUTE 
NODE_VIRT_WAVEOUT_3D_BYPASS 
NODE_PCBEEP_VOLUME 
NODE_PCBEEP_MUTE 
NODE_PHONE_VOLUME 
NODE_PHONE_MUTE 
NODE_MIC_SELECT 
NODE_MIC_BOOST 
NODE_MIC_VOLUME 
NODE_MIC_MUTE 
NODE_LINEIN_VOLUME 
NODE_LINEIN_MUTE 
NODE_CD_VOLUME 
NODE_CD_MUTE 
NODE_VIDEO_VOLUME 
NODE_VIDEO_MUTE 
NODE_AUX_VOLUME 
NODE_AUX_MUTE 
NODE_MAIN_MIX 
NODE_VIRT_3D_CENTER 
NODE_VIRT_3D_DEPTH 
NODE_VIRT_3D_ENABLE 
NODE_BEEP_MIX 
NODE_BASS 
NODE_TREBLE 
NODE_LOUDNESS 
NODE_SIMUL_STEREO 
NODE_MASTEROUT_VOLUME 
NODE_MASTEROUT_MUTE 
NODE_HPOUT_VOLUME 
NODE_HPOUT_MUTE 
NODE_MONOOUT_SELECT 
NODE_VIRT_MONOOUT_VOLUME1 
NODE_VIRT_MONOOUT_VOLUME2 
NODE_WAVEIN_SELECT 
NODE_VIRT_MASTER_INPUT_VOLUME1 
NODE_VIRT_MASTER_INPUT_VOLUME2 
NODE_VIRT_MASTER_INPUT_VOLUME3 
NODE_VIRT_MASTER_INPUT_VOLUME4 
NODE_VIRT_MASTER_INPUT_VOLUME5 
NODE_VIRT_MASTER_INPUT_VOLUME6 
NODE_VIRT_MASTER_INPUT_VOLUME7 
NODE_VIRT_MASTER_INPUT_VOLUME8 
NODE_MICIN_VOLUME 
NODE_MICIN_MUTE 
NODE_SURROUND_VOLUME 
NODE_SURROUND_MUTE 
NODE_CENTER_VOLUME 
NODE_CENTER_MUTE 
NODE_LFE_VOLUME 
NODE_LFE_MUTE 
NODE_FRONT_VOLUME 
NODE_FRONT_MUTE 
NODE_VIRT_MASTERMONO_VOLUME 
NODE_VIRT_MASTERMONO_MUTE 
NODE_TOP_ELEMENT 
NODE_INVALID 

Definition at line 185 of file shared.h.

186 {
189  NODE_VIRT_WAVEOUT_3D_BYPASS, // exposed as AGC control
201  NODE_CD_MUTE,
207  NODE_VIRT_3D_CENTER, // we have no 3D control type, so we
208  NODE_VIRT_3D_DEPTH, // expose 2 volume controls and 2 mute
209  NODE_VIRT_3D_ENABLE, // checkboxs (the other is bypass).
211  NODE_BASS,
212  NODE_TREBLE,
220  NODE_VIRT_MONOOUT_VOLUME1, // each mono out must have volume
223  NODE_VIRT_MASTER_INPUT_VOLUME1, // boy, each master input must have a
241  NODE_VIRT_MASTERMONO_VOLUME, // used for multichannel or headphone
243  NODE_TOP_ELEMENT, // number of nodes
245 };

◆ TopoPinConfig

Enumerator
PINC_PCBEEP_PRESENT 
PINC_PHONE_PRESENT 
PINC_MIC2_PRESENT 
PINC_VIDEO_PRESENT 
PINC_AUX_PRESENT 
PINC_HPOUT_PRESENT 
PINC_MONOOUT_PRESENT 
PINC_MICIN_PRESENT 
PINC_MIC_PRESENT 
PINC_LINEIN_PRESENT 
PINC_CD_PRESENT 
PINC_SURROUND_PRESENT 
PINC_CENTER_LFE_PRESENT 
PINC_TOP_ELEMENT 

Definition at line 61 of file shared.h.

◆ TopoPins

Enumerator
PIN_WAVEOUT_SOURCE 
PIN_PCBEEP_SOURCE 
PIN_PHONE_SOURCE 
PIN_MIC_SOURCE 
PIN_LINEIN_SOURCE 
PIN_CD_SOURCE 
PIN_VIDEO_SOURCE 
PIN_AUX_SOURCE 
PIN_VIRT_3D_CENTER_SOURCE 
PIN_VIRT_3D_DEPTH_SOURCE 
PIN_VIRT_3D_MIX_MONO_SOURCE 
PIN_VIRT_TONE_MIX_SOURCE 
PIN_VIRT_TONE_MIX_MONO_SOURCE 
PIN_VIRT_SURROUND_SOURCE 
PIN_VIRT_CENTER_SOURCE 
PIN_VIRT_LFE_SOURCE 
PIN_VIRT_FRONT_SOURCE 
PIN_MASTEROUT_DEST 
PIN_HPOUT_SOURCE 
PIN_MONOOUT_DEST 
PIN_WAVEIN_DEST 
PIN_MICIN_DEST 
PIN_TOP_ELEMENT 
PIN_INVALID 

Definition at line 111 of file shared.h.

112 {
113  // Source is something that goes into the AC97, dest goes out.
114  PIN_WAVEOUT_SOURCE = 0,
136  PIN_TOP_ELEMENT, // number of pins
138 };

◆ WaveNodes

Enumerator
NODE_WAVEOUT_DAC 
NODE_WAVEIN_ADC 
NODE_MICIN_ADC 

Definition at line 329 of file shared.h.

◆ WavePins

Enumerator
PIN_WAVEOUT 
PIN_WAVEOUT_BRIDGE 
PIN_WAVEIN 
PIN_WAVEIN_BRIDGE 
PIN_MICIN 
PIN_MICIN_BRIDGE 

Definition at line 316 of file shared.h.

Function Documentation

◆ DECLARE_INTERFACE_() [1/2]

DECLARE_INTERFACE_ ( IAC97MiniportTopology  ,
IMiniportTopology   
)

Definition at line 365 of file shared.h.

366 {
367  STDMETHOD_(NTSTATUS,GetPhysicalConnectionPins)
368  ( THIS_
369  OUT PULONG WaveOutSource,
370  OUT PULONG WaveInDest,
371  OUT PULONG MicInDest
372  ) PURE;
373  // Used for DRM:
374  STDMETHOD_(void, SetCopyProtectFlag)
375  ( THIS_
376  IN BOOL
377  ) PURE;
378 };
#define IN
Definition: typedefs.h:39
#define THIS_
Definition: basetyps.h:65
LONG NTSTATUS
Definition: precomp.h:26
#define BOOL
Definition: nt_native.h:43
unsigned int * PULONG
Definition: retypes.h:1
#define PURE
Definition: basetyps.h:64
#define OUT
Definition: typedefs.h:40
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [2/2]

DECLARE_INTERFACE_ ( IAC97AdapterCommon  ,
IUnknown   
)

Definition at line 387 of file shared.h.

388 {
390  ( THIS_
393  ) PURE;
394  STDMETHOD_(BOOL,GetPinConfig)
395  ( THIS_
397  ) PURE;
398  STDMETHOD_(void,SetPinConfig)
399  ( THIS_
401  IN BOOL
402  ) PURE;
403  STDMETHOD_(BOOL,GetNodeConfig)
404  ( THIS_
406  ) PURE;
407  STDMETHOD_(void,SetNodeConfig)
408  ( THIS_
410  IN BOOL
411  ) PURE;
412  STDMETHOD_(AC97Register,GetNodeReg)
413  ( THIS_
414  IN TopoNodes
415  ) PURE;
416  STDMETHOD_(WORD,GetNodeMask)
417  ( THIS_
418  IN TopoNodes
419  ) PURE;
420  STDMETHOD_(NTSTATUS,ReadCodecRegister)
421  ( THIS_
423  _Out_ OUT PWORD wData
424  ) PURE;
425  STDMETHOD_(NTSTATUS,WriteCodecRegister)
426  ( THIS_
428  _In_ IN WORD wData,
429  _In_ IN WORD wMask
430  ) PURE;
431  STDMETHOD_(UCHAR,ReadBMControlRegister8)
432  ( THIS_
433  IN ULONG Offset
434  ) PURE;
435  STDMETHOD_(USHORT,ReadBMControlRegister16)
436  ( THIS_
437  IN ULONG Offset
438  ) PURE;
439  STDMETHOD_(ULONG,ReadBMControlRegister32)
440  ( THIS_
441  IN ULONG Offset
442  ) PURE;
443  STDMETHOD_(void,WriteBMControlRegister)
444  ( THIS_
445  IN ULONG Offset,
446  IN UCHAR Value
447  ) PURE;
448  STDMETHOD_(void,WriteBMControlRegister)
449  ( THIS_
450  IN ULONG Offset,
451  IN USHORT Value
452  ) PURE;
453  STDMETHOD_(void,WriteBMControlRegister)
454  ( THIS_
455  IN ULONG Offset,
456  IN ULONG Value
457  ) PURE;
458  STDMETHOD_(NTSTATUS, RestoreCodecRegisters)
459  ( THIS_
460  void
461  ) PURE;
462  STDMETHOD_(NTSTATUS, ProgramSampleRate)
463  ( THIS_
464  IN AC97Register Register,
465  IN DWORD dwSampleRate
466  ) PURE;
467  // Used for DRM:
468  STDMETHOD_(void, SetMiniportTopology)
469  ( THIS_
471  ) PURE;
472  STDMETHOD_(PAC97MINIPORTTOPOLOGY, GetMiniportTopology)
473  ( THIS_
474  void
475  ) PURE;
476  // These are used by the wave miniport.
477  STDMETHOD_(void, ReadChannelConfigDefault)
478  ( THIS_
479  PDWORD pwChannelConfig,
480  PWORD pwChannels
481  ) PURE;
482  STDMETHOD_(void, WriteChannelConfigDefault)
483  ( THIS_
484  DWORD dwChannelConfig
485  ) PURE;
486 };
#define IN
Definition: typedefs.h:39
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define _In_range_(lb, ub)
Definition: ms_sal.h:571
#define THIS_
Definition: basetyps.h:65
#define _Out_
Definition: ms_sal.h:345
TopoPinConfig
Definition: shared.h:61
LONG NTSTATUS
Definition: precomp.h:26
#define BOOL
Definition: nt_native.h:43
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
unsigned int BOOL
Definition: ntddk_ex.h:94
IAC97MiniportTopology * PAC97MINIPORTTOPOLOGY
Definition: shared.h:378
#define _In_
Definition: ms_sal.h:308
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
WORD * PWORD
Definition: pedump.c:67
TopoNodeConfig
Definition: shared.h:83
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char UCHAR
Definition: xmlstorage.h:181
IResourceList * PRESOURCELIST
Definition: portcls.h:442
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
TopoNodes
Definition: shared.h:185
unsigned short USHORT
Definition: pedump.c:61
#define PURE
Definition: basetyps.h:64
DWORD * PDWORD
Definition: pedump.c:68
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
AC97Register
Definition: ac97reg.h:16
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DEFINE_GUID() [1/2]

DEFINE_GUID ( IID_IAC97AdapterCommon  ,
0x77481fa0  ,
0x1ef2  ,
0x11d2  ,
0x88  ,
0x3a  ,
0x0  ,
0x80  ,
0xc7  ,
0x65  ,
0x64  ,
0x7d   
)

◆ DEFINE_GUID() [2/2]

DEFINE_GUID ( IID_IAC97MiniportTopology  ,
0x245ae964  ,
0x49c8  ,
0x11d2  ,
0x95  ,
0xd7  ,
0x0  ,
0xc0  ,
0x4f  ,
0xb9  ,
0x25  ,
0xd3   
)

◆ NewAdapterCommon()

NTSTATUS NewAdapterCommon ( OUT PUNKNOWN Unknown,
IN  REFCLSID,
IN PUNKNOWN UnknownOuter  OPTIONAL,
_When_((PoolType &NonPagedPoolMustSucceed) !=0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) IN POOL_TYPE  PoolType 
)

Definition at line 117 of file common.cpp.

126 {
127  PAGED_CODE ();
128 
129  ASSERT (Unknown);
130 
131  DOUT (DBG_PRINT, ("[NewAdapterCommon]"));
132 
133  STD_CREATE_BODY_WITH_TAG_(CAC97AdapterCommon,Unknown,UnknownOuter,PoolType,
135 }
IAC97AdapterCommon * PADAPTERCOMMON
Definition: shared.h:486
#define DOUT(lvl, strings)
Definition: debug.h:82
#define ASSERT(a)
Definition: mode.c:44
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
const int DBG_PRINT
Definition: debug.h:17
#define PAGED_CODE()

Referenced by StartDevice().

Variable Documentation

◆ PoolTag

const ULONG PoolTag = '79CA'

Definition at line 53 of file shared.h.