mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-28 05:40:26 +00:00
001e36bc78
The type size of long depends on compiler. Therefore, changing to intptr_t makes it depends on architecture.
23 lines
650 B
C
23 lines
650 B
C
// Copyright 2017 syzkaller project authors. All rights reserved.
|
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
#include <io.h>
|
|
#include <windows.h>
|
|
|
|
#include "nocover.h"
|
|
|
|
static void os_init(int argc, char** argv, void* data, size_t data_size)
|
|
{
|
|
if (VirtualAlloc(data, data_size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE) != data)
|
|
fail("mmap of data segment failed");
|
|
}
|
|
|
|
static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs])
|
|
{
|
|
__try {
|
|
return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
|
|
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
|
return -1;
|
|
}
|
|
}
|