| 351 | } |
| 352 | |
| 353 | BOOL 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 | |
| 404 | CESERVER_REQ* CShellProc::NewCmdOnCreate(CmdOnCreateType aCmd, |
| 405 | LPCWSTR asAction, LPCWSTR asFile, LPCWSTR asParam, LPCWSTR asDir, |
no test coverage detected