Commit 0da601fa authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

msacm32: Cast-qual warnings fix.

parent 3f9a168f
...@@ -402,6 +402,8 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA ...@@ -402,6 +402,8 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA
PWINE_ACMDRIVERID padid; PWINE_ACMDRIVERID padid;
LRESULT lResult; LRESULT lResult;
LPDRVCONFIGINFO pConfigInfo = NULL; LPDRVCONFIGINFO pConfigInfo = NULL;
LPWSTR section_name = NULL;
LPWSTR alias_name = NULL;
/* Check whether handle is an HACMDRIVERID */ /* Check whether handle is an HACMDRIVERID */
padid = MSACM_GetDriverID((HACMDRIVERID)had); padid = MSACM_GetDriverID((HACMDRIVERID)had);
...@@ -434,16 +436,19 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA ...@@ -434,16 +436,19 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA
ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n"); ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n");
} else { } else {
static const WCHAR drivers32[] = {'D','r','i','v','e','r','s','3','2','\0'}; static const WCHAR drivers32[] = {'D','r','i','v','e','r','s','3','2','\0'};
pConfigInfo->dwDCISize = iStructSize; pConfigInfo->dwDCISize = iStructSize;
pConfigInfo->lpszDCISectionName = HeapAlloc(MSACM_hHeap, 0, (strlenW(drivers32) + 1) * sizeof(WCHAR)); section_name = HeapAlloc(MSACM_hHeap, 0, (strlenW(drivers32) + 1) * sizeof(WCHAR));
if (pConfigInfo->lpszDCISectionName) strcpyW((WCHAR *)pConfigInfo->lpszDCISectionName, drivers32); if (section_name) strcpyW(section_name, drivers32);
pConfigInfo->lpszDCIAliasName = HeapAlloc(MSACM_hHeap, 0, (strlenW(pAlias) + 1) * sizeof(WCHAR)); pConfigInfo->lpszDCISectionName = section_name;
if (pConfigInfo->lpszDCIAliasName) strcpyW((WCHAR *)pConfigInfo->lpszDCIAliasName, pAlias); alias_name = HeapAlloc(MSACM_hHeap, 0, (strlenW(pAlias) + 1) * sizeof(WCHAR));
if (alias_name) strcpyW(alias_name, pAlias);
pConfigInfo->lpszDCIAliasName = alias_name;
if (pConfigInfo->lpszDCISectionName == NULL || pConfigInfo->lpszDCIAliasName == NULL) { if (pConfigInfo->lpszDCISectionName == NULL || pConfigInfo->lpszDCIAliasName == NULL) {
HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCIAliasName); HeapFree(MSACM_hHeap, 0, alias_name);
HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCISectionName); HeapFree(MSACM_hHeap, 0, section_name);
HeapFree(MSACM_hHeap, 0, pConfigInfo); HeapFree(MSACM_hHeap, 0, pConfigInfo);
pConfigInfo = NULL; pConfigInfo = NULL;
ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n"); ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n");
...@@ -471,8 +476,8 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA ...@@ -471,8 +476,8 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA
lResult = MSACM_Message(had, uMsg, lParam1, lParam2); lResult = MSACM_Message(had, uMsg, lParam1, lParam2);
} }
if (pConfigInfo) { if (pConfigInfo) {
HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCIAliasName); HeapFree(MSACM_hHeap, 0, alias_name);
HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCISectionName); HeapFree(MSACM_hHeap, 0, section_name);
HeapFree(MSACM_hHeap, 0, pConfigInfo); HeapFree(MSACM_hHeap, 0, pConfigInfo);
} }
return lResult; return lResult;
...@@ -523,6 +528,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe ...@@ -523,6 +528,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
{ {
ACMDRVOPENDESCW adod; ACMDRVOPENDESCW adod;
int len; int len;
LPWSTR section_name;
/* this is not an externally added driver... need to actually load it */ /* this is not an externally added driver... need to actually load it */
if (!padid->pszDriverAlias) if (!padid->pszDriverAlias)
...@@ -538,14 +544,15 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe ...@@ -538,14 +544,15 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
adod.dwFlags = fdwOpen; adod.dwFlags = fdwOpen;
adod.dwError = 0; adod.dwError = 0;
len = strlen("Drivers32") + 1; len = strlen("Drivers32") + 1;
adod.pszSectionName = HeapAlloc(MSACM_hHeap, 0, len * sizeof(WCHAR)); section_name = HeapAlloc(MSACM_hHeap, 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, "Drivers32", -1, (LPWSTR)adod.pszSectionName, len); MultiByteToWideChar(CP_ACP, 0, "Drivers32", -1, section_name, len);
adod.pszSectionName = section_name;
adod.pszAliasName = padid->pszDriverAlias; adod.pszAliasName = padid->pszDriverAlias;
adod.dnDevNode = 0; adod.dnDevNode = 0;
pad->hDrvr = OpenDriver(padid->pszDriverAlias, NULL, (DWORD)&adod); pad->hDrvr = OpenDriver(padid->pszDriverAlias, NULL, (DWORD)&adod);
HeapFree(MSACM_hHeap, 0, (LPWSTR)adod.pszSectionName); HeapFree(MSACM_hHeap, 0, section_name);
if (!pad->hDrvr) if (!pad->hDrvr)
{ {
ret = adod.dwError; ret = adod.dwError;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment