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/HandleManager.cpp

    r9653 r9660  
    1 /* $Id: HandleManager.cpp,v 1.92 2003-01-10 12:57:11 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.93 2003-01-10 15:19:53 sandervl Exp $ */
    22
    33/*
     
    11211121  else
    11221122  {
    1123     SetLastError(ERROR_SUCCESS); //@@@PH 1999/10/27 rc5desg requires this?
    1124 
    1125              /* copy data fields that might have been modified by CreateFile */
     1123    /* copy data fields that might have been modified by CreateFile */
    11261124    memcpy(&TabWin32Handles[iIndexNew].hmHandleData,
    11271125           &HMHandleTemp,
    11281126           sizeof(HMHANDLEDATA));
     1127
     1128    if(lpSecurityAttributes && lpSecurityAttributes->bInheritHandle) {
     1129        dprintf(("Set inheritance for child processes"));
     1130        HMSetHandleInformation(iIndexNew, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
     1131    }
     1132
     1133    SetLastError(ERROR_SUCCESS); //@@@PH 1999/10/27 rc5desg requires this?
    11291134  }
    11301135
     
    45134518  }
    45144519
     4520  dprintf(("Named pipe %x", iIndexNew));
     4521  if(lpSecurityAttributes && lpSecurityAttributes->bInheritHandle) {
     4522      dprintf(("Set inheritance for child processes"));
     4523      HMSetHandleInformation(iIndexNew, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
     4524  }
     4525
    45154526  return iIndexNew;
    45164527}
     
    47604771 *****************************************************************************/
    47614772BOOL HMCreatePipe(PHANDLE phRead,
    4762                 PHANDLE phWrite,
    4763                 LPSECURITY_ATTRIBUTES lpsa,
    4764                 DWORD                 cbPipe)
     4773                  PHANDLE phWrite,
     4774                  LPSECURITY_ATTRIBUTES lpsa,
     4775                  DWORD                 cbPipe)
    47654776{
    47664777  int             iIndex;                     /* index into the handle table */
     
    48344845  }
    48354846
     4847  dprintf(("Read pipe %x, Write pipe %x", iIndexNewRead, iIndexNewWrite));
     4848  if(lpsa && lpsa->bInheritHandle) {
     4849      dprintf(("Set inheritance for child processes"));
     4850      HMSetHandleInformation(iIndexNewRead, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
     4851      HMSetHandleInformation(iIndexNewWrite, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
     4852  }
     4853
    48364854  *phRead  = iIndexNewRead;
    48374855  *phWrite = iIndexNewWrite;
Note: See TracChangeset for help on using the changeset viewer.