Use CoCreateInstance instead of SHCoCreateInstance, drop shell32 from

imports.
Call OleInitialize() on AVIFileInit.
This commit is contained in:
Marcus Meissner 2005-07-02 10:49:39 +00:00 committed by Alexandre Julliard
parent 7016ea79d9
commit c64432cebe
2 changed files with 6 additions and 9 deletions

View File

@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = avifil32.dll MODULE = avifil32.dll
IMPORTLIB = libavifil32.$(IMPLIBEXT) IMPORTLIB = libavifil32.$(IMPLIBEXT)
IMPORTS = msacm32 msvfw32 shell32 winmm ole32 user32 advapi32 kernel32 ntdll IMPORTS = msacm32 msvfw32 winmm ole32 user32 advapi32 kernel32 ntdll
EXTRALIBS = -luuid EXTRALIBS = -luuid
C_SRCS = \ C_SRCS = \

View File

@ -176,8 +176,7 @@ static BOOL AVIFILE_GetFileHandlerByExtension(LPCWSTR szFile, LPCLSID lpclsid)
* AVIFileInit (AVIFILE.100) * AVIFileInit (AVIFILE.100)
*/ */
void WINAPI AVIFileInit(void) { void WINAPI AVIFileInit(void) {
/* need to load ole32.dll if not already done and get some functions */ OleInitialize(NULL);
FIXME("(): stub!\n");
} }
/*********************************************************************** /***********************************************************************
@ -186,6 +185,7 @@ void WINAPI AVIFileInit(void) {
*/ */
void WINAPI AVIFileExit(void) { void WINAPI AVIFileExit(void) {
/* need to free ole32.dll if we are the last exit call */ /* need to free ole32.dll if we are the last exit call */
/* OleUnitialize() */
FIXME("(): stub!\n"); FIXME("(): stub!\n");
} }
@ -253,8 +253,7 @@ HRESULT WINAPI AVIFileOpenW(PAVIFILE *ppfile, LPCWSTR szFile, UINT uMode,
memcpy(&clsidHandler, lpHandler, sizeof(clsidHandler)); memcpy(&clsidHandler, lpHandler, sizeof(clsidHandler));
/* create instance of handler */ /* create instance of handler */
hr = SHCoCreateInstance(NULL, &clsidHandler, NULL, hr = CoCreateInstance(&clsidHandler, NULL, CLSCTX_INPROC, &IID_IAVIFile, (LPVOID*)ppfile);
&IID_IAVIFile, (LPVOID*)ppfile);
if (FAILED(hr) || *ppfile == NULL) if (FAILED(hr) || *ppfile == NULL)
return hr; return hr;
@ -493,8 +492,7 @@ HRESULT WINAPI AVIStreamCreate(PAVISTREAM *ppavi, LONG lParam1, LONG lParam2,
if (pclsidHandler == NULL) if (pclsidHandler == NULL)
return AVIERR_UNSUPPORTED; return AVIERR_UNSUPPORTED;
hr = SHCoCreateInstance(NULL, pclsidHandler, NULL, hr = CoCreateInstance(pclsidHandler, NULL, CLSCTX_INPROC, &IID_IAVIStream, (LPVOID*)ppavi);
&IID_IAVIStream, (LPVOID*)ppavi);
if (FAILED(hr) || *ppavi == NULL) if (FAILED(hr) || *ppavi == NULL)
return hr; return hr;
@ -751,8 +749,7 @@ HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,
} else } else
memcpy(&clsidHandler, pclsidHandler, sizeof(clsidHandler)); memcpy(&clsidHandler, pclsidHandler, sizeof(clsidHandler));
hr = SHCoCreateInstance(NULL, &clsidHandler, NULL, hr = CoCreateInstance(&clsidHandler, NULL, CLSCTX_INPROC, &IID_IAVIStream, (LPVOID*)ppsCompressed);
&IID_IAVIStream, (LPVOID*)ppsCompressed);
if (FAILED(hr) || *ppsCompressed == NULL) if (FAILED(hr) || *ppsCompressed == NULL)
return hr; return hr;