From 0844f3673832ad1553413a64f2e959a807ab0b36 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 8 Apr 2017 13:52:16 +0200 Subject: [PATCH] Added patch to implement stub for ntdll.RtlGetUnloadEventTraceEx. --- ...dd-stub-for-RtlGetUnloadEventTraceEx.patch | 47 +++++++++++++++++++ .../ntdll-RtlGetUnloadEventTraceEx/definition | 2 + patches/patchinstall.sh | 26 ++++++++++ 3 files changed, 75 insertions(+) create mode 100644 patches/ntdll-RtlGetUnloadEventTraceEx/0001-ntdll-Add-stub-for-RtlGetUnloadEventTraceEx.patch create mode 100644 patches/ntdll-RtlGetUnloadEventTraceEx/definition diff --git a/patches/ntdll-RtlGetUnloadEventTraceEx/0001-ntdll-Add-stub-for-RtlGetUnloadEventTraceEx.patch b/patches/ntdll-RtlGetUnloadEventTraceEx/0001-ntdll-Add-stub-for-RtlGetUnloadEventTraceEx.patch new file mode 100644 index 00000000..2bd85f73 --- /dev/null +++ b/patches/ntdll-RtlGetUnloadEventTraceEx/0001-ntdll-Add-stub-for-RtlGetUnloadEventTraceEx.patch @@ -0,0 +1,47 @@ +From 84fb1ffc2b569926c2e6a303922706d068361301 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 21 Mar 2017 23:27:06 +0100 +Subject: ntdll: Add stub for RtlGetUnloadEventTraceEx. + +--- + dlls/ntdll/ntdll.spec | 1 + + dlls/ntdll/rtl.c | 14 ++++++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec +index 9921b4cb1c..3c50e20a8b 100644 +--- a/dlls/ntdll/ntdll.spec ++++ b/dlls/ntdll/ntdll.spec +@@ -669,6 +669,7 @@ + # @ stub RtlGetSetBootStatusData + @ stdcall RtlGetThreadErrorMode() + # @ stub RtlGetUnloadEventTrace ++@ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr) + @ stub RtlGetUserInfoHeap + @ stdcall RtlGetVersion(ptr) + @ stub RtlGuidToPropertySetName +diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c +index 9b1fbbbcf5..098378c646 100644 +--- a/dlls/ntdll/rtl.c ++++ b/dlls/ntdll/rtl.c +@@ -1675,3 +1675,17 @@ NTSTATUS WINAPI RtlQueryPackageIdentity(HANDLE token, WCHAR *fullname, SIZE_T *f + FIXME("(%p, %p, %p, %p, %p, %p): stub\n", token, fullname, fullname_size, appid, appid_size, packaged); + return STATUS_NOT_FOUND; + } ++ ++/********************************************************************* ++ * RtlGetUnloadEventTraceEx [NTDLL.@] ++ */ ++void WINAPI RtlGetUnloadEventTraceEx(ULONG **size, ULONG **count, VOID **trace) ++{ ++ static ULONG dummy_size, dummy_count; ++ ++ FIXME("(%p, %p, %p): stub!\n", size, count, trace); ++ ++ if (size) *size = &dummy_size; ++ if (count) *count = &dummy_count; ++ if (trace) *trace = NULL; ++} +-- +2.11.0 + diff --git a/patches/ntdll-RtlGetUnloadEventTraceEx/definition b/patches/ntdll-RtlGetUnloadEventTraceEx/definition new file mode 100644 index 00000000..8d8b3578 --- /dev/null +++ b/patches/ntdll-RtlGetUnloadEventTraceEx/definition @@ -0,0 +1,2 @@ +Fixes: Implement stub for ntdll.RtlGetUnloadEventTraceEx +Depends: ntdll-RtlQueryPackageIdentity diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a5d43cc1..c78989aa 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -256,6 +256,7 @@ patch_enable_all () enable_ntdll_ProcessQuotaLimits="$1" enable_ntdll_Purist_Mode="$1" enable_ntdll_RtlCaptureStackBackTrace="$1" + enable_ntdll_RtlGetUnloadEventTraceEx="$1" enable_ntdll_RtlIpStringToAddress_Stubs="$1" enable_ntdll_RtlIpStringToAddress_Tests="$1" enable_ntdll_RtlQueryPackageIdentity="$1" @@ -996,6 +997,9 @@ patch_enable () ntdll-RtlCaptureStackBackTrace) enable_ntdll_RtlCaptureStackBackTrace="$2" ;; + ntdll-RtlGetUnloadEventTraceEx) + enable_ntdll_RtlGetUnloadEventTraceEx="$2" + ;; ntdll-RtlIpStringToAddress_Stubs) enable_ntdll_RtlIpStringToAddress_Stubs="$2" ;; @@ -2313,6 +2317,13 @@ if test "$enable_ntdll_RtlIpStringToAddress_Tests" -eq 1; then enable_ntdll_RtlQueryPackageIdentity=1 fi +if test "$enable_ntdll_RtlGetUnloadEventTraceEx" -eq 1; then + if test "$enable_ntdll_RtlQueryPackageIdentity" -gt 1; then + abort "Patchset ntdll-RtlQueryPackageIdentity disabled, but ntdll-RtlGetUnloadEventTraceEx depends on that." + fi + enable_ntdll_RtlQueryPackageIdentity=1 +fi + if test "$enable_ntdll_Purist_Mode" -eq 1; then if test "$enable_ntdll_DllRedirects" -gt 1; then abort "Patchset ntdll-DllRedirects disabled, but ntdll-Purist_Mode depends on that." @@ -5759,6 +5770,21 @@ if test "$enable_ntdll_RtlCaptureStackBackTrace" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-RtlGetUnloadEventTraceEx +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * ntdll-RtlQueryPackageIdentity +# | +# | Modified files: +# | * dlls/ntdll/ntdll.spec, dlls/ntdll/rtl.c +# | +if test "$enable_ntdll_RtlGetUnloadEventTraceEx" -eq 1; then + patch_apply ntdll-RtlGetUnloadEventTraceEx/0001-ntdll-Add-stub-for-RtlGetUnloadEventTraceEx.patch + ( + printf '%s\n' '+ { "Michael Müller", "ntdll: Add stub for RtlGetUnloadEventTraceEx.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-RtlIpStringToAddress_Stubs # | # | Modified files: