>From b6abd09c1c9b96bad31b2eb03ffd3d6d882f5411 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Sat, 14 Jan 2012 16:43:31 +0300
Subject: [PATCH 4/7] Add null terminator to typelib name

---
 dlls/msi/automation.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index 933698f..54c89ed 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -103,20 +103,30 @@ typedef struct {
     IDispatch *installer;
 } SessionObject;
 
+static inline AutomationObject *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface )
+{
+    return CONTAINING_RECORD(iface, AutomationObject, IProvideMultipleClassInfo_iface);
+}
+
+static inline AutomationObject *impl_from_IDispatch( IDispatch *iface )
+{
+    return CONTAINING_RECORD(iface, AutomationObject, IDispatch_iface);
+}
+
 /* Load type info so we don't have to process GetIDsOfNames */
 HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID lcid)
 {
+    static const WCHAR msiserverW[] = {'m','s','i','s','e','r','v','e','r','.','t','l','b',0};
+    ITypeInfo *ti = NULL;
+    ITypeLib *lib = NULL;
     HRESULT hr;
-    LPTYPELIB pLib = NULL;
-    LPTYPEINFO pInfo = NULL;
-    static const WCHAR szMsiServer[] = {'m','s','i','s','e','r','v','e','r','.','t','l','b'};
 
-    TRACE("(%p)->(%s,%d)\n", iface, debugstr_guid(clsid), lcid);
+    TRACE("(%p)->(%s, %d)\n", iface, debugstr_guid(clsid), lcid);
 
     /* Load registered type library */
-    hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, lcid, &pLib);
+    hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, lcid, &lib);
     if (FAILED(hr)) {
-        hr = LoadTypeLib(szMsiServer, &pLib);
+        hr = LoadTypeLib(msiserverW, &lib);
         if (FAILED(hr)) {
             ERR("Could not load msiserver.tlb\n");
             return hr;
@@ -124,26 +134,16 @@ HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID
     }
 
     /* Get type information for object */
-    hr = ITypeLib_GetTypeInfoOfGuid(pLib, clsid, &pInfo);
-    ITypeLib_Release(pLib);
+    hr = ITypeLib_GetTypeInfoOfGuid(lib, clsid, &ti);
+    ITypeLib_Release(lib);
     if (FAILED(hr)) {
         ERR("Could not load ITypeInfo for %s\n", debugstr_guid(clsid));
         return hr;
     }
-    *pptinfo = pInfo;
+    *pptinfo = ti;
     return S_OK;
 }
 
-static inline AutomationObject *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface )
-{
-    return CONTAINING_RECORD(iface, AutomationObject, IProvideMultipleClassInfo_iface);
-}
-
-static inline AutomationObject *impl_from_IDispatch( IDispatch *iface )
-{
-    return CONTAINING_RECORD(iface, AutomationObject, IDispatch_iface);
-}
-
 /* Macro to get pointer to private object data */
 static inline void *private_data( AutomationObject *This )
 {
-- 
1.5.6.5


