Ignore:
Timestamp:
Dec 5, 2001, 7:06:02 PM (24 years ago)
Author:
sandervl
Message:

overlapped io updates

File:
1 edited

Legend:

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

    r7549 r7550  
    1 /* $Id: Fileio.cpp,v 1.58 2001-12-05 14:15:55 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.59 2001-12-05 18:05:58 sandervl Exp $ */
    22
    33/*
     
    679679      return TRUE;
    680680  }
     681  if(!lpOverlapped || !lpCompletionRoutine) {
     682      dprintf(("!WARNING!: !lpOverlapped || !lpCompletionRoutine"));
     683      SetLastError(ERROR_INVALID_PARAMETER);
     684      return FALSE;
     685  }
     686  //SDK docs say ReadFileEx will fail if this condition is true
     687  if(GetFileType(hFile) == FILE_TYPE_PIPE && (lpOverlapped->Offset || lpOverlapped->OffsetHigh)) {
     688      dprintf(("!WARNING!: lpOverlapped->Offset & lpOverlapped->OffsetHigh must be ZERO for named pipes"));
     689      SetLastError(ERROR_INVALID_PARAMETER);
     690      return FALSE;
     691  }
    681692  return (HMReadFile(hFile,
    682693                     lpBuffer,
     
    739750      return TRUE;
    740751  }
    741 
     752  if(!lpOverlapped || !lpCompletionRoutine) {
     753      dprintf(("!WARNING!: !lpOverlapped || !lpCompletionRoutine"));
     754      SetLastError(ERROR_INVALID_PARAMETER);
     755      return FALSE;
     756  }
     757  //SDK docs say WriteFileEx will fail if this condition is true
     758  if(GetFileType(hFile) == FILE_TYPE_PIPE && (lpOverlapped->Offset || lpOverlapped->OffsetHigh)) {
     759      dprintf(("!WARNING!: lpOverlapped->Offset & lpOverlapped->OffsetHigh must be ZERO for named pipes"));
     760      SetLastError(ERROR_INVALID_PARAMETER);
     761      return FALSE;
     762  }
    742763  return (HMWriteFile(hFile,
    743764                      (LPVOID)lpBuffer,
Note: See TracChangeset for help on using the changeset viewer.