MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / handleIsRedirected

Function handleIsRedirected

app/src/Platform/AppPlatform.cpp:183–191  ·  view source on GitHub ↗

* @brief True when a std handle is wired to a pipe or disk file (redirection, not a console). */

Source from the content-addressed store, hash-verified

181 * @brief True when a std handle is wired to a pipe or disk file (redirection, not a console).
182 */
183static bool handleIsRedirected(DWORD stdHandle)
184{
185 const HANDLE h = GetStdHandle(stdHandle);
186 if (h == nullptr || h == INVALID_HANDLE_VALUE)
187 return false;
188
189 const DWORD type = GetFileType(h) & ~static_cast<DWORD>(FILE_TYPE_REMOTE);
190 return type == FILE_TYPE_DISK || type == FILE_TYPE_PIPE;
191}
192
193/**
194 * @brief Wires a CRT stream to the inherited std handle so a GUI-subsystem build honors

Callers 1

attachToConsoleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected