[SHIMGVW] Fix DLL stubs, intended to fix a crash on Windows. Patch by Ricardo Hanke.

CORE-8073 #resolve #comment Committed in r65614. Thanks!

svn path=/trunk/; revision=65614
This commit is contained in:
Amine Khaldi 2014-12-12 13:08:59 +00:00
parent 5bf209a1aa
commit 51fa01cea7
4 changed files with 67 additions and 4 deletions

View file

@ -3,6 +3,7 @@ spec2def(shimgvw.dll shimgvw.spec)
list(APPEND SOURCE
shimgvw.c
comsup.c
shimgvw.rc
${CMAKE_CURRENT_BINARY_DIR}/shimgvw_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/shimgvw.def)

View file

@ -0,0 +1,58 @@
#define INITGUID
#include <windef.h>
#include <comsup.h>
LONG LockCount;
LONG ObjectCount;
VOID
DllInitServer(VOID)
{
ObjectCount = 0;
LockCount = 0;
}
STDAPI
DllRegisterServer(VOID)
{
/* Always return S_OK, since there is currently nothing that can go wrong */
return S_OK;
}
STDAPI
DllUnregisterServer(VOID)
{
/* Always return S_OK, since there is currently nothing that can go wrong */
return S_OK;
}
STDAPI
DllCanUnloadNow(VOID)
{
if ((ObjectCount != 0) || (LockCount != 0))
{
return S_FALSE;
}
else
{
return S_OK;
}
}
STDAPI
DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT hr;
/* There are no classes to export, so always return CLASS_E_CLASSNOTAVAILABLE*/
*ppv = NULL;
hr = CLASS_E_CLASSNOTAVAILABLE;
return hr;
}

View file

@ -0,0 +1,4 @@
extern LONG LockCount;
extern LONG ObjectCount;
VOID DllInitServer(VOID);

View file

@ -7,8 +7,8 @@
@ stdcall ImageView_PrintToW(ptr ptr wstr long)
@ stdcall imageview_fullscreenW(ptr ptr wstr long) ImageView_FullscreenW
@ stub ConvertDIBSECTIONToThumbnail
@ stub -private DllCanUnloadNow
@ stub -private DllGetClassObject
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stub -private DllInstall
@ stub -private DllRegisterServer
@ stub -private DllUnregisterServer
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()