SECURITY_ATTRIBUTES sa;
Sa. NLength=sizeof (SECURITY_ATTRIBUTES);
Sa. The lpSecurityDescriptor=NULL;
Sa. BInheritHandle=TRUE;
if (! The CreatePipe (& amp; G_stdoutPipR, & amp; G_stdoutPipW, & amp; Sa, 0))
{
Printf (" stdout pipe creation failed \ n ");
return;
}
* stdout=* _fdopen (_open_osfhandle ((long) g_stdoutPipW, _O_TEXT), "w");
Setvbuf (_IONBF stdout, NULL, 0);
CodePudding user response:
Set a breakpoint at every step of success?_open_osfhandle prototype
int _open_osfhandle (intptr_t osfhandle, int flags)
Suggest using the
_open_osfhandle ((intptr_t) XXX, long under a 64 - bit system will be truncated