63 static const WCHAR msacmW[] = {
'M',
'S',
'A',
'C',
'M',
'.'};
64 static const WCHAR drvkey[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
65 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
66 'W',
'i',
'n',
'd',
'o',
'w',
's',
' ',
'N',
'T',
'\\',
67 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
68 'D',
'r',
'i',
'v',
'e',
'r',
's',
'3',
'2',
'\0'};
80 WARN(
"unable to open registry key - 0x%08x\n", lRet);
85 WARN(
"unable to query requested subkey %s - 0x%08x\n",
debugstr_w(pszRegEntry), lRet);
103 TRACE(
"cFilterTags=%lu cFormatTags=%lu fdwSupport=%08lx\n",
106 TRACE(
"\tdwFormatTag=%lu cbwfx=%lu\n",
144 padid->aFormatTag =
NULL;
149 if (add.cFormatTags > 0) {
151 add.cFormatTags *
sizeof(padid->aFormatTag[0]));
152 if (!padid->aFormatTag)
goto errCleanUp;
155 padid->cFormatTags = add.cFormatTags;
156 padid->cFilterTags = add.cFilterTags;
157 padid->fdwSupport = add.fdwSupport;
161 for (ntag = 0; ntag < add.cFormatTags; ntag++) {
167 padid->aFormatTag[ntag].dwFormatTag = aftd.dwFormatTag;
168 padid->aFormatTag[ntag].cbwfx = aftd.cbFormatSize;
178 padid->aFormatTag =
NULL;
187 static const WCHAR baseKey[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
188 'A',
'u',
'd',
'i',
'o',
'C',
'o',
'm',
'p',
'r',
'e',
's',
's',
'i',
'o',
'n',
'M',
'a',
'n',
'a',
'g',
'e',
'r',
'\\',
189 'D',
'r',
'i',
'v',
'e',
'r',
'C',
'a',
'c',
'h',
'e',
'\\',
'\0'};
194 ERR(
"No alias needed for registry entry\n");
290 TRACE(
"(%s, %s, %p)\n",
356 static const WCHAR msacm32[] = {
'm',
's',
'a',
'c',
'm',
'3',
'2',
'.',
'd',
'l',
'l',
'\0'};
357 static const WCHAR msacmW[] = {
'M',
'S',
'A',
'C',
'M',
'.'};
358 static const WCHAR drv32[] = {
'd',
'r',
'i',
'v',
'e',
'r',
's',
'3',
'2',
'\0'};
359 static const WCHAR sys[] = {
's',
'y',
's',
't',
'e',
'm',
'.',
'i',
'n',
'i',
'\0'};
360 static const WCHAR drvkey[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
361 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
362 'W',
'i',
'n',
'd',
'o',
'w',
's',
' ',
'N',
'T',
'\\',
363 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
364 'D',
'r',
'i',
'v',
'e',
'r',
's',
'3',
'2',
'\0'};
376 RegQueryInfoKeyW(
hKey, 0, 0, 0, &cnt, 0, 0, 0, 0, 0, 0, 0);
377 for (
i = 0;
i < cnt;
i++) {
388 bufLen =
sizeof(
buf);
420 TRACE(
"(%p,0x%08x)\n", hNotifyWnd, dwNotifyMsg);
523 if (dwPriority == 1) {
529 }
else if (dwPriority == -1) {
559 unsigned int iNumDrivers;
571 static const WCHAR basePriorityKey[] = {
572 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
573 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
574 'M',
'u',
'l',
't',
'i',
'm',
'e',
'd',
'i',
'a',
'\\',
575 'A',
'u',
'd',
'i',
'o',
' ',
'C',
'o',
'm',
'p',
'r',
'e',
's',
's',
'i',
'o',
'n',
' ',
'M',
'a',
'n',
'a',
'g',
'e',
'r',
'\\',
576 'P',
'r',
'i',
'o',
'r',
'i',
't',
'y',
' ',
'v',
'4',
'.',
'0',
'0',
'\0' 585 ERR(
"out of memory\n");
591 TRACE(
"RegOpenKeyW failed, possibly key does not exist yet\n");
599 driverList[
i] = padid;
609 for (
i = 0;
i < iNumDrivers;
i++)
611 static const WCHAR priorityTmpl[] = {
'P',
'r',
'i',
'o',
'r',
'i',
't',
'y',
'%',
'l',
'd',
'\0'};
613 unsigned int iTargetPosition;
614 unsigned int iCurrentPosition;
616 static const WCHAR sPrefix[] = {
'm',
's',
'a',
'c',
'm',
'.',
'\0'};
620 lBufferLength =
sizeof(szBuffer);
628 pAlias =
wcsstr(szBuffer, sPrefix);
629 if (pAlias ==
NULL)
continue;
631 for (iCurrentPosition = 0; iCurrentPosition < iNumDrivers; iCurrentPosition++) {
632 if (
wcsicmp(driverList[iCurrentPosition]->pszDriverAlias, pAlias) == 0)
635 if (iCurrentPosition < iNumDrivers && iTargetPosition != iCurrentPosition) {
636 padid = driverList[iTargetPosition];
637 driverList[iTargetPosition] = driverList[iCurrentPosition];
638 driverList[iCurrentPosition] = padid;
641 if (szBuffer[0] ==
'1') {
643 }
else if (szBuffer[0] ==
'0') {
650 for (
i = 0;
i < iNumDrivers;
i++) {
672 static const WCHAR basePriorityKey[] = {
673 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
674 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
675 'M',
'u',
'l',
't',
'i',
'm',
'e',
'd',
'i',
'a',
'\\',
676 'A',
'u',
'd',
'i',
'o',
' ',
'C',
'o',
'm',
'p',
'r',
'e',
's',
's',
'i',
'o',
'n',
' ',
'M',
'a',
'n',
'a',
'g',
'e',
'r',
'\\',
677 'P',
'r',
'i',
'o',
'r',
'i',
't',
'y',
' ',
'v',
'4',
'.',
'0',
'0',
'\0' 680 DWORD dwPriorityCounter;
681 static const WCHAR priorityTmpl[] = {
'P',
'r',
'i',
'o',
'r',
'i',
't',
'y',
'%',
'l',
'd',
'\0'};
682 static const WCHAR valueTmpl[] = {
'%',
'c',
',',
' ',
'%',
's',
'\0'};
683 static const WCHAR converterAlias[] = {
'I',
'n',
't',
'e',
'r',
'n',
'a',
'l',
' ',
'P',
'C',
'M',
' ',
'C',
'o',
'n',
'v',
'e',
'r',
't',
'e',
'r',
'\0'};
690 ERR(
"unable to remove current key %s (0x%08x) - priority changes won't persist past application end.\n",
696 ERR(
"unable to create key %s (0x%08x) - priority changes won't persist past application end.\n",
708 swprintf(szSubKey, priorityTmpl, dwPriorityCounter);
716 ERR(
"unable to write value for %s under key %s (0x%08x)\n",
723 swprintf(szSubKey, priorityTmpl, dwPriorityCounter);
726 swprintf(szBuffer, valueTmpl,
'1', converterAlias);
730 ERR(
"unable to write value for %s under key %s (0x%08x)\n",
745 ERR(
"local driver instances still present after closing all drivers - memory leak\n");
767 return pNextACMLocalDriver;
777 while (
p->pACMDriverList)
789 if (
p->pPrevACMDriverID)
791 if (
p->pNextACMDriverID)
799 return pNextACMDriverID;
866 #define MSACM_DRIVER_SendMessage(PDRVRINST, msg, lParam1, lParam2) \ 867 (PDRVRINST)->pLocalDriver->lpDrvProc((PDRVRINST)->dwDriverID, (HDRVR)(PDRVRINST), msg, lParam1, lParam2) 930 if (found) *found =
NULL;
938 if (found && !*found) *found = pInst;
970 ERR(
"requested to remove invalid instance %p\n", pPrevInst);
996 FIXME(
"DRV_LOAD failed on driver %p\n", lpNewDrv);
1019 FIXME(
"DRV_OPEN failed on driver %p\n", lpNewDrv);
1049 ERR(
"load0 failed\n");
1055 ERR(
"load1 failed\n");
1070 ERR(
"load failed\n");
1074 TRACE(
"=> %p\n", pDrvInst);
1091 ERR(
"should not directly close session instance (%p)\n", paldrv);
1106 ERR(
"unable to close driver instance\n");
LRESULT(CALLBACK * DRIVERPROC)(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM)
PWINE_ACMNOTIFYWND pNextACMNotifyWnd
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LPARAM lParam1, LPARAM lParam2)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
static PWINE_ACMLOCALDRIVER MSACM_pFirstACMLocalDriver
static BOOL MSACM_pendingBroadcast
PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC lpDriverProc)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
void MSACM_EnableNotifications(void)
static PWINE_ACMLOCALDRIVER MSACM_pLastACMLocalDriver
#define HKEY_CURRENT_USER
GLuint GLuint GLsizei count
static BOOL MSACM_FillCache(PWINE_ACMDRIVERID padid)
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
PWINE_ACMDRIVERID pACMDriverID
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
static BOOL MSACM_AddToList(PWINE_ACMLOCALDRIVERINST lpNewDrv, LPARAM lParam2)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
#define WINE_ACMOBJ_DRIVERID
PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
#define MMSYSERR_INVALHANDLE
struct _WINE_ACMDRIVERID::@468 * aFormatTag
#define ACMDM_FORMATTAG_DETAILS
PWINE_ACMLOCALDRIVERINST pNextACMInst
struct _WINE_ACMOBJ * PWINE_ACMOBJ
static PWINE_ACMNOTIFYWND MSACM_pFirstACMNotifyWnd
BOOL MSACM_FindFormatTagInCache(const WINE_ACMDRIVERID *padid, DWORD fmtTag, LPDWORD idx)
PWINE_ACMDRIVERID pPrevACMDriverID
GLenum GLuint GLenum GLsizei const GLchar * buf
MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
void MSACM_WriteCurrentPriorities(void)
#define ACMDM_DRIVER_DETAILS
static BOOL MSACM_ReadCache(PWINE_ACMDRIVERID padid)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
WORD WORD PSZ PSZ pszFileName
PWINE_ACMLOCALDRIVERINST MSACM_OpenLocalDriver(PWINE_ACMLOCALDRIVER paldrv, LPARAM lParam2)
PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
static PWINE_ACMLOCALDRIVER MSACM_UnregisterLocalDriver(PWINE_ACMLOCALDRIVER paldrv)
PWINE_ACMLOCALDRIVER pPrevACMLocalDrv
#define ERROR_FILE_NOT_FOUND
static BOOL MSACM_RemoveFromList(PWINE_ACMLOCALDRIVERINST lpDrv)
PWINE_ACMDRIVERID pNextACMDriverID
static unsigned MSACM_GetNumberOfModuleRefs(HMODULE hModule, DRIVERPROC lpDrvProc, WINE_ACMLOCALDRIVERINST **found)
void MSACM_BroadcastNotification(void)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
void MSACM_DisableNotifications(void)
#define ACM_FORMATTAGDETAILSF_INDEX
void MSACM_RegisterAllDrivers(void)
PWINE_ACMDRIVER pACMDriverList
#define WINE_ACMOBJ_DONTCARE
MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen)
MMRESULT MSACM_Message(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
void MSACM_UnregisterAllDrivers(void)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
PWINE_ACMLOCALDRIVER pLocalDriver
PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileName, PWINE_ACMLOCALDRIVER pLocalDriver)
PWINE_ACMLOCALDRIVER pLocalDriver
PWINE_ACMLOCALDRIVER pNextACMLocalDrv
#define InterlockedDecrement
#define WINE_ACMOBJ_NOTIFYWND
PWINE_ACMDRIVERID MSACM_pFirstACMDriverID
static PWINE_ACMNOTIFYWND MSACM_pLastACMNotifyWnd
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
int _cdecl swprintf(const WCHAR *,...)
PWINE_ACMLOCALDRIVERINST pACMInstList
PWINE_ACMNOTIFYWND MSACM_UnRegisterNotificationWindow(const WINE_ACMNOTIFYWND *panwnd)
_CRTIMP wchar_t *__cdecl _wcslwr(_Inout_z_ wchar_t *_String)
static void MSACM_ReorderDriversByPriority(void)
#define ACMDRIVERDETAILS_SUPPORTF_LOCAL
WINE_DEFAULT_DEBUG_CHANNEL(msacm)
#define InterlockedIncrement
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define WINE_ACMOBJ_LOCALDRIVER
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
void MSACM_RePositionDriver(PWINE_ACMDRIVERID padid, DWORD dwPriority)
PWINE_ACMNOTIFYWND MSACM_RegisterNotificationWindow(HWND hNotifyWnd, DWORD dwNotifyMsg)
LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST paldrv)
#define ACMDRIVERDETAILS_SUPPORTF_DISABLED
#define WINE_ACMOBJ_DRIVER
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
static LPWSTR MSACM_GetRegistryKey(const WINE_ACMDRIVERID *padid)
static BOOL MSACM_WriteCache(const WINE_ACMDRIVERID *padid)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
GLuint GLuint GLsizei GLenum type
static DWORD MSACM_suspendBroadcastCount
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
INT WINAPI GetPrivateProfileSectionW(LPCWSTR section, LPWSTR buffer, DWORD len, LPCWSTR filename)
#define HeapFree(x, y, z)
#define MSACM_DRIVER_SendMessage(PDRVRINST, msg, lParam1, lParam2)
#define RegCloseKey(hKey)
static PWINE_ACMDRIVERID MSACM_pLastACMDriverID
PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry)
PWINE_ACMNOTIFYWND MSACM_GetNotifyWnd(HACMDRIVERID hDriver)
PWINE_ACMNOTIFYWND pPrevACMNotifyWnd
PWINE_ACMLOCALDRIVERINST pLocalDrvrInst
#define HKEY_LOCAL_MACHINE
GLuint const GLchar * name