From: Alex Henrie alexhenrie24@gmail.com
Instead of multiplying it by 2.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54808 --- dlls/kernel32/tests/actctx.c | 24 ++++++++++++++++++++++-- dlls/ntdll/actctx.c | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index 3d547e01b19..17fd2779749 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -147,6 +147,11 @@ static const char manifest3[] = " name="testsurrogate"" " runtimeVersion="v2.0.50727"" " />" +" <clrSurrogate " +" clsid="{96666666-8888-7777-6666-555555555555}"" +" name="testsurrogate"" +" runtimeVersion="v2.0.50728"" +" />" " <clrClass " " clsid="{22345678-1234-5678-1234-111122223333}"" " name="clrclass"" @@ -1815,9 +1820,11 @@ struct clrsurrogate_data };
static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *name, const WCHAR *version, - ULONG exid, int line) + ULONG exid, ULONG count, int line) { struct clrsurrogate_data *surrogate; + struct guidsection_header *header; + struct guid_index *index; ACTCTX_SECTION_KEYED_DATA data; BOOL ret;
@@ -1871,6 +1878,19 @@ static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *n ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid); + + header = (struct guidsection_header*)data.lpSectionBase; + ok(header->magic == 0x64487347, "got wrong magic 0x%08lx\n", header->magic); + ok(header->size == sizeof(*header), "got size %ld\n", header->size); + ok(header->count == count, "got count %ld, expected %ld\n", header->count, count); + ok(header->index_offset == sizeof(*header), "got index offset %lu\n", header->index_offset); + + index = (struct guid_index*)((BYTE*)data.lpSectionBase + header->index_offset); + ok(index[0].data_offset == sizeof(*header) + count * sizeof(*index), "got data offset %ld\n", index[0].data_offset); + ok(index[0].rosterindex == exid, "got roster index %ld, expected %lu\n", index[0].rosterindex, exid); + ok(index[1].data_offset == index[0].data_offset + index[0].data_len, "got data offset %lu, expected %lu\n", + index[1].data_offset, index[0].data_offset + index[0].data_len); + ok(index[1].rosterindex == exid, "got roster index %ld, expected %lu\n", index[1].rosterindex, exid); }
static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line) @@ -2299,7 +2319,7 @@ static void test_actctx(void) test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.4", 1, __LINE__); test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.5", 1, __LINE__); test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.6", 1, __LINE__); - test_find_surrogate(handle, &IID_Iiface, nameW, versionW, 1, __LINE__); + test_find_surrogate(handle, &IID_Iiface, nameW, versionW, 1, 2, __LINE__); test_find_ifaceps_redirection(handle, &IID_Iifaceps, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__); test_find_ifaceps_redirection(handle, &IID_Iifaceps2, &IID_TlibTest4, &IID_Ibifaceps, &IID_PS32, 1, __LINE__); test_find_ifaceps_redirection(handle, &IID_Iifaceps3, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__); diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index b275a7f5b49..3fcf5196339 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -4819,7 +4819,7 @@ static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT* actctx, struct g ptrW[data->version_len/sizeof(WCHAR)] = 0; }
- data_offset += index->data_offset; + data_offset += index->data_len; index++; } }