From 9ca181cec12f9ad84eb402e523f8eccf656cc361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 8 Jun 2024 18:18:22 +0200 Subject: [PATCH] Update for new USVFS function scheme. --- src/spawn.cpp | 3 ++- src/usvfsconnector.cpp | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/spawn.cpp b/src/spawn.cpp index ae5c86ee5..404d14e2e 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -457,7 +457,8 @@ DWORD spawn(const SpawnParameters& sp, HANDLE& processHandle) const DWORD flags = CREATE_BREAKAWAY_FROM_JOB; if (sp.hooked) { - success = ::CreateProcessHooked(nullptr, const_cast(wcommandLine.c_str()), + success = ::usvfsCreateProcessHooked( + nullptr, const_cast(wcommandLine.c_str()), nullptr, nullptr, inheritHandles, flags, nullptr, wcwd.c_str(), &si, &pi); } else { diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 940d0942d..0e2d97274 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -70,7 +70,7 @@ void LogWorker::process() int noLogCycles = 0; while (!m_QuitRequested) { - if (GetLogMessages(&m_Buffer[0], m_Buffer.size(), false)) { + if (usvfsGetLogMessages(&m_Buffer[0], m_Buffer.size(), false)) { m_LogFile.write(m_Buffer.c_str()); m_LogFile.write("\n"); m_LogFile.flush(); @@ -142,7 +142,7 @@ UsvfsConnector::UsvfsConnector() usvfsSetCrashDumpPath(params, dumpPath.c_str()); usvfsSetProcessDelay(params, delay.count()); - InitLogging(false); + usvfsInitLogging(false); log::debug("initializing usvfs:\n" " . instance: {}\n" @@ -154,13 +154,13 @@ UsvfsConnector::UsvfsConnector() usvfsCreateVFS(params); usvfsFreeParameters(params); - ClearExecutableBlacklist(); + usvfsClearExecutableBlacklist(); for (auto exec : s.executablesBlacklist().split(";")) { std::wstring buf = exec.toStdWString(); - BlacklistExecutable(buf.data()); + usvfsBlacklistExecutable(buf.data()); } - ClearLibraryForceLoads(); + usvfsClearLibraryForceLoads(); m_LogWorker.moveToThread(&m_WorkerThread); @@ -172,7 +172,7 @@ UsvfsConnector::UsvfsConnector() UsvfsConnector::~UsvfsConnector() { - DisconnectVFS(); + usvfsDisconnectVFS(); m_LogWorker.exit(); m_WorkerThread.quit(); m_WorkerThread.wait(); @@ -193,11 +193,11 @@ void UsvfsConnector::updateMapping(const MappingType& mapping) log::debug("Updating VFS mappings..."); - ClearVirtualMappings(); + usvfsClearVirtualMappings(); for (auto map : mapping) { if (progress.wasCanceled()) { - ClearVirtualMappings(); + usvfsClearVirtualMappings(); throw UsvfsConnectorException("VFS mapping canceled by user"); } progress.setValue(value++); @@ -206,12 +206,12 @@ void UsvfsConnector::updateMapping(const MappingType& mapping) } if (map.isDirectory) { - VirtualLinkDirectoryStatic( + usvfsVirtualLinkDirectoryStatic( map.source.toStdWString().c_str(), map.destination.toStdWString().c_str(), (map.createTarget ? LINKFLAG_CREATETARGET : 0) | LINKFLAG_RECURSIVE); ++dirs; } else { - VirtualLinkFile(map.source.toStdWString().c_str(), + usvfsVirtualLinkFile(map.source.toStdWString().c_str(), map.destination.toStdWString().c_str(), 0); ++files; } @@ -243,20 +243,20 @@ void UsvfsConnector::updateParams(MOBase::log::Levels logLevel, usvfsUpdateParameters(p); usvfsFreeParameters(p); - ClearExecutableBlacklist(); + usvfsClearExecutableBlacklist(); for (auto exec : executableBlacklist.split(";")) { std::wstring buf = exec.toStdWString(); - BlacklistExecutable(buf.data()); + usvfsBlacklistExecutable(buf.data()); } } void UsvfsConnector::updateForcedLibraries( const QList& forcedLibraries) { - ClearLibraryForceLoads(); + usvfsClearLibraryForceLoads(); for (auto setting : forcedLibraries) { if (setting.enabled()) { - ForceLoadLibrary(setting.process().toStdWString().data(), + usvfsForceLoadLibrary(setting.process().toStdWString().data(), setting.library().toStdWString().data()); } } @@ -269,7 +269,7 @@ std::vector getRunningUSVFSProcesses() { size_t count = 0; DWORD* buffer = nullptr; - if (!::GetVFSProcessList2(&count, &buffer)) { + if (!::usvfsGetVFSProcessList2(&count, &buffer)) { log::error("failed to get usvfs process list"); return {}; }