aboutsummaryrefslogtreecommitdiff
path: root/zenserver/testing/launch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/testing/launch.cpp')
-rw-r--r--zenserver/testing/launch.cpp53
1 files changed, 43 insertions, 10 deletions
diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp
index 55695ac9c..569bf99e0 100644
--- a/zenserver/testing/launch.cpp
+++ b/zenserver/testing/launch.cpp
@@ -9,17 +9,21 @@
#include <zencore/iobuffer.h>
#include <zencore/iohash.h>
#include <zencore/logging.h>
-#include <zencore/windows.h>
-#include <zenstore/CAS.h>
-
-#include <AccCtrl.h>
-#include <AclAPI.h>
-#include <sddl.h>
-
-#include <UserEnv.h>
-#pragma comment(lib, "UserEnv.lib")
+#include <zenstore/cas.h>
+
+#if ZEN_PLATFORM_WINDOWS
+# include <zencore/windows.h>
+
+ZEN_THIRD_PARTY_INCLUDES_START
+# include <AccCtrl.h>
+# include <AclAPI.h>
+# include <atlbase.h>
+# include <sddl.h>
+# include <UserEnv.h>
+ZEN_THIRD_PARTY_INCLUDES_END
+# pragma comment(lib, "UserEnv.lib")
+#endif
-#include <atlbase.h>
#include <filesystem>
#include <span>
@@ -27,6 +31,7 @@ using namespace std::literals;
namespace zen {
+#if ZEN_PLATFORM_WINDOWS
struct BasicJob
{
public:
@@ -126,7 +131,19 @@ BasicJob::ExitCode()
return gsl::narrow_cast<int>(Ec);
}
+#else
+ struct BasicJob
+ {
+ void SetWorkingDirectory(...);
+ void SpawnJob(...);
+ void Wait();
+ int32_t ExitCode();
+ };
+#endif // ZEN_PLATFORM_WINDOWS
+////////////////////////////////////////////////////////////////////////////////
+
+#if ZEN_PLATFORM_WINDOWS
struct SandboxedJob
{
SandboxedJob() = default;
@@ -316,6 +333,10 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath)
return true;
}
+#else
+#endif // ZEN_PLATFORM_WINDOWS
+
+////////////////////////////////////////////////////////////////////////////////
HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::path& SandboxBaseDir)
: m_Log(logging::Get("exec"))
@@ -336,6 +357,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat
case HttpVerb::kPost:
break;
+
+ default:
+ break;
}
},
HttpVerb::kGet | HttpVerb::kPost);
@@ -362,6 +386,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat
Job.SpawnJob("c:\\windows\\system32\\cmd.exe");
}
break;
+
+ default:
+ break;
}
},
HttpVerb::kGet | HttpVerb::kPost);
@@ -413,6 +440,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat
return HttpReq.WriteResponse(HttpResponseCode::OK, Response);
}
break;
+
+ default:
+ break;
}
},
HttpVerb::kPost);
@@ -496,6 +526,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat
return HttpReq.WriteResponse(HttpResponseCode::OK, Response.Save());
}
break;
+
+ default:
+ break;
}
},
HttpVerb::kGet | HttpVerb::kPost);