From 77872fa87d952d36ed323c76c9c4b52bbf883920 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 12 Jun 2019 09:38:13 +0200 Subject: [PATCH] msacm32: Build with msvcrt. Signed-off-by: Alexandre Julliard --- dlls/msacm32/Makefile.in | 2 ++ dlls/msacm32/driver.c | 11 +++----- dlls/msacm32/format.c | 11 ++++---- dlls/msacm32/internal.c | 51 ++++++++++++++++++------------------- dlls/msacm32/pcmconverter.c | 1 - 5 files changed, 36 insertions(+), 40 deletions(-) diff --git a/dlls/msacm32/Makefile.in b/dlls/msacm32/Makefile.in index be2136d78f7..c018414cf39 100644 --- a/dlls/msacm32/Makefile.in +++ b/dlls/msacm32/Makefile.in @@ -2,6 +2,8 @@ MODULE = msacm32.dll IMPORTLIB = msacm32 IMPORTS = winmm user32 advapi32 +EXTRADLLFLAGS = -mno-cygwin + C_SRCS = \ driver.c \ filter.c \ diff --git a/dlls/msacm32/driver.c b/dlls/msacm32/driver.c index 13187b22041..f0d003f648b 100644 --- a/dlls/msacm32/driver.c +++ b/dlls/msacm32/driver.c @@ -21,8 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" #include #include @@ -38,7 +36,6 @@ #include "msacmdrv.h" #include "wineacm.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); @@ -441,11 +438,11 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA pConfigInfo->dwDCISize = iStructSize; - section_name = HeapAlloc(MSACM_hHeap, 0, (strlenW(drivers32) + 1) * sizeof(WCHAR)); - if (section_name) strcpyW(section_name, drivers32); + section_name = HeapAlloc(MSACM_hHeap, 0, (lstrlenW(drivers32) + 1) * sizeof(WCHAR)); + if (section_name) lstrcpyW(section_name, drivers32); pConfigInfo->lpszDCISectionName = section_name; - alias_name = HeapAlloc(MSACM_hHeap, 0, (strlenW(pAlias) + 1) * sizeof(WCHAR)); - if (alias_name) strcpyW(alias_name, pAlias); + alias_name = HeapAlloc(MSACM_hHeap, 0, (lstrlenW(pAlias) + 1) * sizeof(WCHAR)); + if (alias_name) lstrcpyW(alias_name, pAlias); pConfigInfo->lpszDCIAliasName = alias_name; if (pConfigInfo->lpszDCISectionName == NULL || pConfigInfo->lpszDCIAliasName == NULL) { diff --git a/dlls/msacm32/format.c b/dlls/msacm32/format.c index fcc0d9b1c62..284633ccefe 100644 --- a/dlls/msacm32/format.c +++ b/dlls/msacm32/format.c @@ -27,7 +27,6 @@ #include "winerror.h" #include "wingdi.h" #include "winuser.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "mmsystem.h" #include "mmreg.h" @@ -75,7 +74,7 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, } break; case WINE_ACMFF_FORMAT: - if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) { + if (lstrcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) { HACMDRIVER had; if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) { @@ -102,7 +101,7 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, mmr = acmFormatDetailsW(had, &afd, ACM_FORMATDETAILSF_INDEX); if (mmr == MMSYSERR_NOERROR) { lstrcpynW(buffer, afd.szFormat, ACMFORMATTAGDETAILS_FORMATTAG_CHARS + 1); - len = strlenW(buffer); + len = lstrlenW(buffer); for (j = len; j < ACMFORMATTAGDETAILS_FORMATTAG_CHARS; j++) buffer[j] = ' '; wsprintfW(buffer + ACMFORMATTAGDETAILS_FORMATTAG_CHARS, @@ -123,7 +122,7 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, } break; case WINE_ACMFF_WFX: - if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) { + if (lstrcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) { HACMDRIVER had; if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) { @@ -504,8 +503,8 @@ MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD pafd->pwfx->wBitsPerSample); } MultiByteToWideChar(CP_ACP, 0, (pafd->pwfx->nChannels == 1) ? "; Mono" : "; Stereo", -1, - pafd->szFormat + strlenW(pafd->szFormat), - ARRAY_SIZE(pafd->szFormat) - strlenW(pafd->szFormat)); + pafd->szFormat + lstrlenW(pafd->szFormat), + ARRAY_SIZE(pafd->szFormat) - lstrlenW(pafd->szFormat)); } TRACE("=> %d\n", mmr); diff --git a/dlls/msacm32/internal.c b/dlls/msacm32/internal.c index 7d324a8b27c..9c4d1a75f3b 100644 --- a/dlls/msacm32/internal.c +++ b/dlls/msacm32/internal.c @@ -36,7 +36,6 @@ #include "msacmdrv.h" #include "wineacm.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); @@ -72,7 +71,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry) /* The requested registry entry must have the format msacm.XXXXX in order to be recognized in any future sessions of msacm */ - if (0 == strncmpiW(pszRegEntry, msacmW, ARRAY_SIZE(msacmW))) { + if (0 == wcsnicmp(pszRegEntry, msacmW, ARRAY_SIZE(msacmW))) { lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, drvkey, 0, KEY_QUERY_VALUE, &hKey); if (lRet != ERROR_SUCCESS) { WARN("unable to open registry key - 0x%08x\n", lRet); @@ -192,12 +191,12 @@ static LPWSTR MSACM_GetRegistryKey(const WINE_ACMDRIVERID* padid) ERR("No alias needed for registry entry\n"); return NULL; } - len = strlenW(baseKey); - ret = HeapAlloc(MSACM_hHeap, 0, (len + strlenW(padid->pszDriverAlias) + 1) * sizeof(WCHAR)); + len = lstrlenW(baseKey); + ret = HeapAlloc(MSACM_hHeap, 0, (len + lstrlenW(padid->pszDriverAlias) + 1) * sizeof(WCHAR)); if (!ret) return NULL; - strcpyW(ret, baseKey); - strcpyW(ret + len, padid->pszDriverAlias); + lstrcpyW(ret, baseKey); + lstrcpyW(ret + len, padid->pszDriverAlias); CharLowerW(ret + len); return ret; } @@ -296,23 +295,23 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa padid->pszDriverAlias = NULL; if (pszDriverAlias) { - padid->pszDriverAlias = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszDriverAlias)+1) * sizeof(WCHAR) ); + padid->pszDriverAlias = HeapAlloc( MSACM_hHeap, 0, (lstrlenW(pszDriverAlias)+1) * sizeof(WCHAR) ); if (!padid->pszDriverAlias) { HeapFree(MSACM_hHeap, 0, padid); return NULL; } - strcpyW( padid->pszDriverAlias, pszDriverAlias ); + lstrcpyW( padid->pszDriverAlias, pszDriverAlias ); } padid->pszFileName = NULL; if (pszFileName) { - padid->pszFileName = HeapAlloc( MSACM_hHeap, 0, (strlenW(pszFileName)+1) * sizeof(WCHAR) ); + padid->pszFileName = HeapAlloc( MSACM_hHeap, 0, (lstrlenW(pszFileName)+1) * sizeof(WCHAR) ); if (!padid->pszFileName) { HeapFree(MSACM_hHeap, 0, padid->pszDriverAlias); HeapFree(MSACM_hHeap, 0, padid); return NULL; } - strcpyW( padid->pszFileName, pszFileName ); + lstrcpyW( padid->pszFileName, pszFileName ); } padid->pLocalDriver = pLocalDriver; @@ -376,8 +375,8 @@ void MSACM_RegisterAllDrivers(void) bufLen = ARRAY_SIZE(buf); lRet = RegEnumKeyExW(hKey, i, buf, &bufLen, 0, 0, 0, &lastWrite); if (lRet != ERROR_SUCCESS) continue; - if (strncmpiW(buf, msacmW, ARRAY_SIZE(msacmW))) continue; - if (!(name = strchrW(buf, '='))) continue; + if (wcsnicmp(buf, msacmW, ARRAY_SIZE(msacmW))) continue; + if (!(name = wcschr(buf, '='))) continue; *name = 0; MSACM_RegisterDriver(buf, name + 1, 0); } @@ -386,7 +385,7 @@ void MSACM_RegisterAllDrivers(void) bufLen = sizeof(buf); while(RegEnumValueW(hKey, i, valname, &cnt, 0, &type, (BYTE*)buf, &bufLen) == ERROR_SUCCESS){ - if (!strncmpiW(valname, msacmW, ARRAY_SIZE(msacmW))) + if (!wcsnicmp(valname, msacmW, ARRAY_SIZE(msacmW))) MSACM_RegisterDriver(valname, buf, 0); ++i; } @@ -395,10 +394,10 @@ void MSACM_RegisterAllDrivers(void) if (GetPrivateProfileSectionW(drv32, buf, ARRAY_SIZE(buf), sys)) { - for(s = buf; *s; s += strlenW(s) + 1) + for(s = buf; *s; s += lstrlenW(s) + 1) { - if (strncmpiW(s, msacmW, ARRAY_SIZE(msacmW))) continue; - if (!(name = strchrW(s, '='))) continue; + if (wcsnicmp(s, msacmW, ARRAY_SIZE(msacmW))) continue; + if (!(name = wcschr(s, '='))) continue; *name = 0; MSACM_RegisterDriver(s, name + 1, 0); *name = '='; @@ -614,7 +613,7 @@ static void MSACM_ReorderDriversByPriority(void) static const WCHAR sPrefix[] = {'m','s','a','c','m','.','\0'}; /* Build expected entry name */ - snprintfW(szSubKey, 17, priorityTmpl, i + 1); + swprintf(szSubKey, 17, priorityTmpl, i + 1); lBufferLength = sizeof(szBuffer); lError = RegQueryValueExW(hPriorityKey, szSubKey, NULL, NULL, (LPBYTE)szBuffer, (LPDWORD)&lBufferLength); if (lError != ERROR_SUCCESS) continue; @@ -623,11 +622,11 @@ static void MSACM_ReorderDriversByPriority(void) iTargetPosition = i; /* Locate driver alias in driver list */ - pAlias = strstrW(szBuffer, sPrefix); + pAlias = wcsstr(szBuffer, sPrefix); if (pAlias == NULL) continue; for (iCurrentPosition = 0; iCurrentPosition < iNumDrivers; iCurrentPosition++) { - if (strcmpiW(driverList[iCurrentPosition]->pszDriverAlias, pAlias) == 0) + if (wcsicmp(driverList[iCurrentPosition]->pszDriverAlias, pAlias) == 0) break; } if (iCurrentPosition < iNumDrivers && iTargetPosition != iCurrentPosition) { @@ -703,13 +702,13 @@ void MSACM_WriteCurrentPriorities(void) /* Build required value name */ dwPriorityCounter++; - snprintfW(szSubKey, 17, priorityTmpl, dwPriorityCounter); + swprintf(szSubKey, 17, priorityTmpl, dwPriorityCounter); /* Value has a 1 in front for enabled drivers and 0 for disabled drivers */ - snprintfW(szBuffer, 256, valueTmpl, (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) ? '0' : '1', padid->pszDriverAlias); - strlwrW(szBuffer); + swprintf(szBuffer, 256, valueTmpl, (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) ? '0' : '1', padid->pszDriverAlias); + wcslwr(szBuffer); - lError = RegSetValueExW(hPriorityKey, szSubKey, 0, REG_SZ, (BYTE *)szBuffer, (strlenW(szBuffer) + 1) * sizeof(WCHAR)); + lError = RegSetValueExW(hPriorityKey, szSubKey, 0, REG_SZ, (BYTE *)szBuffer, (lstrlenW(szBuffer) + 1) * sizeof(WCHAR)); if (lError != ERROR_SUCCESS) { ERR("unable to write value for %s under key %s (0x%08x)\n", debugstr_w(padid->pszDriverAlias), debugstr_w(basePriorityKey), lError); @@ -718,12 +717,12 @@ void MSACM_WriteCurrentPriorities(void) /* Build required value name */ dwPriorityCounter++; - snprintfW(szSubKey, 17, priorityTmpl, dwPriorityCounter); + swprintf(szSubKey, 17, priorityTmpl, dwPriorityCounter); /* Value has a 1 in front for enabled drivers and 0 for disabled drivers */ - snprintfW(szBuffer, 256, valueTmpl, '1', converterAlias); + swprintf(szBuffer, 256, valueTmpl, '1', converterAlias); - lError = RegSetValueExW(hPriorityKey, szSubKey, 0, REG_SZ, (BYTE *)szBuffer, (strlenW(szBuffer) + 1) * sizeof(WCHAR)); + lError = RegSetValueExW(hPriorityKey, szSubKey, 0, REG_SZ, (BYTE *)szBuffer, (lstrlenW(szBuffer) + 1) * sizeof(WCHAR)); if (lError != ERROR_SUCCESS) { ERR("unable to write value for %s under key %s (0x%08x)\n", debugstr_w(converterAlias), debugstr_w(basePriorityKey), lError); diff --git a/dlls/msacm32/pcmconverter.c b/dlls/msacm32/pcmconverter.c index dc10f11e7ad..d528a6d35fb 100644 --- a/dlls/msacm32/pcmconverter.c +++ b/dlls/msacm32/pcmconverter.c @@ -26,7 +26,6 @@ * embedded driver handling scheme in msacm32.dll which isn't done yet */ -#include "config.h" #include #include