sti.dll: register sti.dll

Damjan Jovanovic damjan.jov at gmail.com
Tue Jul 14 16:24:05 CDT 2009


Changelog:
* register sti.dll

Damjan Jovanovic
-------------- next part --------------
diff --git a/dlls/sti/Makefile.in b/dlls/sti/Makefile.in
index dd977ac..7516de2 100644
--- a/dlls/sti/Makefile.in
+++ b/dlls/sti/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = sti.dll
 IMPORTLIB = sti
-IMPORTS   = kernel32
+IMPORTS   = kernel32 advapi32 ole32
 
 C_SRCS = sti_main.c
 
diff --git a/dlls/sti/sti.spec b/dlls/sti/sti.spec
index f8b17fd..186f382 100644
--- a/dlls/sti/sti.spec
+++ b/dlls/sti/sti.spec
@@ -1,7 +1,7 @@
 @ stub DllCanUnloadNow
 @ stub DllGetClassObject
-@ stub DllRegisterServer
-@ stub DllUnregisterServer
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
 @ stdcall StiCreateInstance(ptr long ptr ptr)
 @ stdcall StiCreateInstanceA(ptr long ptr ptr)
 @ stdcall StiCreateInstanceW(ptr long ptr ptr)
diff --git a/dlls/sti/sti_main.c b/dlls/sti/sti_main.c
index 1d4e6ad..427e9c5 100644
--- a/dlls/sti/sti_main.c
+++ b/dlls/sti/sti_main.c
@@ -18,10 +18,84 @@
 
 #include <stdarg.h>
 
+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winreg.h"
 #include "winerror.h"
+#include "ole2.h"
+
+#include "initguid.h"
+#include "sti.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(sti);
+
+/******************************************************************************
+ *           DllRegisterServer (STI.@)
+ */
+HRESULT WINAPI DllRegisterServer(void)
+{
+    static const WCHAR clsidBkW[] = {'C','L','S','I','D','\\',0};
+    WCHAR className[6 + 39];
+    HKEY classKey = NULL;
+    HKEY serverKey = NULL;
+    const char *str;
+    DWORD ret;
+
+    TRACE("()\n");
+
+    snprintfW(className, sizeof(className), clsidBkW);
+    StringFromGUID2(&CLSID_Sti, &className[6], 39);
+    ret = RegCreateKeyW(HKEY_CLASSES_ROOT, className, &classKey);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    str = "StillImage";
+    ret = RegSetValueA(classKey, "", REG_SZ, str, strlen(str) + 1);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    ret = RegCreateKeyA(classKey, "InProcServer32", &serverKey);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    str = "sti.dll";
+    ret = RegSetValueA(serverKey, "", REG_SZ, str, strlen(str) + 1);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    str = "Both";
+    ret = RegSetValueExA(serverKey, "ThreadingModel", 0, REG_SZ,
+        (const BYTE*)str, strlen(str) + 1);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    ret = ERROR_SUCCESS;
+
+done:
+    RegCloseKey(classKey);
+    RegCloseKey(serverKey);
+    return HRESULT_FROM_WIN32(ret);
+}
+
+/******************************************************************************
+ *           DllUnregisterServer (STI.@)
+ */
+HRESULT WINAPI DllUnregisterServer()
+{
+    WCHAR guid[39];
+    DWORD ret;
+
+    TRACE("()\n");
+
+    StringFromGUID2(&CLSID_Sti, guid, 39);
+    ret = RegDeleteTreeW(HKEY_CLASSES_ROOT, guid);
+    return HRESULT_FROM_WIN32(ret);
+}
 
 /******************************************************************************
  *           StiCreateInstance   (STI.@)
diff --git a/include/sti.h b/include/sti.h
new file mode 100644
index 0000000..5ddf30d
--- /dev/null
+++ b/include/sti.h
@@ -0,0 +1,3 @@
+#include <guiddef.h>
+
+DEFINE_GUID(CLSID_Sti, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C);
diff --git a/tools/wine.inf.in b/tools/wine.inf.in
index cd9e609..047d284 100644
--- a/tools/wine.inf.in
+++ b/tools/wine.inf.in
@@ -2426,6 +2426,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 11,,quartz.dll,1
 11,,rsaenh.dll,1
 11,,shdocvw.dll,1
+11,,sti.dll,1
 11,,urlmon.dll,1
 11,,windowscodecs.dll,1
 11,,wintrust.dll,1


More information about the wine-patches mailing list