|
@@ -21,7 +21,6 @@ char appname_[50];
|
|
|
const char *const appname = appname_;
|
|
const char *const appname = appname_;
|
|
|
extern const bool share_can_be_downstream = false;
|
|
extern const bool share_can_be_downstream = false;
|
|
|
extern const bool share_can_be_upstream = false;
|
|
extern const bool share_can_be_upstream = false;
|
|
|
-THierarchicalStorage * PuttyStorage = NULL;
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
|
extern "C"
|
|
extern "C"
|
|
|
{
|
|
{
|
|
@@ -466,7 +465,8 @@ ScpSeat::ScpSeat(TSecureShell * ASecureShell)
|
|
|
vt = &ScpSeatVtable;
|
|
vt = &ScpSeatVtable;
|
|
|
}
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
|
-static std::unique_ptr<TCriticalSection> PuttyRegistrySection(TraceInitPtr(new TCriticalSection()));
|
|
|
|
|
|
|
+std::unique_ptr<TCriticalSection> PuttyStorageSection(TraceInitPtr(new TCriticalSection()));
|
|
|
|
|
+THierarchicalStorage * PuttyStorage = NULL;
|
|
|
enum TPuttyRegistryMode { prmPass, prmRedirect, prmCollect, prmFail };
|
|
enum TPuttyRegistryMode { prmPass, prmRedirect, prmCollect, prmFail };
|
|
|
static TPuttyRegistryMode PuttyRegistryMode = prmRedirect;
|
|
static TPuttyRegistryMode PuttyRegistryMode = prmRedirect;
|
|
|
typedef std::map<UnicodeString, unsigned long> TPuttyRegistryTypes;
|
|
typedef std::map<UnicodeString, unsigned long> TPuttyRegistryTypes;
|
|
@@ -482,7 +482,7 @@ void putty_registry_pass(bool enable)
|
|
|
{
|
|
{
|
|
|
if (enable)
|
|
if (enable)
|
|
|
{
|
|
{
|
|
|
- PuttyRegistrySection->Enter();
|
|
|
|
|
|
|
+ PuttyStorageSection->Enter();
|
|
|
DebugAssert(PuttyRegistryMode == prmRedirect);
|
|
DebugAssert(PuttyRegistryMode == prmRedirect);
|
|
|
PuttyRegistryMode = prmPass;
|
|
PuttyRegistryMode = prmPass;
|
|
|
}
|
|
}
|
|
@@ -490,7 +490,7 @@ void putty_registry_pass(bool enable)
|
|
|
{
|
|
{
|
|
|
DebugAssert(PuttyRegistryMode == prmPass);
|
|
DebugAssert(PuttyRegistryMode == prmPass);
|
|
|
PuttyRegistryMode = prmRedirect;
|
|
PuttyRegistryMode = prmRedirect;
|
|
|
- PuttyRegistrySection->Leave();
|
|
|
|
|
|
|
+ PuttyStorageSection->Leave();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
@@ -1511,7 +1511,7 @@ void WritePuttySettings(THierarchicalStorage * Storage, const UnicodeString & AS
|
|
|
{
|
|
{
|
|
|
if (PuttyRegistryTypes.empty())
|
|
if (PuttyRegistryTypes.empty())
|
|
|
{
|
|
{
|
|
|
- TGuard Guard(PuttyRegistrySection.get());
|
|
|
|
|
|
|
+ TGuard Guard(PuttyStorageSection.get());
|
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmCollect);
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmCollect);
|
|
|
Conf * conf = conf_new();
|
|
Conf * conf = conf_new();
|
|
|
try
|
|
try
|
|
@@ -1556,14 +1556,14 @@ void WritePuttySettings(THierarchicalStorage * Storage, const UnicodeString & AS
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
|
void PuttyDefaults(Conf * conf)
|
|
void PuttyDefaults(Conf * conf)
|
|
|
{
|
|
{
|
|
|
- TGuard Guard(PuttyRegistrySection.get());
|
|
|
|
|
|
|
+ TGuard Guard(PuttyStorageSection.get());
|
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmFail);
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmFail);
|
|
|
do_defaults(NULL, conf);
|
|
do_defaults(NULL, conf);
|
|
|
}
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
|
void SavePuttyDefaults(const UnicodeString & Name)
|
|
void SavePuttyDefaults(const UnicodeString & Name)
|
|
|
{
|
|
{
|
|
|
- TGuard Guard(PuttyRegistrySection.get());
|
|
|
|
|
|
|
+ TGuard Guard(PuttyStorageSection.get());
|
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmPass);
|
|
TValueRestorer<TPuttyRegistryMode> PuttyRegistryModeRestorer(PuttyRegistryMode, prmPass);
|
|
|
Conf * conf = conf_new();
|
|
Conf * conf = conf_new();
|
|
|
try
|
|
try
|