Ignore:
Timestamp:
Nov 12, 1999, 3:57:15 PM (26 years ago)
Author:
sandervl
Message:

device driver handlemanager class added

File:
1 edited

Legend:

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

    r1712 r1713  
    1 /* $Id: HandleManager.cpp,v 1.24 1999-11-12 13:41:53 davidr Exp $ */
    2 
    3 /*
    4  *
    5  * Project Odin Software License can be found in LICENSE.TXT
    6  *
    7  */
     1/* $Id: HandleManager.cpp,v 1.25 1999-11-12 14:57:13 sandervl Exp $ */
     2
    83/*
    94 * Win32 Unified Handle Manager for OS/2
     
    127 *
    138 * @(#) HandleManager.Cpp       1.0.0   1998/02/11 PH start
     9 *
     10 * Project Odin Software License can be found in LICENSE.TXT
     11 *
    1412 */
    1513
     
    25472545}
    25482546
     2547/*****************************************************************************
     2548 * Name      : HMDeviceIoControl
     2549 * Purpose   : router function for DeviceIoControl
     2550 * Parameters:
     2551 * Variables :
     2552 * Result    :
     2553 * Remark    :
     2554 * Status    :
     2555 *
     2556 * Author    : Sander van Leeuwen
     2557 *****************************************************************************/
     2558
     2559BOOL WIN32API DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
     2560                              LPVOID lpInBuffer, DWORD nInBufferSize,
     2561                              LPVOID lpOutBuffer, DWORD nOutBufferSize,
     2562                              LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
     2563{
     2564  int       iIndex;                           /* index into the handle table */
     2565  BOOL      fResult;       /* result from the device handler's CloseHandle() */
     2566  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2567
     2568                                                          /* validate handle */
     2569  iIndex = _HMHandleQuery(hDevice);                           /* get the index */
     2570  if (-1 == iIndex)                                               /* error ? */
     2571  {
     2572    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2573    return (FALSE);                                        /* signal failure */
     2574  }
     2575
     2576  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2577  fResult = pHMHandle->pDeviceHandler->DeviceIoControl(&pHMHandle->hmHandleData,
     2578                                                dwIoControlCode,
     2579                                                lpInBuffer, nInBufferSize,
     2580                                                lpOutBuffer, nOutBufferSize,
     2581                                                lpBytesReturned, lpOverlapped);
     2582
     2583  return (fResult);                                   /* deliver return code */
     2584}
Note: See TracChangeset for help on using the changeset viewer.