]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/main-windows.cpp
Put brackets around ipv6 addresses in `inet6 present`
[factor.git] / vm / main-windows.cpp
index b01f780cf1f8be2764fa384b6b2fd69af57fb766..4d6eddedd8a4420fc443f67f9ac4ea5104fd42ff 100644 (file)
@@ -1,13 +1,25 @@
 #include "master.hpp"
 
 VM_C_API int wmain(int argc, wchar_t** argv) {
-  factor::init_globals();
+  HANDLE proc = GetCurrentProcess();
+  HANDLE thread = GetCurrentThread();
+  BOOL res = DuplicateHandle(proc, thread, proc,
+                             &factor::boot_thread, GENERIC_ALL, FALSE, 0);
+  if (!res) {
+    factor::fatal_error("DuplicateHandle() failed", GetLastError());
+    return 1;
+  }
+  factor::init_mvm();
   factor::start_standalone_factor(argc, argv);
   return 0;
 }
 
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    LPSTR lpCmdLine, int nCmdShow) {
+  (void)hInstance;
+  (void)hPrevInstance;
+  (void)lpCmdLine;
+  (void)nCmdShow;
   int argc;
   wchar_t** argv = CommandLineToArgvW(GetCommandLine(), &argc);
   wmain(argc, argv);