forked from TanninOne/usvfs
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ModOrganizer2/Develop
Stage for release 2.2.2
- Loading branch information
Showing
41 changed files
with
996 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,7 @@ | |
*.vcxproj.user | ||
msbuild.log | ||
|
||
/stderr.log | ||
/stderr_32.log | ||
/stdout.log | ||
/stdout_32.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#pragma once | ||
|
||
#include "usvfsparameters.h" | ||
#include "dllimport.h" | ||
#include <shared_memory.h> | ||
|
||
#include <string> | ||
#include <boost/interprocess/containers/string.hpp> | ||
#include <boost/interprocess/containers/flat_set.hpp> | ||
#include <boost/interprocess/containers/slist.hpp> | ||
|
||
namespace usvfs | ||
{ | ||
|
||
class ForcedLibrary | ||
{ | ||
public: | ||
ForcedLibrary( | ||
const std::string& processName, const std::string& libraryPath, | ||
const shared::VoidAllocatorT &allocator); | ||
|
||
std::string processName() const; | ||
std::string libraryPath() const; | ||
|
||
private: | ||
shared::StringT m_processName; | ||
shared::StringT m_libraryPath; | ||
}; | ||
|
||
|
||
class DLLEXPORT SharedParameters | ||
{ | ||
public: | ||
SharedParameters() = delete; | ||
SharedParameters(const SharedParameters &reference) = delete; | ||
SharedParameters &operator=(const SharedParameters &reference) = delete; | ||
|
||
SharedParameters(const usvfsParameters& reference, | ||
const shared::VoidAllocatorT &allocator); | ||
|
||
usvfsParameters makeLocal() const; | ||
|
||
std::string instanceName() const; | ||
std::string currentSHMName() const; | ||
std::string currentInverseSHMName() const; | ||
void setSHMNames(const std::string& current, const std::string& inverse); | ||
|
||
void setDebugParameters( | ||
LogLevel level, CrashDumpsType dumpType, const std::string& dumpPath, | ||
std::chrono::milliseconds delayProcess); | ||
|
||
std::size_t userConnected(); | ||
std::size_t userDisconnected(); | ||
std::size_t userCount(); | ||
|
||
std::size_t registeredProcessCount() const; | ||
std::vector<DWORD> registeredProcesses() const; | ||
void registerProcess(DWORD pid); | ||
void unregisterProcess(DWORD pid); | ||
|
||
void blacklistExecutable(const std::string& name); | ||
void clearExecutableBlacklist(); | ||
bool executableBlacklisted(const std::string& app, const std::string& cmd) const; | ||
|
||
void addForcedLibrary(const std::string& process, const std::string& path); | ||
std::vector<std::string> forcedLibraries(const std::string& processName); | ||
void clearForcedLibraries(); | ||
|
||
private: | ||
using StringAllocatorT = | ||
shared::VoidAllocatorT::rebind<shared::StringT>::other; | ||
|
||
using DWORDAllocatorT = shared::VoidAllocatorT::rebind<DWORD>::other; | ||
|
||
using ForcedLibraryAllocatorT = | ||
shared::VoidAllocatorT::rebind<ForcedLibrary>::other; | ||
|
||
|
||
using ProcessBlacklist = boost::container::flat_set< | ||
shared::StringT, std::less<shared::StringT>, StringAllocatorT>; | ||
|
||
using ProcessList = boost::container::flat_set< | ||
DWORD, std::less<DWORD>, DWORDAllocatorT>; | ||
|
||
using ForcedLibraries = boost::container::slist< | ||
ForcedLibrary, ForcedLibraryAllocatorT>; | ||
|
||
|
||
mutable bi::interprocess_mutex m_mutex; | ||
shared::StringT m_instanceName; | ||
shared::StringT m_currentSHMName; | ||
shared::StringT m_currentInverseSHMName; | ||
bool m_debugMode; | ||
LogLevel m_logLevel; | ||
CrashDumpsType m_crashDumpsType; | ||
shared::StringT m_crashDumpsPath; | ||
std::chrono::milliseconds m_delayProcess; | ||
uint32_t m_userCount; | ||
ProcessBlacklist m_processBlacklist; | ||
ProcessList m_processList; | ||
ForcedLibraries m_forcedLibraries; | ||
}; | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
#include "usvfsparameters.h" | ||
|
||
struct usvfsParameters | ||
{ | ||
char instanceName[65]; | ||
char currentSHMName[65]; | ||
char currentInverseSHMName[65]; | ||
bool debugMode; | ||
LogLevel logLevel{LogLevel::Debug}; | ||
CrashDumpsType crashDumpsType{CrashDumpsType::None}; | ||
char crashDumpsPath[260]; | ||
int delayProcessMs; | ||
|
||
usvfsParameters(); | ||
usvfsParameters(const usvfsParameters&) = default; | ||
usvfsParameters& operator=(const usvfsParameters&) = default; | ||
|
||
usvfsParameters( | ||
const char* instanceName, | ||
const char* currentSHMName, | ||
const char* currentInverseSHMName, | ||
bool debugMode, | ||
LogLevel logLevel, | ||
CrashDumpsType crashDumpsType, | ||
const char* crashDumpsPath, | ||
int delayProcessMs); | ||
|
||
usvfsParameters(const USVFSParameters& oldParams); | ||
|
||
void setInstanceName(const char* name); | ||
void setDebugMode(bool debugMode); | ||
void setLogLevel(LogLevel level); | ||
void setCrashDumpType(CrashDumpsType type); | ||
void setCrashDumpPath(const char* path); | ||
void setProcessDelay(int milliseconds); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.