- Timestamp:
- Dec 9, 2001, 10:19:28 PM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmcomm.cpp
r7583 r7596 1 /* $Id: hmcomm.cpp,v 1.3 1 2001-12-08 15:44:30sandervl Exp $ */1 /* $Id: hmcomm.cpp,v 1.32 2001-12-09 21:19:28 sandervl Exp $ */ 2 2 3 3 /* … … 634 634 ::SetLastError(ERROR_INVALID_PARAMETER); 635 635 return FALSE; 636 } 637 638 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) 639 { 640 return pDevData->iohandler->WaitForEvent(pHMHandleData->hWin32Handle, pDevData->dwEventMask, lpfdwEvtMask, 641 lpo, NULL, (DWORD)pDevData); 636 642 } 637 643 … … 666 672 else break; 667 673 668 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED)669 {670 return pDevData->iohandler->WaitForEvent(pHMHandleData->hWin32Handle, pDevData->dwEventMask, lpfdwEvtMask,671 lpo, NULL, (DWORD)pDevData);672 }673 674 DosSleep(TIMEOUT_COMM); 674 675 } … … 725 726 PHMDEVCOMDATA pDevData = (PHMDEVCOMDATA)pHMHandleData->lpHandlerData; 726 727 727 dprintf(("KERNEL32-WARNING: HMDeviceCommClass::GetOverlappedResult(%08xh,%08xh,%08xh,%08xh) partly implemented",728 dprintf(("KERNEL32-WARNING: HMDeviceCommClass::GetOverlappedResult(%08xh,%08xh,%08xh,%08xh)", 728 729 pHMHandleData->hHMHandle, lpOverlapped, lpcbTransfer, fWait)); 729 730 -
trunk/src/kernel32/overlappedio.cpp
r7567 r7596 1 /* $Id: overlappedio.cpp,v 1. 7 2001-12-07 14:13:38 sandervl Exp $ */1 /* $Id: overlappedio.cpp,v 1.8 2001-12-09 21:19:28 sandervl Exp $ */ 2 2 3 3 /* … … 428 428 { 429 429 LPASYNCIOREQUEST lpRequest, current; 430 DWORD dwLastError, dwResult; 430 431 431 432 if(!lpOverlapped || lpOverlapped->hEvent == 0) { 433 ::SetLastError(ERROR_INVALID_PARAMETER); 434 return FALSE; 435 } 436 if(!lpPollHandler) { 437 DebugInt3(); 432 438 ::SetLastError(ERROR_INVALID_PARAMETER); 433 439 return FALSE; … … 451 457 lpRequest->next = NULL; 452 458 459 lpOverlapped->Internal = ERROR_IO_PENDING; 460 lpOverlapped->InternalHigh = 0; 461 lpOverlapped->Offset = 0; 462 lpOverlapped->OffsetHigh = 0; 463 //reset overlapped semaphore to non-signalled 464 ::ResetEvent(lpOverlapped->hEvent); 465 466 //first check if the event has already occured; if so, return result 467 //immediately 468 dwLastError = lpPollHandler(lpRequest, &dwResult, &dwTimeOut); 469 if(dwLastError != ERROR_IO_PENDING) 470 { 471 dprintf(("OverlappedIOHandler::WaitForEvent %x: result %x, last error %d", lpOverlapped, dwResult, dwLastError)); 472 lpOverlapped->Internal = dwLastError; 473 lpOverlapped->InternalHigh = dwResult; 474 if(lpfdwEvtMask) { 475 *lpfdwEvtMask = dwResult; 476 } 477 //wake up user thread 478 ::SetEvent(lpOverlapped->hEvent); 479 480 delete lpRequest; 481 ::SetLastError(dwLastError); 482 return (dwLastError == ERROR_SUCCESS); 483 } 484 453 485 ::EnterCriticalSection(&critsect); 454 486 if(pending[ASYNC_INDEX_POLL]) { … … 462 494 ::LeaveCriticalSection(&critsect); 463 495 464 lpOverlapped->Internal = ERROR_IO_PENDING;465 lpOverlapped->InternalHigh = 0;466 lpOverlapped->Offset = 0;467 lpOverlapped->OffsetHigh = 0;468 //reset overlapped semaphore to non-signalled469 ::ResetEvent(lpOverlapped->hEvent);470 471 496 //wake up async thread 472 497 ::SetEvent(hEventPoll); … … 514 539 ::SetLastError(lpOverlapped->Internal); 515 540 541 dprintf(("GetOverlappedResult %x -> result %d last error %d", hHandle, lpOverlapped->InternalHigh, lpOverlapped->Internal)); 516 542 return (ret == WAIT_OBJECT_0); 517 543 }
Note:
See TracChangeset
for help on using the changeset viewer.