Changeset 7927 for trunk/src


Ignore:
Timestamp:
Feb 15, 2002, 8:14:52 PM (24 years ago)
Author:
sandervl
Message:

pipe updates

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

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

    r7593 r7927  
    1 /* $Id: HandleManager.cpp,v 1.86 2001-12-09 16:00:30 bird Exp $ */
     1/* $Id: HandleManager.cpp,v 1.87 2002-02-15 19:14:50 sandervl Exp $ */
    22
    33/*
     
    43494349  }
    43504350
    4351   dprintf(("Win32 Handle -> %08x",iIndexNew));
    4352 
    43534351  return iIndexNew;
    43544352}
  • trunk/src/kernel32/dbgwrap.cpp

    r7898 r7927  
    902902#undef DBG_LOCALLOG
    903903#define DBG_LOCALLOG    DBG_char
    904 DEBUGWRAP4(CharLowerA)
    905 DEBUGWRAP8(CharLowerBuffA)
    906 DEBUGWRAP8(CharLowerBuffW)
    907 DEBUGWRAP4(CharLowerW)
    908 DEBUGWRAP4(CharNextA)
    909 DEBUGWRAP12(CharNextExA)
    910 DEBUGWRAP12(CharNextExW)
    911 DEBUGWRAP4(CharNextW)
    912 DEBUGWRAP8(CharPrevA)
    913 DEBUGWRAP16(CharPrevExA)
    914 DEBUGWRAP16(CharPrevExW)
    915 DEBUGWRAP8(CharPrevW)
    916 DEBUGWRAP8(CharToOemA)
    917 DEBUGWRAP12(CharToOemBuffA)
    918 DEBUGWRAP12(CharToOemBuffW)
    919 DEBUGWRAP8(CharToOemW)
    920 DEBUGWRAP4(CharUpperA)
    921 DEBUGWRAP8(CharUpperBuffA)
    922 DEBUGWRAP8(CharUpperBuffW)
    923 DEBUGWRAP4(CharUpperW)
    924 DEBUGWRAP4(IsCharAlphaA)
    925 DEBUGWRAP4(IsCharAlphaNumericA)
    926 DEBUGWRAP4(IsCharAlphaNumericW)
    927 DEBUGWRAP4(IsCharAlphaW)
    928 DEBUGWRAP4(IsCharLowerA)
    929 DEBUGWRAP4(IsCharLowerW)
    930 DEBUGWRAP4(IsCharUpperA)
    931 DEBUGWRAP4(IsCharUpperW)
    932 DEBUGWRAP8(OemToCharA)
    933 DEBUGWRAP12(OemToCharBuffA)
    934 DEBUGWRAP12(OemToCharBuffW)
    935 DEBUGWRAP8(OemToCharW)
     904DEBUGWRAP_LVL2_4(CharLowerA)
     905DEBUGWRAP_LVL2_8(CharLowerBuffA)
     906DEBUGWRAP_LVL2_8(CharLowerBuffW)
     907DEBUGWRAP_LVL2_4(CharLowerW)
     908DEBUGWRAP_LVL2_4(CharNextA)
     909DEBUGWRAP_LVL2_12(CharNextExA)
     910DEBUGWRAP_LVL2_12(CharNextExW)
     911DEBUGWRAP_LVL2_4(CharNextW)
     912DEBUGWRAP_LVL2_8(CharPrevA)
     913DEBUGWRAP_LVL2_16(CharPrevExA)
     914DEBUGWRAP_LVL2_16(CharPrevExW)
     915DEBUGWRAP_LVL2_8(CharPrevW)
     916DEBUGWRAP_LVL2_8(CharToOemA)
     917DEBUGWRAP_LVL2_12(CharToOemBuffA)
     918DEBUGWRAP_LVL2_12(CharToOemBuffW)
     919DEBUGWRAP_LVL2_8(CharToOemW)
     920DEBUGWRAP_LVL2_4(CharUpperA)
     921DEBUGWRAP_LVL2_8(CharUpperBuffA)
     922DEBUGWRAP_LVL2_8(CharUpperBuffW)
     923DEBUGWRAP_LVL2_4(CharUpperW)
     924DEBUGWRAP_LVL2_4(IsCharAlphaA)
     925DEBUGWRAP_LVL2_4(IsCharAlphaNumericA)
     926DEBUGWRAP_LVL2_4(IsCharAlphaNumericW)
     927DEBUGWRAP_LVL2_4(IsCharAlphaW)
     928DEBUGWRAP_LVL2_4(IsCharLowerA)
     929DEBUGWRAP_LVL2_4(IsCharLowerW)
     930DEBUGWRAP_LVL2_4(IsCharUpperA)
     931DEBUGWRAP_LVL2_4(IsCharUpperW)
     932DEBUGWRAP_LVL2_8(OemToCharA)
     933DEBUGWRAP_LVL2_12(OemToCharBuffA)
     934DEBUGWRAP_LVL2_12(OemToCharBuffW)
     935DEBUGWRAP_LVL2_8(OemToCharW)
  • trunk/src/kernel32/hmnpipe.cpp

    r7549 r7927  
    1 /* $Id: hmnpipe.cpp,v 1.7 2001-12-05 14:16:02 sandervl Exp $ */
     1/* $Id: hmnpipe.cpp,v 1.8 2002-02-15 19:14:51 sandervl Exp $ */
    22/*
    33 * Project Odin Software License can be found in LICENSE.TXT
     
    187187//******************************************************************************
    188188BOOL HMDeviceNamedPipeClass::CreatePipe(PHMHANDLEDATA pHMHandleDataRead,
    189                                          PHMHANDLEDATA pHMHandleDataWrite,
    190                                          LPSECURITY_ATTRIBUTES lpsa,
    191                                          DWORD         cbPipe)
     189                                        PHMHANDLEDATA pHMHandleDataWrite,
     190                                        LPSECURITY_ATTRIBUTES lpsa,
     191                                        DWORD         cbPipe)
    192192{
    193193  pHMHandleDataRead->dwInternalType  = HMTYPE_PIPE;
     
    204204    return(FALSE);
    205205}
    206 
    207 
    208206//******************************************************************************
    209207//******************************************************************************
     
    267265  return (FALSE);
    268266}
    269 
    270267//******************************************************************************
    271268//******************************************************************************
     
    290287                                    lpo));
    291288}
    292 
     289//******************************************************************************
     290//******************************************************************************
    293291BOOL HMDeviceNamedPipeClass::SetNamedPipeHandleState(PHMHANDLEDATA pHMHandleData,
    294292                                                LPDWORD lpdwMode,
     
    309307  return ret;
    310308}
    311 
    312 
     309//******************************************************************************
     310//******************************************************************************
    313311BOOL HMDeviceNamedPipeClass::GetOverlappedResult(PHMHANDLEDATA pHMHandleData,
    314312                                                 LPOVERLAPPED  arg2,
     
    318316   return (FALSE);
    319317}
     318/*****************************************************************************
     319 * Name      : BOOL HMDeviceNamedPipeClass::ReadFile
     320 * Purpose   : read data from handle / device
     321 * Parameters: PHMHANDLEDATA pHMHandleData,
     322 *             LPCVOID       lpBuffer,
     323 *             DWORD         nNumberOfBytesToRead,
     324 *             LPDWORD       lpNumberOfBytesRead,
     325 *             LPOVERLAPPED  lpOverlapped
     326 * Variables :
     327 * Result    : Boolean
     328 * Remark    :
     329 * Status    :
     330 *
     331 * Author    : SvL
     332 *****************************************************************************/
     333
     334BOOL HMDeviceNamedPipeClass::ReadFile(PHMHANDLEDATA pHMHandleData,
     335                                      LPCVOID       lpBuffer,
     336                                      DWORD         nNumberOfBytesToRead,
     337                                      LPDWORD       lpNumberOfBytesRead,
     338                                      LPOVERLAPPED  lpOverlapped,
     339                                      LPOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine)
     340{
     341  DWORD        bytesread;
     342  BOOL         bRC;
     343
     344  dprintfl(("KERNEL32: HMDeviceNamedPipeClass::ReadFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n",
     345           lpHMDeviceName,
     346           pHMHandleData,
     347           lpBuffer,
     348           nNumberOfBytesToRead,
     349           lpNumberOfBytesRead,
     350           lpOverlapped));
     351
     352  //This pointer can to be NULL
     353  if(lpNumberOfBytesRead)
     354    *lpNumberOfBytesRead = 0;
     355  else
     356    lpNumberOfBytesRead = &bytesread;
     357
     358  if((pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) && !lpOverlapped) {
     359    dprintf(("FILE_FLAG_OVERLAPPED flag set, but lpOverlapped NULL!!"));
     360    SetLastError(ERROR_INVALID_PARAMETER);
     361    return FALSE;
     362  }
     363  if(!(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) && lpOverlapped) {
     364    dprintf(("Warning: lpOverlapped != NULL & !FILE_FLAG_OVERLAPPED; sync operation"));
     365  }
     366  if(lpCompletionRoutine) {
     367      dprintf(("!WARNING!: lpCompletionRoutine not supported -> fall back to sync IO"));
     368  }
     369
     370  if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) {
     371    dprintf(("ERROR: Overlapped IO not yet implememented!!"));
     372  }
     373
     374  bRC = HMDeviceFileClass::WriteFile(pHMHandleData,
     375                                     lpBuffer,
     376                                     nNumberOfBytesToRead,
     377                                     lpNumberOfBytesRead,
     378                                     lpOverlapped, lpCompletionRoutine);
     379
     380  dprintf(("KERNEL32: HMDeviceNamedPipeClass::ReadFile returned %08xh; bytes written %d",
     381           bRC, *lpNumberOfBytesRead));
     382
     383  return bRC;
     384}
     385
     386
     387/*****************************************************************************
     388 * Name      : BOOL HMDeviceNamedPipeClass::WriteFile
     389 * Purpose   : write data to handle / device
     390 * Parameters: PHMHANDLEDATA pHMHandleData,
     391 *             LPCVOID       lpBuffer,
     392 *             DWORD         nNumberOfBytesToWrite,
     393 *             LPDWORD       lpNumberOfBytesWritten,
     394 *             LPOVERLAPPED  lpOverlapped
     395 * Variables :
     396 * Result    : Boolean
     397 * Remark    :
     398 * Status    :
     399 *
     400 * Author    : SvL
     401 *****************************************************************************/
     402
     403BOOL HMDeviceNamedPipeClass::WriteFile(PHMHANDLEDATA pHMHandleData,
     404                                       LPCVOID       lpBuffer,
     405                                       DWORD         nNumberOfBytesToWrite,
     406                                       LPDWORD       lpNumberOfBytesWritten,
     407                                       LPOVERLAPPED  lpOverlapped,
     408                                       LPOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine)
     409{
     410  DWORD        byteswritten;
     411  BOOL         bRC;
     412
     413  dprintfl(("KERNEL32: HMDeviceNamedPipeClass::WriteFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n",
     414           lpHMDeviceName,
     415           pHMHandleData,
     416           lpBuffer,
     417           nNumberOfBytesToWrite,
     418           lpNumberOfBytesWritten,
     419           lpOverlapped));
     420
     421  //This pointer can to be NULL
     422  if(lpNumberOfBytesWritten)
     423    *lpNumberOfBytesWritten = 0;
     424  else
     425    lpNumberOfBytesWritten = &byteswritten;
     426
     427  if((pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) && !lpOverlapped) {
     428    dprintf(("FILE_FLAG_OVERLAPPED flag set, but lpOverlapped NULL!!"));
     429    SetLastError(ERROR_INVALID_PARAMETER);
     430    return FALSE;
     431  }
     432  if(!(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) && lpOverlapped) {
     433    dprintf(("Warning: lpOverlapped != NULL & !FILE_FLAG_OVERLAPPED; sync operation"));
     434  }
     435
     436  if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) {
     437    dprintf(("ERROR: Overlapped IO not yet implememented!!"));
     438  }
     439  bRC = HMDeviceFileClass::WriteFile(pHMHandleData,
     440                                     lpBuffer,
     441                                     nNumberOfBytesToWrite,
     442                                     lpNumberOfBytesWritten,
     443                                     lpOverlapped, lpCompletionRoutine);
     444
     445  dprintf(("KERNEL32: HMDeviceNamedPipeClass::WriteFile returned %08xh; bytes written %d",
     446           bRC, *lpNumberOfBytesWritten));
     447
     448  return bRC;
     449}
     450//******************************************************************************
     451//******************************************************************************
  • trunk/src/kernel32/hmnpipe.h

    r7549 r7927  
    1 /* $Id: hmnpipe.h,v 1.5 2001-12-05 14:16:02 sandervl Exp $ */
     1/* $Id: hmnpipe.h,v 1.6 2002-02-15 19:14:52 sandervl Exp $ */
    22/*
    33 * Project Odin Software License can be found in LICENSE.TXT
     
    3636                             PVOID         lpSecurityAttributes,
    3737                             PHMHANDLEDATA pHMHandleDataTemplate);
     38
     39  /* this is a handler method for calls to ReadFile/Ex */
     40  virtual BOOL   ReadFile   (PHMHANDLEDATA pHMHandleData,
     41                             LPCVOID       lpBuffer,
     42                             DWORD         nNumberOfBytesToRead,
     43                             LPDWORD       lpNumberOfBytesRead,
     44                             LPOVERLAPPED  lpOverlapped,
     45                             LPOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine);
     46
     47  /* this is a handler method for calls to WriteFile/Ex */
     48  virtual BOOL   WriteFile  (PHMHANDLEDATA pHMHandleData,
     49                             LPCVOID       lpBuffer,
     50                             DWORD         nNumberOfBytesToWrite,
     51                             LPDWORD       lpNumberOfBytesWritten,
     52                             LPOVERLAPPED  lpOverlapped,
     53                             LPOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine);
    3854
    3955  /* this is a handler method for calls to GetFileType() */
  • trunk/src/kernel32/oslibdos.cpp

    r7865 r7927  
    1 /* $Id: oslibdos.cpp,v 1.95 2002-02-11 13:46:36 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.96 2002-02-15 19:14:52 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    17281728
    17291729  if(rc == NO_ERROR) {
    1730       dprintf(("Opening of existing named pipe succeeded"));
    1731       return hPipe;
     1730#if 0
     1731      //TODO:
     1732      if(dwOpenMode & FILE_FLAG_FIRST_PIPE_INSTANCE_W) {
     1733          DosClose(hPipe);
     1734          SetLastError(ERROR_ALREADY_EXISTS_W);
     1735          return -1;
     1736      }
     1737      else {
     1738#endif
     1739          dprintf(("Opening of existing named pipe succeeded"));
     1740          SetLastError(ERROR_SUCCESS_W);
     1741          return hPipe;
     1742//      }
    17321743  }
    17331744
     
    17461757    return -1; // INVALID_HANDLE_VALUE
    17471758  }
     1759  SetLastError(ERROR_SUCCESS_W);
    17481760  return hPipe;
    17491761}
     
    17691781    return FALSE;
    17701782  }
     1783  SetLastError(ERROR_SUCCESS_W);
    17711784  return TRUE;
    17721785}
     
    18591872  if(rc == NO_ERROR) {
    18601873      dprintf(("Opening of existing named pipe succeeded"));
     1874      SetLastError(ERROR_SUCCESS_W);
    18611875      return hPipe;
    18621876  }
     
    18761890  dprintf(("DosConnectNPipe rc=%d",rc));
    18771891
    1878   if (!rc) return (TRUE);
     1892  if(rc == NO_ERROR) {
     1893      SetLastError(ERROR_SUCCESS_W);
     1894      return (TRUE);
     1895  }
    18791896  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    1880 
    18811897  return (FALSE);
    18821898}
     
    19141930
    19151931
    1916   if (!rc) return (TRUE);
     1932  if(rc == NO_ERROR) {
     1933      SetLastError(ERROR_SUCCESS_W);
     1934      return (TRUE);
     1935  }
    19171936  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    1918 
    19191937  return (FALSE);
    19201938}
     
    19401958
    19411959  dprintf(("DosTransactNPipe returned rc=%d");)
    1942   if (!rc) return (TRUE);
     1960  if(rc == NO_ERROR) {
     1961      SetLastError(ERROR_SUCCESS_W);
     1962      return (TRUE);
     1963  }
    19431964  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    1944 
    19451965  return (FALSE);
    19461966}
     
    19671987    *lpcbAvail   = availData.cbpipe;
    19681988    *lpcbMessage = availData.cbmessage;
     1989    SetLastError(ERROR_SUCCESS_W);
    19691990    return (TRUE);
    19701991  }
    19711992  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    1972 
    19731993  return (FALSE);
    19741994}
     
    19832003  dprintf(("DosDisConnectNPipe returned rc=%d",rc));
    19842004
    1985   if (!rc) return TRUE;
     2005  if(rc == NO_ERROR) {
     2006      SetLastError(ERROR_SUCCESS_W);
     2007      return (TRUE);
     2008  }
    19862009  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    1987 
    19882010  return (FALSE);
    19892011}
     
    20102032  dprintf(("DosWaitNPipe returned rc=%d",rc));
    20112033
    2012   if (!rc) return TRUE;
     2034  if(rc == NO_ERROR) {
     2035      SetLastError(ERROR_SUCCESS_W);
     2036      return (TRUE);
     2037  }
    20132038  SetLastError(error2WinError(rc,ERROR_PIPE_NOT_CONNECTED_W));
    20142039
Note: See TracChangeset for help on using the changeset viewer.