Author: akhaldi
Date: Fri Nov 28 19:20:39 2014
New Revision: 65511
URL:
http://svn.reactos.org/svn/reactos?rev=65511&view=rev
Log:
[RTL] Import Wine commit f87767b by Piotr Caban: Handle
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID flag when opening manifest in
RtlCreateActivationContext.
Modified:
trunk/reactos/lib/rtl/actctx.c
Modified: trunk/reactos/lib/rtl/actctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/actctx.c?rev=65511…
==============================================================================
--- trunk/reactos/lib/rtl/actctx.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/actctx.c [iso-8859-1] Fri Nov 28 19:20:39 2014
@@ -4645,7 +4645,30 @@
if (pActCtx->lpSource && !((pActCtx->dwFlags &
ACTCTX_FLAG_RESOURCE_NAME_VALID) &&
(pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)))
{
- if (!RtlDosPathNameToNtPathName_U(pActCtx->lpSource, &nameW, NULL, NULL))
+ WCHAR *source = NULL;
+ BOOLEAN ret;
+
+ if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID &&
+ RtlDetermineDosPathNameType_U(pActCtx->lpSource) == RtlPathTypeRelative)
+ {
+ DWORD dir_len, source_len;
+
+ dir_len = strlenW(pActCtx->lpAssemblyDirectory);
+ source_len = strlenW(pActCtx->lpSource);
+ if (!(source = RtlAllocateHeap( RtlGetProcessHeap(), 0,
(dir_len+source_len+2)*sizeof(WCHAR))))
+ {
+ status = STATUS_NO_MEMORY;
+ goto error;
+ }
+
+ memcpy(source, pActCtx->lpAssemblyDirectory, dir_len*sizeof(WCHAR));
+ source[dir_len] = '\\';
+ memcpy(source+dir_len+1, pActCtx->lpSource,
(source_len+1)*sizeof(WCHAR));
+ }
+
+ ret = RtlDosPathNameToNtPathName_U(source ? source : pActCtx->lpSource,
&nameW, NULL, NULL);
+ if (source) RtlFreeHeap( RtlGetProcessHeap(), 0, source );
+ if (!ret)
{
status = STATUS_NO_SUCH_FILE;
goto error;