- Timestamp:
- Nov 27, 1999, 1:48:26 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r1850 r1858 1 /* $Id: HandleManager.cpp,v 1.2 7 1999-11-26 21:10:51 phallerExp $ */1 /* $Id: HandleManager.cpp,v 1.28 1999-11-27 12:48:25 achimha Exp $ */ 2 2 3 3 /* … … 2591 2591 return (fResult); /* deliver return code */ 2592 2592 } 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 2607 BOOL 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 2641 BOOL 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 } -
trunk/src/kernel32/comm.cpp
r100 r1858 1 /* $Id: comm.cpp,v 1. 2 1999-06-10 20:47:54 phallerExp $ */1 /* $Id: comm.cpp,v 1.3 1999-11-27 12:48:25 achimha Exp $ */ 2 2 3 3 /* … … 15 15 #include <os2win.h> 16 16 #include "unicode.h" 17 #include "handlemanager.h" 17 18 18 19 … … 109 110 BOOL WIN32API SetupComm( HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue ) 110 111 { 111 dprintf(("SetupComm Not implemented (TRUE)\n")); 112 return(TRUE); 112 return HMSetupComm(hFile, dwInQueue, dwOutQueue); 113 113 } 114 114 … … 181 181 BOOL WIN32API GetCommState(INT hCommDev, LPDCB lpdcb) 182 182 { 183 dprintf(("OS2GetCommState Not implemented\n")); 184 return(FALSE); 183 return HMGetCommState(hCommDev, lpdcb); 185 184 } 186 185 -
trunk/src/kernel32/hmcomm.cpp
r1847 r1858 1 /* $Id: hmcomm.cpp,v 1. 2 1999-11-26 08:18:16 achimha Exp $ */1 /* $Id: hmcomm.cpp,v 1.3 1999-11-27 12:48:26 achimha Exp $ */ 2 2 3 3 /* … … 10 10 */ 11 11 12 #include <odin.h> 13 #include <win32type.h> 14 #include <misc.h> 15 #include "handlemanager.h" 16 #include "hmdevice.h" 17 #include "hmcomm.h" 18 #include "oslibdos.h" 19 20 21 HMDeviceCommClass::HMDeviceCommClass(LPCSTR lpDeviceName) : HMDeviceHandler(lpDeviceName) 22 { 23 dprintf(("HMDeviceCommClass: Register COM1 to COM4 with Handle Manager\n")); 24 HMDeviceRegister("COM1", this); 25 HMDeviceRegister("COM2", this); 26 HMDeviceRegister("COM3", this); 27 HMDeviceRegister("COM4", this); 28 29 } 30 31 32 33 DWORD HMDeviceCommClass::CreateFile(LPCSTR lpFileName, 34 PHMHANDLEDATA pHMHandleData, 35 PVOID lpSecurityAttributes, 36 PHMHANDLEDATA pHMHandleDataTemplate) 37 { 38 dprintf(("HMComm: Serial communication port %s open request\n", lpFileName)); 39 40 pHMHandleData->hHMHandle = 0; 41 42 //AH: TODO parse Win32 security handles 43 pHMHandleData->hHMHandle = OSLibDosOpen((char*)lpFileName, 44 OSLIB_ACCESS_READWRITE | 45 OSLIB_ACCESS_SHAREDENYREAD | 46 OSLIB_ACCESS_SHAREDENYWRITE); 47 if (pHMHandleData->hHMHandle != 0) 48 return 0; 49 else 50 return -1; 51 } 52 53 54 /* this is a handler method for calls to CloseHandle() */ 55 DWORD HMDeviceCommClass::CloseHandle(PHMHANDLEDATA pHMHandleData) 56 { 57 dprintf(("HMComm: Serial communication port close request\n")); 58 return OSLibDosClose(pHMHandleData->hHMHandle); 59 } 60 61 /***************************************************************************** 62 * Name : DWORD HMDeviceHandler::SetupComm 63 * Purpose : set com port parameters (queue) 64 * Variables : 65 * Result : 66 * Remark : 67 * Status : 68 * 69 * Author : Achim Hasenmueller 70 *****************************************************************************/ 71 72 BOOL HMDeviceCommClass::SetupComm(PHMHANDLEDATA pHMHandleData, DWORD dwInQueue, DWORD dwOutQueue) 73 { 74 dprintf(("HMDeviceCommClass::SetupComm unimplemented stub!")); 75 76 77 return(TRUE); 78 } -
trunk/src/kernel32/hmcomm.h
r1850 r1858 1 /* $Id: hmcomm.h,v 1. 3 1999-11-26 21:10:52 phallerExp $ */1 /* $Id: hmcomm.h,v 1.4 1999-11-27 12:48:26 achimha Exp $ */ 2 2 3 3 /* … … 16 16 { 17 17 public: 18 HMDeviceCommClass(LPCSTR lpDeviceName) : HMDeviceHandler(lpDeviceName) {} 19 20 /* @@@PH here go the API methods 21 virtual DWORD CreateEvent (PHMHANDLEDATA pHMHandleData, 22 LPSECURITY_ATTRIBUTES lpsa, 23 BOOL fManualReset, 24 BOOL fInitialState, 25 LPCTSTR lpszEventName); 26 27 - strings are ASCII 28 - HANDLEs are translated to a PHMHANDLEDATA pointer 29 30 */ 18 19 HMDeviceCommClass(LPCSTR lpDeviceName); 20 21 /* this is the handler method for calls to CreateFile() */ 22 virtual DWORD CreateFile (LPCSTR lpFileName, 23 PHMHANDLEDATA pHMHandleData, 24 PVOID lpSecurityAttributes, 25 PHMHANDLEDATA pHMHandleDataTemplate); 26 27 /* this is the handler method for calls to CloseHandle() */ 28 virtual DWORD CloseHandle(PHMHANDLEDATA pHMHandleData); 29 30 /* this is the handler method for SetComm() */ 31 virtual BOOL SetupComm(PHMHANDLEDATA pHMHandleData, DWORD dwInQueue, DWORD dwOutQueue); 31 32 32 33 }; 33 34 34 35 35 36 36 #endif // _HM_COMM_H_ -
trunk/src/kernel32/hmdevice.cpp
r1713 r1858 1 /* $Id: hmdevice.cpp,v 1. 9 1999-11-12 14:57:13 sandervlExp $ */1 /* $Id: hmdevice.cpp,v 1.10 1999-11-27 12:48:26 achimha Exp $ */ 2 2 3 3 /* … … 1082 1082 return(FALSE); 1083 1083 } 1084 1085 1086 /***************************************************************************** 1087 * Name : DWORD HMDeviceHandler::SetupComm 1088 * Purpose : set com port parameters (queue) 1089 * Variables : 1090 * Result : 1091 * Remark : 1092 * Status : 1093 * 1094 * Author : Achim Hasenmueller 1095 *****************************************************************************/ 1096 1097 BOOL HMDeviceHandler::SetupComm(PHMHANDLEDATA pHMHandleData, DWORD dwInQueue, DWORD dwOutQueue) 1098 { 1099 dprintf(("KERNEL32: HandleManager::DeviceHandler::SetupComm(%08xh,%08xh,%08xh)\n", 1100 pHMHandleData->hHMHandle, 1101 dwInQueue, dwOutQueue)); 1102 1103 return(FALSE); 1104 } 1105 1106 1107 /***************************************************************************** 1108 * Name : DWORD HMDeviceHandler::GetCommState 1109 * Purpose : query com port control block 1110 * Variables : 1111 * Result : 1112 * Remark : 1113 * Status : 1114 * 1115 * Author : Achim Hasenmueller 1116 *****************************************************************************/ 1117 BOOL HMDeviceHandler::GetCommState(PHMHANDLEDATA pHMHandleData, LPDCB lpdcb) 1118 { 1119 dprintf(("KERNEL32: HandleManager::DeviceHandler::GetCommState(%08xh,%08xh)\n", 1120 pHMHandleData->hHMHandle, 1121 lpdcb)); 1122 1123 return(FALSE); 1124 } 1125 -
trunk/src/kernel32/hmdevice.h
r1713 r1858 1 /* $Id: hmdevice.h,v 1.1 0 1999-11-12 14:57:14 sandervlExp $ */1 /* $Id: hmdevice.h,v 1.11 1999-11-27 12:48:26 achimha Exp $ */ 2 2 3 3 /* … … 287 287 LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); 288 288 289 /* COM ports */ 290 virtual BOOL SetupComm(PHMHANDLEDATA pHMHandleData, DWORD dwInQueue, DWORD dwOutQueue); 291 292 virtual BOOL GetCommState(PHMHANDLEDATA pHMHandleData, LPDCB lpdcb); 293 289 294 }; 290 295 -
trunk/src/kernel32/kernel32exp.def
r1605 r1858 591 591 _lstrncmpA@12 @785 592 592 _lstrncmpW@12 @786 593 _IsProcessorFeaturePresent@4 @880 593 594 _GetFileAttributesExA@12 @874 594 595 _GetFileAttributesExW@12 @875 … … 654 655 _smalloc__FUi @1271 655 656 _wsnprintfA @2000 657 IsExeStarted__Fv @2001
Note:
See TracChangeset
for help on using the changeset viewer.