[PATCH v3 02/10] ntdll/tests: Move NtMapViewOfSection tests from kernel32/tests

Huw Davies huw at codeweavers.com
Wed Jun 19 04:47:07 CDT 2019


On Tue, Jun 18, 2019 at 06:39:26PM +0200, Rémi Bernon wrote:
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> ---
>  dlls/kernel32/tests/virtual.c | 213 ------------------------------
>  dlls/ntdll/tests/virtual.c    | 240 ++++++++++++++++++++++++++++++++++
>  2 files changed, 240 insertions(+), 213 deletions(-)
> 

> diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
> index ff10508a604..65b884f55f9 100644
> --- a/dlls/ntdll/tests/virtual.c
> +++ b/dlls/ntdll/tests/virtual.c
> @@ -28,6 +28,48 @@
>  
>  static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
>  
> +static HANDLE create_target_process(const char *arg)
> +{
> +    char **argv;
> +    char cmdline[MAX_PATH];
> +    PROCESS_INFORMATION pi;
> +    BOOL ret;
> +    STARTUPINFOA si = { 0 };
> +    si.cb = sizeof(si);
> +
> +    winetest_get_mainargs( &argv );
> +    sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg);
> +    ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
> +    ok(ret, "error: %u\n", GetLastError());
> +    ret = CloseHandle(pi.hThread);
> +    ok(ret, "error %u\n", GetLastError());
> +    return pi.hProcess;
> +}

This can't work.  You also need the code inside START_TEST(virtual) to parse
the command line and actually do the sleeping.

Huw.



More information about the wine-devel mailing list