Fix lots of macOS warnings by using a different boost/bind include.
[dcpomatic.git] / src / lib / cross_windows.cc
index 23a5da5998b41c604a54f48e0215b289e152e6e7..ad5a886643211b251174318a7f9d721711c903c1 100644 (file)
@@ -126,12 +126,8 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
                return;
        }
 
-       wchar_t previous_dir[512];
-       GetCurrentDirectory (sizeof(previous_dir), previous_dir);
-
        wchar_t dir[512];
        MultiByteToWideChar (CP_UTF8, 0, directory_containing_executable().string().c_str(), -1, dir, sizeof(dir));
-       SetCurrentDirectory (dir);
 
        STARTUPINFO startup_info;
        ZeroMemory (&startup_info, sizeof (startup_info));
@@ -150,16 +146,14 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 
        PROCESS_INFORMATION process_info;
        ZeroMemory (&process_info, sizeof (process_info));
-       if (!CreateProcess (0, command, 0, 0, TRUE, CREATE_NO_WINDOW, 0, 0, &startup_info, &process_info)) {
+       if (!CreateProcess (0, command, 0, 0, TRUE, CREATE_NO_WINDOW, 0, dir, &startup_info, &process_info)) {
                LOG_ERROR_NC (N_("ffprobe call failed (could not CreateProcess)"));
-               SetCurrentDirectory (previous_dir);
                return;
        }
 
        FILE* o = fopen_boost (out, "w");
        if (!o) {
                LOG_ERROR_NC (N_("ffprobe call failed (could not create output file)"));
-               SetCurrentDirectory (previous_dir);
                return;
        }
 
@@ -180,8 +174,6 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
        CloseHandle (process_info.hProcess);
        CloseHandle (process_info.hThread);
        CloseHandle (child_stderr_read);
-
-       SetCurrentDirectory (previous_dir);
 }
 
 list<pair<string, string> >
@@ -353,12 +345,6 @@ home_directory ()
        return boost::filesystem::path(getenv("HOMEDRIVE")) / boost::filesystem::path(getenv("HOMEPATH"));
 }
 
-string
-command_and_read (string)
-{
-       return "";
-}
-
 /** @return true if this process is a 32-bit one running on a 64-bit-capable OS */
 bool
 running_32_on_64 ()
@@ -643,3 +629,9 @@ disk_write_finished ()
 }
 
 
+string
+dcpomatic::get_process_id ()
+{
+       return dcp::raw_convert<string>(GetCurrentProcessId());
+}
+