28 #define PUT_GUIDS_HERE 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!"));
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)!"));
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;
369 descriptor->
u.
Port.Length = 2;
370 descriptor->
u.
Port.Alignment = 0x10;
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;
383 descriptor->
u.
Port.Length = 1;
384 descriptor->
u.
Port.Alignment = 0x10;
386 DBGPRINT((
"number of resource list descriptors: %d", resourceList->
List[0].
Count));
388 pIrp->IoStatus.Information = (
ULONG_PTR)resourceList;
391 pIrp->IoStatus.Status = ntStatus;
NTSTATUS NewCMIAdapter(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
IPortEvents * PPORTEVENTS
union _IO_RESOURCE_DESCRIPTOR::@1957 u
_In_ PNDIS_STRING _In_ PNDIS_STRING _Out_ PDEVICE_OBJECT * pDeviceObject
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
NTSTATUS NTAPI PcRegisterPhysicalConnection(IN PDEVICE_OBJECT DeviceObject, IN PUNKNOWN FromUnknown, IN ULONG FromPin, IN PUNKNOWN ToUnknown, IN ULONG ToPin)
ICMIAdapter * PCMIADAPTER
struct _IO_RESOURCE_DESCRIPTOR::@1957::@1960 Interrupt
const MUI_LANGUAGE_RESOURCE ResourceList[]
NTSTATUS NTAPI PcRegisterAdapterPowerManagement(IN PUNKNOWN pUnknown, IN PVOID pvContext)
#define CmResourceTypePort
static NTSTATUS ProcessResources(PRESOURCELIST ResourceList, PRESOURCELIST *UartResourceList)
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
NTSTATUS NTAPI PcNewMiniport(OUT PMINIPORT *OutMiniport, IN REFCLSID ClassId)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
struct _IO_RESOURCE_DESCRIPTOR::@1957::@1958 Port
NTSTATUS NTAPI PcAddAdapterDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject, IN PCPFNSTARTDEVICE StartDevice, IN ULONG MaxObjects, IN ULONG DeviceExtensionSize)
#define IO_RESOURCE_ALTERNATIVE
static PDRIVER_OBJECT DriverObject
NTSTATUS NTAPI CreateMiniportWaveCMI(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
#define NT_SUCCESS(StatCode)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPathName)
NTSTATUS NTAPI PcInitializeAdapterDriver(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPathName, IN PDRIVER_ADD_DEVICE AddDevice)
NTSTATUS NTAPI CreateMiniportTopologyCMI(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
static NTSTATUS InstallSubdevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PWCHAR Name, REFGUID PortClassId, REFGUID MiniportClassId, PFNCREATEINSTANCE MiniportCreate, PUNKNOWN UnknownAdapter, PRESOURCELIST ResourceList, REFGUID PortInterfaceId, PUNKNOWN *OutPortUnknown)
IO_RESOURCE_DESCRIPTOR Descriptors[1]
struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
IResourceList * PRESOURCELIST
IN PDEVICE_OBJECT DeviceObject
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
const ULONG MAX_MINIPORTS
#define CM_RESOURCE_PORT_IO
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST
NTSTATUS NTAPI AdapterDispatchPnp(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
static bool CopyResourceDescriptor(PIO_RESOURCE_DESCRIPTOR pInResDescriptor, PIO_RESOURCE_DESCRIPTOR pOutResDescriptor)
#define CmResourceTypeInterrupt
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
NTSTATUS NTAPI PcNewPort(OUT PPORT *OutPort, IN REFCLSID ClassId)
#define RtlZeroMemory(Destination, Length)
int __cdecl _purecall(void)
NTSTATUS NTAPI PcDispatchIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IO_RESOURCE_PREFERRED
#define STATUS_DEVICE_CONFIGURATION_ERROR
HRESULT(NTAPI * PFNCREATEINSTANCE)(_Out_ PUNKNOWN *Unknown, _In_ REFCLSID ClassId, _In_ PUNKNOWN OuterUnknown, _In_ POOL_TYPE PoolType)
#define CmResourceTypeNonArbitrated
NTSTATUS NTAPI StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PRESOURCELIST ResourceList)
NTSTATUS NTAPI AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject)
NTSTATUS NTAPI PcRegisterSubdevice(IN PDEVICE_OBJECT DeviceObject, IN PWCHAR Name, IN PUNKNOWN Unknown)
PORTCLASSAPI NTSTATUS NTAPI PcNewResourceSublist(OUT PRESOURCELIST *OutResourceList, IN PUNKNOWN OuterUnknown OPTIONAL, IN POOL_TYPE PoolType, IN PRESOURCELIST ParentList, IN ULONG MaximumEntries)
BOOLEAN NTAPI IoIsWdmVersionAvailable(IN UCHAR MajorVersion, IN UCHAR MinorVersion)