MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcessSetupOutputPipeFile

Function kwsysProcessSetupOutputPipeFile

Source/kwsys/ProcessWin32.c:1799–1824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1797}
1798
1799DWORD kwsysProcessSetupOutputPipeFile(PHANDLE phandle, char const* name)
1800{
1801 HANDLE fout;
1802 wchar_t* wname;
1803 DWORD error;
1804 if (!name) {
1805 return ERROR_INVALID_PARAMETER;
1806 }
1807
1808 /* Close the existing handle. */
1809 kwsysProcessCleanupHandle(phandle);
1810
1811 /* Create a handle to write a file for the pipe. */
1812 wname = kwsysEncoding_DupToWide(name);
1813 fout =
1814 CreateFileW(wname, GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
1815 error = GetLastError();
1816 free(wname);
1817 if (fout == INVALID_HANDLE_VALUE) {
1818 return error;
1819 }
1820
1821 /* Assign the replacement handle. */
1822 *phandle = fout;
1823 return ERROR_SUCCESS;
1824}
1825
1826void kwsysProcessSetupSharedPipe(DWORD nStdHandle, PHANDLE handle)
1827{

Callers 1

kwsysProcess_ExecuteFunction · 0.70

Calls 2

kwsysEncoding_DupToWideFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…