https://git.reactos.org/?p=reactos.git;a=commitdiff;h=192926ee026ee04992e1f…
commit 192926ee026ee04992e1f8d5c6b34916389fd9ca
Author: William Kent <wjk011(a)gmail.com>
AuthorDate: Fri Nov 29 02:56:02 2019 -0500
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Fri Nov 29 08:56:02 2019 +0100
Stub GetCurrentPackageId() (#1942)
* [KERNEL32] Add stub implementation for GetCurrentPackageId() function
This Windows 8+ function is called by WiX bundles (EXE-based installers) upon exit, if
the export is present. If it is a stub in the spec, they will crash, even if they are
coded to be compatible with Windows XP/ReactOS.
Also add GetCurrentPackageId() forwarder to apiset.
---
dll/apisets/CMakeLists.txt | 2 +-
dll/apisets/api-ms-win-appmodel-runtime-l1-1-1.spec | 2 +-
dll/win32/kernel32/client/sysinfo.c | 12 ++++++++++++
dll/win32/kernel32/kernel32.spec | 1 +
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/dll/apisets/CMakeLists.txt b/dll/apisets/CMakeLists.txt
index 778af7f878f..4e658584755 100644
--- a/dll/apisets/CMakeLists.txt
+++ b/dll/apisets/CMakeLists.txt
@@ -40,7 +40,7 @@ add_cd_file(FILE
${CMAKE_CURRENT_SOURCE_DIR}/x86_reactos.apisets_6595b64144ccf1d
# Apisets will be appended
add_apiset(api-ms-win-appmodel-identity-l1-1-0 0x60000000 )
-add_apiset(api-ms-win-appmodel-runtime-l1-1-1 0x60020000 )
+add_apiset(api-ms-win-appmodel-runtime-l1-1-1 0x60020000 kernel32)
add_apiset(api-ms-win-appmodel-runtime-l1-1-2 0x60040000 )
add_apiset(api-ms-win-core-apiquery-l1-1-0 0x60060000 )
add_apiset(api-ms-win-core-appcompat-l1-1-1 0x60070000 kernel32)
diff --git a/dll/apisets/api-ms-win-appmodel-runtime-l1-1-1.spec
b/dll/apisets/api-ms-win-appmodel-runtime-l1-1-1.spec
index c814f9b98da..1c4887411eb 100644
--- a/dll/apisets/api-ms-win-appmodel-runtime-l1-1-1.spec
+++ b/dll/apisets/api-ms-win-appmodel-runtime-l1-1-1.spec
@@ -8,7 +8,7 @@
@ stub GetCurrentApplicationUserModelId
@ stub GetCurrentPackageFamilyName
@ stub GetCurrentPackageFullName
-@ stub GetCurrentPackageId
+@ stdcall -version=0x602+ GetCurrentPackageId(ptr ptr) kernel32.GetCurrentPackageId
@ stub GetCurrentPackageInfo
@ stub GetCurrentPackagePath
@ stub GetPackageApplicationIds
diff --git a/dll/win32/kernel32/client/sysinfo.c b/dll/win32/kernel32/client/sysinfo.c
index ac0ad750efc..74151c19eea 100644
--- a/dll/win32/kernel32/client/sysinfo.c
+++ b/dll/win32/kernel32/client/sysinfo.c
@@ -582,3 +582,15 @@ SetSystemFileCacheSize(IN SIZE_T MinimumFileCacheSize,
STUB;
return FALSE;
}
+
+/*
+ * @unimplemented
+ */
+LONG
+WINAPI
+GetCurrentPackageId(UINT32 *BufferLength,
+ BYTE *Buffer)
+{
+ STUB;
+ return APPMODEL_ERROR_NO_PACKAGE;
+}
diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec
index 36122395322..b7cf1e6a019 100644
--- a/dll/win32/kernel32/kernel32.spec
+++ b/dll/win32/kernel32/kernel32.spec
@@ -430,6 +430,7 @@
@ stub -version=0x600+ GetCurrentConsoleFontEx
@ stdcall GetCurrentDirectoryA(long ptr)
@ stdcall GetCurrentDirectoryW(long ptr)
+@ stdcall -version=0x602+ GetCurrentPackageId(ptr ptr)
@ stdcall -norelay GetCurrentProcess()
@ stdcall -norelay GetCurrentProcessId()
@ stdcall GetCurrentProcessorNumber() ntdll.RtlGetCurrentProcessorNumber