mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[MSACM32] Sync with Wine Staging 1.9.23. CORE-12409
svn path=/trunk/; revision=73278
This commit is contained in:
parent
8004c858f3
commit
d98c0d0d23
3 changed files with 27 additions and 17 deletions
|
@ -72,6 +72,8 @@ DWORD WINAPI acmGetVersion(void)
|
|||
switch (version.dwPlatformId) {
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
return 0x04000565; /* 4.0.1381 */
|
||||
case VER_PLATFORM_WIN32s:
|
||||
return 0x02010000; /* 2.1 */
|
||||
default:
|
||||
FIXME("%x not supported\n", version.dwPlatformId);
|
||||
/* fall through */
|
||||
|
|
|
@ -37,6 +37,15 @@ static PWINE_ACMSTREAM ACM_GetStream(HACMSTREAM has)
|
|||
return (PWINE_ACMSTREAM)has;
|
||||
}
|
||||
|
||||
static BOOL ACM_ValidatePointers(PACMDRVSTREAMHEADER padsh)
|
||||
{
|
||||
/* check that pointers have not been modified */
|
||||
return !(padsh->pbPreparedSrc != padsh->pbSrc ||
|
||||
padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
|
||||
padsh->pbPreparedDst != padsh->pbDst ||
|
||||
padsh->cbPreparedDstLength < padsh->cbDstLength);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* acmStreamClose (MSACM32.@)
|
||||
*/
|
||||
|
@ -95,13 +104,9 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash,
|
|||
*/
|
||||
padsh = (PACMDRVSTREAMHEADER)pash;
|
||||
|
||||
/* check that pointers have not been modified */
|
||||
if (padsh->pbPreparedSrc != padsh->pbSrc ||
|
||||
padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
|
||||
padsh->pbPreparedDst != padsh->pbDst ||
|
||||
padsh->cbPreparedDstLength < padsh->cbDstLength) {
|
||||
if (!ACM_ValidatePointers(padsh)) {
|
||||
WARN("invalid parameter\n");
|
||||
return MMSYSERR_INVALPARAM;
|
||||
return MMSYSERR_INVALPARAM;
|
||||
}
|
||||
|
||||
padsh->fdwConvert = fdwConvert;
|
||||
|
@ -289,14 +294,21 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
|
|||
|
||||
if ((was = ACM_GetStream(has)) == NULL) {
|
||||
WARN("invalid handle\n");
|
||||
return MMSYSERR_INVALHANDLE;
|
||||
return MMSYSERR_INVALHANDLE;
|
||||
}
|
||||
if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) {
|
||||
WARN("invalid parameter\n");
|
||||
return MMSYSERR_INVALPARAM;
|
||||
return MMSYSERR_INVALPARAM;
|
||||
}
|
||||
if (fdwPrepare) {
|
||||
WARN("invalid use of reserved parameter\n");
|
||||
return MMSYSERR_INVALFLAG;
|
||||
}
|
||||
if (pash->cbSrcLength < was->drvInst.pwfxSrc->nBlockAlign) {
|
||||
WARN("source smaller than block align (%d < %d)\n",
|
||||
pash->cbSrcLength, was->drvInst.pwfxSrc->nBlockAlign);
|
||||
return pash->cbSrcLength ? ACMERR_NOTPOSSIBLE : MMSYSERR_INVALPARAM;
|
||||
}
|
||||
if (fdwPrepare)
|
||||
ret = MMSYSERR_INVALFLAG;
|
||||
|
||||
/* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
|
||||
* size. some fields are private to msacm internals, and are exposed
|
||||
|
@ -447,13 +459,9 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
|
|||
*/
|
||||
padsh = (PACMDRVSTREAMHEADER)pash;
|
||||
|
||||
/* check that pointers have not been modified */
|
||||
if (padsh->pbPreparedSrc != padsh->pbSrc ||
|
||||
padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
|
||||
padsh->pbPreparedDst != padsh->pbDst ||
|
||||
padsh->cbPreparedDstLength < padsh->cbDstLength) {
|
||||
if (!ACM_ValidatePointers(padsh)) {
|
||||
WARN("invalid parameter\n");
|
||||
return MMSYSERR_INVALPARAM;
|
||||
return MMSYSERR_INVALPARAM;
|
||||
}
|
||||
|
||||
padsh->fdwConvert = fdwUnprepare;
|
||||
|
|
|
@ -100,7 +100,7 @@ reactos/dll/win32/mlang # Synced to WineStaging-1.9.16
|
|||
reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23
|
||||
reactos/dll/win32/mpr # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/mprapi # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/msacm32 # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/msacm32 # Synced to WineStaging-1.9.23
|
||||
reactos/dll/win32/msacm32.drv # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/msadp32.acm # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/mscat32 # Synced to WineStaging-1.9.11
|
||||
|
|
Loading…
Reference in a new issue