Reverted print used libs

This commit is contained in:
Jerry 2015-07-09 17:29:48 -07:00
parent 9759cfe458
commit ed034db2aa
4 changed files with 1 additions and 60 deletions

View File

@ -41,26 +41,19 @@ public:
Returns a string identifying the platform this OS is running on.
*/
virtual std::string getPlatformName() const = 0;
//@}
//! Get a Synergy setting
/*!
Reads a Synergy setting from the system.
*/
virtual std::string setting(const std::string& valueName) const = 0;
//@}
//! Set a Synergy setting
/*!
Writes a Synergy setting from the system.
*/
virtual void setting(const std::string& valueName, const std::string& valueString) const = 0;
//@}
//! Get the pathnames of the libraries used by Synergy
/*
Returns a string containing the full path names of all loaded libraries at the point it is called.
*/
virtual std::string getLibsUsed(void) const = 0;
//@}
};

View File

@ -159,38 +159,3 @@ ArchSystemWindows::isWOW64() const
return false;
}
#pragma comment(lib, "psapi")
std::string
ArchSystemWindows::getLibsUsed(void) const
{
HMODULE hMods[1024];
HANDLE hProcess;
DWORD cbNeeded;
unsigned int i;
char hex[16];
DWORD pid = GetCurrentProcessId();
std::string msg = "pid:" + std::to_string((_ULonglong)pid) + "\n";
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
if (NULL == hProcess) {
return msg;
}
if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded)) {
for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++) {
TCHAR szModName[MAX_PATH];
if (GetModuleFileNameEx(hProcess, hMods[i], szModName, sizeof(szModName) / sizeof(TCHAR))) {
sprintf(hex,"(0x%08X)",hMods[i]);
msg += szModName;
msg.append(hex);
msg.append("\n");
}
}
}
CloseHandle(hProcess);
return msg;
}

View File

@ -33,7 +33,6 @@ public:
virtual std::string getPlatformName() const;
virtual std::string setting(const std::string& valueName) const;
virtual void setting(const std::string& valueName, const std::string& valueString) const;
virtual std::string getLibsUsed(void) const;
bool isWOW64() const;
};

View File

@ -33,20 +33,6 @@ SecureListenSocket* g_secureListenSocket = NULL;
Arch* g_arch = NULL;
Log* g_log = NULL;
std::string
helperGetLibsUsed(void)
{
std::stringstream libs(ARCH->getLibsUsed());
std::string msg;
std::string pid;
std::getline(libs,pid);
while( std::getline(libs,msg) ) {
LOG(( CLOG_DEBUG "libs:%s",msg.c_str()));
}
return pid;
}
extern "C" {
void
init(void* log, void* arch)
@ -58,8 +44,6 @@ init(void* log, void* arch)
if (g_arch == NULL) {
Arch::setInstance(reinterpret_cast<Arch*>(arch));
}
LOG(( CLOG_DEBUG "library use: %s", helperGetLibsUsed().c_str()));
}
int