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

This commit is contained in:
Andrew Eikum 2013-06-21 14:27:11 -05:00 committed by Alexandre Julliard
parent 1f508587d6
commit 82376431e8
1 changed files with 20 additions and 0 deletions

View File

@ -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. */