This patch helps the IE6 installer get past the DLL registration stage. The DelNodeRunDLL32 function is stubbed out, but RegisterOCX will correctly register a COM DLL by calling its DllRegisterServer function.
ChangeLog:
* dlls/advpack/advpack.c
Matthew Mastracci mmastrac@canada.com Implement RegisterOCX Stub for DelNodeRunDLL32
Index: dlls/advpack/advpack.c =================================================================== RCS file: /home/wine/wine/dlls/advpack/advpack.c,v retrieving revision 1.7 diff -u -r1.7 advpack.c --- dlls/advpack/advpack.c 20 Jan 2005 20:03:13 -0000 1.7 +++ dlls/advpack/advpack.c 14 Mar 2005 07:35:54 -0000 @@ -32,6 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
+typedef HRESULT (*DLLREGISTER) (void); +
/*********************************************************************** * DllMain (ADVPACK.@) @@ -172,3 +174,60 @@
return S_OK; } + +/*********************************************************************** + * RegisterOCX (ADVPACK.@) + */ +void WINAPI RegisterOCX( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show ) +{ + WCHAR wszBuff[MAX_PATH]; + WCHAR* pwcComma = &wszBuff[0]; + HMODULE hm; + DLLREGISTER pfnRegister; + HRESULT hr; + + TRACE("(%s)\n", cmdline); + + MultiByteToWideChar(CP_ACP, 0, cmdline, strlen(cmdline), wszBuff, MAX_PATH); + while (!(*pwcComma == ',' ) && *pwcComma) + { + pwcComma++; + } + *pwcComma = '\0'; + + TRACE("Parsed DLL name (%s)\n", debugstr_w(wszBuff)); + + hm = LoadLibraryExW(wszBuff, 0, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!hm) + { + ERR("Couldn't load DLL: %s\n", debugstr_w(wszBuff)); + return; + } + + pfnRegister = (DLLREGISTER)GetProcAddress(hm, "DllRegisterServer"); + if (pfnRegister == NULL) + { + ERR("DllRegisterServer entry point not found\n"); + } + else + { + hr = pfnRegister(); + if (hr != S_OK) + { + ERR("DllRegisterServer entry point returned %08lx\n", hr); + } + } + + TRACE("Successfully registered OCX\n"); + + FreeLibrary(hm); +} + +/*********************************************************************** + * DelNodeRunDLL32 (ADVPACK.@) + */ +void WINAPI DelNodeRunDLL32( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show ) +{ + FIXME("(%s) FIXME: stub\n", cmdline); +} + Index: dlls/advpack/advpack.spec =================================================================== RCS file: /home/wine/wine/dlls/advpack/advpack.spec,v retrieving revision 1.5 diff -u -r1.5 advpack.spec --- dlls/advpack/advpack.spec 20 Jan 2005 20:03:13 -0000 1.5 +++ dlls/advpack/advpack.spec 14 Mar 2005 07:35:54 -0000 @@ -2,7 +2,7 @@ @ stub AdvInstallFile @ stub CloseINFEngine @ stub DelNode -@ stub DelNodeRunDLL32 +@ stdcall DelNodeRunDLL32(ptr ptr str long) @ stdcall DllMain(long long ptr) @ stdcall DoInfInstall(ptr) @ stub ExecuteCab @@ -23,10 +23,11 @@ @ stub RegRestoreAll @ stub RegSaveRestore @ stub RegSaveRestoreOnINF -@ stub RegisterOCX +@ stdcall RegisterOCX(ptr ptr str long) @ stub RunSetupCommand @ stub SetPerUserSecValues @ stub TranslateInfString @ stub TranslateInfStringEx @ stub UserInstStubWrapper @ stub UserUnInstStubWrapper
"Matthew Mastracci" matt@aclaro.com wrote:
+typedef HRESULT (*DLLREGISTER) (void);
Shouldn't it have a WINAPI modifier?
Dmitry Timoshkov wrote:
"Matthew Mastracci" matt@aclaro.com wrote:
+typedef HRESULT (*DLLREGISTER) (void);
Shouldn't it have a WINAPI modifier?
Good point, thanks. I'm sending an updated patch to wine-patches with the WINAPI modifier.
Note that I copied the callback function definiton verbatim from Wine's regsvr32 implementation. Should the definition in regsvr32 include WINAPI as well?
Matt.
"Matthew Mastracci" matt@aclaro.com wrote:
Note that I copied the callback function definiton verbatim from Wine's regsvr32 implementation. Should the definition in regsvr32 include WINAPI as well?
Very likely that yes, it should.