Commit cd072ca2 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Added trace and debug printing info.

parent fd758586
...@@ -49,19 +49,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm); ...@@ -49,19 +49,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm);
MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule, MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule,
LPARAM lParam, DWORD dwPriority, DWORD fdwAdd) LPARAM lParam, DWORD dwPriority, DWORD fdwAdd)
{ {
if (!phadid) TRACE("(%p, %p, %08lx, %08lx, %08lx)\n",
phadid, hinstModule, lParam, dwPriority, fdwAdd);
if (!phadid) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
/* Check if any unknown flags */ /* Check if any unknown flags */
if (fdwAdd & if (fdwAdd &
~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND| ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND|
ACM_DRIVERADDF_GLOBAL)) ACM_DRIVERADDF_GLOBAL)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
/* Check if any incompatible flags */ /* Check if any incompatible flags */
if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) &&
(fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
/* FIXME: in fact, should GetModuleFileName(hinstModule) and do a /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a
* LoadDriver on it, to be sure we can call SendDriverMessage on the * LoadDriver on it, to be sure we can call SendDriverMessage on the
...@@ -98,12 +107,18 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) ...@@ -98,12 +107,18 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
PWINE_ACMDRIVERID padid; PWINE_ACMDRIVERID padid;
PWINE_ACMDRIVER* tpad; PWINE_ACMDRIVER* tpad;
if (fdwClose) TRACE("(%p, %08lx)\n", had, fdwClose);
if (fdwClose) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
pad = MSACM_GetDriver(had); pad = MSACM_GetDriver(had);
if (!pad) if (!pad) {
WARN("invalid handle\n");
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
}
padid = pad->obj.pACMDriverID; padid = pad->obj.pACMDriverID;
...@@ -132,11 +147,17 @@ MMRESULT WINAPI acmDriverDetailsA(HACMDRIVERID hadid, PACMDRIVERDETAILSA padd, D ...@@ -132,11 +147,17 @@ MMRESULT WINAPI acmDriverDetailsA(HACMDRIVERID hadid, PACMDRIVERDETAILSA padd, D
MMRESULT mmr; MMRESULT mmr;
ACMDRIVERDETAILSW addw; ACMDRIVERDETAILSW addw;
if (!padd) TRACE("(%p, %p, %08lx)\n", hadid, padd, fdwDetails);
if (!padd) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
if (padd->cbStruct < 4) if (padd->cbStruct < 4) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
addw.cbStruct = sizeof(addw); addw.cbStruct = sizeof(addw);
mmr = acmDriverDetailsW(hadid, &addw, fdwDetails); mmr = acmDriverDetailsW(hadid, &addw, fdwDetails);
...@@ -176,14 +197,22 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D ...@@ -176,14 +197,22 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D
HACMDRIVER acmDrvr; HACMDRIVER acmDrvr;
MMRESULT mmr; MMRESULT mmr;
if (!padd) TRACE("(%p, %p, %08lx)\n", hadid, padd, fdwDetails);
if (!padd) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
if (padd->cbStruct < 4) if (padd->cbStruct < 4) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
if (fdwDetails) if (fdwDetails) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
mmr = acmDriverOpen(&acmDrvr, hadid, 0); mmr = acmDriverOpen(&acmDrvr, hadid, 0);
if (mmr == MMSYSERR_NOERROR) { if (mmr == MMSYSERR_NOERROR) {
...@@ -205,10 +234,17 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR ...@@ -205,10 +234,17 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR
PWINE_ACMDRIVERID padid; PWINE_ACMDRIVERID padid;
DWORD fdwSupport; DWORD fdwSupport;
if (!fnCallback) return MMSYSERR_INVALPARAM; TRACE("(%p, %08lx, %08lx)\n", fnCallback, dwInstance, fdwEnum);
if (fdwEnum & ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) if (!fnCallback) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM;
}
if (fdwEnum & ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
fdwSupport = padid->fdwSupport; fdwSupport = padid->fdwSupport;
...@@ -233,15 +269,23 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID ...@@ -233,15 +269,23 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
{ {
PWINE_ACMOBJ pao; PWINE_ACMOBJ pao;
if (fdwDriverID) TRACE("(%p, %p, %08lx)\n", hao, phadid, fdwDriverID);
if (fdwDriverID) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE); pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE);
if (!pao) if (!pao) {
WARN("invalid handle\n");
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
}
if (!phadid) if (!phadid) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
*phadid = (HACMDRIVERID) pao->pACMDriverID; *phadid = (HACMDRIVERID) pao->pACMDriverID;
...@@ -254,11 +298,15 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID ...@@ -254,11 +298,15 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
*/ */
LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2) LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{ {
TRACE("(%p, %04x, %08lx, %08lx\n", had, uMsg, lParam1, lParam2);
if ((uMsg >= ACMDM_USER && uMsg < ACMDM_RESERVED_LOW) || if ((uMsg >= ACMDM_USER && uMsg < ACMDM_RESERVED_LOW) ||
uMsg == ACMDM_DRIVER_ABOUT || uMsg == ACMDM_DRIVER_ABOUT ||
uMsg == DRV_QUERYCONFIGURE || uMsg == DRV_QUERYCONFIGURE ||
uMsg == DRV_CONFIGURE) uMsg == DRV_CONFIGURE)
return MSACM_Message(had, uMsg, lParam1, lParam2); return MSACM_Message(had, uMsg, lParam1, lParam2);
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
...@@ -273,19 +321,27 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe ...@@ -273,19 +321,27 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
TRACE("(%p, %p, %08lu)\n", phad, hadid, fdwOpen); TRACE("(%p, %p, %08lu)\n", phad, hadid, fdwOpen);
if (!phad) if (!phad) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
}
if (fdwOpen) if (fdwOpen) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
padid = MSACM_GetDriverID(hadid); padid = MSACM_GetDriverID(hadid);
if (!padid) if (!padid) {
WARN("invalid handle\n");
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
}
pad = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER)); pad = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER));
if (!pad) if (!pad) {
WARN("no memory\n");
return MMSYSERR_NOMEM; return MMSYSERR_NOMEM;
}
pad->obj.dwType = WINE_ACMOBJ_DRIVER; pad->obj.dwType = WINE_ACMOBJ_DRIVER;
pad->obj.pACMDriverID = padid; pad->obj.pACMDriverID = padid;
...@@ -334,6 +390,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe ...@@ -334,6 +390,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
gotError: gotError:
WARN("failed: ret = %08x\n", ret);
if (pad && !pad->hDrvr) if (pad && !pad->hDrvr)
HeapFree(MSACM_hHeap, 0, pad); HeapFree(MSACM_hHeap, 0, pad);
return ret; return ret;
...@@ -352,25 +409,35 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd ...@@ -352,25 +409,35 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd
HKEY hPriorityKey; HKEY hPriorityKey;
DWORD dwPriorityCounter; DWORD dwPriorityCounter;
TRACE("(%p, %08lx, %08lx)\n", hadid, dwPriority, fdwPriority);
padid = MSACM_GetDriverID(hadid); padid = MSACM_GetDriverID(hadid);
if (!padid) if (!padid) {
WARN("invalid handle\n");
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
}
/* Check for unknown flags */ /* Check for unknown flags */
if (fdwPriority & if (fdwPriority &
~(ACM_DRIVERPRIORITYF_ENABLE|ACM_DRIVERPRIORITYF_DISABLE| ~(ACM_DRIVERPRIORITYF_ENABLE|ACM_DRIVERPRIORITYF_DISABLE|
ACM_DRIVERPRIORITYF_BEGIN|ACM_DRIVERPRIORITYF_END)) ACM_DRIVERPRIORITYF_BEGIN|ACM_DRIVERPRIORITYF_END)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
/* Check for incompatible flags */ /* Check for incompatible flags */
if ((fdwPriority & ACM_DRIVERPRIORITYF_ENABLE) && if ((fdwPriority & ACM_DRIVERPRIORITYF_ENABLE) &&
(fdwPriority & ACM_DRIVERPRIORITYF_DISABLE)) (fdwPriority & ACM_DRIVERPRIORITYF_DISABLE)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
/* Check for incompatible flags */ /* Check for incompatible flags */
if ((fdwPriority & ACM_DRIVERPRIORITYF_BEGIN) && if ((fdwPriority & ACM_DRIVERPRIORITYF_BEGIN) &&
(fdwPriority & ACM_DRIVERPRIORITYF_END)) (fdwPriority & ACM_DRIVERPRIORITYF_END)) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
lError = RegOpenKeyA(HKEY_CURRENT_USER, lError = RegOpenKeyA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Multimedia\\" "Software\\Microsoft\\Multimedia\\"
...@@ -378,8 +445,10 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd ...@@ -378,8 +445,10 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd
&hPriorityKey &hPriorityKey
); );
/* FIXME: Create key */ /* FIXME: Create key */
if (lError != ERROR_SUCCESS) if (lError != ERROR_SUCCESS) {
WARN("RegOpenKeyA failed\n");
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
}
for (dwPriorityCounter = 1; ; dwPriorityCounter++) { for (dwPriorityCounter = 1; ; dwPriorityCounter++) {
snprintf(szSubKey, 17, "Priority%ld", dwPriorityCounter); snprintf(szSubKey, 17, "Priority%ld", dwPriorityCounter);
...@@ -394,6 +463,7 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd ...@@ -394,6 +463,7 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd
RegCloseKey(hPriorityKey); RegCloseKey(hPriorityKey);
WARN("RegQueryValueA failed\n");
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
} }
...@@ -404,12 +474,18 @@ MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove) ...@@ -404,12 +474,18 @@ MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove)
{ {
PWINE_ACMDRIVERID padid; PWINE_ACMDRIVERID padid;
TRACE("(%p, %08lx)\n", hadid, fdwRemove);
padid = MSACM_GetDriverID(hadid); padid = MSACM_GetDriverID(hadid);
if (!padid) if (!padid) {
WARN("invalid handle\n");
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
}
if (fdwRemove) if (fdwRemove) {
WARN("invalid flag\n");
return MMSYSERR_INVALFLAG; return MMSYSERR_INVALFLAG;
}
MSACM_UnregisterDriver(padid); MSACM_UnregisterDriver(padid);
......
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