X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.c;h=8ec02db4e86877fcbffdca9ef2dd70e57aa8f83a;hb=1363121ddb1d2e722e2e41d1c93758551066797c;hp=9e4186676f2e1e61de2ad234e1598be4405006cf;hpb=2e86a718672b73c942e51dfbda7eb9db8746b6f4;p=sbcl.git diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index 9e41866..8ec02db 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -38,6 +38,7 @@ #include "interrupt.h" #include "interr.h" #include "lispregs.h" +#include "runtime.h" #include "monitor.h" #include "alloc.h" #include "genesis/primitive-objects.h" @@ -620,9 +621,34 @@ void scratch(void) dup(0); LoadLibrary(0); GetProcAddress(0, 0); + FreeLibrary(0); mkdir(0); isatty(0); access(0,0); + GetLastError(); + FormatMessageA(0, 0, 0, 0, 0, 0, 0); + _get_osfhandle(0); + ReadFile(0, 0, 0, 0, 0); + WriteFile(0, 0, 0, 0, 0); + PeekNamedPipe(0, 0, 0, 0, 0, 0); + FlushConsoleInputBuffer(0); + PeekConsoleInput(0, 0, 0, 0); + Sleep(0); +} + +char * +os_get_runtime_executable_path() +{ + char path[MAX_PATH + 1]; + DWORD bufsize = sizeof(path); + DWORD size; + + if ((size = GetModuleFileNameA(NULL, path, bufsize)) == 0) + return NULL; + else if (size == bufsize && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return NULL; + + return copied_string(path); } /* EOF */