Commit d992e2d0 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

ntdll: Move ACTCTX lpResourceName validation to RtlCreateActivationContext.

This prevents passing NULL resource name to get_manifest_in_module().
parent b9507d0e
......@@ -3804,7 +3804,6 @@ static void test_manifest_resource_name_omitted(void)
handle = CreateActCtxW(&ctx);
err = GetLastError();
ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
todo_wine
ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
len = GetModuleFileNameW(NULL, pathbuf, ARRAY_SIZE(pathbuf));
......@@ -3828,7 +3827,6 @@ static void test_manifest_resource_name_omitted(void)
handle = CreateActCtxW(&ctx);
err = GetLastError();
ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
todo_wine
ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
}
......
......@@ -2951,8 +2951,6 @@ static NTSTATUS get_manifest_in_module( struct actctx_loader* acl, struct assemb
hModule, debugstr_w(filename) );
}
if (!resname) return STATUS_INVALID_PARAMETER;
info.Type = RT_MANIFEST;
info.Language = lang;
if (!((ULONG_PTR)resname >> 16))
......@@ -5232,6 +5230,9 @@ NTSTATUS WINAPI RtlCreateActivationContext( HANDLE *handle, const void *ptr )
(pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL))
return STATUS_INVALID_PARAMETER;
if ((pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID) && !pActCtx->lpResourceName)
return STATUS_INVALID_PARAMETER;
if (!(actctx = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*actctx) )))
return STATUS_NO_MEMORY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment