Ver Fonte

Windows make restored; programs being run find DLLs again

Arthur Yefimov há 3 anos atrás
pai
commit
b5f59dec93
2 ficheiros alterados com 5 adições e 2 exclusões
  1. 1 1
      src/make.bat
  2. 4 1
      src/term/term_win32.c

+ 1 - 1
src/make.bat

@@ -1,7 +1,7 @@
 @ECHO OFF
 SET PROG=FreeOberon
 SET OFRDIR=..\data\bin\OfrontPlus\Target\Win64
-SET GCCDIR=..\data\bin\mingw-w64\mingw64\bin
+SET GCCDIR=..\data\bin\mingw64\bin
 SET PATH=%GCCDIR%;%OFRDIR%;%PATH%
 SET OBERON=.;%OFRDIR%\Lib\Sym
 REM SET SDL2Opts=-w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2

+ 4 - 1
src/term/term_win32.c

@@ -149,6 +149,9 @@ int StartProcessIn(char *process, char *dir) {
   siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
   siStartInfo.wShowWindow = SW_HIDE;
 
+  /* Environment block */
+  char chNewEnv[100] = "PATH=..\0"; // Must end with 2 \0s
+
   // Create the child process.
   bSuccess = CreateProcess(NULL,
     process, //szCmdline,    // command line
@@ -156,7 +159,7 @@ int StartProcessIn(char *process, char *dir) {
     NULL,    // primary thread security attributes
     TRUE,    // handles are inherited
     CREATE_NO_WINDOW, // creation flags
-    NULL,         // use parent's environment
+    (LPVOID)chNewEnv, // environment block
     dir,          // current directory of the process
     &siStartInfo, // STARTUPINFO pointer
     &piProcInfo); // receives PROCESS_INFORMATION