// A3DExample.c - example code-snippet for initializing A3D including certification check.
   .
   .
   .
   LPDIRECTSOUND lpDS;
   int           iResult;
   char          szError[80];
   BOOL          bA3DAvailable = FALSE;

   // Create an A3D object.
   iResult = A3dCreate(NULL, (void **) &lpDS, NULL);

   if (iResult >= DS_OK)
   {
      // Check if the DLL is up-to-date.
      if (iResult == A3D_OK_OLD_DLL)
      {
         // Tell the user to upgrade their drivers...
         sprintf(szError, "Your A3D drivers are not current.\nPlease upgrade them at www.a3d.com");
      }

      iResult = VerifyAurealA3D();

      if (iResult == FALSE)
      {
         // This is fake A3D!!! Say/do something about it...
         sprintf(szError, "This is non-Aureal-certified A3D!\nPlease upgrade your drivers at www.a3d.com");
         bA3DAvailable = FALSE;

         // First release fake-A3D interface.
         IDirectSound_Release(lpDS);
         lpDS = NULL;

         // Then use DirectSound in 2D-mode.
         iResult = DirectSoundCreate(NULL, (void **) &lpDS, NULL);

         if (iResult != DS_OK)
         {
            sprintf(szError, "Failed to create DirectSound object");
         }
      }
      else if (iResult == TRUE)
      {
         // Everything is good. You have valid, certified Aureal A3D.
         bA3DAvailable = TRUE;
      }
      else
      {
         // Could not verify A3D as Aureal-certified.
         // Carry on, but user should be aware that cloned-A3D may cause problems in compatibility.
         // The user should check at www.a3d.com for a list of certified A3D hardware.
         bA3DAvailable = TRUE;
      }
   }
   else
   {
      // Failed to intitialize with A3D, so use DirectSound in stereo-mode instead.
      iResult = DirectSoundCreate(NULL, (void **) &lpDS, NULL);
      bA3DAvailable = FALSE;
   }

   // Go on to do SetCooperativeLevel, etc.
   .
   .
   .
}
