avifil32: Eliminate some gcc 4.1 warnings caused by windowsx.h macros.

This commit is contained in:
Mike McCormack 2006-03-04 14:13:05 +09:00 committed by Alexandre Julliard
parent c3a125179d
commit 73bc4e6752

View File

@ -26,7 +26,6 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "vfw.h"
#include "msacm.h"
@ -177,20 +176,24 @@ static ULONG WINAPI ACMStream_fnRelease(IAVIStream* iface)
This->has = NULL;
}
if (This->acmStreamHdr.pbSrc != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbSrc);
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbSrc));
GlobalFree(GlobalHandle(This->acmStreamHdr.pbSrc));
This->acmStreamHdr.pbSrc = NULL;
}
if (This->acmStreamHdr.pbDst != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbDst);
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbDst));
GlobalFree(GlobalHandle(This->acmStreamHdr.pbDst));
This->acmStreamHdr.pbDst = NULL;
}
if (This->lpInFormat != NULL) {
GlobalFreePtr(This->lpInFormat);
GlobalUnlock(GlobalHandle(This->lpInFormat));
GlobalFree(GlobalHandle(This->lpInFormat));
This->lpInFormat = NULL;
This->cbInFormat = 0;
}
if (This->lpOutFormat != NULL) {
GlobalFreePtr(This->lpOutFormat);
GlobalUnlock(GlobalHandle(This->lpOutFormat));
GlobalFree(GlobalHandle(This->lpOutFormat));
This->lpOutFormat = NULL;
This->cbOutFormat = 0;
}
@ -250,7 +253,7 @@ static HRESULT WINAPI ACMStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
else
This->cbOutFormat = sizeof(PCMWAVEFORMAT);
This->lpOutFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, This->cbOutFormat);
This->lpOutFormat = GlobalLock(GlobalAlloc(GHND, This->cbOutFormat));
if (This->lpOutFormat == NULL)
return AVIERR_MEMORY;
@ -383,7 +386,7 @@ static HRESULT WINAPI ACMStream_fnSetFormat(IAVIStream *iface, LONG pos,
if ((This->sInfo.dwCaps & AVIFILECAPS_CANWRITE) == 0)
return AVIERR_READONLY;
This->lpInFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, formatsize);
This->lpInFormat = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, formatsize));
if (This->lpInFormat == NULL)
return AVIERR_MEMORY;
This->cbInFormat = formatsize;
@ -463,7 +466,8 @@ static HRESULT WINAPI ACMStream_fnRead(IAVIStream *iface, LONG start,
/* Need to free destination buffer used for writing? */
if (This->acmStreamHdr.pbDst != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbDst);
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbDst));
GlobalFree(GlobalHandle(This->acmStreamHdr.pbDst));
This->acmStreamHdr.pbDst = NULL;
This->acmStreamHdr.dwDstUser = 0;
}
@ -472,10 +476,13 @@ static HRESULT WINAPI ACMStream_fnRead(IAVIStream *iface, LONG start,
if (This->acmStreamHdr.pbSrc == NULL ||
This->acmStreamHdr.dwSrcUser < size) {
if (This->acmStreamHdr.pbSrc == NULL)
This->acmStreamHdr.pbSrc = GlobalAllocPtr(GMEM_MOVEABLE, size);
This->acmStreamHdr.pbSrc = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, size));
else
This->acmStreamHdr.pbSrc = GlobalReAllocPtr(This->acmStreamHdr.pbSrc,
{
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbSrc));
This->acmStreamHdr.pbDst = GlobalReAlloc(GlobalHandle(This->acmStreamHdr.pbSrc),
size, GMEM_MOVEABLE);
}
if (This->acmStreamHdr.pbSrc == NULL)
return AVIERR_MEMORY;
This->acmStreamHdr.dwSrcUser = size;
@ -567,7 +574,8 @@ static HRESULT WINAPI ACMStream_fnWrite(IAVIStream *iface, LONG start,
/* Need to free source buffer used for reading? */
if (This->acmStreamHdr.pbSrc != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbSrc);
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbSrc));
GlobalFree(GlobalHandle(This->acmStreamHdr.pbSrc));
This->acmStreamHdr.pbSrc = NULL;
This->acmStreamHdr.dwSrcUser = 0;
}
@ -576,10 +584,13 @@ static HRESULT WINAPI ACMStream_fnWrite(IAVIStream *iface, LONG start,
if (This->acmStreamHdr.pbDst == NULL ||
This->acmStreamHdr.dwDstUser < size) {
if (This->acmStreamHdr.pbDst == NULL)
This->acmStreamHdr.pbDst = GlobalAllocPtr(GMEM_MOVEABLE, size);
This->acmStreamHdr.pbDst = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, size));
else
This->acmStreamHdr.pbDst = GlobalReAllocPtr(This->acmStreamHdr.pbDst,
{
GlobalUnlock(GlobalHandle(This->acmStreamHdr.pbDst));
This->acmStreamHdr.pbDst = GlobalReAlloc(GlobalHandle(This->acmStreamHdr.pbDst),
size, GMEM_MOVEABLE);
}
if (This->acmStreamHdr.pbDst == NULL)
return AVIERR_MEMORY;
This->acmStreamHdr.dwDstUser = size;
@ -703,7 +714,7 @@ static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This)
hr = AVIStreamFormatSize(This->pStream, This->sInfo.dwStart, &This->cbInFormat);
if (FAILED(hr))
return hr;
This->lpInFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, This->cbInFormat);
This->lpInFormat = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, This->cbInFormat));
if (This->lpInFormat == NULL)
return AVIERR_MEMORY;
@ -715,7 +726,7 @@ static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This)
if (This->lpOutFormat == NULL) {
/* we must decode to default format */
This->cbOutFormat = sizeof(PCMWAVEFORMAT);
This->lpOutFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, This->cbOutFormat);
This->lpOutFormat = GlobalLock(GlobalAlloc(GHND, This->cbOutFormat));
if (This->lpOutFormat == NULL)
return AVIERR_MEMORY;