Ignore:
Timestamp:
Oct 27, 2001, 10:21:42 AM (24 years ago)
Author:
sandervl
Message:

check registry key to disable audio

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/initwinmm.cpp

    r7196 r7232  
    1 /* $Id: initwinmm.cpp,v 1.4 2001-10-24 22:47:41 sandervl Exp $
     1/* $Id: initwinmm.cpp,v 1.5 2001-10-27 08:21:42 sandervl Exp $
    22 *
    33 * WINMM DLL entry point
     
    3939#include <odin.h>
    4040#include <win32type.h>
     41#include <win32api.h>
    4142#include <winconst.h>
    4243#include <odinlx.h>
     
    4748#include <win\options.h>
    4849#include "initwinmm.h"
     50#include <custombuild.h>
    4951
    5052#define DBG_LOCALLOG    DBG_initterm
     
    8183  static BOOL bInitDone = FALSE;
    8284  char   szError[CCHMAXPATH];
     85  HKEY   hKey;
    8386
    8487  switch (fdwReason)
     
    138141            dprintf(("mciGetErrorString %x", pfnmciGetErrorString));
    139142        }
    140 
     143        if(fMMPMAvailable && RegOpenKeyA(HKEY_LOCAL_MACHINE, CUSTOM_BUILD_OPTIONS_KEY, &hKey) == 0)
     144        {
     145            DWORD dwSize, dwType;
     146            DWORD dwFlag;
     147
     148            dwSize = sizeof(dwFlag);
     149            LONG rc = RegQueryValueExA(hKey, DISABLE_AUDIO_KEY,
     150                                       NULL, &dwType,
     151                                       (LPBYTE)&dwFlag,
     152                                       &dwSize);
     153
     154            if(rc == 0 && dwType == REG_DWORD) {
     155                if(dwFlag) {
     156                    fMMPMAvailable = FALSE;
     157                    pfnmciGetErrorString = NULL;
     158                    pfnmciSendCommand = NULL;
     159                }
     160            }
     161            RegCloseKey(hKey);
     162        }
    141163        return TRUE;
    142164   }
Note: See TracChangeset for help on using the changeset viewer.