https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1e903d96cbdc78dbc9184…
commit 1e903d96cbdc78dbc91843cb599f6c31da627ff3
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Thu Jan 18 16:53:59 2018 +0200
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Sat Jan 27 02:45:50 2018 +0200
[RTL] actctx: Implement the implicit activation context
---
media/CMakeLists.txt | 2 ++
media/systemcompatible.manifest | 8 ++++++++
sdk/lib/rtl/actctx.c | 26 ++++++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt
index 778555daa5..508ab79214 100644
--- a/media/CMakeLists.txt
+++ b/media/CMakeLists.txt
@@ -12,3 +12,5 @@ add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/networks
DESTINATION re
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/protocol DESTINATION
reactos/system32/drivers/etc FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/services DESTINATION
reactos/system32/drivers/etc FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/sounds/ReactOS_LogOn.wav DESTINATION
reactos/media FOR all)
+
+add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/systemcompatible.manifest DESTINATION
reactos/winsxs/manifests FOR all)
\ No newline at end of file
diff --git a/media/systemcompatible.manifest b/media/systemcompatible.manifest
new file mode 100644
index 0000000000..e81ccfeeb2
--- /dev/null
+++ b/media/systemcompatible.manifest
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls" version="5.82.0.0"
publicKeyToken="6595b64144ccf1df" processorArchitecture="*"
language="*" />
+ </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/sdk/lib/rtl/actctx.c b/sdk/lib/rtl/actctx.c
index 6ce1734017..396b442fcd 100644
--- a/sdk/lib/rtl/actctx.c
+++ b/sdk/lib/rtl/actctx.c
@@ -15,6 +15,7 @@
/* Based on Wine Staging 1.7.37 */
#include <rtl.h>
+#include <ntstrsafe.h>
#define NDEBUG
#include <debug.h>
@@ -694,6 +695,7 @@ static const WCHAR wildcardW[] = {'*',0};
static ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } };
static ACTIVATION_CONTEXT *process_actctx = &system_actctx.ActivationContext;
+static ACTIVATION_CONTEXT *implicit_actctx = &system_actctx.ActivationContext;
static WCHAR *strdupW(const WCHAR* str)
{
@@ -4657,6 +4659,8 @@ void actctx_init(void)
{
ACTCTXW ctx;
HANDLE handle;
+ WCHAR buffer[1024];
+ NTSTATUS Status;
ctx.cbSize = sizeof(ctx);
ctx.lpSource = NULL;
@@ -4668,6 +4672,22 @@ void actctx_init(void)
{
process_actctx = check_actctx(handle);
}
+
+ ctx.dwFlags = 0;
+ ctx.hModule = NULL;
+ ctx.lpResourceName = NULL;
+ ctx.lpSource = buffer;
+ RtlStringCchCopyW(buffer, 1024, SharedUserData->NtSystemRoot);
+ RtlStringCchCatW(buffer, 1024,
L"\\winsxs\\manifests\\systemcompatible.manifest");
+ Status = RtlCreateActivationContext(0, (PVOID)&ctx, 0, NULL, NULL, &handle);
+ if (NT_SUCCESS(Status))
+ {
+ implicit_actctx = check_actctx(handle);
+ }
+ else
+ {
+ DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n",
Status);
+ }
}
/* FUNCTIONS ***************************************************************/
@@ -5350,6 +5370,9 @@ NTSTATUS NTAPI RtlFindActivationContextSectionString( ULONG flags,
const GUID *g
if (status != STATUS_SUCCESS)
status = find_string( process_actctx, section_kind, section_name, flags, data );
+ if (status != STATUS_SUCCESS)
+ status = find_string( implicit_actctx, section_kind, section_name, flags, data
);
+
DPRINT("RtlFindActivationContextSectionString() returns status %x\n",
status);
return status;
}
@@ -5390,6 +5413,9 @@ NTSTATUS WINAPI RtlFindActivationContextSectionGuid( ULONG flags,
const GUID *ex
if (status != STATUS_SUCCESS)
status = find_guid( process_actctx, section_kind, guid, flags, data );
+ if (status != STATUS_SUCCESS)
+ status = find_guid( implicit_actctx, section_kind, guid, flags, data );
+
return status;
}