From ca27b3bc5783ce1dbda7f23883d0ddf3729902a8 Mon Sep 17 00:00:00 2001 From: Suraj K Suresh Date: Mon, 28 Sep 2020 14:48:39 +0530 Subject: executor: msvc support syz-executor --- executor/common_windows.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'executor/common_windows.h') diff --git a/executor/common_windows.h b/executor/common_windows.h index e9722a360..a29d437b8 100644 --- a/executor/common_windows.h +++ b/executor/common_windows.h @@ -3,20 +3,17 @@ // This file is shared between executor and csource package. +#include // for _chdir +#include // for mktemp #include -#include "common.h" - #if SYZ_EXECUTOR || SYZ_HANDLE_SEGV static void install_segv_handler() { } -#define NONFAILING(...) \ - __try { \ - __VA_ARGS__; \ - } __except (EXCEPTION_EXECUTE_HANDLER) { \ - } +#define NONFAILING(...) \ + ([&]() { __try { __VA_ARGS__; } __except (EXCEPTION_EXECUTE_HANDLER) { return false; } return true; }()) #endif #if SYZ_EXECUTOR || SYZ_THREADED || SYZ_REPEAT && SYZ_EXECUTOR_USES_FORK_SERVER @@ -111,3 +108,12 @@ static int do_sandbox_none(void) return 0; } #endif + +static void use_temporary_dir(void) +{ + char tmpdir_template[] = "./syzkaller.XXXXXX"; + char* tmpdir = mktemp(tmpdir_template); + + CreateDirectory(tmpdir, NULL); + _chdir(tmpdir); +} -- cgit mrf-deployment