[PATCH] typelib (oleaut32): Implement LoadTypeLib16

Detlef Riekenberg wine.dev at web.de
Wed Aug 27 17:20:42 CDT 2008


---
 dlls/oleaut32/typelib16.c |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/dlls/oleaut32/typelib16.c b/dlls/oleaut32/typelib16.c
index 67ed860..07050ff 100644
--- a/dlls/oleaut32/typelib16.c
+++ b/dlls/oleaut32/typelib16.c
@@ -35,6 +35,7 @@
 #include "winbase.h"
 #include "winreg.h"
 #include "winuser.h"
+#include "winnls.h"
 
 #include "objbase.h"
 #include "ole2disp.h"
@@ -135,6 +136,10 @@ QueryPathOfRegTypeLib16(
  *
  * Load and register a type library.
  *
+ * PARAMS
+ *  szFile [I] Name of file to load from 
+ *  pptLib [O] Destination for loaded ITypeLib interface
+ *
  * RETURNS
  *  Success: S_OK. pptLib contains the type libraries ITypeLib interface.
  *  Failure: An HRESULT error code.
@@ -142,16 +147,23 @@ QueryPathOfRegTypeLib16(
  * NOTES
  *  Both parameters are FAR pointers.
  */
-HRESULT WINAPI LoadTypeLib16(
-    LPSTR szFile, /* [in] Name of file to load from */
-    ITypeLib** pptLib) /* [out] Destination for loaded ITypeLib interface */
+HRESULT WINAPI LoadTypeLib16(LPSTR szFile, ITypeLib** pptLib)
 {
-    FIXME("(%s,%p): stub\n",debugstr_a(szFile),pptLib);
+    LPWSTR nameW = NULL;
+    HRESULT hr;
+    DWORD len;
 
-    if (pptLib!=0)
-      *pptLib=0;
+    TRACE("(%s,%p)\n", debugstr_a(szFile), pptLib);
+
+    if (szFile) {
+        len = MultiByteToWideChar(CP_ACP, 0, szFile, -1, NULL, 0);
+        nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, szFile, -1, nameW, len);
+    }
 
-    return E_FAIL;
+    hr = LoadTypeLib(nameW, pptLib);
+    HeapFree(GetProcessHeap(), 0, nameW);
+    return hr;
 }
 
 /****************************************************************************
-- 
1.5.4.3


--=-NKXkiUb2FHD0LUsBc828--




More information about the wine-patches mailing list