Installation Issues for an Audio Driver in Windows 98

Support for WDM audio drivers is limited in Windows 98, as explained in Windows 98 Support for WDM Audio. For this reason, vendors might want to prevent their audio drivers from installing in Windows 98. Also, a vendor who does choose to allow a driver to install under Windows 98 might want to design the driver to perform a run-time check to determine if it is running in Windows 98 before it attempts to use any audio capabilities that Windows 98 does not support.

The following topics are discussed:

Stopping Installation from a Driver's INF File

Performing a Run-Time Check for Windows 98

Stopping Installation from a Driver's INF File

The following excerpt from the Windows Driver Kit (WDK) sample INF file Ac97smpl.inf shows how to use a KnownRegEntries directive to stop installation in Windows 98:


  [AC97SMPL]
  KnownRegEntries=AC97.KnownRegEntries

  [AC97.KnownRegEntries]
  IsWin98Gold=keep

  [IsWin98Gold]
  1=HKLM,Software\Microsoft\Windows\CurrentVersion,VersionNumber,0,4.10.1998

The registry subkey under HKLM that is specified in the IsWin98Gold section does not have to specify Software\Microsoft\Windows\CurrentVersion. A vendor can use a vendor-specific registry entry and value to control a driver's installation.

The "keep" keyword in the INF entry above degrades the ranking of the driver that is specified in the INF file. The effect is typically to keep the previously installed driver instead of installing the new driver.

Performing a Run-Time Check for Windows 98

An adapter driver's device-startup routine (see Starting a Device) can perform a simple test to determine whether it is running in Windows 98. The function in the following code example queries the WaveCyclic port driver for its IPortEvents interface. Only versions of Windows later than Windows 98 support this interface. If the driver is running in Windows 98, the IsWin98Gold function below returns TRUE. Otherwise, it returns FALSE to indicate that it is running on one of the following: Windows 98 SE, Windows Me, or Windows 2000 and later.


BOOL IsWin98Gold()
{
    BOOL    fWin98Gold=TRUE;

    // create a wave cyclic port
    PPORT pPort = 0;
    ntStatus = PcNewPort(&pPort, CLSID_PortWaveCyclic);
 
    if (!NT_SUCCESS(ntStatus))
    {
        DOUT(DBG_ERROR, ("Error creating a Port"));
        return (FALSE);
    }
 
    // query an event interface (not supported in Windows 98)
    PPORTEVENTS pPortEvents = 0;
    ntStatus = pPort->QueryInterface(IID_IPortEvents, (PVOID *)&pPortEvents);
    if (NT_SUCCESS(ntStatus))
    {
        fWin98Gold = FALSE;
        pPortEvents->Release();
    }
    pPort->Release();
    return (fWin98Gold);
}

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft