//============================================================ // // winmisc.c - Win32 OSD core miscellaneous functions // // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. // Visit http://mamedev.org for licensing and usage restrictions. // //============================================================ // standard windows headers #define _WIN32_WINNT 0x0400 #define WIN32_LEAN_AND_MEAN #include #include // MAME headers #include "osdcore.h" // MAMEOS headers #include "winutf8.h" #include "strconv.h" //============================================================ // osd_alloc_executable //============================================================ void *osd_alloc_executable(size_t size) { return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); } //============================================================ // osd_free_executable //============================================================ void osd_free_executable(void *ptr, size_t size) { VirtualFree(ptr, 0, MEM_RELEASE); } //============================================================ // osd_is_bad_read_ptr //============================================================ int osd_is_bad_read_ptr(const void *ptr, size_t size) { return IsBadReadPtr(ptr, size); } //============================================================ // osd_break_into_debugger //============================================================ void osd_break_into_debugger(const char *message) { if (IsDebuggerPresent()) { win_output_debug_string_utf8(message); DebugBreak(); } }