Index: dll/win32/shimgvw/CMakeLists.txt =================================================================== --- dll/win32/shimgvw/CMakeLists.txt (revision 62744) +++ dll/win32/shimgvw/CMakeLists.txt (working copy) @@ -3,6 +3,7 @@ list(APPEND SOURCE shimgvw.c + comsup.c shimgvw.rc ${CMAKE_CURRENT_BINARY_DIR}/shimgvw_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/shimgvw.def) Index: dll/win32/shimgvw/comsup.c =================================================================== --- dll/win32/shimgvw/comsup.c (revision 0) +++ dll/win32/shimgvw/comsup.c (working copy) @@ -0,0 +1,58 @@ +#define INITGUID + +#include +#include + +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; +} Index: dll/win32/shimgvw/comsup.h =================================================================== --- dll/win32/shimgvw/comsup.h (revision 0) +++ dll/win32/shimgvw/comsup.h (working copy) @@ -0,0 +1,4 @@ +extern LONG LockCount; +extern LONG ObjectCount; + +VOID DllInitServer(VOID); \ No newline at end of file Index: dll/win32/shimgvw/shimgvw.c =================================================================== --- dll/win32/shimgvw/shimgvw.c (revision 62744) +++ dll/win32/shimgvw/shimgvw.c (working copy) @@ -26,6 +26,7 @@ #include #include #include +#include #define NDEBUG #include @@ -606,6 +607,8 @@ switch (dwReason) { case DLL_PROCESS_ATTACH: + DllInitServer(); + case DLL_THREAD_ATTACH: hInstance = hinstDLL; break; Index: dll/win32/shimgvw/shimgvw.spec =================================================================== --- dll/win32/shimgvw/shimgvw.spec (revision 62744) +++ dll/win32/shimgvw/shimgvw.spec (working copy) @@ -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()