Commit fa0491f2 authored by Kevin Puetz's avatar Kevin Puetz Committed by Alexandre Julliard

oleaut32: Use GetFinalPathNameByHandle to canonicalize file path.

parent fecd13e1
......@@ -3335,27 +3335,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
h = CreateFileW(pszPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(h != INVALID_HANDLE_VALUE){
FILE_NAME_INFORMATION size_info;
BOOL br;
/* GetFileInformationByHandleEx returns the path of the file without
* WOW64 redirection */
br = GetFileInformationByHandleEx(h, FileNameInfo, &size_info, sizeof(size_info));
if(br || GetLastError() == ERROR_MORE_DATA){
FILE_NAME_INFORMATION *info;
DWORD size = sizeof(*info) + size_info.FileNameLength + sizeof(WCHAR);
info = HeapAlloc(GetProcessHeap(), 0, size);
br = GetFileInformationByHandleEx(h, FileNameInfo, info, size);
if(br){
info->FileName[info->FileNameLength / sizeof(WCHAR)] = 0;
lstrcpynW(pszPath + 2, info->FileName, cchPath - 2);
}
HeapFree(GetProcessHeap(), 0, info);
}
GetFinalPathNameByHandleW(h, pszPath, cchPath, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
CloseHandle(h);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment