Ignore:
Timestamp:
Nov 27, 1999, 1:48:26 PM (26 years ago)
Author:
achimha
Message:

start of COM port implementation

File:
1 edited

Legend:

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

    r1850 r1858  
    1 /* $Id: HandleManager.cpp,v 1.27 1999-11-26 21:10:51 phaller Exp $ */
     1/* $Id: HandleManager.cpp,v 1.28 1999-11-27 12:48:25 achimha Exp $ */
    22
    33/*
     
    25912591  return (fResult);                                   /* deliver return code */
    25922592}
     2593
     2594
     2595/*****************************************************************************
     2596 * Name      : HMSetupComm
     2597 * Purpose   : router function for SetupComm
     2598 * Parameters:
     2599 * Variables :
     2600 * Result    :
     2601 * Remark    :
     2602 * Status    :
     2603 *
     2604 * Author    : Achim Hasenmueller [Sat, 1999/11/27 13:13]
     2605 *****************************************************************************/
     2606
     2607BOOL HMSetupComm(HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue)
     2608{
     2609  int       iIndex;                           /* index into the handle table */
     2610  BOOL      bResult;                /* result from the device handler's API */
     2611  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2612
     2613                                                          /* validate handle */
     2614  iIndex = _HMHandleQuery(hFile);              /* get the index */
     2615  if (-1 == iIndex)                                               /* error ? */
     2616  {
     2617    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2618    return (NULL);                                         /* signal failure */
     2619  }
     2620
     2621  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2622  bResult = pHMHandle->pDeviceHandler->SetupComm(&pHMHandle->hmHandleData,
     2623                                                 dwInQueue, dwOutQueue);
     2624
     2625  return (bResult);                                  /* deliver return code */
     2626}
     2627
     2628
     2629/*****************************************************************************
     2630 * Name      : HMGetCommState
     2631 * Purpose   : router function for GetCommState
     2632 * Parameters:
     2633 * Variables :
     2634 * Result    :
     2635 * Remark    :
     2636 * Status    :
     2637 *
     2638 * Author    : Achim Hasenmueller [Sat, 1999/11/27 13:40]
     2639 *****************************************************************************/
     2640
     2641BOOL HMGetCommState(INT hCommDev, LPDCB lpdcb)
     2642{
     2643  int       iIndex;                           /* index into the handle table */
     2644  BOOL      bResult;                /* result from the device handler's API */
     2645  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2646
     2647                                                          /* validate handle */
     2648  iIndex = _HMHandleQuery(hCommDev);              /* get the index */
     2649  if (-1 == iIndex)                                               /* error ? */
     2650  {
     2651    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2652    return (NULL);                                         /* signal failure */
     2653  }
     2654
     2655  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2656  bResult = pHMHandle->pDeviceHandler->GetCommState(&pHMHandle->hmHandleData,
     2657                                                    lpdcb);
     2658
     2659  return (bResult);                                  /* deliver return code */
     2660}
Note: See TracChangeset for help on using the changeset viewer.