From 6e2babc977c270d2166380acdedc0ded28ee488f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 23 Sep 2009 14:28:13 +0200 Subject: [PATCH] oleaut32: Properly register the stdole typelibs. --- dlls/oleaut32/regsvr.c | 34 ++++++++++++++++++++++++++++++++++ tools/wine.inf.in | 5 ----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/regsvr.c b/dlls/oleaut32/regsvr.c index 3c5fabc0b20..75deac74d9f 100644 --- a/dlls/oleaut32/regsvr.c +++ b/dlls/oleaut32/regsvr.c @@ -21,6 +21,7 @@ #include #include +#define COBJMACROS #include "windef.h" #include "winbase.h" #include "winuser.h" @@ -377,6 +378,32 @@ static LONG register_key_defvalueA( return res; } +/*********************************************************************** + * register_typelib + */ +static HRESULT register_typelib( const WCHAR *name ) +{ + static const WCHAR backslash[] = {'\\',0}; + HRESULT hr; + ITypeLib *typelib; + WCHAR *path; + DWORD len; + + len = GetSystemDirectoryW( NULL, 0 ) + strlenW( name ) + 1; + if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + GetSystemDirectoryW( path, len ); + strcatW( path, backslash ); + strcatW( path, name ); + hr = LoadTypeLib( path, &typelib ); + if (SUCCEEDED(hr)) + { + hr = RegisterTypeLib( typelib, path, NULL ); + ITypeLib_Release( typelib ); + } + HeapFree( GetProcessHeap(), 0, path ); + return hr; +} + /*********************************************************************** * coclass list */ @@ -538,6 +565,13 @@ HRESULT WINAPI DllRegisterServer(void) hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); + if (SUCCEEDED(hr)) + { + const WCHAR stdole32W[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0}; + const WCHAR stdole2W[] = {'s','t','d','o','l','e','2','.','t','l','b',0}; + hr = register_typelib( stdole2W ); + if (SUCCEEDED(hr)) hr = register_typelib( stdole32W ); + } return hr; } diff --git a/tools/wine.inf.in b/tools/wine.inf.in index ab25de568e2..aedf14e1819 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -188,13 +188,8 @@ HKCR,AVIFile\Extensions\AVI,,,"{00020000-0000-0000-C000-000000000046}" HKCR,AVIFile\Extensions\WAV,,,"{00020003-0000-0000-C000-000000000046}" HKCR,AVIFile\RIFFHandlers\AVI,,,"{00020000-0000-0000-C000-000000000046}" HKCR,AVIFile\RIFFHandlers\WAVE,,,"{00020003-0000-0000-C000-000000000046}" -HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\1.0,,,"OLE Automation" HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\0\win16,,,"stdole.tlb" -HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\0\win32,,,"stdole32.tlb" HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\FLAGS,,,"1" -HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0,,,"OLE Automation" -HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win32,,,"stdole2.tlb" -HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\FLAGS,,,"0" HKCR,MIME\Database\Charset\_iso-2022-jp$ESC,"Codepage",0x10003,932 HKCR,MIME\Database\Charset\_iso-2022-jp$ESC,"InternetEncoding",0x10003,50221