Implements GetTempPath2A() and GetTempPath2W() functions without special functionality when a system process calls them.
-- v5: kernelbase: Implement GetTempPath2A() and GetTempPath2W().
From: Đorđe Mančićdjordjemancic@outlook.com
--- dlls/kernel32/kernel32.spec | 2 ++ dlls/kernelbase/file.c | 22 ++++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 2 ++ include/fileapi.h | 3 +++ 4 files changed, 29 insertions(+)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 179d49ba7cb..36cefbf5d8d 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -862,6 +862,8 @@ @ stdcall GetTapeStatus(ptr) @ stdcall -import GetTempFileNameA(str str long ptr) @ stdcall -import GetTempFileNameW(wstr wstr long ptr) +@ stdcall -import GetTempPath2A(long ptr) +@ stdcall -import GetTempPath2W(long ptr) @ stdcall -import GetTempPathA(long ptr) @ stdcall -import GetTempPathW(long ptr) @ stdcall -import GetThreadContext(long ptr) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 623e283d6d9..1f13511fa7b 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2476,6 +2476,28 @@ 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 */ + FIXME("(%lu, %s) semi-stub\n", count, path); + 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 */ + FIXME("(%lu, %s) semi-stub\n", count, debugstr_w(path)); + return GetTempPathW(count, path); +} + + /*********************************************************************** * GetWindowsDirectoryA (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index a133380a27a..cf1a4e41490 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -739,6 +739,8 @@ # @ stub GetTargetPlatformContext @ stdcall GetTempFileNameA(str str long ptr) @ stdcall GetTempFileNameW(wstr wstr long ptr) +@ stdcall GetTempPath2W(long ptr) +@ stdcall GetTempPath2A(long ptr) @ stdcall GetTempPathA(long ptr) @ stdcall GetTempPathW(long ptr) @ stdcall GetThreadContext(long ptr) 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
On Sun Jul 21 19:00:13 2024 +0000, Fabian Maurer wrote:
Nitpick: To be sorted it needs to be above GetTempPathA.
Didn't notice that, updated the MR.