[PATCH 0/1] MR6133: kernelbase: Implement GetTempPath2A() and GetTempPath2W().
Implements GetTempPath2A() and GetTempPath2W() functions without special functionality when a system process calls them. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6133
From: Đorđe Mančić<djordjemancic(a)outlook.com> --- dlls/kernel32/kernel32.spec | 2 ++ dlls/kernelbase/file.c | 20 ++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 2 ++ include/fileapi.h | 3 +++ 4 files changed, 27 insertions(+) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 179d49ba7cb..49140fb8307 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -864,6 +864,8 @@ @ stdcall -import GetTempFileNameW(wstr wstr long ptr) @ stdcall -import GetTempPathA(long ptr) @ stdcall -import GetTempPathW(long ptr) +@ stdcall -import GetTempPath2A(long ptr) +@ stdcall -import GetTempPath2W(long ptr) @ stdcall -import GetThreadContext(long ptr) @ stdcall -import GetThreadDescription(long ptr) @ stdcall -import GetThreadErrorMode() diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 623e283d6d9..bae668f5630 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2476,6 +2476,26 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetTempPathW( DWORD count, LPWSTR path ) } +/*********************************************************************** + * GetTempPath2A (kernelbase.@) + */ +DWORD WINAPI DECLSPEC_HOTPATCH GetTempPath2A(DWORD count, LPSTR path) +{ + /* TODO: Set temp path to C:\Windows\SystemTemp\ when a SYSTEM process calls this function */ + return GetTempPathA(count, path); +} + + +/*********************************************************************** + * GetTempPath2W (kernelbase.@) + */ +DWORD WINAPI DECLSPEC_HOTPATCH GetTempPath2W(DWORD count, LPWSTR path) +{ + /* TODO: Set temp path to C:\Windows\SystemTemp\ when a SYSTEM process calls this function */ + return GetTempPathW(count, path); +} + + /*********************************************************************** * GetWindowsDirectoryA (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index a133380a27a..9504b07754a 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -741,6 +741,8 @@ @ stdcall GetTempFileNameW(wstr wstr long ptr) @ stdcall GetTempPathA(long ptr) @ stdcall GetTempPathW(long ptr) +@ stdcall GetTempPath2W(long ptr) +@ stdcall GetTempPath2A(long ptr) @ stdcall GetThreadContext(long ptr) @ stdcall GetThreadDescription(long ptr) @ stdcall GetThreadErrorMode() diff --git a/include/fileapi.h b/include/fileapi.h index 02bbbd4d920..2080fbbac21 100644 --- a/include/fileapi.h +++ b/include/fileapi.h @@ -34,6 +34,9 @@ typedef struct _CREATEFILE2_EXTENDED_PARAMETERS { WINBASEAPI HANDLE WINAPI CreateFile2(LPCWSTR,DWORD,DWORD,DWORD,LPCREATEFILE2_EXTENDED_PARAMETERS); +WINBASEAPI DWORD WINAPI GetTempPath2A(DWORD,LPSTR); +WINBASEAPI DWORD WINAPI GetTempPath2W(DWORD,LPWSTR); + #ifdef __cplusplus } #endif -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6133
You should add a FIXME for those 2 functions which mentions they're a semi-stub Also is there an application that depends on these functions? I don't see anything obvious in the WineHQ Bugzilla :frog: -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6133#note_76737
On Sun Jul 21 14:57:10 2024 +0000, Aida Jonikienė wrote:
You should add a FIXME for those 2 functions which mentions they're a semi-stub Also is there an application that depends on these functions? I don't see anything obvious in the WineHQ Bugzilla :frog: Got it, I will submit a v2 containing those FIXMEs.
Although I haven't found any bugs already submitted on the Bugzilla, I've come across [this dotnet runtime issue](https://github.com/dotnet/runtime/issues/105012) which describes that dotnet has switched from using GetTempPath to GetTempPath2 for security reasons, and the MSDN page for GetTempPath recommends using GetTempPath2 instead. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6133#note_76738
participants (2)
-
Aida Jonikienė -
Đorđe Mančić