[PATCH] oleaut32: Implement LoadTypeLib16
Detlef Riekenberg
wine.dev at web.de
Tue Sep 9 22:24:19 CDT 2008
---
dlls/oleaut32/typelib16.c | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/dlls/oleaut32/typelib16.c b/dlls/oleaut32/typelib16.c
index a7b2639..72554a3 100644
--- a/dlls/oleaut32/typelib16.c
+++ b/dlls/oleaut32/typelib16.c
@@ -35,9 +35,11 @@
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
+#include "winnls.h"
#include "objbase.h"
#include "ole2disp.h"
+#include "oleauto.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
@@ -111,6 +113,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.
@@ -118,16 +124,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
--=-LOcf5hKIy5Hd2Y8CLDR7--
More information about the wine-patches
mailing list