[3/3] shell32: Added typelib.

Alexander Morozov amorozov at etersoft.ru
Tue Jan 18 12:52:15 CST 2011


-------------- next part --------------
From 9c4b5dde72d2a85f7d0e843d6e4589048e5af013 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov at etersoft.ru>
Date: Tue, 18 Jan 2011 21:36:08 +0300
Subject: [PATCH 3/3] shell32: Added typelib.

---
 dlls/shell32/Makefile.in    |    2 ++
 dlls/shell32/regsvr.c       |   13 +++++++++++++
 dlls/shell32/shell32.rc     |    3 +++
 dlls/shell32/shell32_v1.idl |   19 +++++++++++++++++++
 4 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 dlls/shell32/shell32_v1.idl

diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in
index 7755111..259e429 100644
--- a/dlls/shell32/Makefile.in
+++ b/dlls/shell32/Makefile.in
@@ -89,6 +89,8 @@ RC_SRCS = \
 
 PO_SRCS = shell32.rc
 
+IDL_TLB_SRCS = shell32_v1.idl
+
 SVG_SRCS = \
 	cdrom.svg \
 	control.svg \
diff --git a/dlls/shell32/regsvr.c b/dlls/shell32/regsvr.c
index f09d72b..9d3ca65 100644
--- a/dlls/shell32/regsvr.c
+++ b/dlls/shell32/regsvr.c
@@ -22,6 +22,8 @@
 #include <string.h>
 #include <stdio.h>
 
+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
@@ -837,6 +839,8 @@ static struct regsvr_namespace const namespace_extensions_list[] = {
 HRESULT WINAPI DllRegisterServer(void)
 {
     HRESULT hr;
+    ITypeLib *tl;
+    static const WCHAR wszShell32[] = { 's','h','e','l','l','3','2','.','d','l','l', 0 };
 
     TRACE("\n");
 
@@ -847,6 +851,12 @@ HRESULT WINAPI DllRegisterServer(void)
 	hr = SHELL_RegisterShellFolders();
     if (SUCCEEDED(hr))
         hr = register_namespace_extensions(namespace_extensions_list);
+    if (SUCCEEDED(hr))
+    {
+        hr = LoadTypeLibEx(wszShell32, REGKIND_REGISTER, &tl);
+        if(SUCCEEDED(hr))
+            ITypeLib_Release(tl);
+    }
     return hr;
 }
 
@@ -864,5 +874,8 @@ HRESULT WINAPI DllUnregisterServer(void)
 	hr = unregister_interfaces(interface_list);
     if (SUCCEEDED(hr))
         hr = unregister_namespace_extensions(namespace_extensions_list);
+    if (SUCCEEDED(hr))
+        hr = UnRegisterTypeLib(&LIBID_Shell32, 1, 0, LOCALE_SYSTEM_DEFAULT,
+                               SYS_WIN32);
     return hr;
 }
diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc
index bc8e8df..66531ec 100644
--- a/dlls/shell32/shell32.rc
+++ b/dlls/shell32/shell32.rc
@@ -260,6 +260,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA."
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
+/* @makedep: shell32_v1.tlb */
+1 TYPELIB shell32_v1.tlb
+
 shv_accel ACCELERATORS
 BEGIN
 	VK_F5, FCIDM_SHVIEW_REFRESH, VIRTKEY
diff --git a/dlls/shell32/shell32_v1.idl b/dlls/shell32/shell32_v1.idl
new file mode 100644
index 0000000..2b6c719
--- /dev/null
+++ b/dlls/shell32/shell32_v1.idl
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2010 Alexander Morozov for Etersoft
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "shldisp.idl"
-- 
1.7.3.4



More information about the wine-patches mailing list