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

Method LoadSrvMapping

src/ConEmuHk/ShellProcessor.cpp:353–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353BOOL CShellProc::LoadSrvMapping(BOOL bLightCheck /*= FALSE*/)
354{
355 if (!this)
356 {
357 _ASSERTEX(FALSE && "Object was not created!");
358 return FALSE;
359 }
360
361 if (gbPrepareDefaultTerminal)
362 {
363 // ghConWnd may be nullptr (if was started for devenv.exe) or NOT nullptr (after AllocConsole in *.vshost.exe)
364 //_ASSERTEX(ghConWnd!=nullptr && "ConWnd was not initialized");
365
366 // Parameters are stored in the registry now
367 if (!CDefTermHk::IsDefTermEnabled())
368 {
369 _ASSERTEX(gpDefTerm != nullptr);
370 LogShellString(L"LoadSrvMapping failed: !IsDefTermEnabled()");
371 return FALSE;
372 }
373
374 if (!CDefTermHk::LoadDefTermSrvMapping(m_SrvMapping))
375 {
376 LogShellString(L"LoadSrvMapping failed: !LoadDefTermSrvMapping()");
377 return FALSE;
378 }
379
380 _ASSERTE(m_SrvMapping.ComSpec.ConEmuExeDir[0] && m_SrvMapping.ComSpec.ConEmuBaseDir[0]);
381
382 return TRUE;
383 }
384
385 if (!m_SrvMapping.cbSize || (m_SrvMapping.hConEmuWndDc && !IsWindow(m_SrvMapping.hConEmuWndDc)))
386 {
387 if (!::LoadSrvMapping(ghConWnd, m_SrvMapping))
388 {
389 LogShellString(L"LoadSrvMapping failed: !::LoadSrvMapping()");
390 return FALSE;
391 }
392 _ASSERTE(m_SrvMapping.ComSpec.ConEmuExeDir[0] && m_SrvMapping.ComSpec.ConEmuBaseDir[0]);
393 }
394
395 if (!m_SrvMapping.hConEmuWndDc || !IsWindow(m_SrvMapping.hConEmuWndDc))
396 {
397 LogShellString(L"LoadSrvMapping failed: !::IsWindow()");
398 return FALSE;
399 }
400
401 return TRUE;
402}
403
404CESERVER_REQ* CShellProc::NewCmdOnCreate(CmdOnCreateType aCmd,
405 LPCWSTR asAction, LPCWSTR asFile, LPCWSTR asParam, LPCWSTR asDir,

Callers 4

DllStartFunction · 0.80
LoadModuleFailedFunction · 0.80
LogModuleLoadedFunction · 0.80
LogModuleUnloadedFunction · 0.80

Calls 1

LoadSrvMappingFunction · 0.85

Tested by

no test coverage detected