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

Function LoadModuleFailed

src/ConEmuHk/SetHook.cpp:1729–1779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1727
1728
1729void LoadModuleFailed(LPCSTR asModuleA, LPCWSTR asModuleW)
1730{
1731 const DWORD dwErrCode = GetLastError();
1732
1733 if (!gnLastLogSetChange)
1734 {
1735 CShellProc* sp = new CShellProc();
1736 if (sp)
1737 {
1738 gnLastLogSetChange = GetTickCount();
1739 gbLogLibraries = sp->LoadSrvMapping() && sp->GetLogLibraries();
1740 delete sp;
1741 }
1742 SetLastError(dwErrCode);
1743 }
1744
1745 if (!gbLogLibraries)
1746 return;
1747
1748
1749 CESERVER_REQ* pIn = nullptr;
1750 wchar_t szModule[MAX_PATH+1]; szModule[0] = 0;
1751 wchar_t szErrCode[64]; szErrCode[0] = 0;
1752 msprintf(szErrCode, countof(szErrCode), L"ErrCode=0x%08X", dwErrCode);
1753 if (!asModuleA && !asModuleW)
1754 {
1755 wcscpy_c(szModule, L"<nullptr>");
1756 asModuleW = szModule;
1757 }
1758 else if (asModuleA)
1759 {
1760 MultiByteToWideChar(AreFileApisANSI() ? CP_ACP : CP_OEMCP, 0, asModuleA, -1, szModule, countof(szModule));
1761 szModule[countof(szModule)-1] = 0;
1762 asModuleW = szModule;
1763 }
1764 pIn = ExecuteNewCmdOnCreate(nullptr, ghConWnd, eLoadLibrary, L"Fail", asModuleW, szErrCode, L"", nullptr, nullptr, nullptr, nullptr,
1765 #ifdef _WIN64
1766 64
1767 #else
1768 32
1769 #endif
1770 , 0, nullptr, nullptr, nullptr);
1771 if (pIn)
1772 {
1773 const MWnd hConWnd(GetRealConsoleWindow());
1774 CESERVER_REQ* pOut = ExecuteGuiCmd(hConWnd, pIn, hConWnd);
1775 ExecuteFreeResult(pIn);
1776 if (pOut) ExecuteFreeResult(pOut);
1777 }
1778 SetLastError(dwErrCode);
1779}
1780
1781
1782void ProcessOnLibraryLoadedW(HMODULE module)

Callers 1

PrepareNewModuleFunction · 0.85

Calls 8

msprintfFunction · 0.85
wcscpy_cFunction · 0.85
ExecuteNewCmdOnCreateFunction · 0.85
ExecuteGuiCmdFunction · 0.85
ExecuteFreeResultFunction · 0.85
LoadSrvMappingMethod · 0.80
GetLogLibrariesMethod · 0.80
GetRealConsoleWindowFunction · 0.70

Tested by

no test coverage detected