Andrew Eikum : oleaut32: Register the typelib' s path without WOW64 redirection.

Alexandre Julliard julliard at winehq.org
Mon Jun 24 16:23:47 CDT 2013


Module: wine
Branch: master
Commit: 82376431e8ffd2456e7883ed5040b93ee2937a77
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=82376431e8ffd2456e7883ed5040b93ee2937a77

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Fri Jun 21 14:27:11 2013 -0500

oleaut32: Register the typelib's path without WOW64 redirection.

---

 dlls/oleaut32/typelib.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index bc7ee56..acf495f 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -66,6 +66,7 @@
 #include "winnls.h"
 #include "winreg.h"
 #include "winuser.h"
+#include "winternl.h"
 #include "lzexpand.h"
 
 #include "wine/unicode.h"
@@ -3128,6 +3129,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
     LPVOID pBase = NULL;
     DWORD dwTLBLength = 0;
     IUnknown *pFile = NULL;
+    HANDLE h;
 
     *ppTypeLib = NULL;
 
@@ -3162,6 +3164,24 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
 
     if(file != pszFileName) heap_free(file);
 
+    h = CreateFileW(pszPath, GENERIC_READ, 0, NULL, OPEN_ALWAYS,
+            FILE_ATTRIBUTE_NORMAL, NULL);
+    if(h != INVALID_HANDLE_VALUE){
+        FILE_NAME_INFORMATION *info;
+        char data[MAX_PATH * sizeof(WCHAR) + sizeof(info->FileNameLength)];
+        BOOL br;
+
+        info = (FILE_NAME_INFORMATION*)data;
+        /* GetFileInformationByHandleEx returns the path of the file without
+         * WOW64 redirection */
+        br = GetFileInformationByHandleEx(h, FileNameInfo, data, sizeof(data));
+        if(br){
+            info->FileName[info->FileNameLength / sizeof(WCHAR)] = 0;
+            lstrcpynW(pszPath + 2, info->FileName, cchPath - 2);
+        }
+        CloseHandle(h);
+    }
+
     TRACE_(typelib)("File %s index %d\n", debugstr_w(pszPath), index);
 
     /* We look the path up in the typelib cache. If found, we just addref it, and return the pointer. */




More information about the wine-cvs mailing list