ReactOS  0.4.14-dev-50-g13bb5e2
miniport.cpp
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel Streaming
4  * FILE: drivers/wdm/audio/backpln/portcls/miniport.cpp
5  * PURPOSE: Miniport construction api
6  * PROGRAMMER: Andrew Greenwood
7  */
8 
9 #include "private.hpp"
10 
11 #ifndef YDEBUG
12 #define NDEBUG
13 #endif
14 
15 #include <debug.h>
16 
17 PVOID
18 __cdecl
19 operator new(
20  size_t Size,
22  ULONG Tag)
23 {
25  if (P)
27  return P;
28 }
29 
30 void
31 __cdecl
32 operator delete(
33  PVOID ptr)
34 {
35  ExFreePool(ptr);
36 }
37 
38 void
39 __cdecl
40 operator delete(
42 {
43  ExFreePool(ptr);
44 }
45 
47 NTAPI
49  OUT PMINIPORT* OutMiniport,
50  IN REFCLSID ClassId)
51 {
53 
54  DPRINT("PcNewMiniport entered\n");
56 
57  if (!OutMiniport)
58  {
59  DPRINT("PcNewMiniport was supplied a NULL OutPort parameter\n");
61  }
62 
63  if (IsEqualGUIDAligned(ClassId, CLSID_MiniportDriverDMusUART) ||
64  IsEqualGUIDAligned(ClassId, CLSID_MiniportDriverUart) ||
65  IsEqualGUIDAligned(ClassId, CLSID_MiniportDriverDMusUARTCapture))
66  {
67  Status = NewMiniportDMusUART(OutMiniport, ClassId);
68  }
69  else if (IsEqualGUIDAligned(ClassId, CLSID_MiniportDriverFmSynth) ||
70  IsEqualGUIDAligned(ClassId, CLSID_MiniportDriverFmSynthWithVol))
71  {
72  Status = NewMiniportFmSynth(OutMiniport, ClassId);
73  }
74  else
75  {
77  }
78 
79  DPRINT("PcNewMiniport Status %x\n", Status);
80  return Status;
81 }
82 
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
#define IN
Definition: typedefs.h:38
#define __cdecl
Definition: accygwin.h:79
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define REFCLSID
Definition: guiddef.h:117
LONG NTSTATUS
Definition: precomp.h:26
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
NTSTATUS NTAPI PcNewMiniport(OUT PMINIPORT *OutMiniport, IN REFCLSID ClassId)
Definition: miniport.cpp:48
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
static PVOID ptr
Definition: dispmode.c:27
NTSTATUS NewMiniportFmSynth(OUT PMINIPORT *OutMiniport, IN REFCLSID ClassId)
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NewMiniportDMusUART(OUT PMINIPORT *OutMiniport, IN REFCLSID ClassId)
INT POOL_TYPE
Definition: typedefs.h:76
#define PC_ASSERT_IRQL_EQUAL(x)
Definition: private.hpp:31
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define P(row, col)
Status
Definition: gdiplustypes.h:24
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
#define ExFreePool(addr)
Definition: env_spec_w32.h:352