[PATCH 1/2] ntdll: windows refuses to load an image, if sections overlap the header size as given in the SizeOfHeaders field (resend)
Alexandre Julliard
julliard at winehq.org
Tue Nov 15 07:00:33 CST 2011
Bernhard Loos <bernhardloos at googlemail.com> writes:
> ---
> dlls/kernel32/tests/loader.c | 79 ++++++++++++++++++++++++++++++++++++++++++
> dlls/ntdll/virtual.c | 5 +++
> 2 files changed, 84 insertions(+), 0 deletions(-)
>
> diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
> index 4d420ea..bcef492 100644
> --- a/dlls/kernel32/tests/loader.c
> +++ b/dlls/kernel32/tests/loader.c
> @@ -692,9 +692,88 @@ static void test_section_access(void)
> }
> }
>
> +static void test_section_mapping(void)
> +{
> + static const char filler[0x2000];
> + static const char section_data[] = "section data 1234567890";
> + DWORD total, written;
> + HANDLE hfile;
> + HMODULE hlib;
> + SYSTEM_INFO si;
> + char temp_path[MAX_PATH];
> + char dll_name[MAX_PATH];
> + BOOL ret;
> +
> + GetSystemInfo(&si);
> +
> + /* prevent displaying of the "Unable to load this DLL" message box */
> + SetErrorMode(SEM_FAILCRITICALERRORS);
> +
> + GetTempPath(MAX_PATH, temp_path);
> +
> + GetTempFileName(temp_path, "ldr", 0, dll_name);
Please merge that test case into the existing loader tests instead of
adding a new function to do the same thing.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list