13#define STR_MODULENAME "AC97 Adapter: "
23#define DEFINE_DEBUG_VARS
34#pragma code_seg("PAGE")
90 ntStatus = MiniportCreate ((
PUNKNOWN*)&miniport, MiniportClassId,
118#pragma warning(disable:6387)
139 (
PVOID *)OutPortUnknown);
147 ntStatus = miniport->QueryInterface (IID_IMiniport,
148 (
PVOID *)OutMiniport);
156 miniport->Release ();
189 if ((countIO != 2) || (countIRQ != 1) || (countDMA != 0))
195 countIO, countIRQ, countDMA));
234 ntStatus =
PcNewPort (&pPort,CLSID_PortWaveCyclic);
241 ntStatus = pPort->QueryInterface (IID_IPortEvents,
242 (
PVOID *)&pPortEvents);
250 pPortEvents->Release ();
286 ntStatus = pUnknownCommon->
QueryInterface (IID_IAC97AdapterCommon,
287 (
PVOID *)&pAdapterCommon);
308 DOUT (
DBG_ERROR, (
"Could not create or query AdapterCommon."));
340 ntStatus = miniTopology->QueryInterface (IID_IAC97MiniportTopology,
341 (
PVOID *)&pMiniportTopology);
342 miniTopology->Release ();
358#if (NTDDI_VERSION >= NTDDI_VISTA)
382 CLSID_PortWaveCyclic,
383 CLSID_PortWaveCyclic,
405#if (NTDDI_VERSION >= NTDDI_VISTA)
411 DOUT (
DBG_ERROR, (
"WaveRT and WavePCI miniport installation failed!"));
439 ULONG ulWaveOut, ulWaveIn, ulMicIn;
443 ntStatus = pMiniportTopology->GetPhysicalConnectionPins (&ulWaveOut,
444 &ulWaveIn, &ulMicIn);
457 DOUT (
DBG_ERROR, (
"Cannot connect topology and wave miniport"
474 DOUT (
DBG_ERROR, (
"Cannot connect topology and wave miniport"
492 DOUT (
DBG_ERROR, (
"Cannot connect topology and wave miniport"
504 pAdapterCommon->Release ();
515 if (pMiniportTopology)
516 pMiniportTopology->Release ();
531#pragma warning(disable:28152)
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)
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)
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 ValidateResources(IN PRESOURCELIST ResourceList)
NTSTATUS NTAPI PcRegisterAdapterPowerManagement(IN PUNKNOWN pUnknown, IN PVOID pvContext)
NTSTATUS CreateAC97MiniportTopology(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS CreateAC97MiniportWaveCyclic(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS CreateAC97MiniportWaveRT(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
NTSTATUS CreateAC97MiniportWavePCI(OUT PUNKNOWN *Unknown, IN REFCLSID, IN PUNKNOWN UnknownOuter OPTIONAL, IN POOL_TYPE PoolType)
HRESULT(* PFNCREATEMINIPORT)(OUT PUNKNOWN *Unknown, IN REFCLSID ClassId, IN PUNKNOWN OuterUnknown OPTIONAL, IN POOL_TYPE PoolType)
#define DOUT(lvl, strings)
IAC97MiniportTopology * PAC97MINIPORTTOPOLOGY
IAC97AdapterCommon * PADAPTERCOMMON
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
#define UNREFERENCED_PARAMETER(P)
#define STATUS_DEVICE_CONFIGURATION_ERROR
DRIVER_ADD_DEVICE AddDevice
NTSTATUS NTAPI PcNewPort(OUT PPORT *OutPort, IN REFCLSID ClassId)
IResourceList * PRESOURCELIST
IPortEvents * PPORTEVENTS
NTSTATUS(NTAPI * PCPFNSTARTDEVICE)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PRESOURCELIST ResourceList)
#define STATUS_UNSUCCESSFUL
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
#define DBG_PRINT(ppi, ch, level)
DRIVER_ADD_DEVICE * PDRIVER_ADD_DEVICE