msvcp: Implement the wchar version of _Read_dir.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2017-05-22 15:59:45 +02:00 committed by Alexandre Julliard
parent 4193e717b6
commit 3ddbd236d0
5 changed files with 28 additions and 14 deletions

View File

@ -1713,8 +1713,8 @@
@ cdecl ?_Random_device@std@@YAIXZ() _Random_device @ cdecl ?_Random_device@std@@YAIXZ() _Random_device
@ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADPADPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADPADPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
@ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADPEADPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADPEADPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
@ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir_wchar
@ stub -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WPEA_WPEAXAEAW4file_type@123@@Z @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WPEA_WPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir_wchar
@ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) _Pad__Release @ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) _Pad__Release
@ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) _Pad__Release @ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) _Pad__Release
@ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) _Pad__Release @ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) _Pad__Release

View File

@ -1674,8 +1674,8 @@
@ cdecl ?_Random_device@std@@YAIXZ() _Random_device @ cdecl ?_Random_device@std@@YAIXZ() _Random_device
@ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
@ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
@ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WAAY0BAE@_WPAXAAW4file_type@123@@Z @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WAAY0BAE@_WPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir_wchar
@ stub -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WAEAY0BAE@_WPEAXAEAW4file_type@123@@Z @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WAEAY0BAE@_WPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir_wchar
@ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) _Pad__Release @ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) _Pad__Release
@ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) _Pad__Release @ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) _Pad__Release
@ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) _Pad__Release @ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) _Pad__Release

View File

@ -1674,8 +1674,8 @@
@ cdecl ?_Random_device@std@@YAIXZ() msvcp120.?_Random_device@std@@YAIXZ @ cdecl ?_Random_device@std@@YAIXZ() msvcp120.?_Random_device@std@@YAIXZ
@ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z
@ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z
@ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WAAY0BAE@_WPAXAAW4file_type@123@@Z @ cdecl -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WAAY0BAE@_WPAXAAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPA_WAAY0BAE@_WPAXAAW4file_type@123@@Z
@ stub -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WAEAY0BAE@_WPEAXAEAW4file_type@123@@Z @ cdecl -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEA_WAEAY0BAE@_WPEAXAEAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir@sys@tr2@std@@YAPEA_WAEAY0BAE@_WPEAXAEAW4file_type@123@@Z
@ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) msvcp120.?_Release@_Pad@std@@QAAXXZ @ cdecl -arch=arm ?_Release@_Pad@std@@QAAXXZ(ptr) msvcp120.?_Release@_Pad@std@@QAAXXZ
@ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) msvcp120.?_Release@_Pad@std@@QAEXXZ @ thiscall -arch=i386 ?_Release@_Pad@std@@QAEXXZ(ptr) msvcp120.?_Release@_Pad@std@@QAEXXZ
@ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) msvcp120.?_Release@_Pad@std@@QEAAXXZ @ cdecl -arch=win64 ?_Release@_Pad@std@@QEAAXXZ(ptr) msvcp120.?_Release@_Pad@std@@QEAAXXZ

View File

@ -3692,7 +3692,7 @@
@ cdecl _Open_dir(ptr wstr long long) tr2_sys__Open_dir_wchar @ cdecl _Open_dir(ptr wstr long long) tr2_sys__Open_dir_wchar
@ cdecl -ret64 _Query_perf_counter() @ cdecl -ret64 _Query_perf_counter()
@ cdecl -ret64 _Query_perf_frequency() @ cdecl -ret64 _Query_perf_frequency()
@ stub _Read_dir @ cdecl _Read_dir(ptr ptr ptr) tr2_sys__Read_dir_wchar
@ stub _Remove_dir @ stub _Remove_dir
@ stub _Rename @ stub _Rename
@ stub _Resize @ stub _Resize

View File

@ -14962,23 +14962,25 @@ void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, e
return handle; return handle;
} }
/* ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z */ /* ??_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z */
/* ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z */ /* ??_Read_dir@sys@tr2@std@@YAPEA_WPEA_WPEAXAEAW4file_type@123@@Z */
char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type) wchar_t* __cdecl tr2_sys__Read_dir_wchar(wchar_t* target, void* handle, enum file_type* type)
{ {
WIN32_FIND_DATAA data; WIN32_FIND_DATAW data;
static const wchar_t dot[] = {'.', 0};
static const wchar_t dotdot[] = {'.', '.', 0};
TRACE("(%p %p %p)\n", target, handle, type); TRACE("(%p %p %p)\n", target, handle, type);
do { do {
if(!FindNextFileA(handle, &data)) { if(!FindNextFileW(handle, &data)) {
*type = status_unknown; *type = status_unknown;
*target = '\0'; *target = '\0';
return target; return target;
} }
} while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")); } while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot));
strcpy(target, data.cFileName); wcscpy(target, data.cFileName);
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
*type = directory_file; *type = directory_file;
else else
@ -14986,6 +14988,18 @@ char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type
return target; return target;
} }
/* ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z */
/* ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z */
char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
{
wchar_t target_w[MAX_PATH];
tr2_sys__Read_dir_wchar(target_w, handle, type);
WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, MAX_PATH, NULL, NULL);
return target;
}
/* ?_Close_dir@sys@tr2@std@@YAXPAX@Z */ /* ?_Close_dir@sys@tr2@std@@YAXPAX@Z */
/* ?_Close_dir@sys@tr2@std@@YAXPEAX@Z */ /* ?_Close_dir@sys@tr2@std@@YAXPEAX@Z */
void __cdecl tr2_sys__Close_dir(void* handle) void __cdecl tr2_sys__Close_dir(void* handle)