Author: akhaldi
Date: Sat Sep 21 14:16:27 2013
New Revision: 60280
URL:
http://svn.reactos.org/svn/reactos?rev=60280&view=rev
Log:
[MSACM32]
* Sync with Wine 1.7.1.
CORE-7469
Modified:
trunk/reactos/dll/win32/msacm32/CMakeLists.txt
trunk/reactos/dll/win32/msacm32/driver.c
trunk/reactos/dll/win32/msacm32/format.c
trunk/reactos/dll/win32/msacm32/internal.c
trunk/reactos/dll/win32/msacm32/msacm32_main.c
trunk/reactos/dll/win32/msacm32/pcmconverter.c
trunk/reactos/dll/win32/msacm32/stream.c
trunk/reactos/dll/win32/msacm32/wineacm.h
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/msacm32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/CMakeLis…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/CMakeLists.txt [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -16,8 +16,7 @@
add_library(msacm32 SHARED ${SOURCE})
set_module_type(msacm32 win32dll ENTRYPOINT DllMain 12 UNICODE)
target_link_libraries(msacm32 wine)
-add_importlibs(msacm32 msvcrt advapi32 user32 winmm kernel32 ntdll)
-add_dependencies(msacm32 psdk)
+add_importlibs(msacm32 advapi32 user32 winmm msvcrt kernel32 ntdll)
add_cd_file(TARGET msacm32 DESTINATION reactos/system32 FOR all)
add_subdirectory(msacm32.drv)
Modified: trunk/reactos/dll/win32/msacm32/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/driver.c…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/driver.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/driver.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -170,7 +170,7 @@
}
break;
default:
- ERR("invalid flag value 0x%08lx for fdwAdd\n", fdwAdd &
ACM_DRIVERADDF_TYPEMASK);
+ ERR("invalid flag value 0x%08x for fdwAdd\n", fdwAdd &
ACM_DRIVERADDF_TYPEMASK);
return MMSYSERR_INVALFLAG;
}
Modified: trunk/reactos/dll/win32/msacm32/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/format.c…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/format.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/format.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -1,5 +1,3 @@
-/* -*- tab-width: 8; c-basic-offset: 4 -*- */
-
/*
* MSACM32 library
*
@@ -41,21 +39,19 @@
WINE_DEFAULT_DEBUG_CHANNEL(msacm);
-static PACMFORMATCHOOSEA afc;
-
struct MSACM_FillFormatData {
HWND hWnd;
#define WINE_ACMFF_TAG 0
#define WINE_ACMFF_FORMAT 1
#define WINE_ACMFF_WFX 2
int mode;
- char szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
- PACMFORMATCHOOSEA afc;
+ WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
+ PACMFORMATCHOOSEW afc;
DWORD ret;
};
static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid,
- PACMFORMATTAGDETAILSA paftd,
+ PACMFORMATTAGDETAILSW paftd,
DWORD_PTR dwInstance,
DWORD fdwSupport)
{
@@ -63,21 +59,21 @@
switch (affd->mode) {
case WINE_ACMFF_TAG:
- if (SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ if (SendDlgItemMessageW(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_FINDSTRINGEXACT, -1,
(LPARAM)paftd->szFormatTag) == CB_ERR)
- SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ SendDlgItemMessageW(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_ADDSTRING, 0, (LPARAM)paftd->szFormatTag);
break;
case WINE_ACMFF_FORMAT:
- if (strcmp(affd->szFormatTag, paftd->szFormatTag) == 0) {
+ if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) {
HACMDRIVER had;
if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) {
- ACMFORMATDETAILSA afd;
- unsigned int i, len;
+ ACMFORMATDETAILSW afd;
+ unsigned int i, len;
MMRESULT mmr;
- char buffer[ACMFORMATDETAILS_FORMAT_CHARS+16];
+ WCHAR buffer[ACMFORMATDETAILS_FORMAT_CHARS+16];
afd.cbStruct = sizeof(afd);
afd.dwFormatTag = paftd->dwFormatTag;
@@ -88,42 +84,45 @@
afd.cbwfx = paftd->cbFormatSize;
for (i = 0; i < paftd->cStandardFormats; i++) {
+ static const WCHAR fmtW[] = {'%','d','
','K','o','/','s','\0'};
+ int j;
+
afd.dwFormatIndex = i;
- mmr = acmFormatDetailsA(had, &afd, ACM_FORMATDETAILSF_INDEX);
+ mmr = acmFormatDetailsW(had, &afd, ACM_FORMATDETAILSF_INDEX);
if (mmr == MMSYSERR_NOERROR) {
- lstrcpynA(buffer, afd.szFormat,
ACMFORMATTAGDETAILS_FORMATTAG_CHARS + 1);
- len = strlen(buffer);
- memset(buffer+len, ' ',
ACMFORMATTAGDETAILS_FORMATTAG_CHARS - len);
- wsprintfA(buffer + ACMFORMATTAGDETAILS_FORMATTAG_CHARS,
- "%d Ko/s",
- (afd.pwfx->nAvgBytesPerSec + 512) / 1024);
- SendDlgItemMessageA(affd->hWnd,
- IDD_ACMFORMATCHOOSE_CMB_FORMAT,
- CB_ADDSTRING, 0, (LPARAM)buffer);
+ lstrcpynW(buffer, afd.szFormat,
ACMFORMATTAGDETAILS_FORMATTAG_CHARS + 1);
+ len = strlenW(buffer);
+ for (j = len; j < ACMFORMATTAGDETAILS_FORMATTAG_CHARS; j++)
+ buffer[j] = ' ';
+ wsprintfW(buffer + ACMFORMATTAGDETAILS_FORMATTAG_CHARS,
+ fmtW, (afd.pwfx->nAvgBytesPerSec + 512) / 1024);
+ SendDlgItemMessageW(affd->hWnd,
+ IDD_ACMFORMATCHOOSE_CMB_FORMAT,
+ CB_ADDSTRING, 0, (LPARAM)buffer);
}
}
acmDriverClose(had, 0);
- SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT,
+ SendDlgItemMessageW(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT,
CB_SETCURSEL, 0, 0);
HeapFree(MSACM_hHeap, 0, afd.pwfx);
}
}
break;
case WINE_ACMFF_WFX:
- if (strcmp(affd->szFormatTag, paftd->szFormatTag) == 0) {
+ if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) {
HACMDRIVER had;
if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) {
- ACMFORMATDETAILSA afd;
+ ACMFORMATDETAILSW afd;
afd.cbStruct = sizeof(afd);
afd.dwFormatTag = paftd->dwFormatTag;
afd.pwfx = affd->afc->pwfx;
afd.cbwfx = affd->afc->cbwfx;
- afd.dwFormatIndex = SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT,
+ afd.dwFormatIndex = SendDlgItemMessageW(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT,
CB_GETCURSEL, 0, 0);
- affd->ret = acmFormatDetailsA(had, &afd, ACM_FORMATDETAILSF_INDEX);
+ affd->ret = acmFormatDetailsW(had, &afd, ACM_FORMATDETAILSF_INDEX);
acmDriverClose(had, 0);
return TRUE;
}
@@ -138,7 +137,7 @@
static BOOL MSACM_FillFormatTags(HWND hWnd)
{
- ACMFORMATTAGDETAILSA aftd;
+ ACMFORMATTAGDETAILSW aftd;
struct MSACM_FillFormatData affd;
memset(&aftd, 0, sizeof(aftd));
@@ -147,37 +146,37 @@
affd.hWnd = hWnd;
affd.mode = WINE_ACMFF_TAG;
- acmFormatTagEnumA(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_SETCURSEL, 0, 0);
+ acmFormatTagEnumW(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_SETCURSEL, 0, 0);
return TRUE;
}
static BOOL MSACM_FillFormat(HWND hWnd)
{
- ACMFORMATTAGDETAILSA aftd;
+ ACMFORMATTAGDETAILSW aftd;
struct MSACM_FillFormatData affd;
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_RESETCONTENT, 0, 0);
memset(&aftd, 0, sizeof(aftd));
aftd.cbStruct = sizeof(aftd);
affd.hWnd = hWnd;
affd.mode = WINE_ACMFF_FORMAT;
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_GETLBTEXT,
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_GETCURSEL, 0, 0),
(LPARAM)affd.szFormatTag);
- acmFormatTagEnumA(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_SETCURSEL, 0, 0);
+ acmFormatTagEnumW(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_SETCURSEL, 0, 0);
return TRUE;
}
-static MMRESULT MSACM_GetWFX(HWND hWnd, PACMFORMATCHOOSEA afc)
-{
- ACMFORMATTAGDETAILSA aftd;
+static MMRESULT MSACM_GetWFX(HWND hWnd, PACMFORMATCHOOSEW afc)
+{
+ ACMFORMATTAGDETAILSW aftd;
struct MSACM_FillFormatData affd;
memset(&aftd, 0, sizeof(aftd));
@@ -187,30 +186,36 @@
affd.mode = WINE_ACMFF_WFX;
affd.afc = afc;
affd.ret = MMSYSERR_NOERROR;
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_GETLBTEXT,
- SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
+ SendDlgItemMessageW(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG,
CB_GETCURSEL, 0, 0),
(LPARAM)affd.szFormatTag);
- acmFormatTagEnumA(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
+ acmFormatTagEnumW(NULL, &aftd, MSACM_FillFormatTagsCB, (DWORD_PTR)&affd, 0);
return affd.ret;
}
+static const WCHAR fmt_prop[] =
{'a','c','m','p','r','o','p','\0'};
+
static INT_PTR CALLBACK FormatChooseDlgProc(HWND hWnd, UINT msg,
- WPARAM wParam, LPARAM lParam)
-{
-
- TRACE("hwnd=%p msg=%i 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam );
+ WPARAM wParam, LPARAM lParam)
+{
+ PACMFORMATCHOOSEW afc = (PACMFORMATCHOOSEW)GetPropW(hWnd, fmt_prop);
+
+ TRACE("hwnd=%p msg=%i 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
- afc = (PACMFORMATCHOOSEA)lParam;
+ afc = (PACMFORMATCHOOSEW)lParam;
+ SetPropW(hWnd, fmt_prop, (HANDLE)afc);
MSACM_FillFormatTags(hWnd);
MSACM_FillFormat(hWnd);
if ((afc->fdwStyle & ~(ACMFORMATCHOOSE_STYLEF_CONTEXTHELP|
- ACMFORMATCHOOSE_STYLEF_SHOWHELP)) != 0)
- FIXME("Unsupported style %08x\n",
((PACMFORMATCHOOSEA)lParam)->fdwStyle);
+ ACMFORMATCHOOSE_STYLEF_SHOWHELP|
+ ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE|
+ ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE)) != 0)
+ FIXME("Unsupported style %08x\n", afc->fdwStyle);
if (!(afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_SHOWHELP))
ShowWindow(GetDlgItem(hWnd, IDD_ACMFORMATCHOOSE_BTN_HELP), SW_HIDE);
return TRUE;
@@ -236,8 +241,8 @@
break;
case IDD_ACMFORMATCHOOSE_BTN_HELP:
if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_SHOWHELP)
- SendMessageA(afc->hwndOwner,
- RegisterWindowMessageA(ACMHELPMSGSTRINGA), 0L, 0L);
+ SendMessageW(afc->hwndOwner,
+ RegisterWindowMessageW(ACMHELPMSGSTRINGW), 0L, 0L);
break;
default:
@@ -248,15 +253,15 @@
break;
case WM_CONTEXTMENU:
if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_CONTEXTHELP)
- SendMessageA(afc->hwndOwner,
- RegisterWindowMessageA(ACMHELPMSGCONTEXTMENUA),
+ SendMessageW(afc->hwndOwner,
+ RegisterWindowMessageW(ACMHELPMSGCONTEXTMENUW),
wParam, lParam);
break;
#if defined(WM_CONTEXTHELP)
case WM_CONTEXTHELP:
if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_CONTEXTHELP)
- SendMessageA(afc->hwndOwner,
- RegisterWindowMessageA(ACMHELPMSGCONTEXTHELPA),
+ SendMessageW(afc->hwndOwner,
+ RegisterWindowMessageW(ACMHELPMSGCONTEXTHELPW),
wParam, lParam);
break;
#endif
@@ -273,18 +278,94 @@
*/
MMRESULT WINAPI acmFormatChooseA(PACMFORMATCHOOSEA pafmtc)
{
- return DialogBoxParamA(MSACM_hInstance32, MAKEINTRESOURCEA(DLG_ACMFORMATCHOOSE_ID),
+ ACMFORMATCHOOSEW afcw;
+ MMRESULT ret;
+ LPWSTR title = NULL;
+ LPWSTR name = NULL;
+ LPWSTR templ = NULL;
+ DWORD sz;
+
+ afcw.cbStruct = sizeof(afcw);
+ afcw.fdwStyle = pafmtc->fdwStyle;
+ afcw.hwndOwner = pafmtc->hwndOwner;
+ afcw.pwfx = pafmtc->pwfx;
+ afcw.cbwfx = pafmtc->cbwfx;
+ if (pafmtc->pszTitle)
+ {
+ sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTitle, -1, NULL, 0);
+ if (!(title = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
+ {
+ ret = MMSYSERR_NOMEM;
+ goto done;
+ }
+ MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTitle, -1, title, sz);
+ }
+ afcw.pszTitle = title;
+ if (pafmtc->pszName)
+ {
+ sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszName, -1, NULL, 0);
+ if (!(name = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
+ {
+ ret = MMSYSERR_NOMEM;
+ goto done;
+ }
+ MultiByteToWideChar(CP_ACP, 0, pafmtc->pszName, -1, name, sz);
+ }
+ afcw.pszName = name;
+ afcw.cchName = pafmtc->cchName;
+ afcw.fdwEnum = pafmtc->fdwEnum;
+ afcw.pwfxEnum = pafmtc->pwfxEnum;
+ afcw.hInstance = pafmtc->hInstance;
+ if (pafmtc->pszTemplateName)
+ {
+ sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTemplateName, -1, NULL, 0);
+ if (!(templ = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
+ {
+ ret = MMSYSERR_NOMEM;
+ goto done;
+ }
+ MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTemplateName, -1, templ, sz);
+ }
+ afcw.pszTemplateName = templ;
+ /* FIXME: hook procs not supported yet */
+ if (pafmtc->pfnHook)
+ {
+ FIXME("Unsupported hook procs\n");
+ ret = MMSYSERR_NOTSUPPORTED;
+ goto done;
+ }
+ ret = acmFormatChooseW(&afcw);
+ if (ret == MMSYSERR_NOERROR)
+ {
+ WideCharToMultiByte(CP_ACP, 0, afcw.szFormatTag, -1, pafmtc->szFormatTag,
sizeof(pafmtc->szFormatTag),
+ NULL, NULL);
+ WideCharToMultiByte(CP_ACP, 0, afcw.szFormat, -1, pafmtc->szFormat,
sizeof(pafmtc->szFormat),
+ NULL, NULL);
+ if (pafmtc->pszName)
+ WideCharToMultiByte(CP_ACP, 0, afcw.pszName, -1, pafmtc->pszName,
pafmtc->cchName, NULL, NULL);
+ }
+done:
+ HeapFree(GetProcessHeap(), 0, title);
+ HeapFree(GetProcessHeap(), 0, name);
+ HeapFree(GetProcessHeap(), 0, templ);
+ return ret;
+}
+
+/***********************************************************************
+ * acmFormatChooseW (MSACM32.@)
+ */
+MMRESULT WINAPI acmFormatChooseW(PACMFORMATCHOOSEW pafmtc)
+{
+ if (pafmtc->fdwStyle & ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE)
+ return DialogBoxIndirectParamW(MSACM_hInstance32,
(LPCDLGTEMPLATEW)pafmtc->hInstance,
+ pafmtc->hwndOwner, FormatChooseDlgProc,
(LPARAM)pafmtc);
+
+ if (pafmtc->fdwStyle & ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE)
+ return DialogBoxParamW(pafmtc->hInstance, pafmtc->pszTemplateName,
+ pafmtc->hwndOwner, FormatChooseDlgProc,
(LPARAM)pafmtc);
+
+ return DialogBoxParamW(MSACM_hInstance32, MAKEINTRESOURCEW(DLG_ACMFORMATCHOOSE_ID),
pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);
-}
-
-/***********************************************************************
- * acmFormatChooseW (MSACM32.@)
- */
-MMRESULT WINAPI acmFormatChooseW(PACMFORMATCHOOSEW pafmtc)
-{
- FIXME("(%p): stub\n", pafmtc);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return MMSYSERR_ERROR;
}
/***********************************************************************
@@ -815,12 +896,12 @@
ACMFORMATTAGENUMCBW fnCallback,
DWORD_PTR dwInstance, DWORD fdwEnum)
{
- PWINE_ACMDRIVERID padid;
- unsigned int i;
- BOOL bPcmDone = FALSE;
+ PWINE_ACMDRIVERID padid;
+ unsigned int i;
+ BOOL bPcmDone = FALSE;
TRACE("(%p, %p, %p, %ld, %d)\n",
- had, paftd, fnCallback, dwInstance, fdwEnum);
+ had, paftd, fnCallback, dwInstance, fdwEnum);
if (!paftd)
return MMSYSERR_INVALPARAM;
@@ -841,63 +922,60 @@
/* if (had) FIXME("had != NULL, not supported\n"); */
if (had) {
-
- if (acmDriverID((HACMOBJ)had, (HACMDRIVERID *)&padid, 0) != MMSYSERR_NOERROR)
- return MMSYSERR_INVALHANDLE;
-
- for (i = 0; i < padid->cFormatTags; i++) {
- paftd->dwFormatTagIndex = i;
- if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS,
- (LPARAM)paftd, ACM_FORMATTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
- if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
- if (paftd->szFormatTag[0] == 0)
- MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFormatTag,
- sizeof(paftd->szFormatTag)/sizeof(WCHAR) );
- /* (WS) I'm preserving this PCM hack since it seems to be
- * correct. Please notice this block was borrowed from
- * below.
- */
- if (bPcmDone) continue;
- bPcmDone = TRUE;
- }
- if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport))
- return MMSYSERR_NOERROR;
- }
- }
-
- }
-
+ if (acmDriverID((HACMOBJ)had, (HACMDRIVERID *)&padid, 0) !=
MMSYSERR_NOERROR)
+ return MMSYSERR_INVALHANDLE;
+
+ for (i = 0; i < padid->cFormatTags; i++) {
+ paftd->dwFormatTagIndex = i;
+ if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS,
+ (LPARAM)paftd, ACM_FORMATTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
+ if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
+ if (paftd->szFormatTag[0] == 0)
+ MultiByteToWideChar( CP_ACP, 0, "PCM", -1,
paftd->szFormatTag,
+ sizeof(paftd->szFormatTag)/sizeof(WCHAR)
);
+ /* (WS) I'm preserving this PCM hack since it seems to be
+ * correct. Please notice this block was borrowed from
+ * below.
+ */
+ if (bPcmDone) continue;
+ bPcmDone = TRUE;
+ }
+ if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance,
padid->fdwSupport))
+ return MMSYSERR_NOERROR;
+ }
+ }
+ }
/* if had==0 then search for the first suitable driver */
else {
- for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
{
- /* should check for codec only */
- if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED)
&&
- acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
- for (i = 0; i < padid->cFormatTags; i++) {
- paftd->dwFormatTagIndex = i;
- if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS,
- (LPARAM)paftd, ACM_FORMATTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
- if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
- if (paftd->szFormatTag[0] == 0)
- MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFormatTag,
- sizeof(paftd->szFormatTag)/sizeof(WCHAR) );
- /* FIXME (EPP): I'm not sure this is the correct
- * algorithm (should make more sense to apply the same
- * for all already loaded formats, but this will do
- * for now
- */
- if (bPcmDone) continue;
- bPcmDone = TRUE;
- }
- if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) {
- acmDriverClose(had, 0);
- return MMSYSERR_NOERROR;
- }
- }
- }
- acmDriverClose(had, 0);
- }
- }
+ for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
{
+ /* should check for codec only */
+ if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED)
&&
+ acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
+ for (i = 0; i < padid->cFormatTags; i++) {
+ paftd->dwFormatTagIndex = i;
+ if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS,
+ (LPARAM)paftd, ACM_FORMATTAGDETAILSF_INDEX) == MMSYSERR_NOERROR)
{
+ if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
+ if (paftd->szFormatTag[0] == 0)
+ MultiByteToWideChar( CP_ACP, 0, "PCM", -1,
paftd->szFormatTag,
+
sizeof(paftd->szFormatTag)/sizeof(WCHAR) );
+ /* FIXME (EPP): I'm not sure this is the correct
+ * algorithm (should make more sense to apply the same
+ * for all already loaded formats, but this will do
+ * for now
+ */
+ if (bPcmDone) continue;
+ bPcmDone = TRUE;
+ }
+ if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance,
padid->fdwSupport)) {
+ acmDriverClose(had, 0);
+ return MMSYSERR_NOERROR;
+ }
+ }
+ }
+ acmDriverClose(had, 0);
+ }
+ }
}
return MMSYSERR_NOERROR;
}
Modified: trunk/reactos/dll/win32/msacm32/internal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/internal…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/internal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/internal.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -362,8 +362,8 @@
'W','i','n','d','o','w','s','
','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'D','r','i','v','e','r','s','3','2','\0'};
- DWORD i, cnt = 0, bufLen, lRet;
- WCHAR buf[2048], *name, *s;
+ DWORD i, cnt, bufLen, lRet, type;
+ WCHAR buf[2048], valname[64], *name, *s;
FILETIME lastWrite;
HKEY hKey;
@@ -382,6 +382,15 @@
if (!(name = strchrW(buf, '='))) continue;
*name = 0;
MSACM_RegisterDriver(buf, name + 1, 0);
+ }
+ i = 0;
+ cnt = sizeof(valname) / sizeof(*valname);
+ bufLen = sizeof(buf);
+ while(RegEnumValueW(hKey, i, valname, &cnt, 0,
+ &type, (BYTE*)buf, &bufLen) == ERROR_SUCCESS){
+ if(!strncmpiW(valname, msacmW, sizeof(msacmW) / sizeof(*msacmW)))
+ MSACM_RegisterDriver(valname, buf, 0);
+ ++i;
}
RegCloseKey( hKey );
}
Modified: trunk/reactos/dll/win32/msacm32/msacm32_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/msacm32_…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/msacm32_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/msacm32_main.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -57,9 +57,8 @@
break;
case DLL_PROCESS_DETACH:
MSACM_UnregisterAllDrivers();
+ if (lpvReserved) break;
HeapDestroy(MSACM_hHeap);
- MSACM_hHeap = NULL;
- MSACM_hInstance32 = NULL;
break;
default:
break;
@@ -89,6 +88,7 @@
return 0x04000565; /* 4.0.1381 */
default:
FIXME("%x not supported\n", version.dwPlatformId);
+ /* fall through */
case VER_PLATFORM_WIN32_WINDOWS:
return 0x04030000; /* 4.3.0 */
}
Modified: trunk/reactos/dll/win32/msacm32/pcmconverter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/pcmconve…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/pcmconverter.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/pcmconverter.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -157,7 +157,7 @@
/***********************************************************************
* R16
*
- * Read a 16 bit sample (correctly handles endianess)
+ * Read a 16 bit sample (correctly handles endianness)
*/
static inline short R16(const unsigned char* src)
{
@@ -167,7 +167,7 @@
/***********************************************************************
* W16
*
- * Write a 16 bit sample (correctly handles endianess)
+ * Write a 16 bit sample (correctly handles endianness)
*/
static inline void W16(unsigned char* dst, short s)
{
Modified: trunk/reactos/dll/win32/msacm32/stream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/stream.c…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/stream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/stream.c [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -259,6 +259,7 @@
TRACE("%s => %08x\n", debugstr_w(wadi->pszDriverAlias), ret);
if (ret == MMSYSERR_NOERROR) {
if (fdwOpen & ACM_STREAMOPENF_QUERY) {
+ MSACM_Message((HACMDRIVER)wad, ACMDM_STREAM_CLOSE, (LPARAM)&was->drvInst, 0);
acmDriverClose(had, 0L);
}
break;
Modified: trunk/reactos/dll/win32/msacm32/wineacm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/wineacm.…
==============================================================================
--- trunk/reactos/dll/win32/msacm32/wineacm.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msacm32/wineacm.h [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -110,43 +110,43 @@
} WINE_ACMNOTIFYWND;
/* From internal.c */
-extern HANDLE MSACM_hHeap;
-extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID;
+extern HANDLE MSACM_hHeap DECLSPEC_HIDDEN;
+extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID DECLSPEC_HIDDEN;
extern PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR
pszFileName,
- PWINE_ACMLOCALDRIVER pLocalDriver);
-extern void MSACM_RegisterAllDrivers(void);
-extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
-extern void MSACM_UnregisterAllDrivers(void);
-extern PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
-extern PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
-extern PWINE_ACMNOTIFYWND MSACM_GetNotifyWnd(HACMDRIVERID hDriver);
-extern PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type);
+ PWINE_ACMLOCALDRIVER pLocalDriver) DECLSPEC_HIDDEN;
+extern void MSACM_RegisterAllDrivers(void) DECLSPEC_HIDDEN;
+extern PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) DECLSPEC_HIDDEN;
+extern void MSACM_UnregisterAllDrivers(void) DECLSPEC_HIDDEN;
+extern PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID) DECLSPEC_HIDDEN;
+extern PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver) DECLSPEC_HIDDEN;
+extern PWINE_ACMNOTIFYWND MSACM_GetNotifyWnd(HACMDRIVERID hDriver) DECLSPEC_HIDDEN;
+extern PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type) DECLSPEC_HIDDEN;
-extern MMRESULT MSACM_Message(HACMDRIVER, UINT, LPARAM, LPARAM);
-extern BOOL MSACM_FindFormatTagInCache(const WINE_ACMDRIVERID*, DWORD, LPDWORD);
+extern MMRESULT MSACM_Message(HACMDRIVER, UINT, LPARAM, LPARAM) DECLSPEC_HIDDEN;
+extern BOOL MSACM_FindFormatTagInCache(const WINE_ACMDRIVERID*, DWORD, LPDWORD)
DECLSPEC_HIDDEN;
-extern void MSACM_RePositionDriver(PWINE_ACMDRIVERID, DWORD);
-extern void MSACM_WriteCurrentPriorities(void);
-extern void MSACM_BroadcastNotification(void);
-extern void MSACM_DisableNotifications(void);
-extern void MSACM_EnableNotifications(void);
-extern PWINE_ACMNOTIFYWND MSACM_RegisterNotificationWindow(HWND hNotifyWnd, DWORD
dwNotifyMsg);
-extern PWINE_ACMNOTIFYWND MSACM_UnRegisterNotificationWindow(const WINE_ACMNOTIFYWND*);
+extern void MSACM_RePositionDriver(PWINE_ACMDRIVERID, DWORD) DECLSPEC_HIDDEN;
+extern void MSACM_WriteCurrentPriorities(void) DECLSPEC_HIDDEN;
+extern void MSACM_BroadcastNotification(void) DECLSPEC_HIDDEN;
+extern void MSACM_DisableNotifications(void) DECLSPEC_HIDDEN;
+extern void MSACM_EnableNotifications(void) DECLSPEC_HIDDEN;
+extern PWINE_ACMNOTIFYWND MSACM_RegisterNotificationWindow(HWND hNotifyWnd, DWORD
dwNotifyMsg) DECLSPEC_HIDDEN;
+extern PWINE_ACMNOTIFYWND MSACM_UnRegisterNotificationWindow(const WINE_ACMNOTIFYWND*)
DECLSPEC_HIDDEN;
-extern PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry);
+extern PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry)
DECLSPEC_HIDDEN;
-extern PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC
lpDriverProc);
-extern PWINE_ACMLOCALDRIVERINST MSACM_OpenLocalDriver(PWINE_ACMLOCALDRIVER, LPARAM);
-extern LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST);
+extern PWINE_ACMLOCALDRIVER MSACM_RegisterLocalDriver(HMODULE hModule, DRIVERPROC
lpDriverProc) DECLSPEC_HIDDEN;
+extern PWINE_ACMLOCALDRIVERINST MSACM_OpenLocalDriver(PWINE_ACMLOCALDRIVER, LPARAM)
DECLSPEC_HIDDEN;
+extern LRESULT MSACM_CloseLocalDriver(PWINE_ACMLOCALDRIVERINST) DECLSPEC_HIDDEN;
/*
extern PWINE_ACMLOCALDRIVER MSACM_GetLocalDriver(HACMDRIVER hDriver);
*/
/* From msacm32.c */
-extern HINSTANCE MSACM_hInstance32;
+extern HINSTANCE MSACM_hInstance32 DECLSPEC_HIDDEN;
/* From pcmcnvtr.c */
LRESULT CALLBACK PCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
- LPARAM dwParam1, LPARAM dwParam2);
+ LPARAM dwParam1, LPARAM dwParam2) DECLSPEC_HIDDEN;
/* Dialog box templates */
#include <msacmdlg.h>
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Sep 21 14:16:27 2013
@@ -105,7 +105,7 @@
reactos/dll/win32/mlang # Synced to Wine-1.7.1
reactos/dll/win32/mpr # Synced to Wine-1.7.1
reactos/dll/win32/mprapi # Synced to Wine-1.5.19
-reactos/dll/win32/msacm32 # Autosync
+reactos/dll/win32/msacm32 # Synced to Wine-1.7.1
reactos/dll/win32/msadp32.acm # Synced to Wine-1.5.19
reactos/dll/win32/mscat32 # Synced to Wine-1.5.19
reactos/dll/win32/mscms # Synced to Wine-1.5.4