Compiling MSVAD under Windows 2000

Getting the MSVAD samples from the Windows DDK disk to compile and run under Windows 2000 is a little more complicated than you might expect.

The following details the problems I encountered, and workarounds for each of them. Before you go down this road, consider that the problems described below are all limited to the Windows 2000 build environment. If you instead build in the XP environment (on a W2K machine) the drivers build cleanly out of the box.

Building The MSVAD Drivers

The instructions included in the DDK are out of date:

To build this sample, start DDK build environment and run build from
the \Ntddk\Src\Audio directory, rather than the MSVAD subdirectory.
This sample links with Stdunk.lib, which is also built if you run 
build from \Ntddk\Src\Audio.

Those instructions are from an older version of the DDK, and are of no use. I found it necessary to first build the support libraries, and then build the msvad drivers. We will cover the problems getting the support libraries to build first.

cd \winddk\2600\src\wdm\audio
build

invalid include statement: importlib(STDOLE_TLB)

The BUILD script generates warnings like the following

D:\WINDDK00\src\wdm\audio>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK00\build.dat...
BUILD: Computing Include file dependencies:
BUILD: d:\inetsdk\include\exdisp.odl(31): 
 d:\inetsdk\include\exdisp.odl - invalid include statement: importlib(STDOLE_TLB);

The problem here is that the BUILD script is scanning for dependencies, and is not smart enough to expand macros like this:

#define STDOLE_TLB "stdole.tlb"
importlib(STDOLE_TLB);

You can fix this by replacing the occurence of STDOLE_TLB with the literal "stdole.tlb" explicitly:

importlib("stdole.tlb");

however the errors are non-fatal, so you can safely ignore them if you prefer not to mess up your global include files.

Cannot Find Include File <ole.h>

The next set of errors from BUILD are these

D:\WINDDK\2600\src\wdm\audio>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: d:\winddk\2600\src\wdm\audio\ac97\cpl\ac97cpl.rc: d:\winddk\2600\inc\w2k\
windows.h: cannot find include file <ole.h>

This is another problem with the BUILD script looking for dependencies. The file ole.h exists at D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE, which is not in the include path by default. For my setup I can get rid of the ole.h warning with the following:

set INCLUDE=D:\WINDDK\2600\inc\w2k;D:\WINDDK\2600\inc;D:\INetSDK\Include;D:\Program Files\Microsoft SDK\Include\.;\
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE

Cannot Find Include File <macwin32.h>

D:\WINDDK\2600\src\wdm\audio>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: d:\winddk\2600\src\wdm\audio\ac97\cpl\ac97cpl.rc: d:\winddk\2600\inc\crt\
winbase.h: cannot find include file <macwin32.h>
BUILD: d:\winddk\2600\src\wdm\audio\ac97\cpl\ac97cpl.rc: d:\winddk\2600\inc\crt\
wingdi.h: cannot find include file <macwin32.h>
BUILD: d:\winddk\2600\src\wdm\audio\ac97\cpl\ac97cpl.rc: d:\winddk\2600\inc\crt\

Once again the BUILD script is failing. In this case it is ignoring an #ifdef and trying to scan for a file that doesn't exist.

These warnings can be safely ignored. If you want to get rid of the warning you can create an empty include file like this:

echo > \WINDDK\2600\inc\w2k\macwin32.h

Cannot Find Include File <alpharef.h>

D:\WINDDK\2600\src\wdm\audio>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Examining d:\winddk\2600\src\wdm\audio directory tree for files to compile.
d:\winddk\2600\src\wdm\audio\ac97\cpl - 2 source files (468 lines)
d:\winddk\2600\src\wdm\audio\ac97\driver - 7 source files (10,247 lines)
d:\winddk\2600\src\wdm\audio\ac97\proppage - 2 source files (688 lines)
BUILD: d:\winddk\2600\src\wdm\audio\fmsynth\miniport.cpp:\
d:\winddk\2600\inc\ddk\wdm\w2k\wdm.h: cannot find include file "alpharef.h"

This is another problem with the BUILD dependency scanner. You can ignore this warning, or do a hack like the following:

echo > \WINDDK\2600\inc\w2k\alpharef.h

Clean Library Build

At this point I get a clean build in the audio directory, but the drivers themselves are not built:

D:\WINDDK\2600\src\wdm\audio>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Examining d:\winddk\2600\src\wdm\audio directory tree for files to compile.
d:\winddk\2600\src\wdm\audio\ac97\driver - 7 source files (10,247 lines)
d:\winddk\2600\src\wdm\audio\fmsynth - 1 source files (2,479 lines)
d:\winddk\2600\src\wdm\audio\stdunk - 1 source files (117 lines)
BUILD: Saving D:\WINDDK\2600\build.dat...
Total of 9 source files (12,843 lines) to compile in 3 directories

BUILD: Compiling d:\winddk\2600\src\wdm\audio\ac97\driver directory
BUILD: Compiling d:\winddk\2600\src\wdm\audio\fmsynth directory
Compiling - fmsynth\miniport.cpp for i386
Building Library - lib\i386\fmsynth.lib for i386
BUILD: Compiling d:\winddk\2600\src\wdm\audio\stdunk directory
Compiling - stdunk\stdunk.cpp for i386
Building Library - lib\i386\stdunk.lib for i386
BUILD: Linking d:\winddk\2600\src\wdm\audio\ac97\cpl directory
BUILD: Linking d:\winddk\2600\src\wdm\audio\ac97\driver directory
BUILD: Linking d:\winddk\2600\src\wdm\audio\ac97\proppage directory
BUILD: Done

4 files compiled -  2596 LPS
2 libraries built

Building the Drivers

Once the support libraries have been built, you can move onto the msvad drivers.

cd \winddk\2600\src\wdm\audio\msvad
build

The first error I encountered building the MSVAD drivers was this

common.cpp(353) : error C2065: 'IID_IAdapterPowerManagement' : undeclared identifier
common.cpp(355) : error C2065: 'PADAPTERPOWERMANAGEMENT' : undeclared identifier

This is a bit of a giggle. These interfaces are only defined for XP, but this line in the XP header file reveals the story:

\winddk\2600\inc\ddk\wxp\portcls.h
//
//  N.B.: If you are having problems building your driver,
//        #define PC_OLD_NAMES in your sources file.
//        This flag is no longer turned on by default.
//
//#ifndef PC_NEW_NAMES
//#define PC_OLD_NAMES
//#endif
#define IID_IAdapterPowerManagment IID_IAdapterPowerManagement
#define PADAPTERPOWERMANAGMENT PADAPTERPOWERMANAGEMENT

Seems in w2k these interfaces had misspelled name. You can fix this by dropping the E's in msvad\common.c as follows.

\winddk\2600\src\wdm\audio\msvad\common.c
	else if (IsEqualGUIDAligned(Interface, IID_IAdapterPowerManagment))
	{
*Object = PVOID(PADAPTERPOWERMANAGMENT(this));

Missing ';' before identifier 'm_pDrmPort'

The next problem looks like this

drmmult\minwave.h(42) : error C2146: syntax error : missing ';' before identifier 'm_pDrmPort'
drmmult\minwave.h(42) : error C2501: 'CMiniportWaveCyclic::PDRMPORT' : missing storage-class or type specifiers

The problem is that the digital rights management (DRM) definitions are only available in the XP header files. I ported a bunch of the definitions from \WINDDK\2600\inc\ddk\wxp\portcls.h and \WINDDK\2600\inc\ddk\wxp\drmk.h over to w2k, but it began to look like a house of cards. Since my interest is not in the DRM drivers, I don't really care if they don't build. So I left them failing.

don't know how to make 'D:\WINDDK\2600\lib\w2k\i386\stdunk.lib'

The final major build error was during linking.

BUILD: Linking d:\winddk\2600\src\wdm\audio\msvad\ac3 directory
NMAKE :  U1073: don't know how to make 'D:\WINDDK\2600\lib\w2k\i386\stdunk.lib'

It seems the w2k libraries do not get copied into the necessary places automatically. I copied them over manually and the non-drm drivers built.

copy d:\winddk\2600\src\wdm\audio\lib\i386\*.lib d:\winddk\2600\lib\w2k\i386

Final MSVAD Build

D:\WINDDK\2600\src\wdm\audio\msvad>build
BUILD: Object root set to: ==> objfre_w2k
BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: /i switch ignored
BUILD: Compile and Link for i386
BUILD: Loading D:\WINDDK\2600\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Examining d:\winddk\2600\src\wdm\audio\msvad directory tree for files to
compile.
    d:\winddk\2600\src\wdm\audio\msvad\ac3 - 11 source files (1,139 lines)
    d:\winddk\2600\src\wdm\audio\msvad\drmmult - 11 source files (1,134 lines)
    d:\winddk\2600\src\wdm\audio\msvad\drmsimp - 11 source files (982 lines)
    d:\winddk\2600\src\wdm\audio\msvad\ds2dhw - 11 source files (1,096 lines)
    d:\winddk\2600\src\wdm\audio\msvad\multstr - 11 source files (1,016 lines)
    d:\winddk\2600\src\wdm\audio\msvad\pcmex - 11 source files (1,121 lines)
    d:\winddk\2600\src\wdm\audio\msvad\simple - 11 source files (1,059 lines)
Total of 77 source files (7,547 lines) to compile in 7 directories

BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\ac3 directory
Compiling - msvad.rc for i386
Compiling - ac3\adapter.cpp for i386
Compiling - ac3\basedma.cpp for i386
Compiling - ac3\basetopo.cpp for i386
Compiling - ac3\basewave.cpp for i386
Compiling - ac3\common.cpp for i386
Compiling - ac3\hw.cpp for i386
Compiling - ac3\kshelper.cpp for i386
Compiling - ac3\savedata.cpp for i386
Compiling - ac3\mintopo.cpp for i386
Compiling - ac3\minwave.cpp for i386
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\drmmult directory
Compiling - msvad.rc for i386
Compiling - drmmult\adapter.cpp for i386
Compiling - drmmult\basedma.cpp for i386
Compiling - drmmult\basetopo.cpp for i386
Compiling - drmmult\basewave.cpp for i386
Compiling - drmmult\common.cpp for i386
Compiling - drmmult\hw.cpp for i386
Compiling - drmmult\kshelper.cpp for i386
Compiling - drmmult\savedata.cpp for i386
Compiling - drmmult\mintopo.cpp for i386
drmmult\minwave.h(42) : error C2146: syntax error : missing ';' before identifie
r 'm_pDrmPort'
drmmult\minwave.h(42) : error C2501: 'CMiniportWaveCyclic::PDRMPORT' : missing s
torage-class or type specifiers
drmmult\minwave.h(42) : error C2501: 'CMiniportWaveCyclic::m_pDrmPort' : missing
 storage-class or type specifiers
drmmult\minwave.h(44) : error C2146: syntax error : missing ';' before identifie
r 'm_MixDrmRights'
drmmult\minwave.h(44) : error C2501: 'CMiniportWaveCyclic::DRMRIGHTS' : missing
storage-class or type specifiers
drmmult\minwave.h(44) : error C2501: 'CMiniportWaveCyclic::m_MixDrmRights' : mis
sing storage-class or type specifiers
drmmult\minwave.h(71) : error C2504: 'IDrmAudioStream' : base class undefined
drmmult\minwave.h(85) : error C2501: 'CMiniportWaveCyclicStream::IMP_IDrmAudioSt
ream' : missing storage-class or type specifiers
Compiling - drmmult\minwave.cpp for i386
drmmult\minwave.h(42) : error C2146: syntax error : missing ';' before identifie
r 'm_pDrmPort'
drmmult\minwave.h(42) : error C2501: 'CMiniportWaveCyclic::PDRMPORT' : missing s
torage-class or type specifiers
drmmult\minwave.h(42) : error C2501: 'CMiniportWaveCyclic::m_pDrmPort' : missing
 storage-class or type specifiers
drmmult\minwave.h(44) : error C2146: syntax error : missing ';' before identifie
r 'm_MixDrmRights'
drmmult\minwave.h(44) : error C2501: 'CMiniportWaveCyclic::DRMRIGHTS' : missing
storage-class or type specifiers
drmmult\minwave.h(44) : error C2501: 'CMiniportWaveCyclic::m_MixDrmRights' : mis
sing storage-class or type specifiers
drmmult\minwave.h(71) : error C2504: 'IDrmAudioStream' : base class undefined
drmmult\minwave.h(85) : error C2501: 'CMiniportWaveCyclicStream::IMP_IDrmAudioSt
ream' : missing storage-class or type specifiers
drmmult\minwave.cpp(86) : error C2065: 'm_pDrmPort' : undeclared identifier
drmmult\minwave.cpp(88) : error C2227: left of '->Release' must point to class/s
truct/union
drmmult\minwave.cpp(237) : error C2065: 'm_MixDrmRights' : undeclared identifier

drmmult\minwave.cpp(237) : error C2070: ''unknown-type'': illegal sizeof operand

drmmult\minwave.cpp(259) : error C2065: 'IID_IDrmPort' : undeclared identifier
drmmult\minwave.cpp(508) : error C2065: 'DRMRIGHTS' : undeclared identifier
drmmult\minwave.cpp(508) : error C2146: syntax error : missing ';' before identi
fier 'MixDrmRights'
drmmult\minwave.cpp(508) : error C2065: 'MixDrmRights' : undeclared identifier
drmmult\minwave.cpp(508) : error C2059: syntax error : '{'
drmmult\minwave.cpp(508) : error C2143: syntax error : missing ';' before '{'
drmmult\minwave.cpp(508) : error C2143: syntax error : missing ';' before '}'
drmmult\minwave.cpp(512) : error C2171: '!' : illegal on operands of type ''unkn
own-type''
drmmult\minwave.cpp(534) : error C2227: left of '->CreateContentMixed' must poin
t to class/struct/union
drmmult\minwave.cpp(543) : error C2227: left of '->GetContentRights' must point
to class/struct/union
drmmult\minwave.cpp(554) : error C2227: left of '->DestroyContent' must point to
 class/struct/union
drmmult\minwave.cpp(556) : error C2070: ''unknown-type'': illegal sizeof operand

drmmult\minwave.cpp(570) : error C2227: left of '->DestroyContent' must point to
 class/struct/union
drmmult\minwave.cpp(715) : error C2065: 'IID_IDrmAudioStream' : undeclared ident
ifier
drmmult\minwave.cpp(717) : error C2065: 'PDRMAUDIOSTREAM' : undeclared identifie
r
drmmult\minwave.cpp(717) : error C2440: '=' : cannot convert from ''unknown-type
'' to 'PVOID'
drmmult\minwave.cpp(717) : error C2143: syntax error : missing ';' before 'this'

drmmult\minwave.cpp(717) : error C4552: '-' : operator has no effect; expected o
perator with side-effect
drmmult\minwave.cpp(736) : error C2039: 'SetContentId' : is not a member of 'CMi
niportWaveCyclicStream'
drmmult\minwave.h(70) : error see declaration of 'CMiniportWaveCyclicStream'
drmmult\minwave.cpp(738) : error C2061: syntax error : identifier 'PCDRMRIGHTS'
drmmult\minwave.cpp(765) : error C2065: 'm_ulContentId' : undeclared identifier
drmmult\minwave.cpp(769) : error C2065: 'm_pMiniportLocal' : undeclared identifi
er
drmmult\minwave.cpp(769) : error C2227: left of '->UpdateDrmRights' must point t
o class/struct/union
drmmult\minwave.cpp(781) : error C2065: 'm_SaveData' : undeclared identifier
drmmult\minwave.cpp(781) : error C2228: left of '.Disable' must have class/struc
t/union type
drmmult\minwave.cpp(781) : error C2065: 'drmRights' : undeclared identifier
drmmult\minwave.cpp(781) : error C2227: left of '->CopyProtect' must point to cl
ass/struct/union
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\drmsimp directory
Compiling - msvad.rc for i386
Compiling - drmsimp\adapter.cpp for i386
Compiling - drmsimp\basedma.cpp for i386
Compiling - drmsimp\basetopo.cpp for i386
Compiling - drmsimp\basewave.cpp for i386
Compiling - drmsimp\common.cpp for i386
Compiling - drmsimp\hw.cpp for i386
Compiling - drmsimp\kshelper.cpp for i386
Compiling - drmsimp\savedata.cpp for i386
Compiling - drmsimp\mintopo.cpp for i386
drmsimp\minwave.h(60) : error C2504: 'IDrmAudioStream' : base class undefined
drmsimp\minwave.h(72) : error C2501: 'CMiniportWaveCyclicStream::IMP_IDrmAudioSt
ream' : missing storage-class or type specifiers
Compiling - drmsimp\minwave.cpp for i386
drmsimp\minwave.h(60) : error C2504: 'IDrmAudioStream' : base class undefined
drmsimp\minwave.h(72) : error C2501: 'CMiniportWaveCyclicStream::IMP_IDrmAudioSt
ream' : missing storage-class or type specifiers
drmsimp\minwave.cpp(573) : error C2065: 'IID_IDrmAudioStream' : undeclared ident
ifier
drmsimp\minwave.cpp(575) : error C2065: 'PDRMAUDIOSTREAM' : undeclared identifie
r
drmsimp\minwave.cpp(575) : error C2440: '=' : cannot convert from ''unknown-type
'' to 'PVOID'
drmsimp\minwave.cpp(575) : error C2143: syntax error : missing ';' before 'this'

drmsimp\minwave.cpp(575) : error C4552: '-' : operator has no effect; expected o
perator with side-effect
drmsimp\minwave.cpp(594) : error C2039: 'SetContentId' : is not a member of 'CMi
niportWaveCyclicStream'
drmsimp\minwave.h(59) : error see declaration of 'CMiniportWaveCyclicStream'
drmsimp\minwave.cpp(596) : error C2061: syntax error : identifier 'PCDRMRIGHTS'
drmsimp\minwave.cpp(629) : error C2065: 'm_SaveData' : undeclared identifier
drmsimp\minwave.cpp(629) : error C2228: left of '.Disable' must have class/struc
t/union type
drmsimp\minwave.cpp(629) : error C2065: 'drmRights' : undeclared identifier
drmsimp\minwave.cpp(629) : error C2227: left of '->CopyProtect' must point to cl
ass/struct/union
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\ds2dhw directory
Compiling - msvad.rc for i386
Compiling - ds2dhw\adapter.cpp for i386
Compiling - ds2dhw\basedma.cpp for i386
Compiling - ds2dhw\basetopo.cpp for i386
Compiling - ds2dhw\basewave.cpp for i386
Compiling - ds2dhw\common.cpp for i386
Compiling - ds2dhw\hw.cpp for i386
Compiling - ds2dhw\kshelper.cpp for i386
Compiling - ds2dhw\savedata.cpp for i386
Compiling - ds2dhw\mintopo.cpp for i386
Compiling - ds2dhw\minwave.cpp for i386
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\multstr directory
Compiling - msvad.rc for i386
Compiling - multstr\adapter.cpp for i386
Compiling - multstr\basedma.cpp for i386
Compiling - multstr\basetopo.cpp for i386
Compiling - multstr\basewave.cpp for i386
Compiling - multstr\common.cpp for i386
Compiling - multstr\hw.cpp for i386
Compiling - multstr\kshelper.cpp for i386
Compiling - multstr\savedata.cpp for i386
Compiling - multstr\mintopo.cpp for i386
multstr\minwave.h(36) : error C2504: 'IPinCount' : base class undefined
multstr\minwave.h(53) : error C2501: 'CMiniportWaveCyclic::IMP_IPinCount' : miss
ing storage-class or type specifiers
Compiling - multstr\minwave.cpp for i386
multstr\minwave.h(36) : error C2504: 'IPinCount' : base class undefined
multstr\minwave.h(53) : error C2501: 'CMiniportWaveCyclic::IMP_IPinCount' : miss
ing storage-class or type specifiers
multstr\minwave.cpp(447) : error C2065: 'IID_IPinCount' : undeclared identifier
multstr\minwave.cpp(449) : error C2065: 'PPINCOUNT' : undeclared identifier
multstr\minwave.cpp(470) : error C2039: 'PinCount' : is not a member of 'CMinipo
rtWaveCyclic'
multstr\minwave.h(33) : error see declaration of 'CMiniportWaveCyclic'
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\pcmex directory
Compiling - msvad.rc for i386
Compiling - pcmex\adapter.cpp for i386
Compiling - pcmex\basedma.cpp for i386
Compiling - pcmex\basetopo.cpp for i386
Compiling - pcmex\basewave.cpp for i386
Compiling - pcmex\common.cpp for i386
Compiling - pcmex\hw.cpp for i386
Compiling - pcmex\kshelper.cpp for i386
Compiling - pcmex\savedata.cpp for i386
Compiling - pcmex\mintopo.cpp for i386
Compiling - pcmex\minwave.cpp for i386
BUILD: Compiling d:\winddk\2600\src\wdm\audio\msvad\simple directory
Compiling - msvad.rc for i386
Compiling - simple\adapter.cpp for i386
Compiling - simple\basedma.cpp for i386
Compiling - simple\basetopo.cpp for i386
Compiling - simple\basewave.cpp for i386
Compiling - simple\common.cpp for i386
Compiling - simple\hw.cpp for i386
Compiling - simple\kshelper.cpp for i386
Compiling - simple\savedata.cpp for i386
Compiling - simple\mintopo.cpp for i386
Compiling - simple\minwave.cpp for i386
BUILD: Linking d:\winddk\2600\src\wdm\audio\msvad\ac3 directory
Linking Executable - ac3\objfre_w2k\i386\vadac3.sys for i386
BUILD: Compile errors: not linking d:\winddk\2600\src\wdm\audio\msvad\drmmult di
rectory
BUILD: Compile errors: not linking d:\winddk\2600\src\wdm\audio\msvad\drmsimp di
rectory
BUILD: Linking d:\winddk\2600\src\wdm\audio\msvad\ds2dhw directory
Linking Executable - ds2dhw\objfre_w2k\i386\vad2dhw.sys for i386
BUILD: Compile errors: not linking d:\winddk\2600\src\wdm\audio\msvad\multstr di
rectory
BUILD: Linking d:\winddk\2600\src\wdm\audio\msvad\pcmex directory
Linking Executable - pcmex\objfre_w2k\i386\vadpcmex.sys for i386
BUILD: Linking d:\winddk\2600\src\wdm\audio\msvad\simple directory
Linking Executable - simple\objfre_w2k\i386\vadsimpl.sys for i386
BUILD: Done

    147 files compiled - 72 Errors -   397 LPS
    4 executables built

Installing The Drivers

To install the drivers, use Start->Settings->Control Panel->Add/Remove Hardware Then in the wizard select Add/Troubleshoot a Device->Add a new device->No, I want to select the hardware from a list->Sound, video and game controllers->Have Disk->Browse and browse to \WINDDK\2600\src\wdm\audio\msvad\msvad.inf Select the driver you want to install. I started with Simple. Remember that the DRM problems mean that only these drivers are available: Simple, AC3, DirectSound 2D HW Acceleration. The sys files are not found by the installer, and you will be prompted for the path to the .sys file. For the simple driver, it is: \WINDDK\2600\src\wdm\audio\msvad\simple\objfre_w2k\i386

The driver wizard will prompt you to reboot once installation is complete. Crazy, but true - you have to reboot before the driver can be used.

Bugs in MSVAD

There is a bug in MSVAD which results in only the first sound being recorded. Subsequent recordings result in empty wave files. The error is in savedata.cpp here:

#ifndef USE_OBSOLETE_FUNCS
    for (int i = 0; i     {
        if (m_pWorkItems[i].WorkItem!=NULL)
        {
            IoFreeWorkItem(m_pWorkItems[i].WorkItem);
            m_pWorkItems[i].WorkItem = NULL;
        }
    }
#endif

Change the #ifndef to #ifdef to read as follows:

#ifdef USE_OBSOLETE_FUNCS

The second bug is in basedma.cpp. I haven't heard any reports of it actually causing problems, but it is a bug nonetheless:

    if ( m_pvDmaBuffer )
     {
         ExFreePool( m_pvDmaBuffer );
         m_ulDmaBufferSize = 0;
     }

This should read

     if ( m_pvDmaBuffer )
     {
         ExFreePool( m_pvDmaBuffer );
         m_ulDmaBufferSize = 0;
         m_pvDmaBuffer = NULL;
     }

More Information

If you are working with MSVAD, do yourself a huge favour and subscribe to the WDMAUDIODEV mailing list.