diff --git a/include/usvfs.h b/include/usvfs.h
index 38027618..2f842816 100644
--- a/include/usvfs.h
+++ b/include/usvfs.h
@@ -176,7 +176,8 @@ DLLEXPORT void WINAPI USVFSInitParameters(USVFSParameters *parameters,
bool debugMode,
LogLevel logLevel,
CrashDumpsType crashDumpsType,
- const char *crashDumpsPath);
+ const char *crashDumpsPath,
+ std::chrono::milliseconds delayProcess={});
DLLEXPORT int WINAPI CreateMiniDump(PEXCEPTION_POINTERS exceptionPtrs, CrashDumpsType type, const wchar_t* dumpPath);
diff --git a/include/usvfsparameters.h b/include/usvfsparameters.h
index c6461d30..7aaf4d73 100644
--- a/include/usvfsparameters.h
+++ b/include/usvfsparameters.h
@@ -22,6 +22,7 @@ along with usvfs. If not, see .
#include "logging.h"
#include "dllimport.h"
+#include
enum class CrashDumpsType : uint8_t {
None,
@@ -40,6 +41,7 @@ struct USVFSParameters {
LogLevel logLevel{LogLevel::Debug};
CrashDumpsType crashDumpsType{CrashDumpsType::None};
char crashDumpsPath[260];
+ std::chrono::milliseconds delayProcess{0};
};
}
diff --git a/src/usvfs_dll/usvfs.cpp b/src/usvfs_dll/usvfs.cpp
index 5779dd91..c0915009 100644
--- a/src/usvfs_dll/usvfs.cpp
+++ b/src/usvfs_dll/usvfs.cpp
@@ -327,6 +327,10 @@ void __cdecl InitHooks(LPVOID parameters, size_t)
usvfs_dump_type = params->crashDumpsType;
usvfs_dump_path = ush::string_cast(params->crashDumpsPath, ush::CodePage::UTF8);
+ if (params->delayProcess.count() > 0) {
+ ::Sleep(static_cast(params->delayProcess.count()));
+ }
+
SetLogLevel(params->logLevel);
if (exceptionHandler == nullptr) {
@@ -775,11 +779,14 @@ void WINAPI USVFSInitParameters(USVFSParameters *parameters,
const char *instanceName, bool debugMode,
LogLevel logLevel,
CrashDumpsType crashDumpsType,
- const char *crashDumpsPath)
+ const char *crashDumpsPath,
+ std::chrono::milliseconds delayProcess)
{
parameters->debugMode = debugMode;
parameters->logLevel = logLevel;
parameters->crashDumpsType = crashDumpsType;
+ parameters->delayProcess = delayProcess;
+
strncpy_s(parameters->instanceName, instanceName, _TRUNCATE);
if (crashDumpsPath && *crashDumpsPath && strlen(crashDumpsPath) < _countof(parameters->crashDumpsPath)) {
memcpy(parameters->crashDumpsPath, crashDumpsPath, strlen(crashDumpsPath)+1);