Microsoft KB Archive/318772

= How to use the DDKSynth audio sample on Windows 98 and on Windows Millennium Edition =

Article ID: 318772

Article Last Modified on 9/28/2004

-

APPLIES TO


 * Microsoft Windows 98 Second Edition
 * Microsoft Windows Millennium Edition
 * Microsoft Win32 Device Driver Kit for Windows 2000

-



This article was previously published under Q318772



SUMMARY
This article describes how to modify the DDKSynth audio sample that is included in Microsoft Windows 2000 Driver Development Kit. After you modify the sample, you can use the sample on Microsoft Windows 98 and on Microsoft Windows Millennium Edition.

This article also includes a modification of the Miniport.cpp file. The modification adds a pin for a MIDI device that is earlier than the Windows Driver Model (WDM) version (pre-WDM MIDI).

This modification of the Miniport.cpp file applies to the following operating systems:
 * Microsoft Windows 98
 * Microsoft Windows Millennium Edition
 * Microsoft Windows 2000
 * Microsoft Windows XP



Build a binary
To build a binary that is compatible with Windows 98 and Windows Millennium Edition, change the Sources file so that the UNDER_NT preprocessor definition is not defined. The following code demonstrates the change in the Sources file. C_DEFINES= $(C_DEFINES) -D_WIN32 -DUNICODE -D_UNICODE
 * 1) removed C_DEFINES= $(C_DEFINES) -D_WIN32 -DUNICODE -D_UNICODE -DUNDER_NT

Modify the Miniport.cpp file
To support a pre-WDM MIDI pin so that the device appears in Control Panel, change the Miniport.cpp filee as shown in the following code.

Note These modifications for a pre-WDM MIDI pin apply to the operating systems that are listed in the &quot;Summary&quot; section of this article. /***************************************************************************** * PinDataRangesStream[] ***************************************************************************** * Structures that indicate range of valid format values for streaming pins. * If your device can also support earlier versions of MIDI, include a second data range * here that supports KSDATAFORMAT_SUBTYPE_MIDI. */ //New code for legacy support. static const KSDATARANGE_MUSIC PinDataRangesStreamLegacy[] = {   {        {            sizeof(KSDATARANGE_MUSIC), 0,           0,            0,            STATICGUIDOF(KSDATAFORMAT_TYPE_MUSIC), STATICGUIDOF(KSDATAFORMAT_SUBTYPE_MIDI), STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) },       STATICGUIDOF(KSMUSIC_TECHNOLOGY_WAVETABLE), 0,       0,        0xFFFF } }; //End new code for legacy support.

static const KSDATARANGE_MUSIC PinDataRangesStream[] = {   {        {            sizeof(KSDATARANGE_MUSIC), 0,           0,            0,            STATICGUIDOF(KSDATAFORMAT_TYPE_MUSIC), STATICGUIDOF(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC), STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) },       STATICGUIDOF(KSMUSIC_TECHNOLOGY_WAVETABLE), 0,                                     // Channels 0,                                     // Notes 0x0000ffff                             // ChannelMask } }; /************************************************************************** * PinDataRangePointersStream[] ***************************************************************************** * List of pointers to structures that indicate the range of valid format values * for streaming pins. */ static const PKSDATARANGE PinDataRangePointersStream[] = {   PKSDATARANGE(&PinDataRangesStreamLegacy), //for legacy midi support PKSDATARANGE(&PinDataRangesStream[0]) };

Sample code
The following code sample demonstrates the modified .inf file for Windows 98 and for Windows Millennium Edition. [Version] Signature=&quot;$CHICAGO$&quot; Class=MEDIA ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318} provider=%MSFT% DriverVer =06/16/1999,5.00.2062.1

[Manufacturer] %DDKMfgName%=Microsoft

[DefaultInstall] AddReg = WDM_DDKSYNTH.DeviceRegistration CopyFiles = Default.CopyFiles

[Default.CopyFiles] ddksynth.inf

[Microsoft] %WDM_DDKSYNTH.DeviceDesc%  = WDM_DDKSYNTH,  SW\{820DC38A-1F81-11d3-A82E-0060083316C1}
 * Replace this with your GUID, same as the Private.h file.


 * You may specify the specific platform that is supported by each SourceDisksNames section.
 * Valid platform identifiers include .x86, .ia64, .alpha, and .axp64.

[SourceDisksNames] 222=%DiskDescription%,,,


 * You may also specify the specific platform that is supported by each SourceDisksFiles section.
 * Valid platform identifiers include .x86, .ia64, .alpha, and .axp64.

[SourceDisksFiles] ddksynth.sys=222
 * ddksynth.inf=222


 * Destination Directory List

[DestinationDirs] WDM_DDKSYNTH.CopyFiles = 10,system32\drivers ; %SystemRoot%\system32\drivers Default.CopyFiles = 10,inf

[WDM_DDKSYNTH.CopyFiles] ddksynth.sys


 * DDKSynth swenum install
 * DDKSynth swenum install

[WDM_DDKSYNTH.DeviceRegistration] HKLM,%RunOnce%,&quot;WDM_DDKSYNTH0&quot;,,&quot;rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_DDKSYNTH.DeviceId%,%KSNAME_DDKSYNTH%,%KSCATEGORY_DATATRANSFORM%,%01%\ddksynth.inf,WDM_DDKSYNTH.Interface.Install&quot; HKLM,%RunOnce%,&quot;WDM_DDKSYNTH1&quot;,,&quot;rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_DDKSYNTH.DeviceId%,%KSNAME_DDKSYNTH%,%KSCATEGORY_SYNTHESIZER%,%01%\ddksynth.inf,WDM_DDKSYNTH.Interface.Install&quot; HKLM,%RunOnce%,&quot;WDM_DDKSYNTH2&quot;,,&quot;rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_DDKSYNTH.DeviceId%,%KSNAME_DDKSYNTH%,%KSCATEGORY_AUDIO%,%01%\ddksynth.inf,WDM_DDKSYNTH.Interface.Install&quot; HKLM,%MediaCategories%\%WDM_DDKSYNTH.GUID%,Name,,%WDM_DDKSYNTH.Pin% HKLM,%MediaCategories%\%WDM_DDKSYNTH.GUID%,Display,1,00,00,00,00

[WDM_DDKSYNTH.Interface.Install] AddReg=WDM_DDKSYNTH.Interface.AddReg

[WDM_DDKSYNTH.Interface.AddReg] HKR,,CLSID,,%Proxy.CLSID% HKR,,FriendlyName,,%WDM_DDKSYNTH.FriendlyName%


 * 9x Specific ****************
 * DDKSynth Install
 * DDKSynth Install

[WDM_DDKSYNTH] AlsoInstall=KS.Registration(ks.inf) CopyFiles = WDM_DDKSYNTH.CopyFiles AddReg=WDM_DDKSYNTH.AddReg
 * AlsoInstall=KS.Registration(ks.inf), WDM.AddReg.Install(wdmaudio.inf)

[WDM_DDKSYNTH.AddReg] HKR,,DevLoader,,*NTKERN HKR,,NTMPDriver,,ddksynth.sys

[WDM_DDKSYNTH.Services] AddService = ddksynth, 0x00000002, DDKSynth_Service_Inst

[DDKSynth_Service_Inst] DisplayName   = %WDM_DDKSYNTH.SvcDesc% ServiceType   = 1                  ; SERVICE_KERNEL_DRIVER StartType     = 3                  ; SERVICE_SYSTEM_START ErrorControl  = 1                  ; SERVICE_ERROR_NORMAL ServiceBinary = %10%\system32\drivers\ddksynth.sys


 * NT Specific ****************
 * DDKSynth Install
 * DDKSynth Install

[WDM_DDKSYNTH.NT] Include=ks.inf, wdmaudio.inf Needs=KS.Registration, WDMAUDIO.Registration CopyFiles = WDM_DDKSYNTH.CopyFiles AddReg=WDM_DDKSYNTH.DeviceRegistration

[WDM_DDKSYNTH.NT.Services] AddService = DDKSynth, 0x00000002, DDKSynth_Service_Inst

[Strings]

MSFT=&quot;Microsoft&quot; DDKMfgName=&quot;doughowe - DDK Sample Inc.&quot; DiskDescription=&quot;doughowe - DDK Sample&quot;

RunOnce = &quot;SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce&quot; MediaCategories=&quot;SYSTEM\CurrentControlSet\Control\MediaCategories&quot; Proxy.CLSID            =   &quot;{17CCA71B-ECD7-11D0-B908-00A0C9223196}&quot; KSNAME_Filter          =   &quot;{9B365890-165F-11D0-A195-0020AFD156E4}&quot; KSNAME_DDKSYNTH        =   &quot;ddksynth&quot;

WDM_DDKSYNTH.GUID        = &quot;{D2D37597-A312-434C-A2DD-2B4C32E6658A}&quot; WDM_DDKSYNTH.DeviceId  =   &quot;{820DC38A-1F81-11d3-A82E-0060083316C1}&quot;
 * GUIDGen your own (WDM_DDKSYNTH.GUID, WDM_DDKSYNTH.DeviceID). Put them here and in Private.h ****

WDM_DDKSYNTH.Pin=&quot;Microsoft DDK DLS Synth sample&quot;

KSCATEGORY_DATATRANSFORM = &quot;{2EB07EA0-7E70-11D0-A5D6-28DB04C10000}&quot; KSCATEGORY_SYNTHESIZER  =  &quot;{DFF220F3-F70F-11D0-B917-00A0C9223196}&quot; KSCATEGORY_AUDIO        =  &quot;{6994AD04-93EF-11D0-A3CC-00A0C9223196}&quot;

WDM_DDKSYNTH.DeviceDesc  = &quot; doughowe - Microsoft DDK Synthesizer (WDM)&quot; WDM_DDKSYNTH.FriendlyName = &quot; Friendly Name - doughowe - Microsoft DDK Synthesizer (WDM)&quot; WDM_DDKSYNTH.SvcDesc     = &quot; doughowe - Microsoft DDK Synthesizer (WDM)&quot;

Keywords: kbinfo kbddk kbcode KB318772

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.