ntdll: Move ACTCTX lpResourceName validation to RtlCreateActivationContext.

This prevents passing NULL resource name to get_manifest_in_module().
This commit is contained in:
Jinoh Kang 2023-05-29 21:18:42 +09:00 committed by Alexandre Julliard
parent b9507d0e5f
commit d992e2d0aa
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}

View file

@ -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;