Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by Jc ( 14 years ago )
//Creamos un tubo con nombre para el recron
hTuboRecron=CreateNamedPipe("\\\\.\\pipe\\tuboRecron",PIPE_ACCESS_INBOUND,0,10,0,0,INFINITE,NULL);
if(!hTuboRecron){
fprintf(stderr,"\nFallo en CreateNamedPipe del bucle principal\n");
ExitProcess(1);
}
/*Nos conectamos al namedPipe en espera de que recron avise*/
bRet=ConnectNamedPipe(hTuboRecron,NULL);
if(!bRet && GetLastError()!=ERROR_PIPE_CONNECTED){
fprintf(stderr,"\nFallo en ConnectNamedPipe del bucle principal\n");
ExitProcess(1);
}
/*Leemos lo que escribe recron en el NamedPipe */
bRet=ReadFile(hTuboRecron,&avisosRecron;,4,&nBytes;,NULL);
if(!bRet || nBytes != 4){
fprintf(stderr,"\nFallo al leer del NamedPipe en el bucle principal\n");
ExitProcess(1);
}
/*Avisamos a los hilos de que recron ha avisado y nos desconectamos del NamedPipe*/
recron=avisosRecron;
DisconnectNamedPipe(hTuboRecron);
retval = TRUE;
Revise this Paste
Children: 44555