Ignore:
Timestamp:
Feb 4, 2003, 12:29:03 PM (23 years ago)
Author:
sandervl
Message:

Support DuplicateHandle for threads; cleaned up semaphore code

File:
1 edited

Legend:

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

    r9660 r9748  
    1 /* $Id: HandleManager.cpp,v 1.93 2003-01-10 15:19:53 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.94 2003-02-04 11:28:55 sandervl Exp $ */
    22
    33/*
     
    959959  TabWin32Handles[iIndexNew].pDeviceHandler         = pDeviceHandler;
    960960                                                  /* call the device handler */
    961   rc = pDeviceHandler->DuplicateHandle(&TabWin32Handles[iIndexNew].hmHandleData,
     961  rc = pDeviceHandler->DuplicateHandle(srchandle,
     962                                       &TabWin32Handles[iIndexNew].hmHandleData,
    962963                                       srcprocess,
    963964                                       &TabWin32Handles[srchandle].hmHandleData,
     
    42854286}
    42864287/*****************************************************************************
     4288 * Name      : HMGetThreadTimes
     4289 * Purpose   : router function for HMGetThreadTimes
     4290 * Parameters:
     4291 * Variables :
     4292 * Result    :
     4293 * Remark    :
     4294 * Status    :
     4295 *
     4296 * Author    : SvL
     4297 *****************************************************************************/
     4298BOOL HMGetThreadTimes(HANDLE hThread, LPFILETIME lpCreationTime,
     4299                      LPFILETIME lpExitTime, LPFILETIME lpKernelTime,
     4300                      LPFILETIME lpUserTime)
     4301{
     4302  int       iIndex;                           /* index into the handle table */
     4303  BOOL      lpResult;                /* result from the device handler's API */
     4304  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     4305
     4306  SetLastError(ERROR_SUCCESS);
     4307                                                          /* validate handle */
     4308  iIndex = _HMHandleQuery(hThread);              /* get the index */
     4309  if (-1 == iIndex)                                               /* error ? */
     4310  {
     4311    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     4312    return FALSE;                                         /* signal failure */
     4313  }
     4314
     4315  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     4316  lpResult = pHMHandle->pDeviceHandler->GetThreadTimes(hThread, &TabWin32Handles[iIndex].hmHandleData,
     4317                                                       lpCreationTime, lpExitTime,
     4318                                                       lpKernelTime, lpUserTime);
     4319
     4320  return (lpResult);                                  /* deliver return code */
     4321}
     4322/*****************************************************************************
    42874323 * Name      : HMTerminateThread
    42884324 * Purpose   : router function for TerminateThread
Note: See TracChangeset for help on using the changeset viewer.