- Fix compilation of cmidriver

- Does not yet link

svn path=/trunk/; revision=39827
This commit is contained in:
Johannes Anderwald 2009-03-01 14:29:57 +00:00
parent 2eba686398
commit 4b4d95da9c
26 changed files with 272 additions and 484 deletions

View file

@ -1,22 +0,0 @@
For compiling and building the WDM driver, the following software is required:
- Microsoft Windows Driver Development Kit (http://www.microsoft.com/whdc/devtools/wdk/default.mspx)
- 7Zip (http://www.7-zip.org/)
- Sed (http://gnuwin32.sourceforge.net/packages/sed.htm)
The directories which contain 7z.exe, sed.exe and devcon.exe need to be in your %PATH% environment variable. Replace the file 'dsound.lib' in the [WINDDK]\[xxxx]\lib\w2k\i386 folder with the version from [WINDDK]\[xxxx]\lib\wxp\i386.
The source files should be unpacked to [WINDDK]\[xxxx]\src\[\wdm]\audio\cmedia
envars.bat - contains some environment variables: you probably want to change them
make.bat - creates a debug build for x86 systems
update.bat - replaces the currently installed driver with the x86 debug build
build-release-x64.bat - creates a non-WaveRT deployment build for x64 systems
build-release-x64-WaveRT.bat - creates a WaveRT deployment build for x64 systems
build-release-x86.bat - creates a non-WaveRT deployment build for x86 systems
build-release-x86-WaveRT.bat - creates a WaveRT deployment build for x86 systems
distclean.bat - cleans up and packs the source
build-all.bat - builds all versions and packs the source
For testing and debugging, DebugView (http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx) is very helpful.
If you have questions, feel free to mail me: dogber1@gmail.com

View file

@ -26,21 +26,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define PUT_GUIDS_HERE
#include <initguid.h>
#include "adapter.hpp"
#pragma code_seg("PAGE")
//#pragma code_seg("PAGE")
NTSTATUS InstallSubdevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PWCHAR Name, REFGUID PortClassId, REFGUID MiniportClassId, PFNCREATEINSTANCE MiniportCreate, PUNKNOWN UnknownAdapter, PRESOURCELIST ResourceList, REFGUID PortInterfaceId, PUNKNOWN* OutPortUnknown)
NTSTATUS InstallSubdevice(
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
PWCHAR Name,
REFGUID PortClassId,
REFGUID MiniportClassId,
PFNCREATEINSTANCE MiniportCreate,
PUNKNOWN UnknownAdapter,
PRESOURCELIST ResourceList,
REFGUID PortInterfaceId,
PUNKNOWN* OutPortUnknown)
{
PAGED_CODE();
DBGPRINT(("InstallSubdevice()"));
NTSTATUS ntStatus;
PPORT Port;
PMINIPORT MiniPort;
////PAGED_CODE();
DBGPRINT(("InstallSubdevice()"));
ntStatus = PcNewPort(&Port, PortClassId);
if (NT_SUCCESS(ntStatus)) {
if (MiniportCreate) {
@ -76,19 +86,24 @@ NTSTATUS InstallSubdevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PWCHAR Name, RE
}
NTSTATUS ProcessResources(PRESOURCELIST ResourceList, PRESOURCELIST* UartResourceList)
NTSTATUS
ProcessResources(
PRESOURCELIST ResourceList,
PRESOURCELIST* UartResourceList)
{
PAGED_CODE();
ASSERT(ResourceList);
ASSERT(UartResourceList);
DBGPRINT(("ProcessResources()"));
DBGPRINT(("NumberOfPorts: %d, NumberOfInterrupts: %d, NumberOfDmas: %d", ResourceList->NumberOfPorts(), ResourceList->NumberOfInterrupts(), ResourceList->NumberOfDmas()));
NTSTATUS ntStatus;
////PAGED_CODE();
////ASSERT(ResourceList);
////ASSERT(UartResourceList);
//DBGPRINT(("ProcessResources()"));
//DBGPRINT(("NumberOfPorts: %d, NumberOfInterrupts: %d, NumberOfDmas: %d", ResourceList->NumberOfPorts(), ResourceList->NumberOfInterrupts(), ResourceList->NumberOfDmas()));
#ifdef UART
(*UartResourceList) = NULL;
#endif
NTSTATUS ntStatus;
if ((ResourceList->NumberOfPorts() == 0) || (ResourceList->NumberOfPorts() > 2) || (ResourceList->NumberOfInterrupts() != 1) || (ResourceList->NumberOfDmas() != 0)) {
DBGPRINT(("Unexpected configuration"));
return STATUS_DEVICE_CONFIGURATION_ERROR;
@ -108,15 +123,16 @@ NTSTATUS ProcessResources(PRESOURCELIST ResourceList, PRESOURCELIST* UartResourc
NTSTATUS StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PRESOURCELIST ResourceList)
{
PAGED_CODE();
ASSERT(DeviceObject);
ASSERT(Irp);
ASSERT(ResourceList);
DBGPRINT(("StartDevice()"));
NTSTATUS ntStatus;
PPORT pPort = 0;
ULONG* MPUBase;
#if 0
//PAGED_CODE();
//ASSERT(DeviceObject);
//ASSERT(Irp);
//ASSERT(ResourceList);
DBGPRINT(("StartDevice()"));
#endif
ntStatus = PcNewPort(&pPort,CLSID_PortWaveCyclic);
if (NT_SUCCESS(ntStatus)) {
@ -248,22 +264,29 @@ NTSTATUS StartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PRESOURCELIST Resour
return ntStatus;
}
extern "C" NTSTATUS AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject)
extern
"C"
NTSTATUS
NTAPI
AddDevice(
PDRIVER_OBJECT DriverObject,
PDEVICE_OBJECT PhysicalDeviceObject)
{
PAGED_CODE();
DBGPRINT(("AddDevice()"));
#if 0
//PAGED_CODE();
DBGPRINT(("AddDevice()"));
#endif
return PcAddAdapterDevice(DriverObject, PhysicalDeviceObject, (PCPFNSTARTDEVICE)StartDevice, MAX_MINIPORTS, 0);
return PcAddAdapterDevice(DriverObject, PhysicalDeviceObject, (PCPFNSTARTDEVICE)StartDevice, MAX_MINIPORTS, 0);
}
bool CopyResourceDescriptor(PIO_RESOURCE_DESCRIPTOR pInResDescriptor, PIO_RESOURCE_DESCRIPTOR pOutResDescriptor)
{
PAGED_CODE();
ASSERT(pInResDescriptor);
ASSERT(pOutResDescriptor);
DBGPRINT(("CopyResourceDescriptor()"));
#if 0
//PAGED_CODE();
//ASSERT(pInResDescriptor);
//ASSERT(pOutResDescriptor);
DBGPRINT(("CopyResourceDescriptor()"));
RtlCopyMemory(pOutResDescriptor, pInResDescriptor, sizeof(IO_RESOURCE_DESCRIPTOR));
#else
pOutResDescriptor->Type = pInResDescriptor->Type;
@ -283,14 +306,18 @@ bool CopyResourceDescriptor(PIO_RESOURCE_DESCRIPTOR pInResDescriptor, PIO_RESOUR
pOutResDescriptor->u.Port.MaximumAddress = pInResDescriptor->u.Port.MaximumAddress;
pOutResDescriptor->u.Port.Length = pInResDescriptor->u.Port.Length;
pOutResDescriptor->u.Port.Alignment = pInResDescriptor->u.Port.Alignment;
#if 0
DBGPRINT((" Port: min %08x.%08x max %08x.%08x, Length: %x, Option: %x", pOutResDescriptor->u.Port.MinimumAddress.HighPart, pOutResDescriptor->u.Port.MinimumAddress.LowPart,
pOutResDescriptor->u.Port.MaximumAddress.HighPart, pOutResDescriptor->u.Port.MaximumAddress.LowPart,
pOutResDescriptor->u.Port.Length, pOutResDescriptor->Option));
#endif
break;
case CmResourceTypeInterrupt:
pOutResDescriptor->u.Interrupt.MinimumVector = pInResDescriptor->u.Interrupt.MinimumVector;
pOutResDescriptor->u.Interrupt.MaximumVector = pInResDescriptor->u.Interrupt.MaximumVector;
#if 0
DBGPRINT((" IRQ: min %x max %x, Option: %d", pOutResDescriptor->u.Interrupt.MinimumVector, pOutResDescriptor->u.Interrupt.MaximumVector, pOutResDescriptor->Option));
#endif
break;
default:
return FALSE;
@ -299,19 +326,25 @@ bool CopyResourceDescriptor(PIO_RESOURCE_DESCRIPTOR pInResDescriptor, PIO_RESOUR
#endif
}
extern "C" NTSTATUS AdapterDispatchPnp(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
extern
"C"
NTSTATUS
NTAPI
AdapterDispatchPnp(
PDEVICE_OBJECT pDeviceObject,
PIRP pIrp)
{
PAGED_CODE();
ASSERT(pDeviceObject);
ASSERT(pIrp);
DBGPRINT(("AdapterDispatchPnp()"));
NTSTATUS ntStatus = STATUS_SUCCESS;
ULONG resourceListSize;
PIO_RESOURCE_REQUIREMENTS_LIST resourceList, list;
PIO_RESOURCE_DESCRIPTOR descriptor;
PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation(pIrp);
////PAGED_CODE();
////ASSERT(pDeviceObject);
////ASSERT(pIrp);
DBGPRINT(("AdapterDispatchPnp()"));
if (pIrpStack->MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS) {
DBGPRINT(("[AdapterDispatchPnp] - IRP_MN_FILTER_RESOURCE_REQUIREMENTS"));
@ -373,7 +406,7 @@ extern "C" NTSTATUS AdapterDispatchPnp(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
descriptor->u.Port.Length = 1;
descriptor->u.Port.Alignment = 0x10;
DBGPRINT(("number of resource list descriptors: %d", resourceList->List[0].Count));
// DBGPRINT(("number of resource list descriptors: %d", resourceList->List[0].Count));
pIrp->IoStatus.Information = (ULONG_PTR)resourceList;
@ -387,27 +420,35 @@ extern "C" NTSTATUS AdapterDispatchPnp(PDEVICE_OBJECT pDeviceObject, PIRP pIrp)
return ntStatus;
}
extern "C" NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPathName)
extern
"C"
NTSTATUS
NTAPI
DriverEntry(
PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPathName)
{
PAGED_CODE();
DBGPRINT(("DriverEntry()"));
NTSTATUS ntStatus;
DBGPRINT(("DriverEntry()"));
//bind the adapter driver to the portclass driver
ntStatus = PcInitializeAdapterDriver(DriverObject, RegistryPathName, AddDevice);
NTSTATUS ntStatus;
//bind the adapter driver to the portclass driver
ntStatus = PcInitializeAdapterDriver(DriverObject, RegistryPathName, AddDevice);
#ifdef UART
if(NT_SUCCESS(ntStatus)) {
DriverObject->MajorFunction[IRP_MJ_PNP] = AdapterDispatchPnp;
}
if(NT_SUCCESS(ntStatus)) {
DriverObject->MajorFunction[IRP_MJ_PNP] = AdapterDispatchPnp;
}
#endif
#ifdef WAVERT
if (!IoIsWdmVersionAvailable(6,0)) {
ntStatus = STATUS_UNSUCCESSFUL;
}
if (!IoIsWdmVersionAvailable(6,0)) {
ntStatus = STATUS_UNSUCCESSFUL;
}
#endif
return ntStatus;
return ntStatus;
}
#pragma code_seg()

View file

@ -1,6 +0,0 @@
@echo off
start /wait cmd.exe /c distclean.bat
start /wait cmd.exe /c build-release-x64.bat
start /wait cmd.exe /c build-release-x64-WaveRT.bat
start /wait cmd.exe /c build-release-x86.bat
start /wait cmd.exe /c build-release-x86-WaveRT.bat

View file

@ -1,32 +0,0 @@
@echo off
call envars.bat
call %CMI_DDKDIR%\bin\setenv %CMI_DDKDIR% fre AMD64
cd %CMI_BUILDDIR%
del CMIDriver-%CMI_VERSION%-bin-x64-WaveRT.zip
del installer\objfre_wlh_AMD64\AMD64\*.obj
del installer\objfre_wlh_AMD64\AMD64\*.exe
del cmicontrol\objfre_wlh_AMD64\AMD64\*.obj
del cmicontrol\objfre_wlh_AMD64\AMD64\*.exe
del cpl\objfre_wlh_AMD64\AMD64\*.obj
del cpl\objfre_wlh_AMD64\AMD64\*.exe
del objfre_wlh_AMD64\AMD64\*.obj
del objfre_wlh_AMD64\AMD64\*.sys
sed -i "s/CMIVERSION.*/CMIVERSION \"%CMI_VERSION%\"/" debug.hpp
sed -i "s/^\/\/#define WAVERT/#define WAVERT/" debug.hpp
nmake /x errors.err
mkdir release-x64-WaveRT
copy objfre_wlh_AMD64\AMD64\*.sys release-x64-WaveRT
sed -e "s/CMIVersion/%CMI_VERSION%/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x64-WaveRT.inf >release-x64-WaveRT\CM8738.inf
copy CHANGELOG.txt release-x64-WaveRT
cd cmicontrol
nmake /x errors.err
copy objfre_wlh_AMD64\AMD64\cmicontrol.exe ..\release-x64-WaveRT
cd ..\cpl
build -cZ
copy objfre_wlh_AMD64\AMD64\cmicpl.cpl ..\release-x64-WaveRT
cd ..\installer
build -cZ
copy objfre_wlh_AMD64\AMD64\setup.exe ..\release-x64-WaveRT
cd ..\release-x64-WaveRT
7z a -tzip ..\CMIDriver-%CMI_VERSION%-bin-x64-WaveRT.zip *
cd ..

View file

@ -1,32 +0,0 @@
@echo off
call envars.bat
call %CMI_DDKDIR%\bin\setenv %CMI_DDKDIR% fre AMD64
cd %CMI_BUILDDIR%
del CMIDriver-%CMI_VERSION%-bin-x64.zip
del installer\objfre_wlh_AMD64\AMD64\*.obj
del installer\objfre_wlh_AMD64\AMD64\*.exe
del cmicontrol\objfre_wlh_AMD64\AMD64\*.obj
del cmicontrol\objfre_wlh_AMD64\AMD64\*.exe
del cpl\objfre_wlh_AMD64\AMD64\*.obj
del cpl\objfre_wlh_AMD64\AMD64\*.exe
del objfre_wlh_AMD64\AMD64\*.obj
del objfre_wlh_AMD64\AMD64\*.sys
sed -i "s/CMIVERSION.*/CMIVERSION \"%CMI_VERSION%\"/" debug.hpp
sed -i "s/^#define WAVERT/\/\/#define WAVERT/" debug.hpp
nmake /x errors.err
mkdir release-x64
copy objfre_wlh_AMD64\AMD64\*.sys release-x64
sed -e "s/CMIVersion/%CMI_VERSION%/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x64.inf >release-x64\CM8738.inf
copy CHANGELOG.txt release-x64
cd cmicontrol
nmake /x errors.err
copy objfre_wlh_AMD64\AMD64\cmicontrol.exe ..\release-x64
cd ..\cpl
build -cZ
copy objfre_wlh_AMD64\AMD64\cmicpl.cpl ..\release-x64
cd ..\installer
build -cZ
copy objfre_wlh_AMD64\AMD64\setup.exe ..\release-x64
cd ..\release-x64
7z a -tzip ..\CMIDriver-%CMI_VERSION%-bin-x64.zip *
cd ..

View file

@ -1,32 +0,0 @@
@echo off
call envars.bat
call %CMI_DDKDIR%\bin\setenv %CMI_DDKDIR% fre x86
cd %CMI_BUILDDIR%
del CMIDriver-%CMI_VERSION%-bin-x86-WaveRT.zip
del installer\objfre_wlh_x86\i386\*.obj
del installer\objfre_wlh_x86\i386\*.exe
del cmicontrol\objfre_wlh_x86\i386\*.obj
del cmicontrol\objfre_wlh_x86\i386\*.exe
del cpl\objfre_wlh_x86\i386\*.obj
del cpl\objfre_wlh_x86\i386\*.exe
del objfre_wlh_x86\i386\*.obj
del objfre_wlh_x86\i386\*.sys
sed -i "s/CMIVERSION.*/CMIVERSION \"%CMI_VERSION%\"/" debug.hpp
sed -i "s/^\/\/#define WAVERT/#define WAVERT/" debug.hpp
nmake /x errors.err
mkdir release-x86-WaveRT
copy objfre_wlh_x86\i386\*.sys release-x86-WaveRT
sed -e "s/CMIVersion/%CMI_VERSION%/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x32-WaveRT.inf >release-x86-WaveRT\CM8738.inf
copy CHANGELOG.txt release-x86-WaveRT
cd cmicontrol
nmake /x errors.err
copy objfre_wlh_x86\i386\cmicontrol.exe ..\release-x86-WaveRT
cd ..\cpl
build -cZ
copy objfre_wlh_x86\i386\cmicpl.cpl ..\release-x86-WaveRT
cd ..\installer
build -cZ
copy objfre_wlh_x86\i386\setup.exe ..\release-x86-WaveRT
cd ..\release-x86-WaveRT
7z a -tzip ..\CMIDriver-%CMI_VERSION%-bin-x86-WaveRT.zip *
cd ..

View file

@ -1,32 +0,0 @@
@echo off
call envars.bat
call %CMI_DDKDIR%\bin\setenv %CMI_DDKDIR% fre x86 wxp
cd %CMI_BUILDDIR%
del CMIDriver-%CMI_VERSION%-bin-x86.zip
del installer\objfre_wxp_x86\i386\*.obj
del installer\objfre_wxp_x86\i386\*.exe
del cmicontrol\objfre_wxp_x86\i386\*.obj
del cmicontrol\objfre_wxp_x86\i386\*.exe
del cpl\objfre_wxp_x86\i386\*.obj
del cpl\objfre_wxp_x86\i386\*.exe
del objfre_wxp_x86\i386\*.obj
del objfre_wxp_x86\i386\*.sys
sed -i "s/CMIVERSION.*/CMIVERSION \"%CMI_VERSION%\"/" debug.hpp
sed -i "s/^#define WAVERT/\/\/#define WAVERT/" debug.hpp
nmake /x errors.err
mkdir release-x86
copy objfre_wxp_x86\i386\*.sys release-x86
sed -e "s/CMIVersion/%CMI_VERSION%/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x32.inf >release-x86\CM8738.inf
copy CHANGELOG.txt release-x86
cd cmicontrol
nmake /x errors.err
copy objfre_wxp_x86\i386\cmicontrol.exe ..\release-x86
cd ..\cpl
build -cZ
copy objfre_wxp_x86\i386\cmicpl.cpl ..\release-x86
cd ..\installer
build -cZ
copy objfre_wxp_x86\i386\setup.exe ..\release-x86
cd ..\release-x86
7z a -tzip ..\CMIDriver-%CMI_VERSION%-bin-x86.zip *
cd ..

View file

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../../tools/rbuild/project.dtd">
<module name="cmidriver" type="kernelmodedriver" installbase="system32/drivers" installname="cmipci.sys" allowwarnings="true">
<include base="mpu401">.</include>
<library>ntoskrnl</library>
<library>portcls</library>
<library>hal</library>
<library>ks</library>
<file>adapter.cpp</file>
<file>common.cpp</file>
<file>mintopo.cpp</file>
<file>minwave.cpp</file>
<file>cmipci.rc</file>
</module>

View file

@ -29,22 +29,31 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma code_seg("PAGE")
NTSTATUS NewCMIAdapter(PUNKNOWN *Unknown, REFCLSID, PUNKNOWN UnknownOuter, POOL_TYPE PoolType)
NTSTATUS
NewCMIAdapter(
PUNKNOWN *Unknown,
REFCLSID,
PUNKNOWN UnknownOuter,
POOL_TYPE PoolType)
{
PAGED_CODE();
#if 0
//PAGED_CODE();
DBGPRINT(("NewCMIAdapter()"));
ASSERT (Unknown);
//ASSERT (Unknown);
#endif
STD_CREATE_BODY_(CCMIAdapter, Unknown, UnknownOuter, PoolType, PCMIADAPTER);
}
STDMETHODIMP_(NTSTATUS) CCMIAdapter::init(PRESOURCELIST ResourceList, PDEVICE_OBJECT aDeviceObject)
{
PAGED_CODE();
ASSERT(ResourceList);
ASSERT(aDeviceObject);
ASSERT(ResourceList->FindTranslatedPort(0));
#if 0
//PAGED_CODE();
//ASSERT(ResourceList);
//ASSERT(aDeviceObject);
//ASSERT(ResourceList->FindTranslatedPort(0));
DBGPRINT(("CCMIAdapter[%p]::init()", this));
#endif
NTSTATUS ntStatus = STATUS_SUCCESS;
@ -110,7 +119,7 @@ STDMETHODIMP_(NTSTATUS) CCMIAdapter::init(PRESOURCELIST ResourceList, PDEVICE_OB
CCMIAdapter::~CCMIAdapter()
{
PAGED_CODE ();
//PAGED_CODE ();
DBGPRINT(("CCMIAdapter[%p]::~CCMIAdapter()", this));
if (InterruptSync) {
@ -122,11 +131,11 @@ CCMIAdapter::~CCMIAdapter()
STDMETHODIMP_(NTSTATUS) CCMIAdapter::NonDelegatingQueryInterface(REFIID Interface, PVOID* Object)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::NonDelegatingQueryInterface()", this));
ASSERT(Object);
//ASSERT(Object);
// Is it IID_IUnknown?
if (IsEqualGUIDAligned (Interface, IID_IUnknown)) {
@ -155,7 +164,7 @@ STDMETHODIMP_(NTSTATUS) CCMIAdapter::NonDelegatingQueryInterface(REFIID Interfac
bool CCMIAdapter::queryChip()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::queryChip()", this));
UInt32 version = readUInt32(REG_INTHLDCLR) & VERSION_MASK;
@ -216,7 +225,7 @@ bool CCMIAdapter::queryChip()
void CCMIAdapter::resetMixer()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::resetMixer()", this));
writeMixer(0, 0);
@ -225,8 +234,10 @@ void CCMIAdapter::resetMixer()
void CCMIAdapter::resetController()
{
PAGED_CODE();
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::resetController()", this));
#endif
writeUInt32(REG_INTHLDCLR, 0);
@ -258,10 +269,11 @@ void CCMIAdapter::resetController()
STDMETHODIMP_(NTSTATUS) CCMIAdapter::activateMPU(ULONG* MPUBase)
{
PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::activateMPU(%X)", this, MPUBase));
UInt32 LegacyCtrl;
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::activateMPU(%X)", this, MPUBase));
#endif
switch ((LONGLONG)MPUBase) {
case 0x300: LegacyCtrl = UART_300; break;
@ -284,8 +296,10 @@ STDMETHODIMP_(NTSTATUS) CCMIAdapter::activateMPU(ULONG* MPUBase)
// XP's order of power states when going to hibernate: D3 -> D0, waking up: D0 -> D3.
STDMETHODIMP_(void) CCMIAdapter::PowerChangeState(POWER_STATE NewState)
{
PAGED_CODE();
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::PowerChangeState(%p)", this, NewState));
#endif
if (NewState.DeviceState == CurrentPowerState ) {
return;
@ -318,25 +332,31 @@ STDMETHODIMP_(void) CCMIAdapter::PowerChangeState(POWER_STATE NewState)
STDMETHODIMP_(NTSTATUS) CCMIAdapter::QueryPowerChangeState(POWER_STATE NewStateQuery)
{
PAGED_CODE();
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::QueryPowerChangeState(%p)", this, NewStateQuery));
#endif
return STATUS_SUCCESS;
}
STDMETHODIMP_(NTSTATUS) CCMIAdapter::QueryDeviceCapabilities(PDEVICE_CAPABILITIES PowerDeviceCaps)
{
PAGED_CODE();
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::QueryDeviceCapabilities(%p)", this, PowerDeviceCaps));
#endif
return STATUS_SUCCESS;
}
STDMETHODIMP_(NTSTATUS) CCMIAdapter::loadSBMixerFromMemory()
{
PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::loadSBMixerFromMemory()", this));
UInt8 sbIndex[] = { 0x04, 0x0A, 0x22, 0x28, 0x2E, 0x30, 0x31, 0x32, 0x33, 0x36, 0x37, 0x38,
0x39, 0x3A, 0x3C, 0x3D, 0x3E, 0xF0 };
#if 0
//PAGED_CODE();
DBGPRINT(("CCMIAdapter[%p]::loadSBMixerFromMemory()", this));
#endif
for (int i = 0; i<(sizeof(sbIndex)/sizeof(sbIndex[0]));i++) {
writeUInt8(REG_SBINDEX, sbIndex[i]);
writeUInt8(REG_SBDATA, mixerCache[i]);
@ -431,13 +451,15 @@ STDMETHODIMP_(void) CCMIAdapter::clearMixerBit(UInt8 index, UInt8 flag)
NTSTATUS CCMIAdapter::InterruptServiceRoutine(PINTERRUPTSYNC InterruptSync, PVOID DynamicContext)
{
ASSERT(InterruptSync);
ASSERT(DynamicContext);
UInt32 status, mask = 0;
CCMIAdapter *CMIAdapter = (CCMIAdapter *)DynamicContext;
#if 0
//ASSERT(InterruptSync);
//ASSERT(DynamicContext);
#endif
if (!(CMIAdapter->cm.WaveMiniport)) {
return STATUS_UNSUCCESSFUL;
}

View file

@ -28,11 +28,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _COMMON_HPP_
#define _COMMON_HPP_
#include "ntddk.h"
#include "stdunk.h"
#include "portcls.h"
#include "dmusicks.h"
#include "ksdebug.h"
#include "kcom.h"
#include "ksmedia.h"
#include "interfaces.hpp"
#include "debug.hpp"

View file

@ -1,53 +0,0 @@
@echo off
call envars.bat
rd /s /q cpl\objchk_wxp_x86
rd /s /q cpl\objchk_wxp_amd64
rd /s /q cpl\objfre_wxp_x86
rd /s /q cpl\objfre_wxp_amd64
rd /s /q cpl\objchk_wlh_x86
rd /s /q cpl\objchk_wlh_amd64
rd /s /q cpl\objfre_wlh_x86
rd /s /q cpl\objfre_wlh_amd64
del cpl\errors.err
del cpl\build*.*
rd /s /q cmicontrol\objchk_wxp_x86
rd /s /q cmicontrol\objchk_wxp_amd64
rd /s /q cmicontrol\objfre_wxp_x86
rd /s /q cmicontrol\objfre_wxp_amd64
rd /s /q cmicontrol\objchk_wlh_x86
rd /s /q cmicontrol\objchk_wlh_amd64
rd /s /q cmicontrol\objfre_wlh_x86
rd /s /q cmicontrol\objfre_wlh_amd64
del cmicontrol\errors.err
del cmicontrol\build*.*
rd /s /q installer\objchk_wxp_x86
rd /s /q installer\objchk_wxp_amd64
rd /s /q installer\objfre_wxp_x86
rd /s /q installer\objfre_wxp_amd64
rd /s /q installer\objchk_wlh_x86
rd /s /q installer\objchk_wlh_amd64
rd /s /q installer\objfre_wlh_x86
rd /s /q installer\objfre_wlh_amd64
del installer\errors.err
del installer\build*.*
rd /s /q objchk_wxp_x86
rd /s /q objchk_wxp_amd64
rd /s /q objfre_wxp_x86
rd /s /q objfre_wxp_amd64
rd /s /q objchk_wlh_x86
rd /s /q objchk_wlh_amd64
rd /s /q objfre_wlh_x86
rd /s /q objfre_wlh_amd64
del errors.err
rd /s /q release-x86
rd /s /q release-x64
rd /s /q release-x86-WaveRT
rd /s /q release-x64-WaveRT
rd /s /q debug-x86
del *.zip
7z a -tzip CMIDriver-%CMI_VERSION%-src.zip * cmicontrol\* cpl\* installer\*

View file

@ -1,14 +0,0 @@
@echo off
set CMI_DDKDIR=c:\WinDDK\6000
set CMI_BUILDDIR=C:\WinDDK\6000\src\Audio\CMedia
set CMI_VERSION=1.1.3
REM the slashes need to be escaped for sed.exe
set CMI_RELEASEDATE=06\/30\/2007
REM wxp | wlh
set CMI_DEBUGOS=wlh
REM x86 | AMD64
set CMI_DEBUGARCH=x86
REM WaveRT |
set CMI_DEBUGVER=
REM find out with 'devcon dp_enum'
set CMI_OEMINF="oem1.inf"

View file

@ -28,8 +28,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _INTERFACES_HPP_
#define _INTERFACES_HPP_
#include <ntddk.h>
#include <portcls.h>
#include <stdunk.h>
#include <debug.h>
#define MAXLEN_DMA_BUFFER 0x18000
#define MAX_OUTPUT_STREAMS 1

View file

@ -1,40 +0,0 @@
@echo off
call envars.bat
if "%DDKBUILDENV%"=="chk" goto :AlreadyDefined
call %CMI_DDKDIR%\bin\setenv %CMI_DDKDIR% chk %CMI_DEBUGARCH% %CMI_DEBUGOS%
:AlreadyDefined
cd %CMI_BUILDDIR%
if "%CMI_DEBUGARCH%"=="AMD64" goto :x64
set CMI_DEBUGDIR=objchk_%CMI_DEBUGOS%_%CMI_DEBUGARCH%\i386
mkdir %CMI_DEBUGDIR%
sed -e "s/CMIVersion/%CMI_VERSION%-dbg/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x32%WAVERTSTR%.INF >%CMI_DEBUGDIR%\CM8738.inf
goto start
:x64
set CMI_DEBUGDIR=objchk_%CMI_DEBUGOS%_%CMI_DEBUGARCH%\AMD64
mkdir %CMI_DEBUGDIR%
sed -e "s/CMIVersion/%CMI_VERSION%-dbg/" -e "s/CMIReleaseDate/%CMI_RELEASEDATE%/" CM8738-x64%WAVERTSTR%.inf >%CMI_DEBUGDIR%\CM8738.inf
:start
del %CMI_DEBUGDIR%\*.obj
sed -i "s/CMIVERSION.*/CMIVERSION \"%CMI_VERSION%-debug\"/" debug.hpp
if "%CMI_DEBUGVER%"=="WaveRT" goto :WaveRT
sed -i "s/^#define WAVERT/\/\/#define WAVERT/" debug.hpp
goto next
:WaveRT
sed -i "s/^\/\/#define WAVERT/#define WAVERT/" debug.hpp
:next
nmake /x errors.err
if "%CMI_DEBUGVER%"=="WaveRT" goto :WaveRT2
set WAVERTSTR=""
goto end
:WaveRT2
set WAVERTSTR="-WAVERT"
:end
sed -i "s/^cmicpl.*$//g" %CMI_DEBUGDIR%\CM8738.inf
sed -i "s/^CMICONTROL.*$//g" %CMI_DEBUGDIR%\CM8738.inf

View file

@ -1,6 +0,0 @@
!if defined(DDK_TARGET_OS) && "$(DDK_TARGET_OS)"!="Win2K"
!INCLUDE $(NTMAKEENV)\makefile.def
!else
!message This project is for Windows XP (or later) only.
!endif

View file

@ -35,18 +35,18 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NTSTATUS CreateMiniportTopologyCMI(PUNKNOWN* Unknown, REFCLSID, PUNKNOWN UnknownOuter, POOL_TYPE PoolType)
{
PAGED_CODE();
ASSERT(Unknown);
//PAGED_CODE();
//ASSERT(Unknown);
STD_CREATE_BODY_(CCMITopology,Unknown,UnknownOuter,PoolType,PMINIPORTTOPOLOGY);
}
STDMETHODIMP CCMITopology::NonDelegatingQueryInterface(REFIID Interface, PVOID* Object)
{
PAGED_CODE();
ASSERT(Object);
//PAGED_CODE();
//ASSERT(Object);
DBGPRINT(("CCMITopology::NonDelegatingQueryInterface"));
if (IsEqualGUIDAligned(Interface,IID_IUnknown)) {
if (IsEqualGUIDAligned(Interface, IID_IUnknown)) {
*Object = PVOID(PUNKNOWN(PMINIPORTTOPOLOGY(this)));
} else if (IsEqualGUIDAligned(Interface,IID_IMiniport)) {
*Object = PVOID(PMINIPORT(this));
@ -68,7 +68,7 @@ STDMETHODIMP CCMITopology::NonDelegatingQueryInterface(REFIID Interface, PVOID*
CCMITopology::~CCMITopology()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMITopology::~CCMITopology"));
@ -82,9 +82,9 @@ CCMITopology::~CCMITopology()
STDMETHODIMP CCMITopology::Init(PUNKNOWN UnknownAdapter, PRESOURCELIST ResourceList, PPORTTOPOLOGY Port)
{
PAGED_CODE();
ASSERT(UnknownAdapter);
ASSERT(Port);
//PAGED_CODE();
//ASSERT(UnknownAdapter);
//ASSERT(Port);
DBGPRINT(("CCMITopology::Init"));
NTSTATUS ntStatus = UnknownAdapter->QueryInterface(IID_ICMIAdapter, (PVOID *)&CMIAdapter);
@ -111,8 +111,8 @@ STDMETHODIMP CCMITopology::Init(PUNKNOWN UnknownAdapter, PRESOURCELIST ResourceL
STDMETHODIMP CCMITopology::GetDescription(PPCFILTER_DESCRIPTOR* OutFilterDescriptor)
{
PAGED_CODE();
ASSERT(OutFilterDescriptor);
//PAGED_CODE();
//ASSERT(OutFilterDescriptor);
DBGPRINT(("CCMITopology::GetDescription"));
*OutFilterDescriptor = &MiniportFilterDescriptor;
@ -122,7 +122,7 @@ STDMETHODIMP CCMITopology::GetDescription(PPCFILTER_DESCRIPTOR* OutFilterDescri
STDMETHODIMP CCMITopology::loadMixerSettingsFromRegistry()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMITopology::loadMixerSettingsFromRegistry"));
PREGISTRYKEY DriverKey;
@ -269,7 +269,7 @@ STDMETHODIMP CCMITopology::loadMixerSettingsFromRegistry()
STDMETHODIMP CCMITopology::storeMixerSettingsToRegistry()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMITopology::storeMixerSettingsToRegistry"));
PREGISTRYKEY DriverKey;
@ -429,7 +429,7 @@ STDMETHODIMP CCMITopology::storeMixerSettingsToRegistry()
STDMETHODIMP CCMITopology::loadMixerSettingsFromMemory()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMITopology::loadMixerSettingsFromMemory"));
CMIAdapter->resetMixer();
@ -449,7 +449,7 @@ STDMETHODIMP CCMITopology::loadMixerSettingsFromMemory()
STDMETHODIMP CCMITopology::storeMixerSettingsToMemory()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CCMITopology::storeMixerSettingsToMemory"));
mixer1Register = CMIAdapter->readUInt8(REG_MIXER1);
@ -462,10 +462,10 @@ STDMETHODIMP CCMITopology::storeMixerSettingsToMemory()
return STATUS_SUCCESS;
}
static NTSTATUS PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_OnOff]"));
CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
@ -1013,8 +1013,8 @@ static NTSTATUS PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS BasicSupportHandler(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[BasicSupportHandler]"));
NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
@ -1081,10 +1081,10 @@ static NTSTATUS BasicSupportHandler(PPCPROPERTY_REQUEST PropertyRequest)
return ntStatus;
}
static NTSTATUS PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_Level]"));
CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
@ -1218,11 +1218,10 @@ static NTSTATUS PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest)
return ntStatus;
}
static NTSTATUS PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_CpuResources]"));
NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
@ -1271,10 +1270,10 @@ static NTSTATUS PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyReque
return ntStatus;
}
NTSTATUS PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_ComponentId]"));
NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
@ -1317,10 +1316,10 @@ NTSTATUS PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest)
return ntStatus;
}
NTSTATUS PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_Private]"));
NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
@ -1347,8 +1346,8 @@ NTSTATUS PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest)
#endif
cmiData->hardwareRevision = that->cm->chipVersion;
cmiData->maxChannels = that->cm->maxChannels;
cmiData->IOBase = (USHORT)that->cm->IOBase;
cmiData->MPUBase = (USHORT)that->cm->MPUBase;
cmiData->IOBase = (USHORT)(ULONG_PTR)that->cm->IOBase;
cmiData->MPUBase = (USHORT)(ULONG_PTR)that->cm->MPUBase;
cmiData->enableSPDO = that->cm->enableSPDIFOut;
cmiData->enableSPDI = that->cm->enableSPDIFIn;
cmiData->formatMask = that->cm->formatMask;

View file

@ -80,14 +80,14 @@ public:
);
//friends
friend NTSTATUS PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS PropertyHandler_Mux(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_Mux(PPCPROPERTY_REQUEST PropertyRequest);
static NTSTATUS EventHandler(PPCEVENT_REQUEST EventRequest);
static NTSTATUS NTAPI EventHandler(PPCEVENT_REQUEST EventRequest);
};
#endif //_MINTOPO_HPP_

View file

@ -37,6 +37,11 @@ DEFINE_GUIDSTRUCT("00000092-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_D
#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF)
#endif
NTSTATUS NTAPI PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest);
NTSTATUS NTAPI PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest);
NTSTATUS NTAPI PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest);
NTSTATUS NTAPI PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest);
NTSTATUS NTAPI PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest);
static KSDATARANGE PinDataRangesBridge[] =
{
@ -292,15 +297,16 @@ static PCPROPERTY_ITEM PropertiesVolume[] =
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_VOLUMELEVEL,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_Level
(PCPFNPROPERTY_HANDLER)PropertyHandler_Level
},
{
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_CPU_RESOURCES,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_CpuResources
(PCPFNPROPERTY_HANDLER)PropertyHandler_CpuResources
}
};
DEFINE_PCAUTOMATION_TABLE_PROP(AutomationVolume,PropertiesVolume);
static PCPROPERTY_ITEM PropertiesLoudness[] =
@ -309,13 +315,13 @@ static PCPROPERTY_ITEM PropertiesLoudness[] =
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_LOUDNESS,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_OnOff
(PCPFNPROPERTY_HANDLER)PropertyHandler_OnOff
},
{
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_CPU_RESOURCES,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_CpuResources
(PCPFNPROPERTY_HANDLER)PropertyHandler_CpuResources
}
};
DEFINE_PCAUTOMATION_TABLE_PROP(AutomationLoudness,PropertiesLoudness);
@ -326,13 +332,13 @@ static PCPROPERTY_ITEM PropertiesMute[] =
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_MUTE,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_OnOff
(PCPFNPROPERTY_HANDLER)PropertyHandler_OnOff
},
{
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_CPU_RESOURCES,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_CpuResources
(PCPFNPROPERTY_HANDLER)PropertyHandler_CpuResources
}
};
DEFINE_PCAUTOMATION_TABLE_PROP(AutomationMute,PropertiesMute);
@ -343,19 +349,19 @@ static PCPROPERTY_ITEM PropertiesFilter[] =
&KSPROPSETID_General,
KSPROPERTY_GENERAL_COMPONENTID,
KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
PropertyHandler_ComponentId
(PCPFNPROPERTY_HANDLER)PropertyHandler_ComponentId
},
{
&KSPROPSETID_CMI,
KSPROPERTY_CMI_GET,
KSPROPERTY_TYPE_GET,
PropertyHandler_Private
(PCPFNPROPERTY_HANDLER)PropertyHandler_Private
},
{
&KSPROPSETID_CMI,
KSPROPERTY_CMI_SET,
KSPROPERTY_TYPE_SET,
PropertyHandler_Private
(PCPFNPROPERTY_HANDLER)PropertyHandler_Private
}
};
DEFINE_PCAUTOMATION_TABLE_PROP(AutomationFilter,PropertiesFilter);

View file

@ -33,8 +33,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NTSTATUS CreateMiniportWaveCMI(PUNKNOWN *Unknown, REFCLSID, PUNKNOWN UnknownOuter, POOL_TYPE PoolType)
{
PAGED_CODE();
ASSERT(Unknown);
//PAGED_CODE();
//ASSERT(Unknown);
#ifdef WAVERT
STD_CREATE_BODY_(CMiniportWaveCMI,Unknown,UnknownOuter,PoolType,PMINIPORTWAVERT);
#else
@ -44,8 +44,8 @@ NTSTATUS CreateMiniportWaveCMI(PUNKNOWN *Unknown, REFCLSID, PUNKNOWN UnknownOute
NTSTATUS CMiniportWaveCMI::processResources(PRESOURCELIST resourceList)
{
PAGED_CODE();
ASSERT (resourceList);
//PAGED_CODE();
//ASSERT (resourceList);
DBGPRINT(("CMiniportWaveCMI[%p]::ProcessResources(%p)", this, resourceList));
if (resourceList->NumberOfInterrupts() < 1) {
@ -58,8 +58,8 @@ NTSTATUS CMiniportWaveCMI::processResources(PRESOURCELIST resourceList)
#ifndef WAVERT
NTSTATUS CMiniportWaveCMI::newDMAChannel(PDMACHANNEL *dmaChannel, UInt32 bufferLength)
{
PAGED_CODE();
ASSERT(dmaChannel);
//PAGED_CODE();
//ASSERT(dmaChannel);
DBGPRINT(("CMiniportWaveCMI[%p]::newDMAChannel(%p)", this, dmaChannel));
NTSTATUS ntStatus;
@ -79,8 +79,8 @@ NTSTATUS CMiniportWaveCMI::newDMAChannel(PDMACHANNEL *dmaChannel, UInt32 bufferL
//generic crap
STDMETHODIMP CMiniportWaveCMI::NonDelegatingQueryInterface(REFIID Interface, PVOID *Object)
{
PAGED_CODE();
ASSERT(Object);
//PAGED_CODE();
//ASSERT(Object);
DBGPRINT(("CMiniportWaveCMI[%p]::NonDelegatingQueryInterface"));
if (IsEqualGUIDAligned(Interface,IID_IUnknown)) {
@ -113,7 +113,7 @@ STDMETHODIMP CMiniportWaveCMI::NonDelegatingQueryInterface(REFIID Interface, PVO
CMiniportWaveCMI::~CMiniportWaveCMI(void)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveCMI[%p]::~CMiniportWaveCMI", this));
storeChannelConfigToRegistry(); //or not. during system shutdown, this doesn't seem to work.
@ -149,11 +149,11 @@ STDMETHODIMP CMiniportWaveCMI::Init(PUNKNOWN UnknownAdapter, PRESOURCELIST Resou
STDMETHODIMP CMiniportWaveCMI::Init(PUNKNOWN UnknownAdapter, PRESOURCELIST ResourceList, PPORTWAVECYCLIC Port_)
#endif
{
PAGED_CODE();
//PAGED_CODE();
ASSERT(UnknownAdapter);
ASSERT(ResourceList);
ASSERT(Port_);
//ASSERT(UnknownAdapter);
//ASSERT(ResourceList);
//ASSERT(Port_);
DBGPRINT(("CMiniportWaveCMI[%p]::Init(%p, %p, %p)", this, UnknownAdapter, ResourceList, Port_));
@ -201,8 +201,8 @@ STDMETHODIMP CMiniportWaveCMI::Init(PUNKNOWN UnknownAdapter, PRESOURCELIST Resou
#ifdef WAVERT
STDMETHODIMP_(NTSTATUS) CMiniportWaveCMI::GetDeviceDescription(PDEVICE_DESCRIPTION OutDeviceDescriptor)
{
PAGED_CODE();
ASSERT(OutDeviceDescriptor);
//PAGED_CODE();
//ASSERT(OutDeviceDescriptor);
DBGPRINT(("CMiniportWaveCMI[%p]::GetDeviceDescription(%p)", this, OutDeviceDescriptor));
RtlZeroMemory(OutDeviceDescriptor, sizeof(DEVICE_DESCRIPTION));
@ -218,8 +218,8 @@ STDMETHODIMP_(NTSTATUS) CMiniportWaveCMI::GetDeviceDescription(PDEVICE_DESCRIPTI
STDMETHODIMP CMiniportWaveCMI::GetDescription(PPCFILTER_DESCRIPTOR *OutFilterDescriptor)
{
PAGED_CODE();
ASSERT(OutFilterDescriptor);
//PAGED_CODE();
//ASSERT(OutFilterDescriptor);
DBGPRINT(("CMiniportWaveCMI[%p]::GetDescription(%p)", this, OutFilterDescriptor));
*OutFilterDescriptor = &WaveMiniportFilterDescriptor;
@ -229,7 +229,7 @@ STDMETHODIMP CMiniportWaveCMI::GetDescription(PPCFILTER_DESCRIPTOR *OutFilterDes
NTSTATUS CMiniportWaveCMI::loadChannelConfigFromRegistry()
{
PAGED_CODE();
//PAGED_CODE();
PREGISTRYKEY DriverKey;
PREGISTRYKEY SettingsKey;
UNICODE_STRING KeyName;
@ -291,7 +291,7 @@ NTSTATUS CMiniportWaveCMI::loadChannelConfigFromRegistry()
NTSTATUS CMiniportWaveCMI::storeChannelConfigToRegistry()
{
PAGED_CODE();
//PAGED_CODE();
PREGISTRYKEY DriverKey;
PREGISTRYKEY SettingsKey;
UNICODE_STRING KeyName;
@ -339,7 +339,7 @@ NTSTATUS CMiniportWaveCMI::storeChannelConfigToRegistry()
STDMETHODIMP_(void) CMiniportWaveCMI::powerUp(void)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveCMI[%p]::powerUp()", this));
KSSTATE oldState[3];
@ -365,7 +365,7 @@ STDMETHODIMP_(void) CMiniportWaveCMI::powerUp(void)
STDMETHODIMP_(void) CMiniportWaveCMI::powerDown(void)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveCMI[%p]::powerDown()", this));
if (cm->TopoMiniport) {
@ -377,8 +377,8 @@ STDMETHODIMP_(void) CMiniportWaveCMI::powerDown(void)
NTSTATUS CMiniportWaveCMI::isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
{
PAGED_CODE();
ASSERT(sampleRate);
//PAGED_CODE();
//ASSERT(sampleRate);
DBGPRINT(("CMiniportWaveCMI[%p]::isFormatAllowed(%d, %d, %d)", this, sampleRate, multiChan, AC3));
if (multiChan) {
@ -410,8 +410,8 @@ NTSTATUS CMiniportWaveCMI::isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan,
NTSTATUS CMiniportWaveCMI::validateFormat(PKSDATAFORMAT format, ULONG PinID, BOOLEAN capture)
{
PAGED_CODE();
ASSERT(format);
//PAGED_CODE();
//ASSERT(format);
DBGPRINT(("CMiniportWaveCMI[%p]::validateFormat(%p, %d, %d)", this, format, PinID, capture));
PWAVEFORMATEX waveFormat = PWAVEFORMATEX(format + 1);
@ -468,7 +468,7 @@ NTSTATUS CMiniportWaveCMI::validateFormat(PKSDATAFORMAT format, ULONG PinID, BOO
// Tests a data range intersection
STDMETHODIMP CMiniportWaveCMI::DataRangeIntersection(ULONG PinId, PKSDATARANGE ClientDataRange, PKSDATARANGE MyDataRange, ULONG OutputBufferLength, PVOID ResultantFormat, PULONG ResultantFormatLength)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveCMI[%p]::DataRangeIntersection(%d, %p, %p, %d, %p, %p)", this, PinId, ClientDataRange, MyDataRange, OutputBufferLength, ResultantFormat, ResultantFormatLength));
if (PinId == PIN_WAVE_AC3_RENDER_SINK) {
@ -722,14 +722,14 @@ STDMETHODIMP CMiniportWaveCMI::NewStream(PMINIPORTWAVERTSTREAM *OutStream, PPORT
STDMETHODIMP CMiniportWaveCMI::NewStream(PMINIPORTWAVECYCLICSTREAM *OutStream, PUNKNOWN OuterUnknown, POOL_TYPE PoolType, ULONG PinID, BOOLEAN Capture, PKSDATAFORMAT DataFormat, PDMACHANNEL* OutDmaChannel, PSERVICEGROUP* OutServiceGroup)
#endif
{
PAGED_CODE();
ASSERT(OutStream);
ASSERT(DataFormat);
//PAGED_CODE();
//ASSERT(OutStream);
//ASSERT(DataFormat);
#ifdef WAVERT
DBGPRINT(("CMiniportWaveCMI[%p]::NewStream(%p, %p, %d, %d, %p)", this, OutStream, OuterUnknown, PinID, Capture, DataFormat));
#else
ASSERT(OutDmaChannel);
ASSERT(OutServiceGroup);
//ASSERT(OutDmaChannel);
//ASSERT(OutServiceGroup);
DBGPRINT(("CMiniportWaveCMI[%p]::NewStream(%p, %p, %p, %d, %d, %p, %p, %p)", this, OutStream, OuterUnknown, PoolType, PinID, Capture, DataFormat, OutDmaChannel, OutServiceGroup));
#endif
@ -820,10 +820,10 @@ STDMETHODIMP CMiniportWaveCMI::NewStream(PMINIPORTWAVECYCLICSTREAM *OutStream, P
return ntStatus;
}
static NTSTATUS PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest)
{
PAGED_CODE();
ASSERT(PropertyRequest);
//PAGED_CODE();
//ASSERT(PropertyRequest);
DBGPRINT(("[PropertyHandler_ChannelConfig]"));
#ifdef WAVERT
@ -881,7 +881,7 @@ static NTSTATUS PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyReques
NTSTATUS CreateMiniportWaveStreamCMI(CMiniportWaveStreamCMI **MiniportWaveStreamCMI, PUNKNOWN pUnknownOuter, POOL_TYPE PoolType)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CreateMiniportWaveStreamCMI"));
#ifdef WAVERT
@ -899,7 +899,7 @@ NTSTATUS CreateMiniportWaveStreamCMI(CMiniportWaveStreamCMI **MiniportWaveStrea
NTSTATUS CMiniportWaveStreamCMI::prepareStream()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::prepareStream()", this));
DBGPRINT(("---streamIndex: %d, channelNumber: %d", streamIndex, channelNumber));
@ -982,7 +982,7 @@ NTSTATUS CMiniportWaveStreamCMI::prepareStream()
NTSTATUS CMiniportWaveStreamCMI::setDACChannels()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::setDACChannels()", this));
NTSTATUS ntStatus = STATUS_SUCCESS;
@ -1046,7 +1046,7 @@ NTSTATUS CMiniportWaveStreamCMI::setDACChannels()
NTSTATUS CMiniportWaveStreamCMI::setupSPDIFPlayback(bool enableSPDIF)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::setupSPDIFPlayback(%d)", this, enableSPDIF));
NTSTATUS ntStatus;
@ -1115,7 +1115,7 @@ NTSTATUS CMiniportWaveStreamCMI::setupSPDIFPlayback(bool enableSPDIF)
NTSTATUS CMiniportWaveStreamCMI::setupAC3Passthru()
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::setupAC3Passthru()"));
if (enableAC3Passthru) {
@ -1177,7 +1177,7 @@ NTSTATUS CMiniportWaveStreamCMI::setupAC3Passthru()
CMiniportWaveStreamCMI::~CMiniportWaveStreamCMI(void)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::~CMiniportWaveStreamCMI", this));
@ -1217,8 +1217,8 @@ CMiniportWaveStreamCMI::~CMiniportWaveStreamCMI(void)
STDMETHODIMP CMiniportWaveStreamCMI::NonDelegatingQueryInterface(REFIID Interface, PVOID *Object)
{
PAGED_CODE();
ASSERT(Object);
//PAGED_CODE();
//ASSERT(Object);
DBGPRINT(("CMiniportWaveStreamCMI[%p]::NonDelegatingQueryInterface(%p, %p)", this, Interface, Object));
if (IsEqualGUIDAligned(Interface,IID_IUnknown)) {
@ -1250,14 +1250,14 @@ NTSTATUS CMiniportWaveStreamCMI::Init(CMiniportWaveCMI* Miniport_, UInt32 stream
NTSTATUS CMiniportWaveStreamCMI::Init(CMiniportWaveCMI* Miniport_, UInt32 streamIndex_, bool isCaptureStream_, PKSDATAFORMAT DataFormat, PDMACHANNEL DMAChannel_, PSERVICEGROUP* OutServiceGroup)
#endif
{
PAGED_CODE();
ASSERT(Miniport_);
ASSERT(DataFormat);
//PAGED_CODE();
//ASSERT(Miniport_);
//ASSERT(DataFormat);
NTSTATUS ntStatus;
#ifdef WAVERT
ASSERT(Port_);
//ASSERT(Port_);
DBGPRINT(("CMiniportWaveStreamCMI[%p]::Init(%p, %d, %d, %p, %p)", this, Miniport_, streamIndex_, isCaptureStream_, DataFormat, Port_));
Port = Port_;
Port->AddRef();
@ -1303,7 +1303,7 @@ NTSTATUS CMiniportWaveStreamCMI::Init(CMiniportWaveCMI* Miniport_, UInt32 stream
NTSTATUS CMiniportWaveStreamCMI::SetFormat(PKSDATAFORMAT Format)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::SetFormat(%p)", this, Format));
PWAVEFORMATEX waveFormat = PWAVEFORMATEX(Format + 1);
NTSTATUS ntStatus = Miniport->validateFormat(Format, -1, isCaptureStream);
@ -1344,7 +1344,7 @@ NTSTATUS CMiniportWaveStreamCMI::SetFormat(PKSDATAFORMAT Format)
// DRM crap - we're supposed to disable every digital interface here
STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::SetContentId(ULONG contentId, PCDRMRIGHTS drmRights)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::SetContentId(%d, %p)", this, contentId, drmRights));
return STATUS_SUCCESS;
@ -1354,7 +1354,7 @@ STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::SetContentId(ULONG contentId, PC
STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::AllocateAudioBuffer(ULONG size, PMDL *userModeBuffer, ULONG *bufferSize, ULONG *bufferOffset, MEMORY_CACHING_TYPE *cacheType)
{
PAGED_CODE();
//PAGED_CODE();
PHYSICAL_ADDRESS low;
PHYSICAL_ADDRESS high;
@ -1393,7 +1393,7 @@ STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::AllocateAudioBuffer(ULONG size,
STDMETHODIMP_(VOID) CMiniportWaveStreamCMI::FreeAudioBuffer(PMDL Mdl, ULONG Size)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::FreeAudioBuffer(%p, %x)", this, Mdl, Size));
Port->FreePagesFromMdl(Mdl);
@ -1403,7 +1403,7 @@ STDMETHODIMP_(VOID) CMiniportWaveStreamCMI::FreeAudioBuffer(PMDL Mdl, ULONG Size
}
STDMETHODIMP_(void) CMiniportWaveStreamCMI::GetHWLatency(PKSRTAUDIO_HWLATENCY hwLatency) {
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::GetHWLatency(%p)", this, hwLatency));
hwLatency->FifoSize = 32;
hwLatency->ChipsetDelay = 0;
@ -1412,7 +1412,7 @@ STDMETHODIMP_(void) CMiniportWaveStreamCMI::GetHWLatency(PKSRTAUDIO_HWLATENCY hw
STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::GetPositionRegister(PKSRTAUDIO_HWREGISTER hwRegister)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::GetPositionRegister(%p)", this, hwRegister));
return STATUS_UNSUCCESSFUL;
@ -1420,7 +1420,7 @@ STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::GetPositionRegister(PKSRTAUDIO_H
STDMETHODIMP_(NTSTATUS) CMiniportWaveStreamCMI::GetClockRegister(PKSRTAUDIO_HWREGISTER hwRegister)
{
PAGED_CODE();
//PAGED_CODE();
DBGPRINT(("CMiniportWaveStreamCMI[%p]::GetClockRegister(%p)", this, hwRegister));
return STATUS_UNSUCCESSFUL;
@ -1578,7 +1578,7 @@ STDMETHODIMP CMiniportWaveStreamCMI::SetState(KSSTATE NewState)
#ifdef WAVERT
STDMETHODIMP CMiniportWaveStreamCMI::GetPosition(PKSAUDIO_POSITION Position)
{
ASSERT(Position);
//ASSERT(Position);
UInt32 reg;
@ -1597,7 +1597,7 @@ STDMETHODIMP CMiniportWaveStreamCMI::GetPosition(PKSAUDIO_POSITION Position)
#else //WaveCyclic
STDMETHODIMP CMiniportWaveStreamCMI::GetPosition(PULONG Position)
{
ASSERT(Position);
//ASSERT(Position);
UInt32 reg;

View file

@ -85,7 +85,7 @@ public:
STDMETHODIMP_(void) powerUp();
STDMETHODIMP_(void) powerDown();
friend NTSTATUS PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest);
friend NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest);
friend class CMiniportWaveStreamCMI;
};

View file

@ -33,6 +33,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
DEFINE_GUIDSTRUCT("00000092-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF);
#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF)
NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest);
static KSDATARANGE_AUDIO WavePinDataRangesPCMStream[] =
{
{
@ -274,7 +277,7 @@ static PCPROPERTY_ITEM PropertiesChannels[] =
&KSPROPSETID_Audio,
KSPROPERTY_AUDIO_CHANNEL_CONFIG,
KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET,
PropertyHandler_ChannelConfig
(PCPFNPROPERTY_HANDLER)PropertyHandler_ChannelConfig
}
};
DEFINE_PCAUTOMATION_TABLE_PROP(AutomationChans,PropertiesChannels);

View file

@ -1,20 +0,0 @@
TARGETNAME=cmipci
TARGETTYPE=DRIVER
TARGETPATH=obj
TARGETLIBS= $(DDK_LIB_PATH)\portcls.lib \
$(DDK_LIB_PATH)\stdunk.lib \
$(SDK_LIB_PATH)\libcntpr.lib \
$(DDK_LIB_PATH)\ntstrsafe.lib
INCLUDES=
MSC_WARNING_LEVEL=-WX
C_DEFINES= $(C_DEFINES) -D_WIN32 -DUNICODE -D_UNICODE -DDEBUG_LEVEL=DEBUGLVL_TERSE
SOURCES = adapter.cpp \
common.cpp \
mintopo.cpp \
minwave.cpp \
cmipci.rc

View file

@ -1,12 +0,0 @@
@echo off
call envars.bat
if "%CMI_DEBUGARCH%"=="AMD64" goto :x64
set CMI_DEBUGDIR=objchk_%CMI_DEBUGOS%_%CMI_DEBUGARCH%\i386
goto start
:x64
set CMI_DEBUGDIR=objchk_%CMI_DEBUGOS%_%CMI_DEBUGARCH%\AMD64
:start
devcon remove "PCI\VEN_13F6&DEV_0111&SUBSYS_011113F6&REV_10"
devcon dp_delete %CMI_OEMINF%
devcon rescan
devcon update %CMI_DEBUGDIR%\CM8738.INF "PCI\VEN_13F6&DEV_0111&SUBSYS_011113F6&REV_10"