Ignore:
Timestamp:
Jan 10, 2003, 4:19:54 PM (23 years ago)
Author:
sandervl
Message:

changes for inheritance (check security structure); workaround for PeekNamedPipe with unnamed pipes; support input/output redirection for child processes

File:
1 edited

Legend:

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

    r9653 r9660  
    1 /* $Id: oslibdos.cpp,v 1.111 2003-01-10 12:57:13 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.112 2003-01-10 15:19:54 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    18401840//******************************************************************************
    18411841BOOL OSLibDosPeekNamedPipe(DWORD   hPipe,
    1842                         LPVOID  lpvBuffer,
    1843                         DWORD   cbBuffer,
    1844                         LPDWORD lpcbRead,
    1845                         LPDWORD lpcbAvail,
    1846                         LPDWORD lpcbMessage)
     1842                           LPVOID  lpvBuffer,
     1843                           DWORD   cbBuffer,
     1844                           LPDWORD lpcbRead,
     1845                           LPDWORD lpcbAvail,
     1846                           LPDWORD lpcbMessage)
    18471847{
    18481848  DWORD     rc;
    18491849  AVAILDATA availData ={0};
    1850   ULONG     ulDummy;
    1851 
    1852   rc=DosPeekNPipe(hPipe,lpvBuffer,cbBuffer,lpcbRead,&availData,&ulDummy);
     1850  ULONG     ulState, ulRead, ulMessage;
     1851  char      buffer;
     1852
     1853  if(lpcbRead == NULL) {
     1854      lpcbRead = &ulRead;
     1855  }
     1856  if(lpcbMessage == NULL) {
     1857      lpcbMessage = &ulMessage;
     1858  }
     1859  if(lpvBuffer == NULL) {
     1860      lpvBuffer = &buffer;
     1861      cbBuffer = 0;
     1862  }
     1863
     1864  rc = DosPeekNPipe(hPipe,lpvBuffer,cbBuffer,lpcbRead,&availData,&ulState);
    18531865
    18541866  dprintf(("DosPeekNPipe returned rc=%d",rc));
    18551867
    1856   if (!rc)
    1857   {
    1858     *lpcbAvail   = availData.cbpipe;
    1859     *lpcbMessage = availData.cbmessage;
     1868  //OS/2 doesn't support DosPeekNPipe for unnamed pipes; win32 does
     1869  if (rc == 1) {
     1870     dprintf(("WARNING: Pretend broken pipe for PeekNamedPipe with unnamed pipe handle"));
     1871     SetLastError(ERROR_BROKEN_PIPE_W);
     1872     return FALSE;
     1873  }
     1874  if (rc == NO_ERROR)
     1875  {
     1876    if(lpcbAvail) {
     1877        *lpcbAvail   = availData.cbpipe;
     1878    }
     1879    if(lpcbMessage) {
     1880        *lpcbMessage = availData.cbmessage;
     1881    }
    18601882    SetLastError(ERROR_SUCCESS_W);
    18611883    return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.