Autosyncing with Wine HEAD

svn path=/trunk/; revision=24193
This commit is contained in:
The Wine Synchronizer
2006-09-18 16:32:05 +00:00
parent fab72e48ec
commit 8bde95b20e
32 changed files with 332 additions and 284 deletions
+20 -28
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -26,9 +26,7 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "msacm.h"
@@ -117,7 +115,7 @@ HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppv)
*ppv = NULL;
pstream = (IAVIStreamImpl*)LocalAlloc(LPTR, sizeof(IAVIStreamImpl));
pstream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIStreamImpl));
if (pstream == NULL)
return AVIERR_MEMORY;
@@ -125,7 +123,7 @@ HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppv)
hr = IAVIStream_QueryInterface((IAVIStream*)pstream, riid, ppv);
if (FAILED(hr))
LocalFree((HLOCAL)pstream);
HeapFree(GetProcessHeap(), 0, pstream);
return hr;
}
@@ -177,21 +175,17 @@ static ULONG WINAPI ACMStream_fnRelease(IAVIStream* iface)
acmStreamClose(This->has, 0);
This->has = NULL;
}
if (This->acmStreamHdr.pbSrc != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbSrc);
This->acmStreamHdr.pbSrc = NULL;
}
if (This->acmStreamHdr.pbDst != NULL) {
GlobalFreePtr(This->acmStreamHdr.pbDst);
This->acmStreamHdr.pbDst = NULL;
}
HeapFree(GetProcessHeap(), 0, This->acmStreamHdr.pbSrc);
This->acmStreamHdr.pbSrc = NULL;
HeapFree(GetProcessHeap(), 0, This->acmStreamHdr.pbDst);
This->acmStreamHdr.pbDst = NULL;
if (This->lpInFormat != NULL) {
GlobalFreePtr(This->lpInFormat);
HeapFree(GetProcessHeap(), 0, This->lpInFormat);
This->lpInFormat = NULL;
This->cbInFormat = 0;
}
if (This->lpOutFormat != NULL) {
GlobalFreePtr(This->lpOutFormat);
HeapFree(GetProcessHeap(), 0, This->lpOutFormat);
This->lpOutFormat = NULL;
This->cbOutFormat = 0;
}
@@ -199,7 +193,7 @@ static ULONG WINAPI ACMStream_fnRelease(IAVIStream* iface)
IAVIStream_Release(This->pStream);
This->pStream = NULL;
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
@@ -251,7 +245,7 @@ static HRESULT WINAPI ACMStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
else
This->cbOutFormat = sizeof(PCMWAVEFORMAT);
This->lpOutFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, This->cbOutFormat);
This->lpOutFormat = HeapAlloc(GetProcessHeap(), 0, This->cbOutFormat);
if (This->lpOutFormat == NULL)
return AVIERR_MEMORY;
@@ -384,7 +378,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 = HeapAlloc(GetProcessHeap(), 0, formatsize);
if (This->lpInFormat == NULL)
return AVIERR_MEMORY;
This->cbInFormat = formatsize;
@@ -464,7 +458,7 @@ 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);
HeapFree(GetProcessHeap(), 0, This->acmStreamHdr.pbDst);
This->acmStreamHdr.pbDst = NULL;
This->acmStreamHdr.dwDstUser = 0;
}
@@ -473,10 +467,9 @@ 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 = HeapAlloc(GetProcessHeap(), 0, size);
else
This->acmStreamHdr.pbSrc = GlobalReAllocPtr(This->acmStreamHdr.pbSrc,
size, GMEM_MOVEABLE);
This->acmStreamHdr.pbDst = HeapReAlloc(GetProcessHeap(), 0, This->acmStreamHdr.pbSrc, size);
if (This->acmStreamHdr.pbSrc == NULL)
return AVIERR_MEMORY;
This->acmStreamHdr.dwSrcUser = size;
@@ -568,7 +561,7 @@ 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);
HeapFree(GetProcessHeap(), 0, This->acmStreamHdr.pbSrc);
This->acmStreamHdr.pbSrc = NULL;
This->acmStreamHdr.dwSrcUser = 0;
}
@@ -577,10 +570,9 @@ 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 = HeapAlloc(GetProcessHeap(), 0, size);
else
This->acmStreamHdr.pbDst = GlobalReAllocPtr(This->acmStreamHdr.pbDst,
size, GMEM_MOVEABLE);
This->acmStreamHdr.pbDst = HeapReAlloc(GetProcessHeap(), 0, This->acmStreamHdr.pbDst, size);
if (This->acmStreamHdr.pbDst == NULL)
return AVIERR_MEMORY;
This->acmStreamHdr.dwDstUser = size;
@@ -704,7 +696,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 = HeapAlloc(GetProcessHeap(), 0, This->cbInFormat);
if (This->lpInFormat == NULL)
return AVIERR_MEMORY;
@@ -716,7 +708,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 = HeapAlloc(GetProcessHeap(), 0, This->cbOutFormat);
if (This->lpOutFormat == NULL)
return AVIERR_MEMORY;
+35 -40
View File
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
@@ -30,12 +30,10 @@
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "windowsx.h"
#include "ole2.h"
#include "shellapi.h"
#include "shlobj.h"
#include "mmreg.h"
#include "vfw.h"
#include "msacm.h"
@@ -216,7 +214,7 @@ HRESULT WINAPI AVIFileOpenA(PAVIFILE *ppfile, LPCSTR szFile, UINT uMode,
if (len <= 0)
return AVIERR_BADPARAM;
wszFile = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
wszFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wszFile == NULL)
return AVIERR_MEMORY;
@@ -224,7 +222,7 @@ HRESULT WINAPI AVIFileOpenA(PAVIFILE *ppfile, LPCSTR szFile, UINT uMode,
hr = AVIFileOpenW(ppfile, wszFile, uMode, lpHandler);
LocalFree((HLOCAL)wszFile);
HeapFree(GetProcessHeap(), 0, wszFile);
return hr;
}
@@ -1010,7 +1008,7 @@ HRESULT WINAPI AVIBuildFilterA(LPSTR szFilter, LONG cbFilter, BOOL fSaving)
szFilter[0] = 0;
szFilter[1] = 0;
wszFilter = (LPWSTR)GlobalAllocPtr(GHND, cbFilter * sizeof(WCHAR));
wszFilter = HeapAlloc(GetProcessHeap(), 0, cbFilter * sizeof(WCHAR));
if (wszFilter == NULL)
return AVIERR_MEMORY;
@@ -1020,7 +1018,7 @@ HRESULT WINAPI AVIBuildFilterA(LPSTR szFilter, LONG cbFilter, BOOL fSaving)
szFilter, cbFilter, NULL, NULL);
}
GlobalFreePtr(wszFilter);
HeapFree(GetProcessHeap(), 0, wszFilter);
return hr;
}
@@ -1052,7 +1050,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
if (cbFilter < 2)
return AVIERR_BADSIZE;
lp = (AVIFilter*)GlobalAllocPtr(GHND, MAX_FILTERS * sizeof(AVIFilter));
lp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_FILTERS * sizeof(AVIFilter));
if (lp == NULL)
return AVIERR_MEMORY;
@@ -1066,7 +1064,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
* collection of all possible extensions except "*.*".
*/
if (RegOpenKeyW(HKEY_CLASSES_ROOT, szAVIFileExtensions, &hKey) != S_OK) {
GlobalFreePtr(lp);
HeapFree(GetProcessHeap(), 0, lp);
return AVIERR_ERROR;
}
for (n = 0;RegEnumKeyW(hKey, n, szFileExt, sizeof(szFileExt)) == S_OK;n++) {
@@ -1114,7 +1112,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
/* 2. get descriptions for the CLSIDs and fill out szFilter */
if (RegOpenKeyW(HKEY_CLASSES_ROOT, szClsid, &hKey) != S_OK) {
GlobalFreePtr(lp);
HeapFree(GetProcessHeap(), 0, lp);
return AVIERR_ERROR;
}
for (n = 0; n <= count; n++) {
@@ -1133,7 +1131,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
if (cbFilter < size + lstrlenW(lp[n].szExtensions) + 2) {
szFilter[0] = 0;
szFilter[1] = 0;
GlobalFreePtr(lp);
HeapFree(GetProcessHeap(), 0, lp);
RegCloseKey(hKey);
return AVIERR_BUFFERTOOSMALL;
}
@@ -1148,7 +1146,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
}
RegCloseKey(hKey);
GlobalFreePtr(lp);
HeapFree(GetProcessHeap(), 0, lp);
/* add "All files" "*.*" filter if enough space left */
size = LoadStringW(AVIFILE_hModule, IDS_ALLFILES,
@@ -1259,10 +1257,10 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, &size);
if ((pOptions->cbFormat == 0 || pOptions->lpFormat == NULL) && size != 0) {
pOptions->lpFormat = GlobalAllocPtr(GMEM_MOVEABLE, size);
pOptions->lpFormat = HeapAlloc(GetProcessHeap(), 0, size);
pOptions->cbFormat = size;
} else if (pOptions->cbFormat < (DWORD)size) {
pOptions->lpFormat = GlobalReAllocPtr(pOptions->lpFormat, size, GMEM_MOVEABLE);
pOptions->lpFormat = HeapReAlloc(GetProcessHeap(), 0, pOptions->lpFormat, size);
pOptions->cbFormat = size;
}
if (pOptions->lpFormat == NULL)
@@ -1275,7 +1273,7 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
sInfo.dwStart, &size);
if (size < (LONG)sizeof(PCMWAVEFORMAT))
size = sizeof(PCMWAVEFORMAT);
afmtc.pwfxEnum = GlobalAllocPtr(GHND, size);
afmtc.pwfxEnum = HeapAlloc(GetProcessHeap(), 0, size);
if (afmtc.pwfxEnum != NULL) {
AVIStreamReadFormat(SaveOpts.ppavis[SaveOpts.nCurrent],
sInfo.dwStart, afmtc.pwfxEnum, &size);
@@ -1286,9 +1284,7 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
if (ret == S_OK)
pOptions->dwFlags |= AVICOMPRESSF_VALID;
if (afmtc.pwfxEnum != NULL)
GlobalFreePtr(afmtc.pwfxEnum);
HeapFree(GetProcessHeap(), 0, afmtc.pwfxEnum);
return (ret == S_OK ? TRUE : FALSE);
} else {
ERR(": unknown streamtype 0x%08lX\n", sInfo.fccType);
@@ -1320,7 +1316,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
szFormat[0] = 0;
/* read format to build format description string */
lpFormat = GlobalAllocPtr(GHND, size);
lpFormat = HeapAlloc(GetProcessHeap(), 0, size);
if (lpFormat != NULL) {
if (SUCCEEDED(AVIStreamReadFormat(SaveOpts.ppavis[SaveOpts.nCurrent],sInfo.dwStart,lpFormat, &size))) {
if (sInfo.fccType == streamtypeVIDEO) {
@@ -1367,7 +1363,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
}
}
}
GlobalFreePtr(lpFormat);
HeapFree(GetProcessHeap(), 0, lpFormat);
}
/* set text for format description */
@@ -1411,8 +1407,7 @@ static INT_PTR CALLBACK AVISaveOptionsDlgProc(HWND hWnd, UINT uMsg,
/* select first stream */
SendDlgItemMessageW(hWnd, IDC_STREAM, CB_SETCURSEL, 0, 0);
SendMessageW(hWnd, WM_COMMAND,
GET_WM_COMMAND_MPS(IDC_STREAM, hWnd, CBN_SELCHANGE));
SendMessageW(hWnd, WM_COMMAND, MAKELONG(IDC_STREAM, CBN_SELCHANGE), (LPARAM)hWnd);
/* initialize interleave */
if (SaveOpts.ppOptions[0] != NULL &&
@@ -1428,7 +1423,7 @@ static INT_PTR CALLBACK AVISaveOptionsDlgProc(HWND hWnd, UINT uMsg,
EnableWindow(GetDlgItem(hWnd, IDC_INTERLEAVEEVERY), bIsInterleaved);
break;
case WM_COMMAND:
switch (GET_WM_COMMAND_ID(wParam, lParam)) {
switch (LOWORD(wParam)) {
case IDOK:
/* get data from controls and save them */
dwInterleave = GetDlgItemInt(hWnd, IDC_INTERLEAVEEVERY, NULL, 0);
@@ -1444,14 +1439,14 @@ static INT_PTR CALLBACK AVISaveOptionsDlgProc(HWND hWnd, UINT uMsg,
}
/* fall through */
case IDCANCEL:
EndDialog(hWnd, GET_WM_COMMAND_ID(wParam, lParam) == IDOK);
EndDialog(hWnd, LOWORD(wParam) == IDOK);
break;
case IDC_INTERLEAVE:
EnableWindow(GetDlgItem(hWnd, IDC_INTERLEAVEEVERY),
IsDlgButtonChecked(hWnd, IDC_INTERLEAVE));
break;
case IDC_STREAM:
if (GET_WM_COMMAND_CMD(wParam, lParam) == CBN_SELCHANGE) {
if (HIWORD(wParam) == CBN_SELCHANGE) {
/* update control elements */
AVISaveOptionsUpdate(hWnd);
}
@@ -1484,7 +1479,7 @@ BOOL WINAPI AVISaveOptions(HWND hWnd, UINT uFlags, INT nStreams,
/* save options in case the user presses cancel */
if (ppOptions != NULL && nStreams > 1) {
pSavedOptions = GlobalAllocPtr(GHND,nStreams * sizeof(AVICOMPRESSOPTIONS));
pSavedOptions = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(AVICOMPRESSOPTIONS));
if (pSavedOptions == NULL)
return FALSE;
@@ -1513,7 +1508,7 @@ BOOL WINAPI AVISaveOptions(HWND hWnd, UINT uFlags, INT nStreams,
memcpy(ppOptions[n], pSavedOptions + n, sizeof(AVICOMPRESSOPTIONS));
}
}
GlobalFreePtr(pSavedOptions);
HeapFree(GetProcessHeap(), 0, pSavedOptions);
}
return (BOOL)ret;
@@ -1535,12 +1530,12 @@ HRESULT WINAPI AVISaveOptionsFree(INT nStreams,LPAVICOMPRESSOPTIONS*ppOptions)
ppOptions[nStreams]->dwFlags &= ~AVICOMPRESSF_VALID;
if (ppOptions[nStreams]->lpParms != NULL) {
GlobalFreePtr(ppOptions[nStreams]->lpParms);
HeapFree(GetProcessHeap(), 0, ppOptions[nStreams]->lpParms);
ppOptions[nStreams]->lpParms = NULL;
ppOptions[nStreams]->cbParms = 0;
}
if (ppOptions[nStreams]->lpFormat != NULL) {
GlobalFreePtr(ppOptions[nStreams]->lpFormat);
HeapFree(GetProcessHeap(), 0, ppOptions[nStreams]->lpFormat);
ppOptions[nStreams]->lpFormat = NULL;
ppOptions[nStreams]->cbFormat = 0;
}
@@ -1572,7 +1567,7 @@ HRESULT WINAPI AVISaveVA(LPCSTR szFile, CLSID *pclsidHandler,
if (len <= 0)
return AVIERR_BADPARAM;
wszFile = LocalAlloc(LPTR, len * sizeof(WCHAR));
wszFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wszFile == NULL)
return AVIERR_MEMORY;
@@ -1581,7 +1576,7 @@ HRESULT WINAPI AVISaveVA(LPCSTR szFile, CLSID *pclsidHandler,
hr = AVISaveVW(wszFile, pclsidHandler, lpfnCallback,
nStream, ppavi, plpOptions);
LocalFree((HLOCAL)wszFile);
HeapFree(GetProcessHeap(), 0, wszFile);
return hr;
}
@@ -1722,7 +1717,8 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
}
/* allocate buffer for formats, data, etc. of an initial size of 64 kBytes*/
lpBuffer = GlobalAllocPtr(GPTR, cbBuffer = 0x00010000);
cbBuffer = 0x00010000;
lpBuffer = HeapAlloc(GetProcessHeap(), 0, cbBuffer);
if (lpBuffer == NULL) {
hres = AVIERR_MEMORY;
goto error;
@@ -1865,7 +1861,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
lFirstVideo - lStart[curStream], lpBuffer,
cbBuffer, &lReadBytes, &lReadSamples);
} while ((hres == AVIERR_BUFFERTOOSMALL) &&
(lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL);
(lpBuffer = HeapReAlloc(GetProcessHeap(), 0, lpBuffer, cbBuffer *= 2)) != NULL);
if (lpBuffer == NULL)
hres = AVIERR_MEMORY;
if (FAILED(hres))
@@ -1934,7 +1930,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
hres = AVIStreamRead(pInStreams[curStream],sInfo.dwStart,lSamples,
lpBuffer,cbBuffer,&lReadBytes,&lReadSamples);
} while ((hres == AVIERR_BUFFERTOOSMALL) &&
(lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL);
(lpBuffer = HeapReAlloc(GetProcessHeap(), 0, lpBuffer, cbBuffer *= 2)) != NULL);
if (lpBuffer == NULL)
hres = AVIERR_MEMORY;
if (FAILED(hres))
@@ -1980,7 +1976,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
hres = AVIStreamRead(pInStreams[curStream], sInfo.dwStart, 1,
lpBuffer, cbBuffer,&lReadBytes,&lReadSamples);
} while ((hres == AVIERR_BUFFERTOOSMALL) &&
(lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL);
(lpBuffer = HeapReAlloc(GetProcessHeap(), 0, lpBuffer, cbBuffer *= 2)) != NULL);
if (lpBuffer == NULL)
hres = AVIERR_MEMORY;
if (FAILED(hres))
@@ -2009,8 +2005,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
}
error:
if (lpBuffer != NULL)
GlobalFreePtr(lpBuffer);
HeapFree(GetProcessHeap(), 0, lpBuffer);
if (pfile != NULL) {
for (curStream = 0; curStream < nStreams; curStream++) {
if (pOutStreams[curStream] != NULL)
@@ -2194,7 +2189,7 @@ HRESULT WINAPI EditStreamSetInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi,
memcpy(&asiw, asi, sizeof(asiw) - sizeof(asiw.szName));
MultiByteToWideChar(CP_ACP, 0, asi->szName, -1,
asiw.szName, sizeof(asiw.szName));
asiw.szName, sizeof(asiw.szName)/sizeof(WCHAR));
return EditStreamSetInfoW(pstream, &asiw, sizeof(asiw));
}
@@ -2320,7 +2315,7 @@ HRESULT WINAPI AVIPutFileOnClipboard(PAVIFILE pfile)
return AVIERR_UNSUPPORTED;
}
HRESULT CDECL AVISaveA(LPCSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback,
HRESULT WINAPIV AVISaveA(LPCSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback,
int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...)
{
FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_a(szFile), pclsidHandler, lpfnCallback,
@@ -2329,7 +2324,7 @@ HRESULT CDECL AVISaveA(LPCSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpf
return AVIERR_UNSUPPORTED;
}
HRESULT CDECL AVISaveW(LPCWSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback,
HRESULT WINAPIV AVISaveW(LPCWSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback,
int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...)
{
FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_w(szFile), pclsidHandler, lpfnCallback,
+10 -6
View File
@@ -3,18 +3,22 @@
<importlibrary definition="avifil32.spec.def" />
<include base="avifil32">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__REACTOS__" />
<define name="__WINESRC__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<library>wine</library>
<library>uuid</library>
<library>ntdll</library>
<library>msacm32</library>
<library>msvfw32</library>
<library>winmm</library>
<library>ole32</library>
<library>msvfw32</library>
<library>msacm32</library>
<library>kernel32</library>
<library>advapi32</library>
<library>user32</library>
<library>advapi32</library>
<library>kernel32</library>
<library>uuid</library>
<library>ntdll</library>
<file>acmstream.c</file>
<file>api.c</file>
<file>avifile.c</file>
@@ -1,13 +1,3 @@
Index: avifil32.rbuild
===================================================================
--- avifil32.rbuild (revision 23782)
+++ avifil32.rbuild (working copy)
@@ -1,4 +1,5 @@
<module name="avifil32" type="win32dll" baseaddress="${BASEADDRESS_AVIFIL32}" installbase="system32" installname="avifil32.dll" allowwarnings="true">
+ <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="avifil32.spec.def" />
<include base="avifil32">.</include>
<include base="ReactOS">include/reactos/wine</include>
Index: avifile_private.h
===================================================================
--- avifile_private.h (revision 23782)
+51 -63
View File
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* TODO:
@@ -40,9 +40,7 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "avifile_private.h"
@@ -241,7 +239,7 @@ HRESULT AVIFILE_CreateAVIFile(REFIID riid, LPVOID *ppv)
*ppv = NULL;
pfile = (IAVIFileImpl*)LocalAlloc(LPTR, sizeof(IAVIFileImpl));
pfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIFileImpl));
if (pfile == NULL)
return AVIERR_MEMORY;
@@ -252,7 +250,7 @@ HRESULT AVIFILE_CreateAVIFile(REFIID riid, LPVOID *ppv)
hr = IAVIFile_QueryInterface((IAVIFile*)pfile, riid, ppv);
if (FAILED(hr))
LocalFree((HLOCAL)pfile);
HeapFree(GetProcessHeap(), 0, pfile);
return hr;
}
@@ -311,33 +309,32 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
This->ppStreams[i]->ref, i, This->ppStreams[i]);
}
AVIFILE_DestructAVIStream(This->ppStreams[i]);
LocalFree((HLOCAL)This->ppStreams[i]);
HeapFree(GetProcessHeap(), 0, This->ppStreams[i]);
This->ppStreams[i] = NULL;
}
}
if (This->idxRecords != NULL) {
GlobalFreePtr(This->idxRecords);
HeapFree(GetProcessHeap(), 0, This->idxRecords);
This->idxRecords = NULL;
This->nIdxRecords = 0;
}
if (This->fileextra.lp != NULL) {
GlobalFreePtr(This->fileextra.lp);
HeapFree(GetProcessHeap(), 0, This->fileextra.lp);
This->fileextra.lp = NULL;
This->fileextra.cb = 0;
}
if (This->szFileName != NULL) {
LocalFree((HLOCAL)This->szFileName);
This->szFileName = NULL;
}
HeapFree(GetProcessHeap(), 0, This->szFileName);
This->szFileName = NULL;
if (This->hmmio != NULL) {
mmioClose(This->hmmio, 0);
This->hmmio = NULL;
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
@@ -423,7 +420,7 @@ static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis,
/* now it seems to be save to add the stream */
assert(This->ppStreams[n] == NULL);
This->ppStreams[n] = (IAVIStreamImpl*)LocalAlloc(LPTR,
This->ppStreams[n] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IAVIStreamImpl));
if (This->ppStreams[n] == NULL)
return AVIERR_MEMORY;
@@ -540,7 +537,7 @@ static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
if (nStream < This->fInfo.dwStreams &&
This->ppStreams[nStream] != NULL) {
/* ... so delete it now */
LocalFree((HLOCAL)This->ppStreams[nStream]);
HeapFree(GetProcessHeap(), 0, This->ppStreams[nStream]);
if (This->fInfo.dwStreams - nStream > 0)
memcpy(This->ppStreams + nStream, This->ppStreams + nStream + 1,
@@ -631,7 +628,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
This->paf->uMode = dwMode;
len = lstrlenW(pszFileName) + 1;
This->paf->szFileName = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
This->paf->szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (This->paf->szFileName == NULL)
return AVIERR_MEMORY;
lstrcpyW(This->paf->szFileName, pszFileName);
@@ -645,7 +642,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
len = WideCharToMultiByte(CP_ACP, 0, This->paf->szFileName, -1,
NULL, 0, NULL, NULL);
szFileName = LocalAlloc(LPTR, len * sizeof(CHAR));
szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR));
if (szFileName == NULL)
return AVIERR_MEMORY;
@@ -653,7 +650,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
len, NULL, NULL);
This->paf->hmmio = mmioOpenA(szFileName, NULL, MMIO_ALLOCBUF | dwMode);
LocalFree((HLOCAL)szFileName);
HeapFree(GetProcessHeap(), 0, szFileName);
if (This->paf->hmmio == NULL)
return AVIERR_FILEOPEN;
}
@@ -705,7 +702,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
if (This->paf->szFileName != NULL) {
int len = lstrlenW(This->paf->szFileName) + 1;
*ppszFileName = (LPOLESTR)GlobalAllocPtr(GHND, len * sizeof(WCHAR));
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
if (*ppszFileName == NULL)
return AVIERR_MEMORY;
@@ -957,7 +954,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
if (This->paf->dwMoviChunkPos != 0)
return AVIERR_ERROR; /* user has used API in wrong sequnece! */
This->lpFormat = GlobalAllocPtr(GMEM_MOVEABLE, formatsize);
This->lpFormat = HeapAlloc(GetProcessHeap(), 0, formatsize);
if (This->lpFormat == NULL)
return AVIERR_MEMORY;
This->cbFormat = formatsize;
@@ -1008,7 +1005,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* simply say all colors have changed */
ck.ckid = MAKEAVICKID(cktypePALchange, This->nStream);
ck.cksize = 2 * sizeof(WORD) + lpbiOld->biClrUsed * sizeof(PALETTEENTRY);
lppc = (AVIPALCHANGE*)GlobalAllocPtr(GMEM_MOVEABLE, ck.cksize);
lppc = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (lppc == NULL)
return AVIERR_MEMORY;
@@ -1032,7 +1029,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
return AVIERR_FILEWRITE;
This->paf->dwNextFramePos += ck.cksize + 2 * sizeof(DWORD);
GlobalFreePtr(lppc);
HeapFree(GetProcessHeap(), 0, lppc);
return AVIFILE_AddFrame(This, cktypePALchange, n, ck.dwDataOffset, 0);
}
@@ -1342,7 +1339,7 @@ static HRESULT WINAPI IAVIStream_fnWriteData(IAVIStream *iface, DWORD fcc,
return AVIERR_UNSUPPORTED;
}
This->lpHandlerData = GlobalAllocPtr(GMEM_MOVEABLE, size);
This->lpHandlerData = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpHandlerData == NULL)
return AVIERR_MEMORY;
This->cbHandlerData = size;
@@ -1391,11 +1388,11 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
This->nIdxFmtChanges += 16;
if (This->idxFmtChanges == NULL)
This->idxFmtChanges =
GlobalAllocPtr(GHND, This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
else
This->idxFmtChanges =
GlobalReAllocPtr(This->idxFmtChanges,
This->nIdxFmtChanges * sizeof(AVIINDEXENTRY), GHND);
HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxFmtChanges,
This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
if (This->idxFmtChanges == NULL)
return AVIERR_MEMORY;
@@ -1427,12 +1424,10 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
if (This->idxFrames == NULL || This->lLastFrame + 1 >= This->nIdxFrames) {
This->nIdxFrames += 512;
if (This->idxFrames == NULL)
This->idxFrames =
GlobalAllocPtr(GHND, This->nIdxFrames * sizeof(AVIINDEXENTRY));
This->idxFrames = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->nIdxFrames * sizeof(AVIINDEXENTRY));
else
This->idxFrames =
GlobalReAllocPtr(This->idxFrames,
This->nIdxFrames * sizeof(AVIINDEXENTRY), GHND);
This->idxFrames = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxFrames,
This->nIdxFrames * sizeof(AVIINDEXENTRY));
if (This->idxFrames == NULL)
return AVIERR_MEMORY;
}
@@ -1457,7 +1452,7 @@ static HRESULT AVIFILE_AddRecord(IAVIFileImpl *This)
if (This->idxRecords == NULL || This->cbIdxRecords == 0) {
This->cbIdxRecords += 1024 * sizeof(AVIINDEXENTRY);
This->idxRecords = GlobalAllocPtr(GHND, This->cbIdxRecords);
This->idxRecords = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->cbIdxRecords);
if (This->idxRecords == NULL)
return AVIERR_MEMORY;
}
@@ -1532,14 +1527,14 @@ static void AVIFILE_ConstructAVIStream(IAVIFileImpl *paf, DWORD nr, LPAVISTRE
if (asi->dwLength > 0) {
/* pre-allocate mem for frame-index structure */
pstream->idxFrames =
(AVIINDEXENTRY*)GlobalAllocPtr(GHND, asi->dwLength * sizeof(AVIINDEXENTRY));
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, asi->dwLength * sizeof(AVIINDEXENTRY));
if (pstream->idxFrames != NULL)
pstream->nIdxFrames = asi->dwLength;
}
if (asi->dwFormatChangeCount > 0) {
/* pre-allocate mem for formatchange-index structure */
pstream->idxFmtChanges =
(AVIINDEXENTRY*)GlobalAllocPtr(GHND, asi->dwFormatChangeCount * sizeof(AVIINDEXENTRY));
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, asi->dwFormatChangeCount * sizeof(AVIINDEXENTRY));
if (pstream->idxFmtChanges != NULL)
pstream->nIdxFmtChanges = asi->dwFormatChangeCount;
}
@@ -1565,31 +1560,29 @@ static void AVIFILE_DestructAVIStream(IAVIStreamImpl *This)
This->lLastFrame = -1;
This->paf = NULL;
if (This->idxFrames != NULL) {
GlobalFreePtr(This->idxFrames);
HeapFree(GetProcessHeap(), 0, This->idxFrames);
This->idxFrames = NULL;
This->nIdxFrames = 0;
}
if (This->idxFmtChanges != NULL) {
GlobalFreePtr(This->idxFmtChanges);
This->idxFmtChanges = NULL;
}
HeapFree(GetProcessHeap(), 0, This->idxFmtChanges);
This->idxFmtChanges = NULL;
if (This->lpBuffer != NULL) {
GlobalFreePtr(This->lpBuffer);
HeapFree(GetProcessHeap(), 0, This->lpBuffer);
This->lpBuffer = NULL;
This->cbBuffer = 0;
}
if (This->lpHandlerData != NULL) {
GlobalFreePtr(This->lpHandlerData);
HeapFree(GetProcessHeap(), 0, This->lpHandlerData);
This->lpHandlerData = NULL;
This->cbHandlerData = 0;
}
if (This->extra.lp != NULL) {
GlobalFreePtr(This->extra.lp);
HeapFree(GetProcessHeap(), 0, This->extra.lp);
This->extra.lp = NULL;
This->extra.cb = 0;
}
if (This->lpFormat != NULL) {
GlobalFreePtr(This->lpFormat);
HeapFree(GetProcessHeap(), 0, This->lpFormat);
This->lpFormat = NULL;
This->cbFormat = 0;
}
@@ -1679,7 +1672,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
if (ckLIST2.ckid == FOURCC_LIST &&
ckLIST2.fccType == listtypeSTREAMHEADER) {
pStream = This->ppStreams[nStream] =
(IAVIStreamImpl*)LocalAlloc(LPTR, sizeof(IAVIStreamImpl));
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIStreamImpl));
if (pStream == NULL)
return AVIERR_MEMORY;
AVIFILE_ConstructAVIStream(This, nStream, NULL);
@@ -1690,8 +1683,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
case ckidSTREAMHANDLERDATA:
if (pStream->lpHandlerData != NULL)
return AVIERR_BADFORMAT;
pStream->lpHandlerData = GlobalAllocPtr(GMEM_DDESHARE|GMEM_MOVEABLE,
ck.cksize);
pStream->lpHandlerData = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (pStream->lpHandlerData == NULL)
return AVIERR_MEMORY;
pStream->cbHandlerData = ck.cksize;
@@ -1705,8 +1697,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
if (ck.cksize == 0)
break;
pStream->lpFormat = GlobalAllocPtr(GMEM_DDESHARE|GMEM_MOVEABLE,
ck.cksize);
pStream->lpFormat = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (pStream->lpFormat == NULL)
return AVIERR_MEMORY;
pStream->cbFormat = ck.cksize;
@@ -1800,20 +1791,20 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
break;
case ckidSTREAMNAME:
{ /* streamname will be saved as ASCII string */
LPSTR str = (LPSTR)LocalAlloc(LMEM_FIXED, ck.cksize);
LPSTR str = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (str == NULL)
return AVIERR_MEMORY;
if (mmioRead(This->hmmio, (HPSTR)str, ck.cksize) != ck.cksize)
{
LocalFree((HLOCAL)str);
HeapFree(GetProcessHeap(), 0, str);
return AVIERR_FILEREAD;
}
MultiByteToWideChar(CP_ACP, 0, str, -1, pStream->sInfo.szName,
sizeof(pStream->sInfo.szName)/sizeof(pStream->sInfo.szName[0]));
LocalFree((HLOCAL)str);
HeapFree(GetProcessHeap(), 0, str);
}
break;
case ckidAVIPADDING:
@@ -1919,8 +1910,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
HRESULT hr = AVIERR_OK;
BOOL bAbsolute = TRUE;
lp = (AVIINDEXENTRY*)GlobalAllocPtr(GMEM_MOVEABLE,
IDX_PER_BLOCK * sizeof(AVIINDEXENTRY));
lp = HeapAlloc(GetProcessHeap(), 0, IDX_PER_BLOCK * sizeof(AVIINDEXENTRY));
if (lp == NULL)
return AVIERR_MEMORY;
@@ -1931,7 +1921,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
pStream->lLastFrame = -1;
if (pStream->idxFrames != NULL) {
GlobalFreePtr(pStream->idxFrames);
HeapFree(GetProcessHeap(), 0, pStream->idxFrames);
pStream->idxFrames = NULL;
pStream->nIdxFrames = 0;
}
@@ -1947,7 +1937,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
pStream->nIdxFrames = pStream->sInfo.dwLength;
pStream->idxFrames =
(AVIINDEXENTRY*)GlobalAllocPtr(GHND, pStream->nIdxFrames * sizeof(AVIINDEXENTRY));
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pStream->nIdxFrames * sizeof(AVIINDEXENTRY));
if (pStream->idxFrames == NULL && pStream->nIdxFrames > 0) {
pStream->nIdxFrames = 0;
return AVIERR_MEMORY;
@@ -1971,8 +1961,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset)
pos, &bAbsolute);
}
if (lp != NULL)
GlobalFreePtr(lp);
HeapFree(GetProcessHeap(), 0, lp);
/* checking ... */
for (n = 0; n < This->fInfo.dwStreams; n++) {
@@ -2041,10 +2030,9 @@ static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos,
DWORD maxSize = max(size, This->sInfo.dwSuggestedBufferSize);
if (This->lpBuffer == NULL)
This->lpBuffer = (LPDWORD)GlobalAllocPtr(GMEM_MOVEABLE, maxSize);
This->lpBuffer = HeapAlloc(GetProcessHeap(), 0, maxSize);
else
This->lpBuffer =
(LPDWORD)GlobalReAllocPtr(This->lpBuffer, maxSize, GMEM_MOVEABLE);
This->lpBuffer = HeapReAlloc(GetProcessHeap(), 0, This->lpBuffer, maxSize);
if (This->lpBuffer == NULL)
return AVIERR_MEMORY;
This->cbBuffer = max(size, This->sInfo.dwSuggestedBufferSize);
@@ -2255,18 +2243,18 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This)
return AVIERR_FILEWRITE;
/* the streamname must be saved in ASCII not Unicode */
str = (LPSTR)LocalAlloc(LPTR, ck.cksize);
str = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (str == NULL)
return AVIERR_MEMORY;
WideCharToMultiByte(CP_ACP, 0, pStream->sInfo.szName, -1, str,
ck.cksize, NULL, NULL);
if (mmioWrite(This->hmmio, (HPSTR)str, ck.cksize) != ck.cksize) {
LocalFree((HLOCAL)str);
HeapFree(GetProcessHeap(), 0, str);
return AVIERR_FILEWRITE;
}
LocalFree((HLOCAL)str);
HeapFree(GetProcessHeap(), 0, str);
if (mmioAscend(This->hmmio, &ck, 0) != S_OK)
return AVIERR_FILEWRITE;
}
+11 -8
View File
@@ -1,4 +1,5 @@
/*
/* Hey, Emacs, open this file with -*- coding: cp1250 -*-
*
* Copyright 2002 Michael Günnewig
*
* Czech resources for avifile
@@ -16,10 +17,12 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_CZECH, SUBLANG_NEUTRAL
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
/* Czech strings in CP1250 */
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
@@ -30,21 +33,21 @@ BEGIN
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "V&olby...",IDC_OPTIONS,145,17,45,14
AUTOCHECKBOX "Prolo¾&it ka¾dých",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
AUTOCHECKBOX "Prolož&it každých",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
LTEXT "rámcù",-1,104,43,36,9
LTEXT "Souèasný formát:",-1,3,56,53,9
LTEXT "Zbývající místo",IDC_FORMATTEXT,55,56,90,26
DEFPUSHBUTTON "Budi¾",IDOK,145,42,45,14
PUSHBUTTON "Zru¹it",IDCANCEL,145,61,45,14
DEFPUSHBUTTON "Budiž",IDOK,145,42,45,14
PUSHBUTTON "Zrušit",IDCANCEL,145,61,45,14
END
STRINGTABLE DISCARDABLE
{
IDS_WAVESTREAMFORMAT "Waveform: %s"
IDS_WAVEFILETYPE "Waveform"
IDS_ALLMULTIMEDIA "V¹echny soubory multimédií"
IDS_ALLFILES "V¹echny soubory (*.*)@*.*"
IDS_ALLMULTIMEDIA "Všechny soubory multimédií"
IDS_ALLFILES "Všechny soubory (*.*)@*.*"
IDS_VIDEO "video"
IDS_AUDIO "audio"
IDS_AVISTREAMFORMAT "%s %s #%d"
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+2 -2
View File
@@ -13,10 +13,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
+1 -1
View File
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+50
View File
@@ -0,0 +1,50 @@
/*
* Copyright 2006 Andras Kovacs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Tömörítési beállítások"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Válassuon folyamot:",-1,2,5,114,10
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "&Opciók...",IDC_OPTIONS,145,17,45,14
AUTOCHECKBOX "&Beékel minden",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
LTEXT "képkockát",-1,104,43,36,9
LTEXT "Jelenlegi formátum:",-1,3,56,53,9
LTEXT "Ez hely kölcsönzésre",IDC_FORMATTEXT,55,56,90,26
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
PUSHBUTTON "Mégse",IDCANCEL,145,61,45,14
END
STRINGTABLE DISCARDABLE
{
IDS_WAVESTREAMFORMAT "Hullámforma: %s"
IDS_WAVEFILETYPE "Hullámforma"
IDS_ALLMULTIMEDIA "Minden multimédia fájl"
IDS_ALLFILES "Minden fájl (*.*)@*.*"
IDS_VIDEO "video"
IDS_AUDIO "hang"
IDS_AVISTREAMFORMAT "%s %s #%d"
IDS_AVIFILETYPE "Wine AVI-alapértelmezett-fájlkezelõ"
IDS_UNCOMPRESSED "tömörítetlen"
}
+2 -2
View File
@@ -14,10 +14,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+1 -1
View File
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+2 -2
View File
@@ -15,10 +15,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
+2 -2
View File
@@ -14,10 +14,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_POLISH, SUBLANG_NEUTRAL
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+2 -2
View File
@@ -13,10 +13,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+2 -2
View File
@@ -15,10 +15,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_NEUTRAL
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+2 -2
View File
@@ -13,10 +13,10 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_SLOVENIAN, SUBLANG_NEUTRAL
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+50
View File
@@ -0,0 +1,50 @@
/*
* Copyright 2006 Fatih Aþýcý
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Sýkýþtýrma seçenekleri"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Bir akýþ se&çin:",-1,2,5,114,10
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "&Seçenekler...",IDC_OPTIONS,145,17,45,14
AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
LTEXT "frames",-1,104,43,36,9
LTEXT "Geçerli biçim:",-1,3,56,53,9
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
DEFPUSHBUTTON "Tamam",IDOK,145,42,45,14
PUSHBUTTON "Ýptal",IDCANCEL,145,61,45,14
END
STRINGTABLE DISCARDABLE
{
IDS_WAVESTREAMFORMAT "Waveform: %s"
IDS_WAVEFILETYPE "Waveform"
IDS_ALLMULTIMEDIA "Tüm çokluortam dosyalarý"
IDS_ALLFILES "Tüm dosyalar (*.*)@*.*"
IDS_VIDEO "vidyo"
IDS_AUDIO "ses"
IDS_AVISTREAMFORMAT "%s %s #%d"
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
IDS_UNCOMPRESSED "sýkýþtýrýlmamýþ"
}
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __AVIFILE_PRIVATE_H
+15 -19
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -22,13 +22,11 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wingdi.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "avifile_private.h"
@@ -189,7 +187,7 @@ PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream)
{
IAVIEditStreamImpl *pedit = NULL;
pedit = (IAVIEditStreamImpl*)LocalAlloc(LPTR,sizeof(IAVIEditStreamImpl));
pedit = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIEditStreamImpl));
if (pedit == NULL)
return NULL;
@@ -331,20 +329,19 @@ static BOOL AVIFILE_FormatsEqual(PAVISTREAM avi1, PAVISTREAM avi2)
return FALSE;
/* sizes match, now get formats and compare them */
fmt1 = GlobalAllocPtr(GHND, size1);
fmt1 = HeapAlloc(GetProcessHeap(), 0, size1);
if (fmt1 == NULL)
return FALSE;
if (SUCCEEDED(AVIStreamReadFormat(avi1, start1, fmt1, &size1))) {
fmt2 = GlobalAllocPtr(GHND, size1);
fmt2 = HeapAlloc(GetProcessHeap(), 0, size1);
if (fmt2 != NULL) {
if (SUCCEEDED(AVIStreamReadFormat(avi2, start2, fmt2, &size1)))
status = (memcmp(fmt1, fmt2, size1) == 0);
}
}
if (fmt2 != NULL)
GlobalFreePtr(fmt2);
GlobalFreePtr(fmt1);
HeapFree(GetProcessHeap(), 0, fmt2);
HeapFree(GetProcessHeap(), 0, fmt1);
return status;
}
@@ -405,10 +402,10 @@ static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface)
if (This->pStreams[i].pStream != NULL)
IAVIStream_Release(This->pStreams[i].pStream);
}
GlobalFreePtr(This->pStreams);
HeapFree(GetProcessHeap(), 0, This->pStreams);
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
return ref;
@@ -471,8 +468,8 @@ static HRESULT WINAPI IAVIEditStream_fnCut(IAVIEditStream*iface,LONG*plStart,
} else {
/* splitting */
if (This->nStreams + 1 >= This->nTableSize) {
This->pStreams =
GlobalReAllocPtr(This->pStreams, (This->nTableSize + 32) * sizeof(EditStreamTable), GMEM_SHARE|GHND);
This->pStreams = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->pStreams,
(This->nTableSize + 32) * sizeof(EditStreamTable));
if (This->pStreams == NULL)
return AVIERR_MEMORY;
This->nTableSize += 32;
@@ -663,8 +660,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart,
if (This->nStreams + nStreams + 1 > This->nTableSize) {
n = This->nStreams + nStreams + 33;
This->pStreams =
GlobalReAllocPtr(This->pStreams, n * sizeof(EditStreamTable), GMEM_SHARE|GHND);
This->pStreams = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->pStreams, n * sizeof(EditStreamTable));
if (This->pStreams == NULL)
return AVIERR_MEMORY;
This->nTableSize = n;
@@ -753,7 +749,8 @@ static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface,
if (pEdit == NULL)
return AVIERR_MEMORY;
if (This->nStreams > pEdit->nTableSize) {
pEdit->pStreams = GlobalReAllocPtr(pEdit->pStreams, This->nStreams * sizeof(EditStreamTable),GMEM_SHARE|GHND);
pEdit->pStreams = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pEdit->pStreams,
This->nStreams * sizeof(EditStreamTable));
if (pEdit->pStreams == NULL)
return AVIERR_MEMORY;
pEdit->nTableSize = This->nStreams;
@@ -841,8 +838,7 @@ static HRESULT WINAPI IEditAVIStream_fnCreate(IAVIStream*iface,
return AVIERR_ERROR;
if (This->pStreams == NULL) {
This->pStreams =
GlobalAllocPtr(GMEM_SHARE|GHND, 256 * sizeof(EditStreamTable));
This->pStreams = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 256 * sizeof(EditStreamTable));
if (This->pStreams == NULL)
return AVIERR_MEMORY;
This->nTableSize = 256;
+7 -9
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -23,8 +23,6 @@
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "windowsx.h"
#include "mmreg.h"
#include "vfw.h"
#include "wine/debug.h"
@@ -82,9 +80,9 @@ HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData,
assert(size > 0);
if (extra->lp)
lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + size + 2 * sizeof(DWORD), GHND);
lp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, extra->lp, extra->cb + size + 2 * sizeof(DWORD));
else
lp = (LPDWORD)GlobalAllocPtr(GHND, size + 2 * sizeof(DWORD));
lp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 2 * sizeof(DWORD));
if (lp == NULL)
return AVIERR_MEMORY;
@@ -117,10 +115,10 @@ HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck)
cb = lpck->cksize + 2 * sizeof(DWORD);
cb += (cb & 1);
if (extra->lp != NULL) {
lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + cb, GHND);
} else
lp = (LPDWORD)GlobalAllocPtr(GHND, cb);
if (extra->lp != NULL)
lp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, extra->lp, extra->cb + cb);
else
lp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
if (lp == NULL)
return AVIERR_MEMORY;
+1 -1
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_EXTRACHUNK_H
+5 -4
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
@@ -30,7 +30,6 @@
#include "winerror.h"
#include "ole2.h"
#include "mmreg.h"
#include "vfw.h"
#include "wine/debug.h"
@@ -76,7 +75,7 @@ static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid,
*ppv = NULL;
pClassFactory = (IClassFactoryImpl*)LocalAlloc(LPTR, sizeof(*pClassFactory));
pClassFactory = HeapAlloc(GetProcessHeap(), 0, sizeof(*pClassFactory));
if (pClassFactory == NULL)
return E_OUTOFMEMORY;
@@ -86,7 +85,7 @@ static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid,
hr = IClassFactory_QueryInterface((IClassFactory*)pClassFactory, riid, ppv);
if (FAILED(hr)) {
LocalFree((HLOCAL)pClassFactory);
HeapFree(GetProcessHeap(), 0, pClassFactory);
*ppv = NULL;
}
@@ -125,6 +124,8 @@ static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface)
if ((--(This->dwRef)) > 0)
return This->dwRef;
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
+11 -19
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -23,12 +23,9 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "windowsx.h"
#include "wingdi.h"
#include "winuser.h"
#include "vfw.h"
#include "mmreg.h"
#include "avifile_private.h"
@@ -100,14 +97,12 @@ typedef struct _IGetFrameImpl {
static void AVIFILE_CloseCompressor(IGetFrameImpl *This)
{
if (This->lpOutFormat != NULL && This->lpInFormat != This->lpOutFormat) {
GlobalFreePtr(This->lpOutFormat);
if (This->lpInFormat != This->lpOutFormat) {
HeapFree(GetProcessHeap(), 0, This->lpOutFormat);
This->lpOutFormat = NULL;
}
if (This->lpInFormat != NULL) {
GlobalFreePtr(This->lpInFormat);
This->lpInFormat = NULL;
}
HeapFree(GetProcessHeap(), 0, This->lpInFormat);
This->lpInFormat = NULL;
if (This->hic != NULL) {
if (This->bResize)
ICDecompressExEnd(This->hic);
@@ -126,7 +121,7 @@ PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pStream)
if (pStream == NULL)
return NULL;
pg = (IGetFrameImpl*)LocalAlloc(LPTR, sizeof(IGetFrameImpl));
pg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IGetFrameImpl));
if (pg != NULL) {
pg->lpVtbl = &igetframeVtbl;
pg->ref = 1;
@@ -178,7 +173,7 @@ static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface)
This->pStream = NULL;
}
LocalFree((HLOCAL)iface);
HeapFree(GetProcessHeap(), 0, iface);
return 0;
}
@@ -268,7 +263,7 @@ static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos)
if (This->cbInBuffer >= readBytes)
break;
This->cbInBuffer = This->cbInFormat + readBytes;
This->lpInFormat = GlobalReAllocPtr(This->lpInFormat, This->cbInBuffer, 0);
This->lpInFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpInFormat, This->cbInBuffer);
if (This->lpInFormat == NULL)
return NULL; /* out of memory */
This->lpInBuffer = (BYTE*)This->lpInFormat + This->cbInFormat;
@@ -369,8 +364,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
IAVIStream_ReadFormat(This->pStream, sInfo.dwStart,
NULL, &This->cbInFormat);
This->lpInFormat =
(LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, This->cbInFormat + This->cbInBuffer);
This->lpInFormat = HeapAlloc(GetProcessHeap(), 0, This->cbInFormat + This->cbInBuffer);
if (This->lpInFormat == NULL) {
AVIFILE_CloseCompressor(This);
return AVIERR_MEMORY;
@@ -410,8 +404,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
/* need memory for output format? */
if (This->lpOutFormat == NULL) {
This->lpOutFormat =
(LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, sizeof(BITMAPINFOHEADER)
+ 256 * sizeof(RGBQUAD));
HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
if (This->lpOutFormat == NULL) {
AVIFILE_CloseCompressor(This);
return AVIERR_MEMORY;
@@ -480,8 +473,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
register DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
This->lpOutFormat =
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpOutFormat, size, GMEM_MOVEABLE);
This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
if (This->lpOutFormat == NULL) {
AVIFILE_CloseCompressor(This);
return AVIERR_MEMORY;
+17 -22
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -26,10 +26,8 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "vfw.h"
#include "mmreg.h"
#include "msacm.h"
#include "avifile_private.h"
@@ -129,7 +127,7 @@ HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
*ppv = NULL;
pstream = (IAVIStreamImpl*)LocalAlloc(LPTR, sizeof(IAVIStreamImpl));
pstream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIStreamImpl));
if (pstream == NULL)
return AVIERR_MEMORY;
@@ -138,7 +136,7 @@ HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
hr = IAVIStream_QueryInterface((IAVIStream*)pstream, riid, ppv);
if (FAILED(hr))
LocalFree((HLOCAL)pstream);
HeapFree(GetProcessHeap(), 0, pstream);
return hr;
}
@@ -195,7 +193,7 @@ static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface)
if (This->hic != NULL) {
if (This->lpbiPrev != NULL) {
ICDecompressEnd(This->hic);
GlobalFreePtr(This->lpbiPrev);
HeapFree(GetProcessHeap(), 0, This->lpbiPrev);
This->lpbiPrev = NULL;
This->lpPrev = NULL;
}
@@ -203,22 +201,22 @@ static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface)
This->hic = NULL;
}
if (This->lpbiCur != NULL) {
GlobalFreePtr(This->lpbiCur);
HeapFree(GetProcessHeap(), 0, This->lpbiCur);
This->lpbiCur = NULL;
This->lpCur = NULL;
}
if (This->lpbiOutput != NULL) {
GlobalFreePtr(This->lpbiOutput);
HeapFree(GetProcessHeap(), 0, This->lpbiOutput);
This->lpbiOutput = NULL;
This->cbOutput = 0;
}
if (This->lpbiInput != NULL) {
GlobalFreePtr(This->lpbiInput);
HeapFree(GetProcessHeap(), 0, This->lpbiInput);
This->lpbiInput = NULL;
This->cbInput = 0;
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
@@ -480,7 +478,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
assert(This->hic != NULL);
/* get memory for input format */
This->lpbiInput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, formatsize);
This->lpbiInput = HeapAlloc(GetProcessHeap(), 0, formatsize);
if (This->lpbiInput == NULL)
return AVIERR_MEMORY;
This->cbInput = formatsize;
@@ -490,7 +488,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
size = ICCompressGetFormatSize(This->hic, This->lpbiInput);
if (size < sizeof(BITMAPINFOHEADER))
return AVIERR_COMPRESSOR;
This->lpbiOutput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
This->lpbiOutput = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpbiOutput == NULL)
return AVIERR_MEMORY;
This->cbOutput = size;
@@ -509,8 +507,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* allocate memory for compressed frame */
size = ICCompressGetSize(This->hic, This->lpbiInput, This->lpbiOutput);
This->lpbiCur =
(LPBITMAPINFOHEADER)GlobalAllocPtr(GMEM_MOVEABLE, This->cbOutput + size);
This->lpbiCur = HeapAlloc(GetProcessHeap(), 0, This->cbOutput + size);
if (This->lpbiCur == NULL)
return AVIERR_MEMORY;
memcpy(This->lpbiCur, This->lpbiOutput, This->cbOutput);
@@ -520,7 +517,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
if (This->lKeyFrameEvery != 1 &&
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) {
size = ICDecompressGetFormatSize(This->hic, This->lpbiOutput);
This->lpbiPrev = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
This->lpbiPrev = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpbiPrev == NULL)
return AVIERR_MEMORY;
if (ICDecompressGetFormat(This->hic, This->lpbiOutput, This->lpbiPrev) < S_OK)
@@ -533,8 +530,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* get memory for format and picture */
size += This->lpbiPrev->biSizeImage;
This->lpbiPrev =
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE);
This->lpbiPrev = HeapReAlloc(GetProcessHeap(), 0, This->lpbiPrev, size);
if (This->lpbiPrev == NULL)
return AVIERR_MEMORY;
This->lpPrev = DIBPTR(This->lpbiPrev);
@@ -917,7 +913,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
size = ICCompressGetFormatSize(This->hic, lpbi);
if ((LONG)size < (LONG)sizeof(BITMAPINFOHEADER))
return AVIERR_COMPRESSOR;
This->lpbiOutput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
This->lpbiOutput = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpbiOutput == NULL)
return AVIERR_MEMORY;
This->cbOutput = size;
@@ -939,7 +935,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
/* allocate memory for current frame */
size += This->sInfo.dwSuggestedBufferSize;
This->lpbiCur = (LPBITMAPINFOHEADER)GlobalAllocPtr(GMEM_MOVEABLE, size);
This->lpbiCur = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpbiCur == NULL)
return AVIERR_MEMORY;
memcpy(This->lpbiCur, This->lpbiOutput, This->cbOutput);
@@ -949,7 +945,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
if (This->lKeyFrameEvery != 1 &&
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) {
size = ICDecompressGetFormatSize(This->hic, This->lpbiOutput);
This->lpbiPrev = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
This->lpbiPrev = HeapAlloc(GetProcessHeap(), 0, size);
if (This->lpbiPrev == NULL)
return AVIERR_MEMORY;
if (ICDecompressGetFormat(This->hic, This->lpbiOutput, This->lpbiPrev) < S_OK)
@@ -962,8 +958,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
/* get memory for format and picture */
size += This->lpbiPrev->biSizeImage;
This->lpbiPrev =
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE);
This->lpbiPrev = HeapReAlloc(GetProcessHeap(), 0, This->lpbiPrev, size );
if (This->lpbiPrev == NULL)
return AVIERR_MEMORY;
This->lpPrev = DIBPTR(This->lpbiPrev);
+4 -5
View File
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -30,7 +30,6 @@
#include "winerror.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "avifile_private.h"
@@ -152,7 +151,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list)
}
if (list->base_iid) {
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
@@ -174,12 +173,12 @@ static HRESULT register_interfaces(struct regsvr_interface const *list)
}
if (list->ps_clsid) {
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
+3 -1
View File
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
@@ -43,6 +43,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "avifile_En.rc"
#include "avifile_Es.rc"
#include "avifile_Fr.rc"
#include "avifile_Hu.rc"
#include "avifile_It.rc"
#include "avifile_Ja.rc"
#include "avifile_Ko.rc"
@@ -52,3 +53,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "avifile_Pt.rc"
#include "avifile_Ru.rc"
#include "avifile_Si.rc"
#include "avifile_Tr.rc"
+5 -7
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -26,9 +26,7 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "avifile_private.h"
@@ -78,7 +76,7 @@ PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, PAVISTREAM *ppStreams) {
ITmpFileImpl *tmpFile;
int i;
tmpFile = LocalAlloc(LPTR, sizeof(ITmpFileImpl));
tmpFile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITmpFileImpl));
if (tmpFile == NULL)
return NULL;
@@ -87,9 +85,9 @@ PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, PAVISTREAM *ppStreams) {
memset(&tmpFile->fInfo, 0, sizeof(tmpFile->fInfo));
tmpFile->fInfo.dwStreams = nStreams;
tmpFile->ppStreams = LocalAlloc(LPTR, nStreams * sizeof(PAVISTREAM));
tmpFile->ppStreams = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(PAVISTREAM));
if (tmpFile->ppStreams == NULL) {
LocalFree((HLOCAL)tmpFile);
HeapFree(GetProcessHeap(), 0, tmpFile);
return NULL;
}
@@ -178,7 +176,7 @@ static ULONG WINAPI ITmpFile_fnRelease(IAVIFile *iface)
}
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
+16 -21
View File
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COM_NO_WINDOWS_H
@@ -26,9 +26,7 @@
#include "winuser.h"
#include "winnls.h"
#include "winerror.h"
#include "windowsx.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "vfw.h"
#include "msacm.h"
@@ -226,7 +224,7 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv)
*ppv = NULL;
pfile = (IAVIFileImpl*)LocalAlloc(LPTR, sizeof(IAVIFileImpl));
pfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIFileImpl));
if (pfile == NULL)
return AVIERR_MEMORY;
@@ -239,7 +237,7 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv)
hr = IAVIFile_QueryInterface((IAVIFile*)pfile, riid, ppv);
if (FAILED(hr))
LocalFree((HLOCAL)pfile);
HeapFree(GetProcessHeap(), 0, pfile);
return hr;
}
@@ -290,25 +288,23 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
}
if (This->lpFormat != NULL) {
GlobalFreePtr(This->lpFormat);
HeapFree(GetProcessHeap(), 0, This->lpFormat);
This->lpFormat = NULL;
This->cbFormat = 0;
}
if (This->extra.lp != NULL) {
GlobalFreePtr(This->extra.lp);
HeapFree(GetProcessHeap(), 0, This->extra.lp);
This->extra.lp = NULL;
This->extra.cb = 0;
}
if (This->szFileName != NULL) {
LocalFree((HLOCAL)This->szFileName);
This->szFileName = NULL;
}
HeapFree(GetProcessHeap(), 0, This->szFileName);
This->szFileName = NULL;
if (This->hmmio != NULL) {
mmioClose(This->hmmio, 0);
This->hmmio = NULL;
}
LocalFree((HLOCAL)This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
return ref;
@@ -486,7 +482,7 @@ static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
if ((This->uMode & MMIO_RWMODE) == 0)
return AVIERR_READONLY;
GlobalFreePtr(This->lpFormat);
HeapFree(GetProcessHeap(), 0, This->lpFormat);
This->lpFormat = NULL;
This->cbFormat = 0;
@@ -583,7 +579,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
This->uMode = dwMode;
len = lstrlenW(pszFileName) + 1;
This->szFileName = LocalAlloc(LPTR, len * sizeof(WCHAR));
This->szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (This->szFileName == NULL)
return AVIERR_MEMORY;
lstrcpyW(This->szFileName, pszFileName);
@@ -595,7 +591,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
LPSTR szFileName;
len = WideCharToMultiByte(CP_ACP, 0, This->szFileName, -1,
NULL, 0, NULL, NULL);
szFileName = LocalAlloc(LPTR, len * sizeof(CHAR));
szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR));
if (szFileName == NULL)
return AVIERR_MEMORY;
@@ -603,7 +599,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
len, NULL, NULL);
This->hmmio = mmioOpenA(szFileName, NULL, MMIO_ALLOCBUF | dwMode);
LocalFree((HLOCAL)szFileName);
HeapFree(GetProcessHeap(), 0, szFileName);
if (This->hmmio == NULL)
return AVIERR_FILEOPEN;
}
@@ -664,7 +660,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
if (This->paf->szFileName != NULL) {
int len = lstrlenW(This->paf->szFileName) + 1;
*ppszFileName = GlobalAllocPtr(GHND, len * sizeof(WCHAR));
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
if (*ppszFileName == NULL)
return AVIERR_MEMORY;
@@ -827,7 +823,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
return AVIERR_READONLY;
/* get memory for format and copy it */
This->lpFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, formatsize);
This->lpFormat = HeapAlloc(GetProcessHeap(), 0, formatsize);
if (This->lpFormat == NULL)
return AVIERR_MEMORY;
@@ -1080,7 +1076,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
return AVIERR_FILEREAD;
/* get memory for format and read it */
This->lpFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, ck.cksize);
This->lpFormat = HeapAlloc(GetProcessHeap(), 0, ck.cksize);
if (This->lpFormat == NULL)
return AVIERR_FILEREAD;
This->cbFormat = ck.cksize;
@@ -1169,8 +1165,7 @@ static HRESULT AVIFILE_LoadSunFile(IAVIFileImpl *This)
This->cbFormat = sizeof(WAVEFORMATEX); break;
};
This->lpFormat =
(LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, This->cbFormat);
This->lpFormat = HeapAlloc(GetProcessHeap(), 0, This->cbFormat);
if (This->lpFormat == NULL)
return AVIERR_MEMORY;