#include #include int main(void) { SECURITY_ATTRIBUTES sattr; HANDLE childstdoutrd, childstdoutwr, childstdoutrddup, file, pipe; PROCESS_INFORMATION pi; STARTUPINFO si; sattr.nLength = sizeof(SECURITY_ATTRIBUTES); sattr.bInheritHandle = TRUE; sattr.lpSecurityDescriptor = NULL; SetLastError(0); if (!CreatePipe(&childstdoutrd, &childstdoutwr, &sattr, 0)) printf("CreatePipe() failed: %lu\n", GetLastError()); else puts("ok"); CloseHandle(childstdoutrd); CloseHandle(childstdoutwr); return 0; }