From: Alex Henrie alexhenrie24@gmail.com
--- dlls/oleaut32/typelib.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index d92d0234c6c..95a1ea00eda 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -69,6 +69,7 @@ #include "typelib.h" #include "wine/debug.h" #include "variant.h" +#include "atlconv.h" #include "wine/asm.h" #include "wine/heap.h" #include "wine/list.h" @@ -1644,18 +1645,6 @@ static inline void TLB_FreeCustData(struct list *custdata_list) } }
-static BSTR TLB_MultiByteToBSTR(const char *ptr) -{ - DWORD len; - BSTR ret; - - len = MultiByteToWideChar(CP_ACP, 0, ptr, -1, NULL, 0); - ret = SysAllocStringLen(NULL, len - 1); - if (!ret) return ret; - MultiByteToWideChar(CP_ACP, 0, ptr, -1, ret, len); - return ret; -} - static inline TLBFuncDesc *TLB_get_funcdesc_by_memberid(ITypeInfoImpl *typeinfo, MEMBERID memid) { int i; @@ -3610,7 +3599,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) size >>= 2; name = heap_alloc_zero(size+1); MSFT_Read(name, size, &cx, DO_NOT_SEEK); - pImpLib->name = TLB_MultiByteToBSTR(name); + pImpLib->name = A2BSTR(name); heap_free(name);
pImpLib->guid = MSFT_ReadGuid(oGuid, &cx); @@ -3717,7 +3706,7 @@ static TLBString *SLTG_ReadName(const char *pNameTable, int offset, ITypeLibImpl return tlbstr; }
- tmp_str = TLB_MultiByteToBSTR(pNameTable + offset); + tmp_str = A2BSTR(pNameTable + offset); tlbstr = TLB_append_str(&lib->name_list, tmp_str); SysFreeString(tmp_str);
@@ -3939,7 +3928,7 @@ static sltg_ref_lookup_t *SLTG_DoRefs(SLTG_RefInfo *pRef, ITypeLibImpl *pTL, if(fname[len-1] != '#') FIXME("fname = %s\n", fname); fname[len-1] = '\0'; - import->name = TLB_MultiByteToBSTR(fname); + import->name = A2BSTR(fname); list_add_tail(&pTL->implib_list, &import->entry); } ref_type->pImpTLInfo = import;