mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:22:58 +00:00
[AVIFIL32]
* Sync with Wine 1.5.26. svn path=/trunk/; revision=59125
This commit is contained in:
parent
c928e73b43
commit
637f9643ad
15 changed files with 295 additions and 245 deletions
|
@ -22,16 +22,5 @@ add_library(avifil32 SHARED
|
||||||
|
|
||||||
set_module_type(avifil32 win32dll)
|
set_module_type(avifil32 win32dll)
|
||||||
target_link_libraries(avifil32 uuid wine)
|
target_link_libraries(avifil32 uuid wine)
|
||||||
|
add_importlibs(avifil32 msacm32 msvfw32 winmm ole32 user32 advapi32 msvcrt kernel32 ntdll)
|
||||||
add_importlibs(avifil32
|
|
||||||
msvcrt
|
|
||||||
msacm32
|
|
||||||
msvfw32
|
|
||||||
winmm
|
|
||||||
ole32
|
|
||||||
user32
|
|
||||||
advapi32
|
|
||||||
kernel32
|
|
||||||
ntdll)
|
|
||||||
|
|
||||||
add_cd_file(TARGET avifil32 DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET avifil32 DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -228,7 +228,7 @@ static HRESULT WINAPI ACMStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
|
||||||
/* check for swapped parameters */
|
/* check for swapped parameters */
|
||||||
if ((LPVOID)lParam1 != NULL &&
|
if ((LPVOID)lParam1 != NULL &&
|
||||||
((LPAVICOMPRESSOPTIONS)lParam1)->fccType == streamtypeAUDIO) {
|
((LPAVICOMPRESSOPTIONS)lParam1)->fccType == streamtypeAUDIO) {
|
||||||
register LPARAM tmp = lParam1;
|
LPARAM tmp = lParam1;
|
||||||
|
|
||||||
lParam1 = lParam2;
|
lParam1 = lParam2;
|
||||||
lParam2 = tmp;
|
lParam2 = tmp;
|
||||||
|
|
|
@ -1248,7 +1248,7 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
|
||||||
pOptions->dwFlags |= AVICOMPRESSF_VALID;
|
pOptions->dwFlags |= AVICOMPRESSF_VALID;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, afmtc.pwfxEnum);
|
HeapFree(GetProcessHeap(), 0, afmtc.pwfxEnum);
|
||||||
return (ret == S_OK ? TRUE : FALSE);
|
return ret == S_OK;
|
||||||
} else {
|
} else {
|
||||||
ERR(": unknown streamtype 0x%08X\n", sInfo.fccType);
|
ERR(": unknown streamtype 0x%08X\n", sInfo.fccType);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
54
reactos/dll/win32/avifil32/avifil32.idl
Normal file
54
reactos/dll/win32/avifil32/avifil32.idl
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* COM Classes for avifil32
|
||||||
|
*
|
||||||
|
* Copyright 2010 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
[
|
||||||
|
helpstring("Microsoft AVI Files"),
|
||||||
|
threading(apartment),
|
||||||
|
uuid(00020000-0000-0000-C000-000000000046)
|
||||||
|
]
|
||||||
|
coclass AVIFile { interface IAVIFile; }
|
||||||
|
|
||||||
|
[
|
||||||
|
helpstring("AVI Compressed Stream"),
|
||||||
|
threading(apartment),
|
||||||
|
uuid(00020001-0000-0000-c000-000000000046)
|
||||||
|
]
|
||||||
|
coclass ICMStream { interface IAVIStream; }
|
||||||
|
|
||||||
|
[
|
||||||
|
helpstring("Microsoft Wave File"),
|
||||||
|
threading(apartment),
|
||||||
|
uuid(00020003-0000-0000-c000-000000000046)
|
||||||
|
]
|
||||||
|
coclass WAVFile { interface IAVIFile; }
|
||||||
|
|
||||||
|
[
|
||||||
|
helpstring("IAVIStream & IAVIFile Proxy"),
|
||||||
|
threading(apartment),
|
||||||
|
uuid(0002000d-0000-0000-c000-000000000046)
|
||||||
|
]
|
||||||
|
coclass AVIProxy { }
|
||||||
|
|
||||||
|
[
|
||||||
|
helpstring("ACM Compressed Audio Stream"),
|
||||||
|
threading(apartment),
|
||||||
|
uuid(0002000f-0000-0000-c000-000000000046)
|
||||||
|
]
|
||||||
|
coclass ACMStream { interface IAVIStream; }
|
29
reactos/dll/win32/avifil32/avifil32_idl.rgs
Normal file
29
reactos/dll/win32/avifil32/avifil32_idl.rgs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
HKCR
|
||||||
|
{
|
||||||
|
NoRemove Interface
|
||||||
|
{
|
||||||
|
}
|
||||||
|
NoRemove CLSID
|
||||||
|
{
|
||||||
|
'{00020000-0000-0000-C000-000000000046}' = s 'Microsoft AVI Files'
|
||||||
|
{
|
||||||
|
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||||
|
}
|
||||||
|
'{00020001-0000-0000-C000-000000000046}' = s 'AVI Compressed Stream'
|
||||||
|
{
|
||||||
|
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||||
|
}
|
||||||
|
'{00020003-0000-0000-C000-000000000046}' = s 'Microsoft Wave File'
|
||||||
|
{
|
||||||
|
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||||
|
}
|
||||||
|
'{0002000D-0000-0000-C000-000000000046}' = s 'IAVIStream & IAVIFile Proxy'
|
||||||
|
{
|
||||||
|
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||||
|
}
|
||||||
|
'{0002000F-0000-0000-C000-000000000046}' = s 'ACM Compressed Audio Stream'
|
||||||
|
{
|
||||||
|
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,6 +34,7 @@
|
||||||
#define _INC_WINDOWS
|
#define _INC_WINDOWS
|
||||||
#define COM_NO_WINDOWS_H
|
#define COM_NO_WINDOWS_H
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
@ -58,54 +59,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||||
#define IDX_PER_BLOCK 2730
|
#define IDX_PER_BLOCK 2730
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj);
|
|
||||||
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface);
|
|
||||||
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile*iface);
|
|
||||||
static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam);
|
|
||||||
|
|
||||||
static const struct IAVIFileVtbl iavift = {
|
|
||||||
IAVIFile_fnQueryInterface,
|
|
||||||
IAVIFile_fnAddRef,
|
|
||||||
IAVIFile_fnRelease,
|
|
||||||
IAVIFile_fnInfo,
|
|
||||||
IAVIFile_fnGetStream,
|
|
||||||
IAVIFile_fnCreateStream,
|
|
||||||
IAVIFile_fnWriteData,
|
|
||||||
IAVIFile_fnReadData,
|
|
||||||
IAVIFile_fnEndRecord,
|
|
||||||
IAVIFile_fnDeleteStream
|
|
||||||
};
|
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnQueryInterface(IPersistFile*iface,REFIID refiid,LPVOID*obj);
|
|
||||||
static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile*iface);
|
|
||||||
static ULONG WINAPI IPersistFile_fnRelease(IPersistFile*iface);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile*iface,CLSID*pClassID);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile*iface);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile*iface,LPCOLESTR pszFileName,DWORD dwMode);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile*iface,LPCOLESTR pszFileName,BOOL fRemember);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile*iface,LPCOLESTR pszFileName);
|
|
||||||
static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile*iface,LPOLESTR*ppszFileName);
|
|
||||||
|
|
||||||
static const struct IPersistFileVtbl ipersistft = {
|
|
||||||
IPersistFile_fnQueryInterface,
|
|
||||||
IPersistFile_fnAddRef,
|
|
||||||
IPersistFile_fnRelease,
|
|
||||||
IPersistFile_fnGetClassID,
|
|
||||||
IPersistFile_fnIsDirty,
|
|
||||||
IPersistFile_fnLoad,
|
|
||||||
IPersistFile_fnSave,
|
|
||||||
IPersistFile_fnSaveCompleted,
|
|
||||||
IPersistFile_fnGetCurFile
|
|
||||||
};
|
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
|
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
|
||||||
static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface);
|
static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface);
|
||||||
static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface);
|
static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface);
|
||||||
|
@ -140,14 +93,6 @@ static const struct IAVIStreamVtbl iavist = {
|
||||||
|
|
||||||
typedef struct _IAVIFileImpl IAVIFileImpl;
|
typedef struct _IAVIFileImpl IAVIFileImpl;
|
||||||
|
|
||||||
typedef struct _IPersistFileImpl {
|
|
||||||
/* IUnknown stuff */
|
|
||||||
const IPersistFileVtbl *lpVtbl;
|
|
||||||
|
|
||||||
/* IPersistFile stuff */
|
|
||||||
IAVIFileImpl *paf;
|
|
||||||
} IPersistFileImpl;
|
|
||||||
|
|
||||||
typedef struct _IAVIStreamImpl {
|
typedef struct _IAVIStreamImpl {
|
||||||
/* IUnknown stuff */
|
/* IUnknown stuff */
|
||||||
const IAVIStreamVtbl *lpVtbl;
|
const IAVIStreamVtbl *lpVtbl;
|
||||||
|
@ -178,12 +123,11 @@ typedef struct _IAVIStreamImpl {
|
||||||
} IAVIStreamImpl;
|
} IAVIStreamImpl;
|
||||||
|
|
||||||
struct _IAVIFileImpl {
|
struct _IAVIFileImpl {
|
||||||
/* IUnknown stuff */
|
IUnknown IUnknown_inner;
|
||||||
const IAVIFileVtbl *lpVtbl;
|
IAVIFile IAVIFile_iface;
|
||||||
LONG ref;
|
IPersistFile IPersistFile_iface;
|
||||||
|
IUnknown *outer_unk;
|
||||||
/* IAVIFile stuff... */
|
LONG ref;
|
||||||
IPersistFileImpl iPersistFile;
|
|
||||||
|
|
||||||
AVIFILEINFOW fInfo;
|
AVIFILEINFOW fInfo;
|
||||||
IAVIStreamImpl *ppStreams[MAX_AVISTREAMS];
|
IAVIStreamImpl *ppStreams[MAX_AVISTREAMS];
|
||||||
|
@ -207,6 +151,21 @@ struct _IAVIFileImpl {
|
||||||
BOOL fDirty;
|
BOOL fDirty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline IAVIFileImpl *impl_from_IUnknown(IUnknown *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IAVIFileImpl, IUnknown_inner);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IAVIFileImpl *impl_from_IAVIFile(IAVIFile *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IAVIFileImpl, IAVIFile_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IAVIFileImpl *impl_from_IPersistFile(IPersistFile *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IAVIFileImpl, IPersistFile_iface);
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size,
|
static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size,
|
||||||
|
@ -233,87 +192,64 @@ static HRESULT AVIFILE_WriteBlock(IAVIStreamImpl *This, DWORD block,
|
||||||
FOURCC ckid, DWORD flags, LPCVOID buffer,
|
FOURCC ckid, DWORD flags, LPCVOID buffer,
|
||||||
LONG size);
|
LONG size);
|
||||||
|
|
||||||
HRESULT AVIFILE_CreateAVIFile(REFIID riid, LPVOID *ppv)
|
static HRESULT WINAPI IUnknown_fnQueryInterface(IUnknown *iface, REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *pfile;
|
IAVIFileImpl *This = impl_from_IUnknown(iface);
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
assert(riid != NULL && ppv != NULL);
|
TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv);
|
||||||
|
|
||||||
|
if (!ppv) {
|
||||||
|
WARN("invalid parameter\n");
|
||||||
|
return E_INVALIDARG;
|
||||||
|
}
|
||||||
*ppv = NULL;
|
*ppv = NULL;
|
||||||
|
|
||||||
pfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIFileImpl));
|
if (IsEqualIID(riid, &IID_IUnknown))
|
||||||
if (pfile == NULL)
|
*ppv = &This->IUnknown_inner;
|
||||||
return AVIERR_MEMORY;
|
else if (IsEqualIID(riid, &IID_IAVIFile))
|
||||||
|
*ppv = &This->IAVIFile_iface;
|
||||||
pfile->lpVtbl = &iavift;
|
else if (IsEqualGUID(riid, &IID_IPersistFile))
|
||||||
pfile->ref = 0;
|
*ppv = &This->IPersistFile_iface;
|
||||||
pfile->iPersistFile.lpVtbl = &ipersistft;
|
else {
|
||||||
pfile->iPersistFile.paf = pfile;
|
WARN("unknown IID %s\n", debugstr_guid(riid));
|
||||||
|
return E_NOINTERFACE;
|
||||||
hr = IAVIFile_QueryInterface((IAVIFile*)pfile, riid, ppv);
|
|
||||||
if (FAILED(hr))
|
|
||||||
HeapFree(GetProcessHeap(), 0, pfile);
|
|
||||||
|
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid,
|
|
||||||
LPVOID *obj)
|
|
||||||
{
|
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
|
||||||
|
|
||||||
TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj);
|
|
||||||
|
|
||||||
if (IsEqualGUID(&IID_IUnknown, refiid) ||
|
|
||||||
IsEqualGUID(&IID_IAVIFile, refiid)) {
|
|
||||||
*obj = iface;
|
|
||||||
IAVIFile_AddRef(iface);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
} else if (IsEqualGUID(&IID_IPersistFile, refiid)) {
|
|
||||||
*obj = &This->iPersistFile;
|
|
||||||
IAVIFile_AddRef(iface);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return OLE_E_ENUM_NOMORE;
|
/* Violation of the COM aggregation ref counting rule */
|
||||||
|
IUnknown_AddRef(&This->IUnknown_inner);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface)
|
static ULONG WINAPI IUnknown_fnAddRef(IUnknown *iface)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IUnknown(iface);
|
||||||
ULONG ref = InterlockedIncrement(&This->ref);
|
ULONG ref = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) -> %d\n", iface, ref);
|
TRACE("(%p) ref=%d\n", This, ref);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
|
static ULONG WINAPI IUnknown_fnRelease(IUnknown *iface)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IUnknown(iface);
|
||||||
UINT i;
|
|
||||||
ULONG ref = InterlockedDecrement(&This->ref);
|
ULONG ref = InterlockedDecrement(&This->ref);
|
||||||
|
UINT i;
|
||||||
|
|
||||||
TRACE("(%p) -> %d\n", iface, ref);
|
TRACE("(%p) ref=%d\n", This, ref);
|
||||||
|
|
||||||
if (!ref) {
|
if (!ref) {
|
||||||
if (This->fDirty) {
|
if (This->fDirty)
|
||||||
/* need to write headers to file */
|
|
||||||
AVIFILE_SaveFile(This);
|
AVIFILE_SaveFile(This);
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < This->fInfo.dwStreams; i++) {
|
for (i = 0; i < This->fInfo.dwStreams; i++) {
|
||||||
if (This->ppStreams[i] != NULL) {
|
if (This->ppStreams[i] != NULL) {
|
||||||
if (This->ppStreams[i]->ref != 0) {
|
if (This->ppStreams[i]->ref != 0)
|
||||||
ERR(": someone has still %u reference to stream %u (%p)!\n",
|
ERR(": someone has still %u reference to stream %u (%p)!\n",
|
||||||
This->ppStreams[i]->ref, i, This->ppStreams[i]);
|
This->ppStreams[i]->ref, i, This->ppStreams[i]);
|
||||||
}
|
AVIFILE_DestructAVIStream(This->ppStreams[i]);
|
||||||
AVIFILE_DestructAVIStream(This->ppStreams[i]);
|
HeapFree(GetProcessHeap(), 0, This->ppStreams[i]);
|
||||||
HeapFree(GetProcessHeap(), 0, This->ppStreams[i]);
|
This->ppStreams[i] = NULL;
|
||||||
This->ppStreams[i] = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,10 +278,37 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, LPAVIFILEINFOW afi,
|
static const IUnknownVtbl unk_vtbl =
|
||||||
LONG size)
|
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IUnknown_fnQueryInterface,
|
||||||
|
IUnknown_fnAddRef,
|
||||||
|
IUnknown_fnRelease
|
||||||
|
};
|
||||||
|
|
||||||
|
static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID riid, void **ppv)
|
||||||
|
{
|
||||||
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
|
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface)
|
||||||
|
{
|
||||||
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
|
return IUnknown_AddRef(This->outer_unk);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
|
||||||
|
{
|
||||||
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
|
return IUnknown_Release(This->outer_unk);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, AVIFILEINFOW *afi, LONG size)
|
||||||
|
{
|
||||||
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p,%d)\n",iface,afi,size);
|
TRACE("(%p,%p,%d)\n",iface,afi,size);
|
||||||
|
|
||||||
|
@ -363,11 +326,10 @@ static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, LPAVIFILEINFOW afi,
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, PAVISTREAM *avis,
|
static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, DWORD fccType,
|
||||||
DWORD fccType, LONG lParam)
|
LONG lParam)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
ULONG nStream;
|
ULONG nStream;
|
||||||
|
|
||||||
TRACE("(%p,%p,0x%08X,%d)\n", iface, avis, fccType, lParam);
|
TRACE("(%p,%p,0x%08X,%d)\n", iface, avis, fccType, lParam);
|
||||||
|
@ -390,11 +352,10 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, PAVISTREAM *avis,
|
||||||
return AVIERR_NODATA;
|
return AVIERR_NODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis,
|
static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface, IAVIStream **avis,
|
||||||
LPAVISTREAMINFOW asi)
|
AVISTREAMINFOW *asi)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
DWORD n;
|
DWORD n;
|
||||||
|
|
||||||
TRACE("(%p,%p,%p)\n", iface, avis, asi);
|
TRACE("(%p,%p,%p)\n", iface, avis, asi);
|
||||||
|
@ -444,10 +405,9 @@ static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis,
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid,
|
static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid, void *lpData, LONG size)
|
||||||
LPVOID lpData, LONG size)
|
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
TRACE("(%p,0x%08X,%p,%d)\n", iface, ckid, lpData, size);
|
TRACE("(%p,0x%08X,%p,%d)\n", iface, ckid, lpData, size);
|
||||||
|
|
||||||
|
@ -466,10 +426,9 @@ static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid,
|
||||||
return WriteExtraChunk(&This->fileextra, ckid, lpData, size);
|
return WriteExtraChunk(&This->fileextra, ckid, lpData, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile *iface, DWORD ckid,
|
static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile *iface, DWORD ckid, void *lpData, LONG *size)
|
||||||
LPVOID lpData, LONG *size)
|
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
TRACE("(%p,0x%08X,%p,%p)\n", iface, ckid, lpData, size);
|
TRACE("(%p,0x%08X,%p,%p)\n", iface, ckid, lpData, size);
|
||||||
|
|
||||||
|
@ -478,7 +437,7 @@ static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile *iface, DWORD ckid,
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile *iface)
|
static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile *iface)
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n",iface);
|
TRACE("(%p)\n",iface);
|
||||||
|
|
||||||
|
@ -517,11 +476,9 @@ static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile *iface)
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
|
static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType, LONG lParam)
|
||||||
LONG lParam)
|
|
||||||
{
|
{
|
||||||
IAVIFileImpl *This = (IAVIFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IAVIFile(iface);
|
||||||
|
|
||||||
ULONG nStream;
|
ULONG nStream;
|
||||||
|
|
||||||
TRACE("(%p,0x%08X,%d)\n", iface, fccType, lParam);
|
TRACE("(%p,0x%08X,%d)\n", iface, fccType, lParam);
|
||||||
|
@ -556,38 +513,42 @@ static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
|
||||||
return AVIERR_NODATA;
|
return AVIERR_NODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************/
|
static const struct IAVIFileVtbl avif_vt = {
|
||||||
|
IAVIFile_fnQueryInterface,
|
||||||
|
IAVIFile_fnAddRef,
|
||||||
|
IAVIFile_fnRelease,
|
||||||
|
IAVIFile_fnInfo,
|
||||||
|
IAVIFile_fnGetStream,
|
||||||
|
IAVIFile_fnCreateStream,
|
||||||
|
IAVIFile_fnWriteData,
|
||||||
|
IAVIFile_fnReadData,
|
||||||
|
IAVIFile_fnEndRecord,
|
||||||
|
IAVIFile_fnDeleteStream
|
||||||
|
};
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnQueryInterface(IPersistFile *iface,
|
|
||||||
REFIID refiid, LPVOID *obj)
|
static HRESULT WINAPI IPersistFile_fnQueryInterface(IPersistFile *iface, REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
|
||||||
|
|
||||||
return IAVIFile_QueryInterface((PAVIFILE)This->paf, refiid, obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile *iface)
|
static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile *iface)
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
return IUnknown_AddRef(This->outer_unk);
|
||||||
|
|
||||||
return IAVIFile_AddRef((PAVIFILE)This->paf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI IPersistFile_fnRelease(IPersistFile *iface)
|
static ULONG WINAPI IPersistFile_fnRelease(IPersistFile *iface)
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
return IUnknown_Release(This->outer_unk);
|
||||||
|
|
||||||
return IAVIFile_Release((PAVIFILE)This->paf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile *iface,
|
static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile *iface, LPCLSID pClassID)
|
||||||
LPCLSID pClassID)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p,%p)\n", iface, pClassID);
|
TRACE("(%p,%p)\n", iface, pClassID);
|
||||||
|
|
||||||
|
@ -601,20 +562,16 @@ static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile *iface,
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile *iface)
|
static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile *iface)
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", iface);
|
TRACE("(%p)\n", iface);
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
return (This->fDirty ? S_OK : S_FALSE);
|
||||||
|
|
||||||
return (This->paf->fDirty ? S_OK : S_FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
|
static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
|
||||||
LPCOLESTR pszFileName, DWORD dwMode)
|
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
TRACE("(%p,%s,0x%08X)\n", iface, debugstr_w(pszFileName), dwMode);
|
TRACE("(%p,%s,0x%08X)\n", iface, debugstr_w(pszFileName), dwMode);
|
||||||
|
@ -623,53 +580,49 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
|
||||||
if (pszFileName == NULL)
|
if (pszFileName == NULL)
|
||||||
return AVIERR_BADPARAM;
|
return AVIERR_BADPARAM;
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
if (This->hmmio != NULL)
|
||||||
if (This->paf->hmmio != NULL)
|
|
||||||
return AVIERR_ERROR; /* No reuse of this object for another file! */
|
return AVIERR_ERROR; /* No reuse of this object for another file! */
|
||||||
|
|
||||||
/* remember mode and name */
|
/* remember mode and name */
|
||||||
This->paf->uMode = dwMode;
|
This->uMode = dwMode;
|
||||||
|
|
||||||
len = lstrlenW(pszFileName) + 1;
|
len = lstrlenW(pszFileName) + 1;
|
||||||
This->paf->szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
This->szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||||
if (This->paf->szFileName == NULL)
|
if (This->szFileName == NULL)
|
||||||
return AVIERR_MEMORY;
|
return AVIERR_MEMORY;
|
||||||
lstrcpyW(This->paf->szFileName, pszFileName);
|
lstrcpyW(This->szFileName, pszFileName);
|
||||||
|
|
||||||
/* try to open the file */
|
/* try to open the file */
|
||||||
This->paf->hmmio = mmioOpenW(This->paf->szFileName, NULL,
|
This->hmmio = mmioOpenW(This->szFileName, NULL, MMIO_ALLOCBUF | dwMode);
|
||||||
MMIO_ALLOCBUF | dwMode);
|
if (This->hmmio == NULL) {
|
||||||
if (This->paf->hmmio == NULL) {
|
|
||||||
/* mmioOpenW not in native DLLs of Win9x -- try mmioOpenA */
|
/* mmioOpenW not in native DLLs of Win9x -- try mmioOpenA */
|
||||||
LPSTR szFileName;
|
LPSTR szFileName;
|
||||||
|
|
||||||
len = WideCharToMultiByte(CP_ACP, 0, This->paf->szFileName, -1,
|
len = WideCharToMultiByte(CP_ACP, 0, This->szFileName, -1, NULL, 0, NULL, NULL);
|
||||||
NULL, 0, NULL, NULL);
|
|
||||||
szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR));
|
szFileName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR));
|
||||||
if (szFileName == NULL)
|
if (szFileName == NULL)
|
||||||
return AVIERR_MEMORY;
|
return AVIERR_MEMORY;
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, This->paf->szFileName, -1, szFileName,
|
WideCharToMultiByte(CP_ACP, 0, This->szFileName, -1, szFileName, len, NULL, NULL);
|
||||||
len, NULL, NULL);
|
|
||||||
|
|
||||||
This->paf->hmmio = mmioOpenA(szFileName, NULL, MMIO_ALLOCBUF | dwMode);
|
This->hmmio = mmioOpenA(szFileName, NULL, MMIO_ALLOCBUF | dwMode);
|
||||||
HeapFree(GetProcessHeap(), 0, szFileName);
|
HeapFree(GetProcessHeap(), 0, szFileName);
|
||||||
if (This->paf->hmmio == NULL)
|
if (This->hmmio == NULL)
|
||||||
return AVIERR_FILEOPEN;
|
return AVIERR_FILEOPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* should we create a new file? */
|
/* should we create a new file? */
|
||||||
if (dwMode & OF_CREATE) {
|
if (dwMode & OF_CREATE) {
|
||||||
memset(& This->paf->fInfo, 0, sizeof(This->paf->fInfo));
|
memset(& This->fInfo, 0, sizeof(This->fInfo));
|
||||||
This->paf->fInfo.dwFlags = AVIFILEINFO_HASINDEX | AVIFILEINFO_TRUSTCKTYPE;
|
This->fInfo.dwFlags = AVIFILEINFO_HASINDEX | AVIFILEINFO_TRUSTCKTYPE;
|
||||||
|
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
} else
|
} else
|
||||||
return AVIFILE_LoadFile(This->paf);
|
return AVIFILE_LoadFile(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile *iface,
|
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile *iface, LPCOLESTR pszFileName,
|
||||||
LPCOLESTR pszFileName,BOOL fRemember)
|
BOOL fRemember)
|
||||||
{
|
{
|
||||||
TRACE("(%p,%s,%d)\n", iface, debugstr_w(pszFileName), fRemember);
|
TRACE("(%p,%s,%d)\n", iface, debugstr_w(pszFileName), fRemember);
|
||||||
|
|
||||||
|
@ -678,8 +631,7 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile *iface,
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile *iface,
|
static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
|
||||||
LPCOLESTR pszFileName)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p,%s)\n", iface, debugstr_w(pszFileName));
|
TRACE("(%p,%s)\n", iface, debugstr_w(pszFileName));
|
||||||
|
|
||||||
|
@ -688,10 +640,9 @@ static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile *iface,
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
|
static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface, LPOLESTR *ppszFileName)
|
||||||
LPOLESTR *ppszFileName)
|
|
||||||
{
|
{
|
||||||
IPersistFileImpl *This = (IPersistFileImpl *)iface;
|
IAVIFileImpl *This = impl_from_IPersistFile(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p)\n", iface, ppszFileName);
|
TRACE("(%p,%p)\n", iface, ppszFileName);
|
||||||
|
|
||||||
|
@ -700,22 +651,56 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
|
||||||
|
|
||||||
*ppszFileName = NULL;
|
*ppszFileName = NULL;
|
||||||
|
|
||||||
assert(This->paf != NULL);
|
if (This->szFileName != NULL) {
|
||||||
|
int len = lstrlenW(This->szFileName) + 1;
|
||||||
if (This->paf->szFileName != NULL) {
|
|
||||||
int len = lstrlenW(This->paf->szFileName) + 1;
|
|
||||||
|
|
||||||
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
|
*ppszFileName = CoTaskMemAlloc(len * sizeof(WCHAR));
|
||||||
if (*ppszFileName == NULL)
|
if (*ppszFileName == NULL)
|
||||||
return AVIERR_MEMORY;
|
return AVIERR_MEMORY;
|
||||||
|
|
||||||
strcpyW(*ppszFileName, This->paf->szFileName);
|
strcpyW(*ppszFileName, This->szFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************/
|
static const struct IPersistFileVtbl pf_vt = {
|
||||||
|
IPersistFile_fnQueryInterface,
|
||||||
|
IPersistFile_fnAddRef,
|
||||||
|
IPersistFile_fnRelease,
|
||||||
|
IPersistFile_fnGetClassID,
|
||||||
|
IPersistFile_fnIsDirty,
|
||||||
|
IPersistFile_fnLoad,
|
||||||
|
IPersistFile_fnSave,
|
||||||
|
IPersistFile_fnSaveCompleted,
|
||||||
|
IPersistFile_fnGetCurFile
|
||||||
|
};
|
||||||
|
|
||||||
|
HRESULT AVIFILE_CreateAVIFile(IUnknown *pUnkOuter, REFIID riid, void **ppv)
|
||||||
|
{
|
||||||
|
IAVIFileImpl *obj;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
*ppv = NULL;
|
||||||
|
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIFileImpl));
|
||||||
|
if (!obj)
|
||||||
|
return AVIERR_MEMORY;
|
||||||
|
|
||||||
|
obj->IUnknown_inner.lpVtbl = &unk_vtbl;
|
||||||
|
obj->IAVIFile_iface.lpVtbl = &avif_vt;
|
||||||
|
obj->IPersistFile_iface.lpVtbl = &pf_vt;
|
||||||
|
obj->ref = 1;
|
||||||
|
if (pUnkOuter)
|
||||||
|
obj->outer_unk = pUnkOuter;
|
||||||
|
else
|
||||||
|
obj->outer_unk = &obj->IUnknown_inner;
|
||||||
|
|
||||||
|
hr = IUnknown_QueryInterface(&obj->IUnknown_inner, riid, ppv);
|
||||||
|
IUnknown_Release(&obj->IUnknown_inner);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream *iface,
|
static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream *iface,
|
||||||
REFIID refiid, LPVOID *obj)
|
REFIID refiid, LPVOID *obj)
|
||||||
|
@ -745,7 +730,7 @@ static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream *iface)
|
||||||
|
|
||||||
/* also add ref to parent, so that it doesn't kill us */
|
/* also add ref to parent, so that it doesn't kill us */
|
||||||
if (This->paf != NULL)
|
if (This->paf != NULL)
|
||||||
IAVIFile_AddRef((PAVIFILE)This->paf);
|
IAVIFile_AddRef(&This->paf->IAVIFile_iface);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -758,7 +743,7 @@ static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface)
|
||||||
TRACE("(%p) -> %d\n", iface, ref);
|
TRACE("(%p) -> %d\n", iface, ref);
|
||||||
|
|
||||||
if (This->paf != NULL)
|
if (This->paf != NULL)
|
||||||
IAVIFile_Release((PAVIFILE)This->paf);
|
IAVIFile_Release(&This->paf->IAVIFile_iface);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,26 +2,11 @@ HKCR
|
||||||
{
|
{
|
||||||
NoRemove CLSID
|
NoRemove CLSID
|
||||||
{
|
{
|
||||||
'{00020000-0000-0000-C000-000000000046}' = s 'Microsoft AVI Files'
|
'{00020000-0000-0000-C000-000000000046}' { InprocServer = s 'avifile.dll' }
|
||||||
{
|
'{00020001-0000-0000-C000-000000000046}' { InprocServer = s 'avifile.dll' }
|
||||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
'{00020003-0000-0000-C000-000000000046}' { InprocServer = s 'avifile.dll' }
|
||||||
}
|
'{0002000d-0000-0000-C000-000000000046}' { InprocServer = s 'avifile.dll' }
|
||||||
'{00020001-0000-0000-C000-000000000046}' = s 'AVI Compressed Stream'
|
'{0002000f-0000-0000-C000-000000000046}' { InprocServer = s 'avifile.dll' }
|
||||||
{
|
|
||||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
|
||||||
}
|
|
||||||
'{00020003-0000-0000-C000-000000000046}' = s 'Microsoft Wave File'
|
|
||||||
{
|
|
||||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
|
||||||
}
|
|
||||||
'{0002000d-0000-0000-C000-000000000046}' = s 'IAVIStream & IAVIFile Proxy'
|
|
||||||
{
|
|
||||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
|
||||||
}
|
|
||||||
'{0002000f-0000-0000-C000-000000000046}' = s 'ACM Compressed Audio Stream'
|
|
||||||
{
|
|
||||||
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
NoRemove AVIFile
|
NoRemove AVIFile
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ DEFINE_AVIGUID(CLSID_ACMStream, 0x0002000F, 0, 0);
|
||||||
|
|
||||||
extern HMODULE AVIFILE_hModule DECLSPEC_HIDDEN;
|
extern HMODULE AVIFILE_hModule DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
extern HRESULT AVIFILE_CreateAVIFile(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
extern HRESULT AVIFILE_CreateAVIFile(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
extern HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
extern HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
extern HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||||
|
|
||||||
/* reads a chunk outof the extrachunk-structure */
|
/* reads a chunk out of the extrachunk-structure */
|
||||||
HRESULT ReadExtraChunk(const EXTRACHUNKS *extra,FOURCC ckid,LPVOID lpData,LPLONG size)
|
HRESULT ReadExtraChunk(const EXTRACHUNKS *extra,FOURCC ckid,LPVOID lpData,LPLONG size)
|
||||||
{
|
{
|
||||||
LPBYTE lp;
|
LPBYTE lp;
|
||||||
|
@ -102,7 +102,7 @@ HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPCVOID lpData, LONG siz
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reads a chunk fomr the HMMIO into the extrachunk-structure */
|
/* reads a chunk from the HMMIO into the extrachunk-structure */
|
||||||
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,const MMCKINFO *lpck)
|
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,const MMCKINFO *lpck)
|
||||||
{
|
{
|
||||||
LPDWORD lp;
|
LPDWORD lp;
|
||||||
|
|
|
@ -42,7 +42,7 @@ HRESULT ReadExtraChunk(const EXTRACHUNKS *extra,FOURCC ckid,LPVOID lp,LPLONG siz
|
||||||
/* writes a chunk into the extrachunk-structure */
|
/* writes a chunk into the extrachunk-structure */
|
||||||
HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPCVOID lp,LONG size) DECLSPEC_HIDDEN;
|
HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPCVOID lp,LONG size) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* reads a chunk fomr the HMMIO into the extrachunk-structure */
|
/* reads a chunk from the HMMIO into the extrachunk-structure */
|
||||||
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,const MMCKINFO *lpck) DECLSPEC_HIDDEN;
|
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,const MMCKINFO *lpck) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* reads all non-junk chunks into the extrachunk-structure until it finds
|
/* reads all non-junk chunks into the extrachunk-structure until it finds
|
||||||
|
|
|
@ -144,12 +144,19 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance(LPCLASSFACTORY iface,
|
||||||
TRACE("(%p,%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid),
|
TRACE("(%p,%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid),
|
||||||
ppobj);
|
ppobj);
|
||||||
|
|
||||||
if (ppobj == NULL || pOuter != NULL)
|
if (!ppobj)
|
||||||
return E_FAIL;
|
return E_INVALIDARG;
|
||||||
*ppobj = NULL;
|
*ppobj = NULL;
|
||||||
|
|
||||||
|
if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if (IsEqualGUID(&CLSID_AVIFile, &This->clsid))
|
if (IsEqualGUID(&CLSID_AVIFile, &This->clsid))
|
||||||
return AVIFILE_CreateAVIFile(riid,ppobj);
|
return AVIFILE_CreateAVIFile(pOuter, riid, ppobj);
|
||||||
|
|
||||||
|
if (pOuter)
|
||||||
|
return CLASS_E_NOAGGREGATION;
|
||||||
|
|
||||||
if (IsEqualGUID(&CLSID_ICMStream, &This->clsid))
|
if (IsEqualGUID(&CLSID_ICMStream, &This->clsid))
|
||||||
return AVIFILE_CreateICMStream(riid,ppobj);
|
return AVIFILE_CreateICMStream(riid,ppobj);
|
||||||
if (IsEqualGUID(&CLSID_WAVFile, &This->clsid))
|
if (IsEqualGUID(&CLSID_WAVFile, &This->clsid))
|
||||||
|
|
|
@ -311,8 +311,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
||||||
if (sInfo.fccType != streamtypeVIDEO)
|
if (sInfo.fccType != streamtypeVIDEO)
|
||||||
return AVIERR_UNSUPPORTED;
|
return AVIERR_UNSUPPORTED;
|
||||||
|
|
||||||
This->bFormatChanges =
|
This->bFormatChanges = (sInfo.dwFlags & AVISTREAMINFO_FORMATCHANGES) != 0;
|
||||||
(sInfo.dwFlags & AVISTREAMINFO_FORMATCHANGES ? TRUE : FALSE );
|
|
||||||
This->dwFormatChangeCount = sInfo.dwFormatChangeCount;
|
This->dwFormatChangeCount = sInfo.dwFormatChangeCount;
|
||||||
This->dwEditCount = sInfo.dwEditCount;
|
This->dwEditCount = sInfo.dwEditCount;
|
||||||
This->lCurrentFrame = -1;
|
This->lCurrentFrame = -1;
|
||||||
|
@ -434,7 +433,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpBits == NULL) {
|
if (lpBits == NULL) {
|
||||||
register DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
|
DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
|
||||||
|
|
||||||
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
|
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
|
||||||
This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
|
This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
|
||||||
|
|
|
@ -28,6 +28,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
/* @makedep: avifile.rgs */
|
/* @makedep: avifile.rgs */
|
||||||
1 WINE_REGISTRY avifile.rgs
|
1 WINE_REGISTRY avifile.rgs
|
||||||
|
|
||||||
|
2 WINE_REGISTRY avifil32_idl.rgs
|
||||||
|
|
||||||
#define WINE_FILEDESCRIPTION_STR "Wine AVI file support library"
|
#define WINE_FILEDESCRIPTION_STR "Wine AVI file support library"
|
||||||
#define WINE_FILENAME_STR "avifil32.dll"
|
#define WINE_FILENAME_STR "avifil32.dll"
|
||||||
#define WINE_FILEVERSION 4,0,3,1998
|
#define WINE_FILEVERSION 4,0,3,1998
|
||||||
|
|
|
@ -262,7 +262,7 @@ PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, const PAVISTREAM *ppStreams)
|
||||||
tmpFile->fInfo.dwSuggestedBufferSize = sInfo.dwSuggestedBufferSize;
|
tmpFile->fInfo.dwSuggestedBufferSize = sInfo.dwSuggestedBufferSize;
|
||||||
|
|
||||||
{
|
{
|
||||||
register DWORD tmp;
|
DWORD tmp;
|
||||||
|
|
||||||
tmp = MulDiv(AVIStreamSampleToTime(ppStreams[i], sInfo.dwLength),
|
tmp = MulDiv(AVIStreamSampleToTime(ppStreams[i], sInfo.dwLength),
|
||||||
tmpFile->fInfo.dwScale, tmpFile->fInfo.dwRate * 1000);
|
tmpFile->fInfo.dwScale, tmpFile->fInfo.dwRate * 1000);
|
||||||
|
|
|
@ -43,7 +43,7 @@ reactos/dll/win32/actxprxy # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/advpack # Synced to Wine-1.5.26
|
reactos/dll/win32/advpack # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/atl # Synced to Wine-1.5.19
|
reactos/dll/win32/atl # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/atl100 # Synced to Wine-1.5.19
|
reactos/dll/win32/atl100 # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/avifil32 # Synced to Wine-1.3.37
|
reactos/dll/win32/avifil32 # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/bcrypt # Synced to Wine-1.5.19
|
reactos/dll/win32/bcrypt # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/browseui # Out of sync
|
reactos/dll/win32/browseui # Out of sync
|
||||||
reactos/dll/win32/cabinet # Synced to Wine-1.5.19
|
reactos/dll/win32/cabinet # Synced to Wine-1.5.19
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue