MCPcopy Create free account
hub / github.com/ConEmu/ConEmu / LogModuleLoaded

Function LogModuleLoaded

src/ConEmuHk/SetHook.cpp:1980–2029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1978
1979
1980void LogModuleLoaded(LPCWSTR pwszModule, HMODULE hModule)
1981{
1982 // Update gnExeFlags
1983 // For cmd.exe
1984 if (gbIsCmdProcess || gbIsPowerShellProcess)
1985 {
1986 if (lstrcmpi(PointToName(pwszModule), CLINK_DLL_NAME_v1) == 0
1987 || lstrcmpi(PointToName(pwszModule), CLINK_DLL_NAME_v0) == 0)
1988 gnExeFlags |= caf_Clink;
1989 }
1990
1991 CShellProc* sp = nullptr;
1992
1993 if (!gnLastLogSetChange || ((GetTickCount() - gnLastLogSetChange) > 2000))
1994 {
1995 sp = new CShellProc();
1996 if (sp)
1997 {
1998 gnLastLogSetChange = GetTickCount();
1999 gbLogLibraries = sp->LoadSrvMapping(TRUE) && sp->GetLogLibraries();
2000 }
2001 }
2002 else if (gbLogLibraries)
2003 {
2004 sp = new CShellProc();
2005 if (!sp)
2006 {
2007 gbLogLibraries = FALSE;
2008 }
2009 }
2010
2011 if (gbLogLibraries)
2012 {
2013 CESERVER_REQ* pIn = nullptr;
2014
2015 wchar_t szInfo[64] = L"";
2016 FormatModuleHandle(hModule, L"Module=0x%08X", L"Module=0x%08X%08X", szInfo, countof(szInfo));
2017
2018 pIn = sp->NewCmdOnCreate(eLoadLibrary, nullptr, pwszModule, szInfo, nullptr, nullptr, nullptr, nullptr, nullptr, WIN3264TEST(32,64), 0, nullptr, nullptr, nullptr);
2019 if (pIn)
2020 {
2021 const MWnd hConWnd(GetRealConsoleWindow());
2022 CESERVER_REQ* pOut = ExecuteGuiCmd(hConWnd, pIn, hConWnd);
2023 ExecuteFreeResult(pIn);
2024 if (pOut) ExecuteFreeResult(pOut);
2025 }
2026 }
2027
2028 SafeDelete(sp);
2029}
2030
2031void LogModuleUnloaded(LPCWSTR pwszModule, HMODULE hModule)
2032{

Callers 1

PrepareNewModuleFunction · 0.85

Calls 9

PointToNameFunction · 0.85
FormatModuleHandleFunction · 0.85
ExecuteGuiCmdFunction · 0.85
ExecuteFreeResultFunction · 0.85
SafeDeleteFunction · 0.85
LoadSrvMappingMethod · 0.80
GetLogLibrariesMethod · 0.80
NewCmdOnCreateMethod · 0.80
GetRealConsoleWindowFunction · 0.70

Tested by

no test coverage detected