Ignore:
Timestamp:
Dec 10, 2001, 1:55:13 PM (24 years ago)
Author:
sandervl
Message:

overlapped io updates & fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/overlappedio.cpp

    r7603 r7604  
    1 /* $Id: overlappedio.cpp,v 1.10 2001-12-10 11:29:01 sandervl Exp $ */
     1/* $Id: overlappedio.cpp,v 1.11 2001-12-10 12:55:12 sandervl Exp $ */
    22
    33/*
     
    5555    dprintf(("OverlappedIOThread: hEventRead %x hEventWrite %x hEventPoll %x", hEventRead, hEventWrite, hEventPoll));
    5656
    57     //the exit event semaphore is manual reset, because this event
     57    //the exit & cancel event semaphores are manual reset, because these events
    5858    //must be able to wake up multiple threads
    5959    hEventExit   = ::CreateEventA(NULL, TRUE, FALSE, NULL);
    60     if(!hEventPoll || !hEventRead || !hEventWrite || !hEventExit)
     60    hEventCancel = ::CreateEventA(NULL, TRUE, FALSE, NULL);
     61    if(!hEventPoll || !hEventRead || !hEventWrite || !hEventExit || !hEventCancel)
    6162    {
    6263        DebugInt3();
     
    254255
    255256            case ASYNCIO_POLL:
    256                 hEventsWait[0] = lpRequest->hEventCancel;
     257                hEventsWait[0] = hEventCancel;
    257258                hEventsWait[1] = hEventExit;
    258259                ret = WAIT_TIMEOUT;
     
    349350    ::LeaveCriticalSection(&critsect);
    350351
    351     lpOverlapped->Internal     = ERROR_IO_PENDING;
     352    lpOverlapped->Internal     = STATUS_PENDING;
    352353    lpOverlapped->InternalHigh = 0;
    353354    lpOverlapped->Offset       = 0;
     
    407408    ::LeaveCriticalSection(&critsect);
    408409
    409     lpOverlapped->Internal     = ERROR_IO_PENDING;
     410    lpOverlapped->Internal     = STATUS_PENDING;
    410411    lpOverlapped->InternalHigh = 0;
    411412    lpOverlapped->Offset       = 0;
     
    459460    lpRequest->next                = NULL;
    460461
    461     lpOverlapped->Internal     = ERROR_IO_PENDING;
     462    lpOverlapped->Internal     = STATUS_PENDING;
    462463    lpOverlapped->InternalHigh = 0;
    463464    lpOverlapped->Offset       = 0;
     
    509510    for(int i=ASYNC_INDEX_READ;i<NR_ASYNC_OPERATIONS;i++)
    510511    {
    511         while(TRUE) {
     512        while(TRUE)
     513        {
    512514            lpRequest = findAndRemoveRequest(i, hHandle);
    513515
    514516            if(lpRequest) {
    515                  ::SetEvent(lpRequest->hEventCancel);   //cancel pending operation
     517                 //TODO: This doesn't work if multiple handles share the
     518                 //      same OverlappedIOHandler
     519                 lpRequest->fCancelled = TRUE;
     520                 ::SetEvent(hEventCancel);   //cancel pending operation
    516521                 if(i != ASYNC_INDEX_BUSY) {//thread that handles the request will delete it
    517522                    delete lpRequest;
Note: See TracChangeset for help on using the changeset viewer.