33#pragma code_seg("PAGE")
93 (*UartResourceList) =
NULL;
97 DBGPRINT((
"Unexpected configuration"));
104 (*UartResourceList)->AddPortFromParent(
ResourceList, 1);
105 (*UartResourceList)->AddInterruptFromParent(
ResourceList, 0);
129 ntStatus =
PcNewPort(&pPort,CLSID_PortWaveCyclic);
133 ntStatus = pPort->QueryInterface(IID_IPortEvents, (
PVOID *)&pPortEvents);
135 DBGPRINT((
"ERROR: This driver doesn't work under Win98!"));
140 pPortEvents->Release();
151 DBGPRINT((
"ProcessResources() failed"));
161 DBGPRINT((
"NewCMIAdapter() failed"));
167 DBGPRINT((
"QueryInterface() for ICMIAdapter failed"));
172 DBGPRINT((
"CMIAdapter->init() failed"));
186 DBGPRINT((
"Topology miniport installation failed"));
195 if (
ResourceList->FindTranslatedPort(
i)->u.Port.Length == 2) {
200 ntStatus = pCMIAdapter->activateMPU(MPUBase);
207 pCMIAdapter->activateMPU(0);
208 DBGPRINT((
"UART miniport installation failed"));
210 if (UartResourceList) {
211 UartResourceList->Release();
222 DBGPRINT((
"Wave miniport installation failed"));
229 DBGPRINT((
"Cannot connect topology and wave miniport (render)!"));
234 DBGPRINT((
"Cannot connect topology and wave miniport (capture)!"));
241 DBGPRINT((
"Cannot connect topology and wave miniport (ac3)!"));
247 pCMIAdapter->Release();
249 if (unknownTopology) {
273 ASSERT(pOutResDescriptor);
274 DBGPRINT((
"CopyResourceDescriptor()"));
279 pOutResDescriptor->
Type = pInResDescriptor->
Type;
281 pOutResDescriptor->
Flags = pInResDescriptor->
Flags;
284 switch (pInResDescriptor->
Type) {
292 pOutResDescriptor->
u.
Port.MinimumAddress = pInResDescriptor->
u.
Port.MinimumAddress;
293 pOutResDescriptor->
u.
Port.MaximumAddress = pInResDescriptor->
u.
Port.MaximumAddress;
294 pOutResDescriptor->
u.
Port.Length = pInResDescriptor->
u.
Port.Length;
295 pOutResDescriptor->
u.
Port.Alignment = pInResDescriptor->
u.
Port.Alignment;
296 DBGPRINT((
" Port: min %08x.%08x max %08x.%08x, Length: %x, Option: %x", pOutResDescriptor->
u.
Port.MinimumAddress.HighPart, pOutResDescriptor->
u.
Port.MinimumAddress.LowPart,
297 pOutResDescriptor->
u.
Port.MaximumAddress.HighPart, pOutResDescriptor->
u.
Port.MaximumAddress.LowPart,
298 pOutResDescriptor->
u.
Port.Length, pOutResDescriptor->
Option));
320 ULONG resourceListSize;
326 DBGPRINT((
"[AdapterDispatchPnp] - IRP_MN_FILTER_RESOURCE_REQUIREMENTS"));
344 resourceList->
ListSize = resourceListSize;
351 for (
unsigned int i=0;
i<
list->List[0].Count;
i++) {
365 descriptor->u.Port.MinimumAddress.LowPart = 0x300;
366 descriptor->u.Port.MinimumAddress.HighPart = 0;
367 descriptor->u.Port.MaximumAddress.LowPart = 0x330;
368 descriptor->u.Port.MaximumAddress.HighPart = 0;
379 descriptor->u.Port.MinimumAddress.LowPart = 0x0;
380 descriptor->u.Port.MinimumAddress.HighPart = 0;
381 descriptor->u.Port.MaximumAddress.LowPart = 0xFFFF;
382 descriptor->u.Port.MaximumAddress.HighPart = 0;
386 DBGPRINT((
"number of resource list descriptors: %d", resourceList->
List[0].
Count));
391 pIrp->IoStatus.Status = ntStatus;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
NTSTATUS NTAPI CreateMiniportTopologyCMI(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS NTAPI CreateMiniportWaveCMI(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS NewCMIAdapter(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS NTAPI PcAddAdapterDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject, IN PCPFNSTARTDEVICE StartDevice, IN ULONG MaxObjects, IN ULONG DeviceExtensionSize)
NTSTATUS NTAPI PcInitializeAdapterDriver(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPathName, IN PDRIVER_ADD_DEVICE AddDevice)
NTSTATUS NTAPI PcRegisterSubdevice(IN PDEVICE_OBJECT DeviceObject, IN PWCHAR Name, IN PUNKNOWN Unknown)
NTSTATUS NTAPI PcNewMiniport(OUT PMINIPORT *OutMiniport, IN REFCLSID ClassId)
PDEVICE_OBJECT PhysicalDeviceObject
NTSTATUS NTAPI PcRegisterPhysicalConnection(IN PDEVICE_OBJECT DeviceObject, IN PUNKNOWN FromUnknown, IN ULONG FromPin, IN PUNKNOWN ToUnknown, IN ULONG ToPin)
#define NT_SUCCESS(StatCode)
int __cdecl _purecall(void)
static NTSTATUS ProcessResources(PRESOURCELIST ResourceList, PRESOURCELIST *UartResourceList)
NTSTATUS NTAPI AdapterDispatchPnp(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
static bool CopyResourceDescriptor(PIO_RESOURCE_DESCRIPTOR pInResDescriptor, PIO_RESOURCE_DESCRIPTOR pOutResDescriptor)
@ PIN_WAVE_CAPTURE_SOURCE
@ PIN_WAVE_AC3_RENDER_SOURCE
ICMIAdapter * PCMIADAPTER
DRIVER_INITIALIZE DriverEntry
NTSTATUS InstallSubdevice(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ PWSTR Name, _In_ REFGUID PortClassId, _In_ REFGUID MiniportClassId, _In_opt_ PFNCREATEMINIPORT MiniportCreate, _In_opt_ PUNKNOWN UnknownAdapter, _In_opt_ PRESOURCELIST ResourceList, _In_opt_ REFGUID PortInterfaceId, _Out_opt_ PMINIPORT *OutMiniport, _Out_opt_ PUNKNOWN *OutPortUnknown)
NTSTATUS NTAPI PcRegisterAdapterPowerManagement(IN PUNKNOWN pUnknown, IN PVOID pvContext)
#define ExAllocatePoolWithTag(hernya, size, tag)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define CmResourceTypeNonArbitrated
#define CmResourceTypePort
#define CmResourceTypeInterrupt
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
NTSTATUS NTAPI PcDispatchIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
_In_ PNDIS_STRING _In_ PNDIS_STRING _Out_ PDEVICE_OBJECT * pDeviceObject
#define CM_RESOURCE_PORT_IO
static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
BOOLEAN NTAPI IoIsWdmVersionAvailable(IN UCHAR MajorVersion, IN UCHAR MinorVersion)
#define STATUS_DEVICE_CONFIGURATION_ERROR
DRIVER_ADD_DEVICE AddDevice
NTSTATUS NTAPI PcNewPort(OUT PPORT *OutPort, IN REFCLSID ClassId)
IResourceList * PRESOURCELIST
IPortEvents * PPORTEVENTS
HRESULT(NTAPI * PFNCREATEINSTANCE)(_Out_ PUNKNOWN *Unknown, _In_ REFCLSID ClassId, _In_ PUNKNOWN OuterUnknown, _In_ POOL_TYPE PoolType)
PORTCLASSAPI NTSTATUS NTAPI PcNewResourceSublist(OUT PRESOURCELIST *OutResourceList, IN PUNKNOWN OuterUnknown OPTIONAL, IN POOL_TYPE PoolType, IN PRESOURCELIST ParentList, IN ULONG MaximumEntries)
struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
struct _IO_RESOURCE_DESCRIPTOR::@2054::@2055 Port
struct _IO_RESOURCE_DESCRIPTOR::@2054::@2057 Interrupt
union _IO_RESOURCE_DESCRIPTOR::@2054 u
IO_RESOURCE_DESCRIPTOR Descriptors[1]
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
@ CmResourceShareDeviceExclusive
#define IO_RESOURCE_ALTERNATIVE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IO_RESOURCE_PREFERRED
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST