From baefdf6d68a6ff8afe7685f30532f6cf904444c2 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Sun, 22 Jun 2008 00:11:23 -0700 Subject: [PATCH] ntdll: Use module for path to activation context, when available --- dlls/ntdll/actctx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 8f9a2c1..d128e43 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2206,6 +2206,16 @@ NTSTATUS WINAPI RtlCreateActivationContext( HANDLE *handle, const void *ptr ) { if (!(actctx->appdir.info = strdupW( pActCtx->lpApplicationName ))) goto error; } + else if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID) + { + UNICODE_STRING dir; + WCHAR *p; + + if ((status = get_module_filename( pActCtx->hModule, &dir, 0 ))) + goto error; + if ((p = strrchrW( dir.Buffer, '\\' ))) p[1] = 0; + actctx->appdir.info = dir.Buffer; + } else { UNICODE_STRING dir; -- 1.5.4.1