Changeset 7549 for trunk/src/kernel32
- Timestamp:
- Dec 5, 2001, 3:16:38 PM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r7518 r7549 1 /* $Id: Fileio.cpp,v 1.5 7 2001-12-01 19:26:40sandervl Exp $ */1 /* $Id: Fileio.cpp,v 1.58 2001-12-05 14:15:55 sandervl Exp $ */ 2 2 3 3 /* … … 663 663 dwLength, 664 664 lpNumberOfBytesRead, 665 lpOverlapped ));665 lpOverlapped, NULL)); 666 666 } 667 667 //****************************************************************************** … … 679 679 return TRUE; 680 680 } 681 return (HMReadFile Ex(hFile,682 683 nNumberOfBytesToRead,684 681 return (HMReadFile(hFile, 682 lpBuffer, 683 nNumberOfBytesToRead, NULL, 684 lpOverlapped, lpCompletionRoutine)); 685 685 } 686 686 //****************************************************************************** … … 704 704 nrbytes, 705 705 nrbyteswritten, 706 lpOverlapped ));706 lpOverlapped, NULL)); 707 707 } 708 708 /***************************************************************************** … … 740 740 } 741 741 742 return (HMWriteFile Ex(hFile,743 744 nNumberOfBytesToWrite,745 742 return (HMWriteFile(hFile, 743 (LPVOID)lpBuffer, 744 nNumberOfBytesToWrite, NULL, 745 lpOverlapped, lpCompletionRoutine)); 746 746 } 747 747 //****************************************************************************** -
trunk/src/kernel32/HandleManager.cpp
r7532 r7549 1 /* $Id: HandleManager.cpp,v 1.8 2 2001-12-03 12:13:06 sandervl Exp $ */1 /* $Id: HandleManager.cpp,v 1.83 2001-12-05 14:15:56 sandervl Exp $ */ 2 2 3 3 /* … … 268 268 TabWin32Handles[ulLoop].hmHandleData.dwUserData = 0; 269 269 TabWin32Handles[ulLoop].hmHandleData.dwInternalType = HMTYPE_UNKNOWN; 270 TabWin32Handles[ulLoop].hmHandleData.hWin32Handle = (HANDLE)ulLoop; 270 271 TabWin32Handles[ulLoop].hmHandleData.lpDeviceData = NULL; 271 272 handleMutex.leave(); … … 845 846 /* initialize the complete HMHANDLEDATA structure */ 846 847 pHMHandleData = &TabWin32Handles[hHandle].hmHandleData; 847 pHMHandleData->dwType = FILE_TYPE_CHAR;848 848 pHMHandleData->dwAccess = 0; 849 849 pHMHandleData->dwShare = 0; … … 916 916 /* initialize the complete HMHANDLEDATA structure */ 917 917 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 918 pHMHandleData->dwType = TabWin32Handles[srchandle].hmHandleData.dwType;919 918 if (fdwOptions & DUPLICATE_SAME_ACCESS) 920 pHMHandleData->dwAccess = TabWin32Handles[srchandle].hmHandleData.dwAccess;919 pHMHandleData->dwAccess = TabWin32Handles[srchandle].hmHandleData.dwAccess; 921 920 else 922 pHMHandleData->dwAccess = fdwAccess;921 pHMHandleData->dwAccess = fdwAccess; 923 922 924 923 if((fdwOdinOptions & DUPLICATE_ACCESS_READWRITE) == DUPLICATE_ACCESS_READWRITE) { 925 pHMHandleData->dwAccess = GENERIC_READ | GENERIC_WRITE;924 pHMHandleData->dwAccess = GENERIC_READ | GENERIC_WRITE; 926 925 } 927 926 else 928 927 if(fdwOdinOptions & DUPLICATE_ACCESS_READ) { 929 pHMHandleData->dwAccess = GENERIC_READ;928 pHMHandleData->dwAccess = GENERIC_READ; 930 929 } 931 930 932 931 if(fdwOdinOptions & DUPLICATE_SHARE_READ) { 933 pHMHandleData->dwShare = FILE_SHARE_READ;932 pHMHandleData->dwShare = FILE_SHARE_READ; 934 933 } 935 934 else 936 935 if(fdwOdinOptions & DUPLICATE_SHARE_DENYNONE) { 937 pHMHandleData->dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE;936 pHMHandleData->dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE; 938 937 } 939 938 else pHMHandleData->dwShare = TabWin32Handles[srchandle].hmHandleData.dwShare; … … 1069 1068 else 1070 1069 { 1071 HMHandleTemp.dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */1072 1070 HMHandleTemp.dwAccess = dwDesiredAccess; 1073 1071 HMHandleTemp.dwShare = dwShareMode; … … 1089 1087 sizeof(HMHANDLEDATA)); 1090 1088 1091 rc = pDeviceHandler->CreateFile( (HANDLE)iIndexNew,lpFileName, /* call the device handler */1089 rc = pDeviceHandler->CreateFile(lpFileName, /* call the device handler */ 1092 1090 &HMHandleTemp, 1093 1091 lpSecurityAttributes, … … 1215 1213 } 1216 1214 1217 1218 /* initialize the complete HMHANDLEDATA structure */ 1215 /* initialize the complete HMHANDLEDATA structure */ 1219 1216 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 1220 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */1221 1217 1222 1218 FILE_ConvertOFMode(fuMode, /* map OF_flags */ … … 1231 1227 pHMHandleData->lpDeviceData = pDevData; 1232 1228 1233 1234 1235 1236 1229 /* we've got to mark the handle as occupied here, since another device */ 1230 /* could be created within the device handler -> deadlock */ 1231 1232 /* write appropriate entry into the handle table if open succeeded */ 1237 1233 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = iIndexNew; 1238 1234 TabWin32Handles[iIndexNew].pDeviceHandler = pDeviceHandler; 1239 1235 1240 rc = pDeviceHandler->OpenFile ((HANDLE)iIndexNew,lpFileName, /* call the device handler */1241 1242 1243 1236 rc = pDeviceHandler->OpenFile(lpFileName, /* call the device handler */ 1237 &TabWin32Handles[iIndexNew].hmHandleData, 1238 pOFStruct, 1239 fuMode); 1244 1240 1245 1241 #ifdef DEBUG_LOCAL … … 1356 1352 DWORD nNumberOfBytesToRead, 1357 1353 LPDWORD lpNumberOfBytesRead, 1358 LPOVERLAPPED lpOverlapped) 1354 LPOVERLAPPED lpOverlapped, 1355 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1359 1356 { 1360 1357 int iIndex; /* index into the handle table */ … … 1375 1372 nNumberOfBytesToRead, 1376 1373 lpNumberOfBytesRead, 1377 lpOverlapped); 1378 1379 return (fResult); /* deliver return code */ 1380 } 1381 /***************************************************************************** 1382 * Name : HANDLE HMReadFileEx 1383 * Purpose : Wrapper for the ReadFileEx() API 1384 * Parameters: 1385 * Variables : 1386 * Result : 1387 * Remark : 1388 * Status : 1389 * 1390 * Author : SvL 1391 *****************************************************************************/ 1392 BOOL HMReadFileEx(HANDLE hFile, 1393 LPVOID lpBuffer, 1394 DWORD nNumberOfBytesToRead, 1395 LPOVERLAPPED lpOverlapped, 1396 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1397 { 1398 int iIndex; /* index into the handle table */ 1399 BOOL fResult; /* result from the device handler's CloseHandle() */ 1400 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */ 1401 1402 /* validate handle */ 1403 iIndex = _HMHandleQuery(hFile); /* get the index */ 1404 if (-1 == iIndex) /* error ? */ 1405 { 1406 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1407 return (FALSE); /* signal failure */ 1408 } 1409 1410 pHMHandle = &TabWin32Handles[iIndex]; /* call device handler */ 1411 fResult = pHMHandle->pDeviceHandler->ReadFileEx(&pHMHandle->hmHandleData, 1412 lpBuffer, 1413 nNumberOfBytesToRead, 1414 lpOverlapped, 1415 lpCompletionRoutine); 1374 lpOverlapped, lpCompletionRoutine); 1416 1375 1417 1376 return (fResult); /* deliver return code */ … … 1434 1393 DWORD nNumberOfBytesToWrite, 1435 1394 LPDWORD lpNumberOfBytesWritten, 1436 LPOVERLAPPED lpOverlapped) 1395 LPOVERLAPPED lpOverlapped, 1396 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1437 1397 { 1438 1398 int iIndex; /* index into the handle table */ … … 1453 1413 nNumberOfBytesToWrite, 1454 1414 lpNumberOfBytesWritten, 1455 lpOverlapped); 1456 1457 return (fResult); /* deliver return code */ 1458 } 1459 1460 /***************************************************************************** 1461 * Name : HANDLE HMWriteFileEx 1462 * Purpose : Wrapper for the WriteFileEx() API 1463 * Parameters: 1464 * Variables : 1465 * Result : 1466 * Remark : 1467 * Status : 1468 * 1469 * Author : SvL 1470 *****************************************************************************/ 1471 BOOL HMWriteFileEx(HANDLE hFile, 1472 LPVOID lpBuffer, 1473 DWORD nNumberOfBytesToWrite, 1474 LPOVERLAPPED lpOverlapped, 1475 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1476 { 1477 int iIndex; /* index into the handle table */ 1478 BOOL fResult; /* result from the device handler's CloseHandle() */ 1479 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */ 1480 1481 /* validate handle */ 1482 iIndex = _HMHandleQuery(hFile); /* get the index */ 1483 if (-1 == iIndex) /* error ? */ 1484 { 1485 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1486 return (FALSE); /* signal failure */ 1487 } 1488 1489 pHMHandle = &TabWin32Handles[iIndex]; /* call device handler */ 1490 fResult = pHMHandle->pDeviceHandler->WriteFileEx(&pHMHandle->hmHandleData, 1491 lpBuffer, 1492 nNumberOfBytesToWrite, 1493 lpOverlapped, 1494 lpCompletionRoutine); 1415 lpOverlapped, lpCompletionRoutine); 1495 1416 1496 1417 return (fResult); /* deliver return code */ … … 2346 2267 /* Initialize the complete HMHANDLEDATA structure */ 2347 2268 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2348 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2349 2269 pHMHandleData->dwAccess = 0; 2350 2270 pHMHandleData->dwShare = 0; … … 2424 2344 /* initialize the complete HMHANDLEDATA structure */ 2425 2345 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2426 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2427 2346 pHMHandleData->dwAccess = 0; 2428 2347 pHMHandleData->dwShare = 0; … … 2492 2411 /* initialize the complete HMHANDLEDATA structure */ 2493 2412 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2494 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2495 2413 pHMHandleData->dwAccess = fdwAccess; 2496 2414 pHMHandleData->dwShare = 0; … … 2559 2477 /* initialize the complete HMHANDLEDATA structure */ 2560 2478 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2561 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2562 2479 pHMHandleData->dwAccess = fdwAccess; 2563 2480 pHMHandleData->dwShare = 0; … … 2636 2553 /* initialize the complete HMHANDLEDATA structure */ 2637 2554 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2638 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2639 2555 pHMHandleData->dwAccess = 0; 2640 2556 pHMHandleData->dwShare = 0; … … 2705 2621 /* initialize the complete HMHANDLEDATA structure */ 2706 2622 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2707 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2708 2623 pHMHandleData->dwAccess = fdwAccess; 2709 2624 pHMHandleData->dwShare = 0; … … 2812 2727 /* initialize the complete HMHANDLEDATA structure */ 2813 2728 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2814 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2815 2729 pHMHandleData->dwAccess = 0; 2816 2730 pHMHandleData->dwShare = 0; … … 2890 2804 /* initialize the complete HMHANDLEDATA structure */ 2891 2805 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 2892 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */2893 2806 pHMHandleData->dwAccess = fdwAccess; 2894 2807 pHMHandleData->dwShare = 0; … … 3878 3791 /* initialize the complete HMHANDLEDATA structure */ 3879 3792 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 3880 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */3881 3793 pHMHandleData->dwAccess = DesiredAccess; 3882 3794 pHMHandleData->dwShare = 0; … … 3946 3858 /* initialize the complete HMHANDLEDATA structure */ 3947 3859 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 3948 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */3949 3860 pHMHandleData->dwAccess = DesiredAccess; 3950 3861 pHMHandleData->dwShare = 0; … … 4018 3929 /* initialize the complete HMHANDLEDATA structure */ 4019 3930 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 4020 pHMHandleData->dwType = FILE_TYPE_UNKNOWN; /* unknown handle type */4021 3931 pHMHandleData->dwAccess = 0; 4022 3932 pHMHandleData->dwShare = 0; … … 4411 4321 /* initialize the complete HMHANDLEDATA structure */ 4412 4322 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 4413 pHMHandleData->dwType = FILE_TYPE_PIPE;4414 4323 pHMHandleData->dwAccess = 0; 4415 4324 pHMHandleData->dwShare = 0; … … 4721 4630 /* initialize the complete HMHANDLEDATA structure */ 4722 4631 pHMHandleData = &TabWin32Handles[iIndexNewRead].hmHandleData; 4723 pHMHandleData->dwType = FILE_TYPE_PIPE;4724 4632 pHMHandleData->dwAccess = 0; 4725 4633 pHMHandleData->dwShare = 0; … … 4737 4645 /* initialize the complete HMHANDLEDATA structure */ 4738 4646 pHMHandleData = &TabWin32Handles[iIndexNewWrite].hmHandleData; 4739 pHMHandleData->dwType = FILE_TYPE_PIPE;4740 4647 pHMHandleData->dwAccess = 0; 4741 4648 pHMHandleData->dwShare = 0; … … 4804 4711 /* initialize the complete HMHANDLEDATA structure */ 4805 4712 pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData; 4806 pHMHandleData->dwType = FILE_TYPE_UNKNOWN;4807 4713 pHMHandleData->dwAccess = 0; 4808 4714 pHMHandleData->dwShare = 0; -
trunk/src/kernel32/async.cpp
r5308 r7549 1 /* $Id: async.cpp,v 1.1 0 2001-03-13 18:45:32sandervl Exp $ */1 /* $Id: async.cpp,v 1.11 2001-12-05 14:15:56 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 * Remark * 17 17 ***************************************************************************** 18 19 ReadFileEx20 18 21 19 */ -
trunk/src/kernel32/conbuffer.cpp
r7457 r7549 1 /* $Id: conbuffer.cpp,v 1.1 5 2001-11-26 14:53:58sandervl Exp $ */1 /* $Id: conbuffer.cpp,v 1.16 2001-12-05 14:15:56 sandervl Exp $ */ 2 2 3 3 /* … … 98 98 *****************************************************************************/ 99 99 100 DWORD HMDeviceConsoleBufferClass::CreateFile (HANDLE hHandle, 101 LPCSTR lpFileName, 100 DWORD HMDeviceConsoleBufferClass::CreateFile (LPCSTR lpFileName, 102 101 PHMHANDLEDATA pHMHandleData, 103 102 PVOID lpSecurityAttributes, … … 115 114 #endif 116 115 117 pHMHandleData->dwType = FILE_TYPE_CHAR; /* we're a character device */118 119 116 pHMHandleData->lpHandlerData = malloc ( sizeof(CONSOLEBUFFER) ); 120 117 … … 153 150 154 151 /***************************************************************************** 152 * Name : DWORD HMDeviceConsoleBufferClass::GetFileType 153 * Purpose : determine the handle type 154 * Parameters: PHMHANDLEDATA pHMHandleData 155 * Variables : 156 * Result : API returncode 157 * Remark : 158 * Status : 159 * 160 * Author : Patrick Haller [Wed, 1998/02/11 20:44] 161 *****************************************************************************/ 162 163 DWORD HMDeviceConsoleBufferClass::GetFileType(PHMHANDLEDATA pHMHandleData) 164 { 165 dprintf(("KERNEL32: HMDeviceConsoleBufferClass::GetFileType %s(%08x)\n", 166 lpHMDeviceName, 167 pHMHandleData)); 168 169 return FILE_TYPE_CHAR; 170 } 171 172 /***************************************************************************** 155 173 * Name : 156 174 * Purpose : … … 205 223 DWORD nNumberOfBytesToRead, 206 224 LPDWORD lpNumberOfBytesRead, 207 LPOVERLAPPED lpOverlapped) 225 LPOVERLAPPED lpOverlapped, 226 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 208 227 { 209 228 … … 239 258 DWORD nNumberOfBytesToWrite, 240 259 LPDWORD lpNumberOfBytesWritten, 241 LPOVERLAPPED lpOverlapped) 260 LPOVERLAPPED lpOverlapped, 261 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 242 262 { 243 263 PCONSOLEBUFFER pConsoleBuffer = (PCONSOLEBUFFER)pHMHandleData->lpHandlerData; … … 2499 2519 cchToWrite, 2500 2520 lpcchWritten, 2501 NULL ));2521 NULL, NULL)); 2502 2522 } 2503 2523 … … 2550 2570 cchToWrite, 2551 2571 lpcchWritten, 2552 NULL); 2572 NULL, NULL); 2573 2553 2574 // free memory again 2554 2575 HEAP_free(pszAscii); -
trunk/src/kernel32/conbuffer.h
r7457 r7549 1 /* $Id: conbuffer.h,v 1. 4 2001-11-26 14:53:58sandervl Exp $ */1 /* $Id: conbuffer.h,v 1.5 2001-12-05 14:15:57 sandervl Exp $ */ 2 2 3 3 /* … … 55 55 56 56 /* this is a handler method for calls to CreateFile() */ 57 virtual DWORD CreateFile (HANDLE hHandle, 58 LPCSTR lpFileName, 57 virtual DWORD CreateFile (LPCSTR lpFileName, 59 58 PHMHANDLEDATA pHMHandleData, 60 59 PVOID lpSecurityAttributes, … … 66 65 DWORD nNumberOfBytesToRead, 67 66 LPDWORD lpNumberOfBytesRead, 68 LPOVERLAPPED lpOverlapped); 67 LPOVERLAPPED lpOverlapped, 68 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 69 69 70 70 /* this is a handler method for calls to WriteFile() */ … … 73 73 DWORD nNumberOfBytesToWrite, 74 74 LPDWORD lpNumberOfBytesWritten, 75 LPOVERLAPPED lpOverlapped); 75 LPOVERLAPPED lpOverlapped, 76 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 77 78 /* this is a handler method for calls to GetFileType() */ 79 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 76 80 77 81 virtual DWORD CloseHandle(PHMHANDLEDATA pHMHandleData); -
trunk/src/kernel32/conbuffervio.cpp
r6920 r7549 1 /* $Id: conbuffervio.cpp,v 1. 4 2001-10-01 01:45:18 birdExp $ */1 /* $Id: conbuffervio.cpp,v 1.5 2001-12-05 14:15:57 sandervl Exp $ */ 2 2 3 3 /* … … 97 97 DWORD nNumberOfBytesToWrite, 98 98 LPDWORD lpNumberOfBytesWritten, 99 LPOVERLAPPED lpOverlapped) 99 LPOVERLAPPED lpOverlapped, 100 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 100 101 { 101 102 PCONSOLEBUFFER pConsoleBuffer = (PCONSOLEBUFFER)pHMHandleData->lpHandlerData; … … 136 137 retcode = WriteFile(pHMHandleData, lpBuffer, 137 138 min(nNumberOfBytesToWrite, 512), lpNumberOfBytesWritten, 138 lpOverlapped );139 lpOverlapped, lpCompletionRoutine); 139 140 if(retcode != TRUE) break; 140 141 -
trunk/src/kernel32/conbuffervio.h
r4502 r7549 1 /* $Id: conbuffervio.h,v 1. 1 2000-10-20 11:46:45sandervl Exp $ */1 /* $Id: conbuffervio.h,v 1.2 2001-12-05 14:15:57 sandervl Exp $ */ 2 2 3 3 /* … … 54 54 DWORD nNumberOfBytesToWrite, 55 55 LPDWORD lpNumberOfBytesWritten, 56 LPOVERLAPPED lpOverlapped); 56 LPOVERLAPPED lpOverlapped, 57 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 57 58 58 59 }; -
trunk/src/kernel32/conin.cpp
r7457 r7549 1 /* $Id: conin.cpp,v 1.1 5 2001-11-26 14:53:58 sandervl Exp $ */1 /* $Id: conin.cpp,v 1.16 2001-12-05 14:15:58 sandervl Exp $ */ 2 2 3 3 /* … … 68 68 *****************************************************************************/ 69 69 70 DWORD HMDeviceConsoleInClass::CreateFile (HANDLE hHandle, 71 LPCSTR lpFileName, 70 DWORD HMDeviceConsoleInClass::CreateFile (LPCSTR lpFileName, 72 71 PHMHANDLEDATA pHMHandleData, 73 72 PVOID lpSecurityAttributes, … … 83 82 #endif 84 83 85 pHMHandleData->dwType = FILE_TYPE_CHAR; /* we're a character device */86 87 84 return(NO_ERROR); 88 85 } 89 86 87 /***************************************************************************** 88 * Name : DWORD HMDeviceConsoleInClass::GetFileType 89 * Purpose : determine the handle type 90 * Parameters: PHMHANDLEDATA pHMHandleData 91 * Variables : 92 * Result : API returncode 93 * Remark : 94 * Status : 95 * 96 * Author : Patrick Haller [Wed, 1998/02/11 20:44] 97 *****************************************************************************/ 98 99 DWORD HMDeviceConsoleInClass::GetFileType(PHMHANDLEDATA pHMHandleData) 100 { 101 dprintf(("KERNEL32: HMDeviceConsoleInClass::GetFileType %s(%08x)\n", 102 lpHMDeviceName, 103 pHMHandleData)); 104 105 return FILE_TYPE_CHAR; 106 } 90 107 91 108 /***************************************************************************** … … 102 119 103 120 BOOL HMDeviceConsoleInClass::ReadFile(PHMHANDLEDATA pHMHandleData, 104 LPCVOID lpBuffer, 105 DWORD nNumberOfBytesToRead, 106 LPDWORD lpNumberOfBytesRead, 107 LPOVERLAPPED lpOverlapped) 121 LPCVOID lpBuffer, 122 DWORD nNumberOfBytesToRead, 123 LPDWORD lpNumberOfBytesRead, 124 LPOVERLAPPED lpOverlapped, 125 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 108 126 { 109 127 ULONG ulCounter; /* character counter for the queue loop */ … … 190 208 2, 191 209 &ulPostCounter, /* dummy result */ 192 NULL );210 NULL, NULL); 193 211 194 212 } … … 208 226 1, 209 227 &ulPostCounter, /* dummy result */ 210 NULL );228 NULL, NULL); 211 229 } 212 230 break; … … 227 245 1, 228 246 &ulPostCounter, /* dummy result */ 229 NULL); 230 231 247 NULL, NULL); 232 248 } 233 249 } … … 248 264 1, 249 265 &ulPostCounter, /* dummy result */ 250 NULL );266 NULL, NULL); 251 267 } 252 268 … … 283 299 DWORD nNumberOfBytesToWrite, 284 300 LPDWORD lpNumberOfBytesWritten, 285 LPOVERLAPPED lpOverlapped) 301 LPOVERLAPPED lpOverlapped, 302 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 286 303 { 287 304 … … 695 712 cchToRead, 696 713 lpcchRead, 697 NULL)); 698 } 699 714 NULL, NULL)); 715 } 700 716 701 717 /***************************************************************************** … … 744 760 cchToRead, 745 761 lpcchRead, 746 NULL); 762 NULL, NULL); 763 747 764 /* Ascii -> unicode translation */ 748 765 if (dwResult == TRUE) … … 979 996 980 997 981 DWORD HMDeviceConsoleInClass::GetFileType (PHMHANDLEDATA pHMHandleData)982 {983 return FILE_TYPE_CHAR;984 } -
trunk/src/kernel32/conin.h
r7457 r7549 1 /* $Id: conin.h,v 1. 4 2001-11-26 14:53:59sandervl Exp $ */1 /* $Id: conin.h,v 1.5 2001-12-05 14:15:58 sandervl Exp $ */ 2 2 3 3 /* … … 56 56 57 57 /* this is a handler method for calls to CreateFile() */ 58 virtual DWORD CreateFile (HANDLE hHandle, 59 LPCSTR lpFileName, 58 virtual DWORD CreateFile (LPCSTR lpFileName, 60 59 PHMHANDLEDATA pHMHandleData, 61 60 PVOID lpSecurityAttributes, … … 67 66 DWORD nNumberOfBytesToRead, 68 67 LPDWORD lpNumberOfBytesRead, 69 LPOVERLAPPED lpOverlapped); 68 LPOVERLAPPED lpOverlapped, 69 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 70 70 71 71 /* this is a handler method for calls to WriteFile() */ … … 74 74 DWORD nNumberOfBytesToWrite, 75 75 LPDWORD lpNumberOfBytesWritten, 76 LPOVERLAPPED lpOverlapped); 76 LPOVERLAPPED lpOverlapped, 77 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 78 79 /* this is a handler method for calls to GetFileType() */ 80 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 77 81 78 82 virtual DWORD _DeviceRequest (PHMHANDLEDATA pHMHandleData, … … 140 144 LPDWORD lpcWritten); 141 145 142 /* this is a handler method for calls to GetFileType() */143 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);144 145 146 }; 146 147 -
trunk/src/kernel32/conout.cpp
r7476 r7549 1 /* $Id: conout.cpp,v 1.1 2 2001-11-29 00:20:46 phallerExp $ */1 /* $Id: conout.cpp,v 1.13 2001-12-05 14:15:58 sandervl Exp $ */ 2 2 3 3 /* … … 94 94 *****************************************************************************/ 95 95 96 DWORD HMDeviceConsoleOutClass::CreateFile (HANDLE hHandle, 97 LPCSTR lpFileName, 96 DWORD HMDeviceConsoleOutClass::CreateFile (LPCSTR lpFileName, 98 97 PHMHANDLEDATA pHMHandleData, 99 98 PVOID lpSecurityAttributes, … … 103 102 HANDLE hConsole; 104 103 105 #ifdef DEBUG_LOCAL2 106 WriteLog("KERNEL32/CONSOLE:HMDeviceConsoleOutClass %s(%s,%08x,%08x,%08x)\n", 104 dprintf(("KERNEL32/CONSOLE:HMDeviceConsoleOutClass %s(%s,%08x,%08x,%08x)\n", 107 105 lpHMDeviceName, 108 106 lpFileName, 109 107 pHMHandleData->hHMHandle, 110 108 lpSecurityAttributes, 111 pHMHandleDataTemplate); 112 #endif 113 114 pHMHandleData->dwType = FILE_TYPE_CHAR; /* we're a character device */ 115 116 117 /* if no default buffer is available, then do default setup */ 109 pHMHandleDataTemplate)); 110 111 112 /* if no default buffer is available, then do default setup */ 118 113 if (pConsoleGlobals->hConsoleBuffer == INVALID_HANDLE_VALUE) 119 114 { … … 126 121 if (hConsole == INVALID_HANDLE_VALUE) 127 122 { 128 #ifdef DEBUG_LOCAL 129 WriteLog("KERNEL32/CONSOLE:OS2CreateConsoleScreenBuffer = %u.\n", 130 GetLastError()); 131 #endif 123 dprintf(("KERNEL32/CONSOLE:OS2CreateConsoleScreenBuffer = %u.\n", 124 GetLastError())); 132 125 return INVALID_HANDLE_VALUE; /* abort further processing immediately */ 133 126 } … … 145 138 if (fResult == FALSE) 146 139 { 147 #ifdef DEBUG_LOCAL 148 WriteLog("KERNEL32/CONSOLE:OS2SetConsoleScreenBufferSize=%u.\n", 149 GetLastError()); 150 #endif 140 dprintf(("KERNEL32/CONSOLE:OS2SetConsoleScreenBufferSize=%u.\n", 141 GetLastError())); 151 142 HMCloseHandle(hConsole); /* free handle again */ 152 143 return (INVALID_HANDLE_VALUE); /* abort further processing */ … … 156 147 if (fResult == FALSE) 157 148 { 158 #ifdef DEBUG_LOCAL 159 WriteLog("KERNEL32/CONSOLE:OS2SetConsoleActiveScreenBuffer=%u.\n", 160 GetLastError()); 161 #endif 149 dprintf(("KERNEL32/CONSOLE:OS2SetConsoleActiveScreenBuffer=%u.\n", 150 GetLastError())); 162 151 HMCloseHandle(hConsole); /* free handle again */ 163 152 return (INVALID_HANDLE_VALUE); /* abort further processing */ … … 173 162 } 174 163 164 /***************************************************************************** 165 * Name : DWORD HMDeviceConsoleOutClass::GetFileType 166 * Purpose : determine the handle type 167 * Parameters: PHMHANDLEDATA pHMHandleData 168 * Variables : 169 * Result : API returncode 170 * Remark : 171 * Status : 172 * 173 * Author : Patrick Haller [Wed, 1998/02/11 20:44] 174 *****************************************************************************/ 175 176 DWORD HMDeviceConsoleOutClass::GetFileType(PHMHANDLEDATA pHMHandleData) 177 { 178 dprintf(("KERNEL32: HMDeviceConsoleOutClass::GetFileType %s(%08x)\n", 179 lpHMDeviceName, 180 pHMHandleData)); 181 182 return FILE_TYPE_CHAR; 183 } 175 184 176 185 /***************************************************************************** … … 190 199 DWORD nNumberOfBytesToRead, 191 200 LPDWORD lpNumberOfBytesRead, 192 LPOVERLAPPED lpOverlapped) 201 LPOVERLAPPED lpOverlapped, 202 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 193 203 { 194 204 … … 224 234 DWORD nNumberOfBytesToWrite, 225 235 LPDWORD lpNumberOfBytesWritten, 226 LPOVERLAPPED lpOverlapped) 236 LPOVERLAPPED lpOverlapped, 237 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 227 238 { 228 239 BOOL dwResult; /* result from subsequent WriteFile */ … … 246 257 nNumberOfBytesToWrite, 247 258 lpNumberOfBytesWritten, 248 lpOverlapped );259 lpOverlapped, lpCompletionRoutine); 249 260 250 261 return (dwResult); /* return result code */ … … 300 311 301 312 302 DWORD HMDeviceConsoleOutClass::GetFileType (PHMHANDLEDATA pHMHandleData)303 {304 return FILE_TYPE_CHAR;305 } -
trunk/src/kernel32/conout.h
r7457 r7549 1 /* $Id: conout.h,v 1. 3 2001-11-26 14:53:59sandervl Exp $ */1 /* $Id: conout.h,v 1.4 2001-12-05 14:15:58 sandervl Exp $ */ 2 2 3 3 /* … … 54 54 55 55 /* this is a handler method for calls to CreateFile() */ 56 virtual DWORD CreateFile (HANDLE hHandle, 57 LPCSTR lpFileName, 56 virtual DWORD CreateFile (LPCSTR lpFileName, 58 57 PHMHANDLEDATA pHMHandleData, 59 58 PVOID lpSecurityAttributes, 60 59 PHMHANDLEDATA pHMHandleDataTemplate); 60 61 /* this is a handler method for calls to GetFileType() */ 62 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 61 63 62 64 /* this is a handler method for calls to ReadFile() */ … … 65 67 DWORD nNumberOfBytesToRead, 66 68 LPDWORD lpNumberOfBytesRead, 67 LPOVERLAPPED lpOverlapped); 69 LPOVERLAPPED lpOverlapped, 70 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 68 71 69 72 /* this is a handler method for calls to WriteFile() */ … … 72 75 DWORD nNumberOfBytesToWrite, 73 76 LPDWORD lpNumberOfBytesWritten, 74 LPOVERLAPPED lpOverlapped); 77 LPOVERLAPPED lpOverlapped, 78 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 75 79 76 80 … … 83 87 ULONG arg4); 84 88 85 /* this is a handler method for calls to GetFileType() */86 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);87 88 89 }; 89 90 -
trunk/src/kernel32/dbglocal.cpp
r7476 r7549 1 /* $Id: dbglocal.cpp,v 1.1 8 2001-11-29 00:20:47 phallerExp $ */1 /* $Id: dbglocal.cpp,v 1.19 2001-12-05 14:15:58 sandervl Exp $ */ 2 2 3 3 /* … … 126 126 "hmmailslot", 127 127 "hmparport", 128 "hmnul" 128 "hmnul", 129 "overlappedio" 129 130 }; 130 131 //****************************************************************************** -
trunk/src/kernel32/dbglocal.h
r7476 r7549 124 124 #define DBG_hmparport 104 125 125 #define DBG_hmnul 105 126 #define DBG_MAXFILES 106 126 #define DBG_overlappedio 106 127 #define DBG_MAXFILES 107 127 128 128 129 extern USHORT DbgEnabledKERNEL32[DBG_MAXFILES]; -
trunk/src/kernel32/hmcomm.cpp
r7543 r7549 1 /* $Id: hmcomm.cpp,v 1.2 5 2001-12-04 16:11:25sandervl Exp $ */1 /* $Id: hmcomm.cpp,v 1.26 2001-12-05 14:15:59 sandervl Exp $ */ 2 2 3 3 /* … … 61 61 #define BaudTableSize (sizeof(BaudTable)/sizeof(BAUDTABLEENTRY)) 62 62 63 DWORD CALLBACK SerialCommThread(LPVOID lpThreadParam);64 65 63 //****************************************************************************** 66 64 //****************************************************************************** … … 157 155 //****************************************************************************** 158 156 //****************************************************************************** 159 DWORD HMDeviceCommClass::CreateFile(HANDLE hComm, 160 LPCSTR lpFileName, 157 DWORD HMDeviceCommClass::CreateFile(LPCSTR lpFileName, 161 158 PHMHANDLEDATA pHMHandleData, 162 159 PVOID lpSecurityAttributes, 163 160 PHMHANDLEDATA pHMHandleDataTemplate) 164 161 { 165 char comname[6]; 162 char comname[6]; 163 DWORD ret = ERROR_SUCCESS; 166 164 167 165 dprintf(("HMComm: Serial communication port %s open request\n", lpFileName)); … … 237 235 DWORD dwThreadId; 238 236 239 pDevData->hEventSem = ::CreateEventA(NULL, TRUE, FALSE, NULL);240 pDevData->hThread = ::CreateThread(NULL, 32*1024, SerialCommThread, (LPVOID)hComm, 0, &dwThreadId);241 242 if(!pDevData->hEventSem || !pDevData->hThread)243 {244 DebugInt3();245 if(pDevData->hEventSem) ::CloseHandle(pDevData->hEventSem);246 delete pHMHandleData->lpHandlerData;247 OSLibDosClose(pHMHandleData->hHMHandle);248 return ERROR_NOT_ENOUGH_MEMORY;249 }250 237 } 251 238 return ERROR_SUCCESS; … … 253 240 else 254 241 return ERROR_ACCESS_DENIED; 242 243 244 fail: 245 246 delete pHMHandleData->lpHandlerData; 247 OSLibDosClose(pHMHandleData->hHMHandle); 248 return ret; 249 } 250 /***************************************************************************** 251 * Name : DWORD HMDeviceCommClass::GetFileType 252 * Purpose : determine the handle type 253 * Parameters: PHMHANDLEDATA pHMHandleData 254 * Variables : 255 * Result : API returncode 256 * Remark : 257 * Status : 258 * 259 * Author : SvL 260 *****************************************************************************/ 261 262 DWORD HMDeviceCommClass::GetFileType(PHMHANDLEDATA pHMHandleData) 263 { 264 dprintf(("KERNEL32: HMDeviceCommClass::GetFileType %s(%08x)\n", 265 lpHMDeviceName, 266 pHMHandleData)); 267 268 return FILE_TYPE_CHAR; 255 269 } 256 270 //****************************************************************************** … … 263 277 if(pDevData && pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) 264 278 { 265 pDevData->fClosing = TRUE; 266 dprintf(("signalling serial thread")); 267 ::SetEvent(pDevData->hEventSem); 268 ::ResetEvent(pDevData->hEventSem); 269 270 //Wait for thread to clean up 271 dprintf(("waiting for serial thread")); 272 DWORD ret = ::WaitForSingleObject(pDevData->hEventSem, 200); 273 dprintf(("waiting for serial thread done -> %x", ret)); 274 ::CloseHandle(pDevData->hEventSem); 279 DebugInt3(); 275 280 } 276 281 delete pHMHandleData->lpHandlerData; … … 296 301 DWORD nNumberOfBytesToWrite, 297 302 LPDWORD lpNumberOfBytesWritten, 298 LPOVERLAPPED lpOverlapped) 303 LPOVERLAPPED lpOverlapped, 304 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 299 305 { 300 306 dprintf(("KERNEL32:HMDeviceCommClass::WriteFile %s(%08x,%08x,%08x,%08x,%08x)", … … 318 324 } 319 325 //testestestest 320 dprintf (("Bytes to write:"));326 dprintf2(("Bytes to write:")); 321 327 for(int i=0;i<nNumberOfBytesToWrite;i++) { 322 dprintf (("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i]));328 dprintf2(("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i])); 323 329 } 324 330 //testestestset … … 336 342 337 343 return ret; 338 }339 /*****************************************************************************340 * Name : BOOL WriteFileEx341 * Purpose : The WriteFileEx function writes data to a file. It is designed342 * solely for asynchronous operation, unlike WriteFile, which is343 * designed for both synchronous and asynchronous operation.344 * WriteFileEx reports its completion status asynchronously,345 * calling a specified completion routine when writing is completed346 * and the calling thread is in an alertable wait state.347 * Parameters: HANDLE hFile handle of file to write348 * LPVOID lpBuffer address of buffer349 * DWORD nNumberOfBytesToRead number of bytes to write350 * LPOVERLAPPED lpOverlapped address of offset351 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine352 * Variables :353 * Result : TRUE / FALSE354 * Remark :355 * Status : UNTESTED STUB356 *357 * Author : SvL358 *****************************************************************************/359 360 BOOL HMDeviceCommClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,361 LPVOID lpBuffer,362 DWORD nNumberOfBytesToWrite,363 LPOVERLAPPED lpOverlapped,364 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)365 {366 dprintf(("!ERROR!: WriteFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",367 lpHMDeviceName,368 pHMHandleData->hHMHandle,369 lpBuffer,370 nNumberOfBytesToWrite,371 lpOverlapped,372 lpCompletionRoutine));373 374 if(!(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED)) {375 dprintf(("!WARNING!: Handle not created with FILE_FLAG_OVERLAPPED!"));376 ::SetLastError(ERROR_ACCESS_DENIED); //todo: right error?377 return FALSE;378 }379 380 ::SetLastError(ERROR_INVALID_FUNCTION);381 return FALSE;382 344 } 383 345 /***************************************************************************** … … 401 363 DWORD nNumberOfBytesToRead, 402 364 LPDWORD lpNumberOfBytesRead, 403 LPOVERLAPPED lpOverlapped) 365 LPOVERLAPPED lpOverlapped, 366 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 404 367 { 405 368 dprintf(("KERNEL32:HMDeviceCommClass::ReadFile %s(%08x,%08x,%08x,%08x,%08x)", … … 444 407 else { 445 408 //testestestest 446 dprintf (("Bytes read:"));409 dprintf2(("%d Bytes read:", ulBytesRead)); 447 410 for(int i=0;i<ulBytesRead;i++) { 448 dprintf (("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i]));411 dprintf2(("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i])); 449 412 } 450 413 //testestestset … … 453 416 } 454 417 455 /*****************************************************************************456 * Name : BOOL ReadFileEx457 * Purpose : The ReadFileEx function reads data from a file asynchronously.458 * It is designed solely for asynchronous operation, unlike the459 * ReadFile function, which is designed for both synchronous and460 * asynchronous operation. ReadFileEx lets an application perform461 * other processing during a file read operation.462 * The ReadFileEx function reports its completion status asynchronously,463 * calling a specified completion routine when reading is completed464 * and the calling thread is in an alertable wait state.465 * Parameters: HANDLE hFile handle of file to read466 * LPVOID lpBuffer address of buffer467 * DWORD nNumberOfBytesToRead number of bytes to read468 * LPOVERLAPPED lpOverlapped address of offset469 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine470 * Variables :471 * Result : TRUE / FALSE472 * Remark :473 * Status : UNTESTED STUB474 *475 * Author : SvL476 *****************************************************************************/477 BOOL HMDeviceCommClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,478 LPVOID lpBuffer,479 DWORD nNumberOfBytesToRead,480 LPOVERLAPPED lpOverlapped,481 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)482 {483 dprintf(("!ERROR!: ReadFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",484 lpHMDeviceName,485 pHMHandleData->hHMHandle,486 lpBuffer,487 nNumberOfBytesToRead,488 lpOverlapped,489 lpCompletionRoutine));490 491 if(!(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED)) {492 dprintf(("!WARNING!: Handle not created with FILE_FLAG_OVERLAPPED!"));493 ::SetLastError(ERROR_ACCESS_DENIED); //todo: right error?494 return FALSE;495 }496 497 ::SetLastError(ERROR_INVALID_FUNCTION);498 return FALSE;499 }500 418 /***************************************************************************** 501 419 * Name : DWORD HMDeviceHandler::SetupComm … … 526 444 } 527 445 //****************************************************************************** 528 #define TIMEOUT_COMM 50 529 //****************************************************************************** 530 DWORD CALLBACK SerialCommThread(LPVOID lpThreadParam) 531 { 532 HANDLE hComm = (HANDLE)lpThreadParam; 533 PHMHANDLEDATA pHMHandleData; 534 PHMDEVCOMDATA pDevData; 535 DWORD ret; 536 APIRET rc; 537 ULONG ulLen; 538 USHORT COMEvt; 539 DWORD dwEvent,dwMask; 540 541 pHMHandleData = HMQueryHandleData(hComm); 542 if(!pHMHandleData) { 543 dprintf(("!ERROR!: Invalid handle -> aborting")); 544 return 0; 545 } 546 547 pDevData = (PHMDEVCOMDATA)pHMHandleData->lpHandlerData; 548 if(!pDevData) { 549 dprintf(("!ERROR! SerialCommThread !pDevData")); 550 DebugInt3(); 551 return 0; 552 } 553 HANDLE hEvent = pDevData->hEventSem; 554 HANDLE hCommOS2 = pHMHandleData->hHMHandle; 555 if(!hCommOS2 || !hEvent) { 556 dprintf(("!ERROR! SerialCommThread !hCommOS2 || !hEvent")); 557 DebugInt3(); 558 return 0; 559 } 560 dprintf(("SerialCommThread %x entered", hComm)); 561 562 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); 563 while(TRUE) 564 { 565 //validate handle 566 pHMHandleData = HMQueryHandleData(hComm); 567 if(!pHMHandleData) { 568 dprintf(("!ERROR!: Invalid handle -> aborting")); 569 return 0; 570 } 571 if(pDevData->fClosing) { 572 dprintf(("Cleaning up async comm thread")); 573 SetEvent(hEvent); //signal to CloseHandle that we're done 574 return 0; 575 } 576 577 //Wait for the app to call WaitCommEvent 578 dprintf(("SerialCommThread: wait for WaitCommEvent")); 579 ret = WaitForSingleObject(hEvent, INFINITE); 580 ResetEvent(hEvent); 581 dprintf(("SerialCommThread: wait for WaitCommEvent done %x", ret)); 582 583 //validate handle first 584 pHMHandleData = HMQueryHandleData(hComm); 585 if(!pHMHandleData) { 586 dprintf(("!ERROR!: Invalid handle -> aborting")); 587 return 0; 588 } 589 590 if(pDevData->fClosing) { 591 dprintf(("Cleaning up async comm thread")); 592 SetEvent(hEvent); //signal to CloseHandle that we're done 593 return 0; 594 } 595 596 HANDLE hOverlappedEvent = pDevData->overlapped.hEvent; 597 if(!hOverlappedEvent) { 598 DebugInt3(); 599 return 0; 600 } 601 602 ulLen = sizeof(CHAR); 603 dwEvent = 0; 604 rc = 0; 605 ulLen = sizeof(COMEvt); 606 dwMask = pDevData->dwEventMask; 607 608 while( (0==rc) && 609 !(dwEvent & dwMask) && 610 (dwMask == pDevData->dwEventMask) && 611 !(pDevData->fCancelIo) && !(pDevData->fClosing) ) // Exit if the Mask gets changed 612 { 613 rc = OSLibDosDevIOCtl(hCommOS2, 614 IOCTL_ASYNC, 615 ASYNC_GETCOMMEVENT, 616 0,0,0, 617 &COMEvt,ulLen,&ulLen); 618 if(!rc) 619 { 620 dwEvent |= (COMEvt&0x0001)? EV_RXCHAR:0; 621 //dwEvent |= (COMEvt&0x0002)? 0:0; 622 dwEvent |= (COMEvt&0x0004)? EV_TXEMPTY:0; 623 dwEvent |= (COMEvt&0x0008)? EV_CTS:0; 624 dwEvent |= (COMEvt&0x0010)? EV_DSR:0; 625 //dwEvent |= (COMEvt&0x0020)? 0:0; DCS = RLSD? 626 dwEvent |= (COMEvt&0x0040)? EV_BREAK:0; 627 dwEvent |= (COMEvt&0x0080)? EV_ERR:0; 628 dwEvent |= (COMEvt&0x0100)? EV_RING:0; 629 if((dwEvent & dwMask)) break; 630 } 631 else break; 632 633 //validate handle first 634 pHMHandleData = HMQueryHandleData(hComm); 635 if(!pHMHandleData) { 636 dprintf(("!ERROR!: Invalid handle -> aborting")); 637 return 0; 638 } 639 640 if(pDevData->fClosing) { 641 dprintf(("Cleaning up async comm thread")); 642 SetEvent(hEvent); //signal to CloseHandle that we're done 643 return 0; 644 } 645 646 DosSleep(TIMEOUT_COMM); 647 } 648 if(pDevData->fClosing) { 649 dprintf(("Cleaning up async comm thread")); 650 SetEvent(hEvent); //signal to CloseHandle that we're done 651 return 0; 652 } 653 else 654 if(pDevData->fCancelIo) { 655 pDevData->overlapped.Internal = 0; 656 pDevData->dwLastError = ERROR_OPERATION_ABORTED; 657 if(pDevData->lpfdwEvtMask) *pDevData->lpfdwEvtMask = 0; 658 dprintf(("Overlapped: WaitCommEvent ERROR_OPERATION_ABORTED")); 659 660 //signal to app that a comm event has occurred 661 SetEvent(hOverlappedEvent); 662 } 663 else 664 if((dwEvent & dwMask) && (dwMask == pDevData->dwEventMask)) { 665 pDevData->overlapped.Internal |= (rc==0) ? (dwEvent & dwMask) : 0; 666 pDevData->dwLastError = rc; 667 668 //We're also supposed to write the result to the address supplied 669 //by the call to WaitCommEvent 670 if(pDevData->lpfdwEvtMask) *pDevData->lpfdwEvtMask = (rc==0) ? (dwEvent & dwMask) : 0; 671 dprintf(("Overlapped: WaitCommEvent returned %x", pDevData->overlapped.Internal)); 672 673 //signal to app that a comm event has occurred 674 SetEvent(hOverlappedEvent); 675 } 676 } 677 return 0; 678 } 679 //****************************************************************************** 446 #define TIMEOUT_COMM 50 680 447 //****************************************************************************** 681 448 BOOL HMDeviceCommClass::WaitCommEvent( PHMHANDLEDATA pHMHandleData, … … 741 508 ::ResetEvent(lpo->hEvent); 742 509 743 //signal async comm thread to start polling comm status744 ::SetEvent(pDevData->hEventSem);745 510 ::SetLastError(ERROR_IO_PENDING); 746 511 return FALSE; … … 779 544 //signal serial thread to cancel pending IO operation 780 545 pDevData->fCancelIo = TRUE; 781 ::SetEvent(pDevData->hEventSem);546 // ::SetEvent(pDevData->hEventSem); 782 547 783 548 ::SetLastError(ERROR_SUCCESS); … … 1187 952 memcpy(&os2dcb,&pDevData->dcbOS2,sizeof(DCBINFO)); 1188 953 1189 fbTimeOut = 0x02; 954 fbTimeOut = 0x02; //normal processing (wait until timout or buffer full) 1190 955 if(MAXDWORD==pDevData->CommTOuts.ReadIntervalTimeout) 1191 956 { 1192 957 if( (0==pDevData->CommTOuts.ReadTotalTimeoutMultiplier) && 1193 958 (0==pDevData->CommTOuts.ReadTotalTimeoutConstant)) 1194 fbTimeOut = 0x05; 959 fbTimeOut = 0x05; //no wait 1195 960 else 1196 fbTimeOut = 0x04; 961 fbTimeOut = 0x04; //wait for something 1197 962 } 1198 963 else … … 1200 965 DWORD dwTimeout; 1201 966 dwTimeout = pDevData->CommTOuts.ReadIntervalTimeout/10; 1202 #if 01203 967 if(dwTimeout) 1204 968 dwTimeout--; // 0=10 ms unit is 10ms or .01s 1205 #endif 969 1206 970 os2dcb.usWriteTimeout = 0x0000FFFF & dwTimeout; 1207 971 os2dcb.usReadTimeout = 0x0000FFFF & dwTimeout; 1208 972 } 1209 os2dcb.fbTimeOut = (os2dcb.fbTimeOut & 0xF9) | fbTimeOut; 973 if( (0==pDevData->CommTOuts.WriteTotalTimeoutMultiplier) && 974 (0==pDevData->CommTOuts.WriteTotalTimeoutConstant)) 975 {//no timeout used for writing 976 os2dcb.fbTimeOut |= 1; //write infinite timeout 977 } 978 979 os2dcb.fbTimeOut = (os2dcb.fbTimeOut & 0xF8) | fbTimeOut; 1210 980 1211 981 dprintf((" New DCB:\n" -
trunk/src/kernel32/hmcomm.h
r7499 r7549 1 /* $Id: hmcomm.h,v 1.1 1 2001-11-30 13:52:32sandervl Exp $ */1 /* $Id: hmcomm.h,v 1.12 2001-12-05 14:15:59 sandervl Exp $ */ 2 2 3 3 /* … … 90 90 DWORD dwInBuffer, dwOutBuffer; 91 91 DWORD dwEventMask; 92 //overlapped IO info93 HANDLE hThread;94 HANDLE hEventSem;95 92 OVERLAPPED overlapped; 96 DWORD dwLastError; 97 DWORD *lpfdwEvtMask; 98 BOOL fClosing; 99 BOOL fCancelIo; 93 DWORD *lpfdwEvtMask; 94 BOOL fCancelIo; 95 DWORD dwLastError; 100 96 //OS/2 Device Control Block 101 97 DCBINFO dcbOS2; … … 130 126 131 127 /* this is the handler method for calls to CreateFile() */ 132 virtual DWORD CreateFile (HANDLE hHandle, 133 LPCSTR lpFileName, 128 virtual DWORD CreateFile (LPCSTR lpFileName, 134 129 PHMHANDLEDATA pHMHandleData, 135 130 PVOID lpSecurityAttributes, 136 131 PHMHANDLEDATA pHMHandleDataTemplate); 132 133 /* this is a handler method for calls to GetFileType() */ 134 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 137 135 138 136 /* this is the handler method for calls to CloseHandle() */ … … 187 185 LPDWORD lpdwSize); 188 186 189 /* this is a handler method for calls to ReadFile()*/187 /* this is a handler method for calls to ReadFile/Ex */ 190 188 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 191 189 LPCVOID lpBuffer, 192 190 DWORD nNumberOfBytesToRead, 193 191 LPDWORD lpNumberOfBytesRead, 194 LPOVERLAPPED lpOverlapped); 195 196 /* this is a handler method for calls to ReadFileEx() */ 197 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 198 LPVOID lpBuffer, 199 DWORD nNumberOfBytesToRead, 200 LPOVERLAPPED lpOverlapped, 201 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 202 203 /* this is a handler method for calls to WriteFile() */ 192 LPOVERLAPPED lpOverlapped, 193 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 194 195 /* this is a handler method for calls to WriteFile/Ex */ 204 196 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 205 197 LPCVOID lpBuffer, 206 198 DWORD nNumberOfBytesToWrite, 207 199 LPDWORD lpNumberOfBytesWritten, 208 LPOVERLAPPED lpOverlapped); 209 210 /* this is a handler method for calls to WriteFileEx() */ 211 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 212 LPVOID lpBuffer, 213 DWORD nNumberOfBytesToWrite, 214 LPOVERLAPPED lpOverlapped, 215 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 200 LPOVERLAPPED lpOverlapped, 201 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 216 202 217 203 virtual BOOL CancelIo (PHMHANDLEDATA pHMHandleData); -
trunk/src/kernel32/hmdevice.cpp
r7532 r7549 1 /* $Id: hmdevice.cpp,v 1.3 0 2001-12-03 12:13:08sandervl Exp $ */1 /* $Id: hmdevice.cpp,v 1.31 2001-12-05 14:15:59 sandervl Exp $ */ 2 2 3 3 /* … … 169 169 *****************************************************************************/ 170 170 171 DWORD HMDeviceHandler::CreateFile (HANDLE hHandle, 172 LPCSTR lpFileName, 171 DWORD HMDeviceHandler::CreateFile (LPCSTR lpFileName, 173 172 PHMHANDLEDATA pHMHandleData, 174 173 PVOID lpSecurityAttributes, … … 217 216 * LPDWORD lpNumberOfBytesRead, 218 217 * LPOVERLAPPED lpOverlapped 218 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine 219 219 * Variables : 220 220 * Result : Boolean … … 229 229 DWORD nNumberOfBytesToRead, 230 230 LPDWORD lpNumberOfBytesRead, 231 LPOVERLAPPED lpOverlapped) 232 { 233 dprintf(("KERNEL32:HandleManager::ReadFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n", 231 LPOVERLAPPED lpOverlapped, 232 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 233 { 234 dprintf(("KERNEL32:HandleManager::ReadFile %s(%08x,%08x,%08x,%08x,%08x %08x) - stub?\n", 234 235 lpHMDeviceName, 235 236 pHMHandleData->hHMHandle, … … 237 238 nNumberOfBytesToRead, 238 239 lpNumberOfBytesRead, 239 lpOverlapped ));240 lpOverlapped, lpCompletionRoutine)); 240 241 241 242 SetLastError(ERROR_INVALID_FUNCTION); … … 243 244 } 244 245 245 /*****************************************************************************246 * Name : BOOL ReadFileEx247 * Purpose : The ReadFileEx function reads data from a file asynchronously.248 * It is designed solely for asynchronous operation, unlike the249 * ReadFile function, which is designed for both synchronous and250 * asynchronous operation. ReadFileEx lets an application perform251 * other processing during a file read operation.252 * The ReadFileEx function reports its completion status asynchronously,253 * calling a specified completion routine when reading is completed254 * and the calling thread is in an alertable wait state.255 * Parameters: HANDLE hFile handle of file to read256 * LPVOID lpBuffer address of buffer257 * DWORD nNumberOfBytesToRead number of bytes to read258 * LPOVERLAPPED lpOverlapped address of offset259 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine260 * Variables :261 * Result : TRUE / FALSE262 * Remark :263 * Status : UNTESTED STUB264 *265 * Author : Patrick Haller [Mon, 1998/06/15 08:00]266 *****************************************************************************/267 BOOL HMDeviceHandler::ReadFileEx(PHMHANDLEDATA pHMHandleData,268 LPVOID lpBuffer,269 DWORD nNumberOfBytesToRead,270 LPOVERLAPPED lpOverlapped,271 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)272 {273 dprintf(("ERROR: ReadFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",274 lpHMDeviceName,275 pHMHandleData->hHMHandle,276 lpBuffer,277 nNumberOfBytesToRead,278 lpOverlapped,279 lpCompletionRoutine));280 281 SetLastError(ERROR_INVALID_FUNCTION);282 return FALSE;283 }284 246 285 247 /***************************************************************************** … … 291 253 * LPDWORD lpNumberOfBytesWritten, 292 254 * LPOVERLAPPED lpOverlapped 255 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine 293 256 * Variables : 294 257 * Result : Boolean … … 303 266 DWORD nNumberOfBytesToWrite, 304 267 LPDWORD lpNumberOfBytesWritten, 305 LPOVERLAPPED lpOverlapped) 306 { 307 dprintf(("KERNEL32:HandleManager::WriteFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n", 268 LPOVERLAPPED lpOverlapped, 269 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 270 { 271 dprintf(("KERNEL32:HandleManager::WriteFile %s(%08x,%08x,%08x,%08x,%08x,%08x) - stub?\n", 308 272 lpHMDeviceName, 309 273 pHMHandleData->hHMHandle, … … 311 275 nNumberOfBytesToWrite, 312 276 lpNumberOfBytesWritten, 313 lpOverlapped)); 314 315 SetLastError(ERROR_INVALID_FUNCTION); 316 return FALSE; 317 } 318 319 320 /***************************************************************************** 321 * Name : BOOL WriteFileEx 322 * Purpose : The WriteFileEx function writes data to a file. It is designed 323 * solely for asynchronous operation, unlike WriteFile, which is 324 * designed for both synchronous and asynchronous operation. 325 * WriteFileEx reports its completion status asynchronously, 326 * calling a specified completion routine when writing is completed 327 * and the calling thread is in an alertable wait state. 328 * Parameters: HANDLE hFile handle of file to write 329 * LPVOID lpBuffer address of buffer 330 * DWORD nNumberOfBytesToRead number of bytes to write 331 * LPOVERLAPPED lpOverlapped address of offset 332 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine 333 * Variables : 334 * Result : TRUE / FALSE 335 * Remark : 336 * Status : UNTESTED STUB 337 * 338 * Author : Patrick Haller [Mon, 1998/06/15 08:00] 339 *****************************************************************************/ 340 341 BOOL HMDeviceHandler::WriteFileEx(PHMHANDLEDATA pHMHandleData, 342 LPVOID lpBuffer, 343 DWORD nNumberOfBytesToWrite, 344 LPOVERLAPPED lpOverlapped, 345 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 346 { 347 dprintf(("ERROR: WriteFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n", 348 lpHMDeviceName, 349 pHMHandleData->hHMHandle, 350 lpBuffer, 351 nNumberOfBytesToWrite, 352 lpOverlapped, 353 lpCompletionRoutine)); 277 lpOverlapped, lpCompletionRoutine)); 354 278 355 279 SetLastError(ERROR_INVALID_FUNCTION); … … 375 299 pHMHandleData)); 376 300 377 return pHMHandleData->dwType;301 return FILE_TYPE_UNKNOWN; 378 302 } 379 303 … … 627 551 *****************************************************************************/ 628 552 629 DWORD HMDeviceHandler::OpenFile (HANDLE hHandle, 630 LPCSTR lpFileName, 553 DWORD HMDeviceHandler::OpenFile (LPCSTR lpFileName, 631 554 PHMHANDLEDATA pHMHandleData, 632 555 OFSTRUCT *pOFStruct, -
trunk/src/kernel32/hmdevice.h
r7532 r7549 1 /* $Id: hmdevice.h,v 1.3 1 2001-12-03 12:13:08sandervl Exp $ */1 /* $Id: hmdevice.h,v 1.32 2001-12-05 14:16:00 sandervl Exp $ */ 2 2 3 3 /* … … 35 35 #define HMTYPE_MUTEXSEM 8 36 36 #define HMTYPE_SEMAPHORE 9 37 #define HMTYPE_COMPORT 10 38 #define HMTYPE_PARPORT 11 37 39 //..... 38 40 … … 44 46 { 45 47 HANDLE hHMHandle; /* a copy of the OS/2 system handle */ 46 47 DWORD dwType; /* handle type identifier */ 48 HANDLE hWin32Handle; // win32 handle 48 49 49 50 DWORD dwAccess; /* access mode of the handle */ … … 99 100 DWORD fdwOdinOptions); 100 101 101 /* this is a handler method for calls to CreateFile() */ 102 virtual DWORD CreateFile (HANDLE hHandle, 103 LPCSTR lpFileName, 102 /* this is a handler method for calls to CreateFile() */ 103 virtual DWORD CreateFile (LPCSTR lpFileName, 104 104 PHMHANDLEDATA pHMHandleData, 105 105 PVOID lpSecurityAttributes, 106 106 PHMHANDLEDATA pHMHandleDataTemplate); 107 107 108 /* this is a handler method for calls to OpenFile() */ 109 virtual DWORD OpenFile (HANDLE hHandle, 110 LPCSTR lpFileName, 108 /* this is a handler method for calls to OpenFile() */ 109 virtual DWORD OpenFile (LPCSTR lpFileName, 111 110 PHMHANDLEDATA pHMHandleData, 112 111 OFSTRUCT* pOFStruct, 113 112 UINT fuMode); 114 113 115 114 /* this is a handler method for calls to CloseHandle() */ 116 115 virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData); 117 116 118 /* this is a handler method for calls to ReadFile()*/117 /* this is a handler method for calls to ReadFile/Ex */ 119 118 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 120 119 LPCVOID lpBuffer, 121 120 DWORD nNumberOfBytesToRead, 122 121 LPDWORD lpNumberOfBytesRead, 123 LPOVERLAPPED lpOverlapped); 124 125 /* this is a handler method for calls to ReadFileEx() */ 126 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 127 LPVOID lpBuffer, 128 DWORD nNumberOfBytesToRead, 129 LPOVERLAPPED lpOverlapped, 130 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 131 132 /* this is a handler method for calls to WriteFile() */ 122 LPOVERLAPPED lpOverlapped, 123 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 124 125 /* this is a handler method for calls to WriteFile/Ex */ 133 126 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 134 127 LPCVOID lpBuffer, 135 128 DWORD nNumberOfBytesToWrite, 136 129 LPDWORD lpNumberOfBytesWritten, 137 LPOVERLAPPED lpOverlapped); 138 139 /* this is a handler method for calls to WriteFileEx() */ 140 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 141 LPVOID lpBuffer, 142 DWORD nNumberOfBytesToWrite, 143 LPOVERLAPPED lpOverlapped, 144 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 145 146 /* this is a handler method for calls to GetFileType() */ 130 LPOVERLAPPED lpOverlapped, 131 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 132 133 /* this is a handler method for calls to GetFileType() */ 147 134 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 148 135 … … 241 228 ***************************************************************************/ 242 229 243 230 /* this is a handler method for calls to CreateEvent() */ 244 231 virtual DWORD CreateEvent (PHMHANDLEDATA pHMHandleData, 245 232 LPSECURITY_ATTRIBUTES lpsa, … … 248 235 LPCSTR lpszEventName); 249 236 250 237 /* this is a handler method for calls to OpenEvent() */ 251 238 virtual DWORD OpenEvent (PHMHANDLEDATA pHMHandleData, 252 239 BOOL fInheritHandle, 253 240 LPCSTR lpszEventName); 254 241 255 242 /* this is a handle method for calls to ResetEvent() */ 256 243 virtual BOOL ResetEvent (PHMHANDLEDATA pHMHandleData); 257 244 258 245 /* this is a handle method for calls to SetEvent() */ 259 246 virtual BOOL SetEvent (PHMHANDLEDATA pHMHandleData); 260 247 261 248 /* this is a handle method for calls to PulseEvent() */ 262 249 virtual BOOL PulseEvent (PHMHANDLEDATA pHMHandleData); 263 250 … … 267 254 ***************************************************************************/ 268 255 269 256 /* this is a handler method for calls to CreateMutex() */ 270 257 virtual DWORD CreateMutex (PHMHANDLEDATA pHMHandleData, 271 258 LPSECURITY_ATTRIBUTES lpsa, … … 273 260 LPCSTR lpszMutexName); 274 261 275 262 /* this is a handler method for calls to OpenMutex() */ 276 263 virtual DWORD OpenMutex (PHMHANDLEDATA pHMHandleData, 277 264 BOOL fInheritHandle, 278 265 LPCSTR lpszMutexName); 279 266 280 267 /* this is a handle method for calls to ReleaseMutex() */ 281 268 virtual BOOL ReleaseMutex(PHMHANDLEDATA pHMHandleData); 282 269 … … 286 273 ***************************************************************************/ 287 274 288 275 /* this is a handler method for calls to CreateSemaphore() */ 289 276 virtual DWORD CreateSemaphore (PHMHANDLEDATA pHMHandleData, 290 277 LPSECURITY_ATTRIBUTES lpsa, … … 293 280 LPCSTR lpszSemaphoreName); 294 281 295 282 /* this is a handler method for calls to OpenSemaphore() */ 296 283 virtual DWORD OpenSemaphore (PHMHANDLEDATA pHMHandleData, 297 284 BOOL fInheritHandle, 298 285 LPCSTR lpszSemaphoreName); 299 286 300 287 /* this is a handle method for calls to ReleaseSemaphore() */ 301 288 virtual BOOL ReleaseSemaphore(PHMHANDLEDATA pHMHandleData, 302 289 LONG cReleaseCount, 303 290 LPLONG lpPreviousCount); 304 291 305 292 /* this is a handler method for calls to CreateFileMapping() */ 306 293 virtual DWORD CreateFileMapping (PHMHANDLEDATA pHMHandleData, 307 294 HANDLE hFile, … … 312 299 LPCSTR lpName); 313 300 314 301 /* this is a handler method for calls to OpenFileMapping() */ 315 302 virtual DWORD OpenFileMapping (PHMHANDLEDATA pHMHandleData, 316 303 DWORD access, /* [in] Access mode */ … … 318 305 LPCSTR lpName); 319 306 320 307 /* this is a handler method for calls to MapViewOfFileEx() */ 321 308 virtual LPVOID MapViewOfFileEx (PHMHANDLEDATA pHMHandleData, 322 309 DWORD dwDesiredAccess, … … 324 311 DWORD dwFileOffsetLow, 325 312 DWORD dwNumberOfBytesToMap, 326 LPVOID lpBaseAddress);327 328 313 LPVOID lpBaseAddress); 314 315 /* this is a handler method for calls to DeviceIoControl() */ 329 316 virtual BOOL DeviceIoControl (PHMHANDLEDATA pHMHandleData, DWORD dwIoControlCode, 330 317 LPVOID lpInBuffer, DWORD nInBufferSize, -
trunk/src/kernel32/hmdevio.cpp
r7474 r7549 1 /* $Id: hmdevio.cpp,v 1.1 8 2001-11-28 23:33:35 phallerExp $ */1 /* $Id: hmdevio.cpp,v 1.19 2001-12-05 14:16:00 sandervl Exp $ */ 2 2 3 3 /* … … 172 172 //****************************************************************************** 173 173 //****************************************************************************** 174 DWORD HMDeviceDriver::CreateFile (HANDLE hHandle, 175 LPCSTR lpFileName, 174 DWORD HMDeviceDriver::CreateFile (LPCSTR lpFileName, 176 175 PHMHANDLEDATA pHMHandleData, 177 176 PVOID lpSecurityAttributes, … … 492 491 //****************************************************************************** 493 492 //****************************************************************************** 494 DWORD HMCustomDriver::CreateFile (HANDLE hHandle, 495 LPCSTR lpFileName, 493 DWORD HMCustomDriver::CreateFile (LPCSTR lpFileName, 496 494 PHMHANDLEDATA pHMHandleData, 497 495 PVOID lpSecurityAttributes, -
trunk/src/kernel32/hmdevio.h
r7458 r7549 1 /* $Id: hmdevio.h,v 1. 6 2001-11-26 17:16:24sandervl Exp $ */1 /* $Id: hmdevio.h,v 1.7 2001-12-05 14:16:00 sandervl Exp $ */ 2 2 3 3 #ifndef __DEVIO_H__ … … 123 123 124 124 /* this is a handler method for calls to CreateFile() */ 125 virtual DWORD CreateFile (HANDLE hHandle, 126 LPCSTR lpFileName, 125 virtual DWORD CreateFile (LPCSTR lpFileName, 127 126 PHMHANDLEDATA pHMHandleData, 128 127 PVOID lpSecurityAttributes, … … 153 152 154 153 /* this is a handler method for calls to CreateFile() */ 155 virtual DWORD CreateFile (HANDLE hHandle, 156 LPCSTR lpFileName, 154 virtual DWORD CreateFile (LPCSTR lpFileName, 157 155 PHMHANDLEDATA pHMHandleData, 158 156 PVOID lpSecurityAttributes, -
trunk/src/kernel32/hmdisk.cpp
r7494 r7549 1 /* $Id: hmdisk.cpp,v 1.3 3 2001-11-29 19:58:09sandervl Exp $ */1 /* $Id: hmdisk.cpp,v 1.34 2001-12-05 14:16:00 sandervl Exp $ */ 2 2 3 3 /* … … 101 101 //TODO: PHYSICALDRIVEn!! 102 102 //****************************************************************************** 103 DWORD HMDeviceDiskClass::CreateFile (HANDLE hHandle, 104 LPCSTR lpFileName, 103 DWORD HMDeviceDiskClass::CreateFile (LPCSTR lpFileName, 105 104 PHMHANDLEDATA pHMHandleData, 106 105 PVOID lpSecurityAttributes, … … 1184 1183 DWORD nNumberOfBytesToRead, 1185 1184 LPDWORD lpNumberOfBytesRead, 1186 LPOVERLAPPED lpOverlapped) 1185 LPOVERLAPPED lpOverlapped, 1186 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1187 1187 { 1188 1188 LPVOID lpRealBuf; … … 1309 1309 return ret; 1310 1310 } 1311 /*****************************************************************************1312 * Name : BOOL ReadFileEx1313 * Purpose : The ReadFileEx function reads data from a file asynchronously.1314 * It is designed solely for asynchronous operation, unlike the1315 * ReadFile function, which is designed for both synchronous and1316 * asynchronous operation. ReadFileEx lets an application perform1317 * other processing during a file read operation.1318 * The ReadFileEx function reports its completion status asynchronously,1319 * calling a specified completion routine when reading is completed1320 * and the calling thread is in an alertable wait state.1321 * Parameters: HANDLE hFile handle of file to read1322 * LPVOID lpBuffer address of buffer1323 * DWORD nNumberOfBytesToRead number of bytes to read1324 * LPOVERLAPPED lpOverlapped address of offset1325 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine1326 * Variables :1327 * Result : TRUE / FALSE1328 * Remark :1329 * Status : UNTESTED STUB1330 *1331 * Author : Patrick Haller [Mon, 1998/06/15 08:00]1332 *****************************************************************************/1333 BOOL HMDeviceDiskClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,1334 LPVOID lpBuffer,1335 DWORD nNumberOfBytesToRead,1336 LPOVERLAPPED lpOverlapped,1337 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)1338 {1339 dprintf(("ERROR: ReadFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",1340 pHMHandleData->hHMHandle,1341 lpBuffer,1342 nNumberOfBytesToRead,1343 lpOverlapped,1344 lpCompletionRoutine));1345 return FALSE;1346 }1347 1348 1311 1349 1312 /***************************************************************************** … … 1367 1330 DWORD nNumberOfBytesToWrite, 1368 1331 LPDWORD lpNumberOfBytesWritten, 1369 LPOVERLAPPED lpOverlapped) 1332 LPOVERLAPPED lpOverlapped, 1333 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 1370 1334 { 1371 1335 LPVOID lpRealBuf; … … 1456 1420 } 1457 1421 1458 /*****************************************************************************1459 * Name : BOOL WriteFileEx1460 * Purpose : The WriteFileEx function writes data to a file. It is designed1461 * solely for asynchronous operation, unlike WriteFile, which is1462 * designed for both synchronous and asynchronous operation.1463 * WriteFileEx reports its completion status asynchronously,1464 * calling a specified completion routine when writing is completed1465 * and the calling thread is in an alertable wait state.1466 * Parameters: HANDLE hFile handle of file to write1467 * LPVOID lpBuffer address of buffer1468 * DWORD nNumberOfBytesToRead number of bytes to write1469 * LPOVERLAPPED lpOverlapped address of offset1470 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine1471 * Variables :1472 * Result : TRUE / FALSE1473 * Remark :1474 * Status : UNTESTED STUB1475 *1476 * Author : Patrick Haller [Mon, 1998/06/15 08:00]1477 *****************************************************************************/1478 1479 BOOL HMDeviceDiskClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,1480 LPVOID lpBuffer,1481 DWORD nNumberOfBytesToWrite,1482 LPOVERLAPPED lpOverlapped,1483 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)1484 {1485 dprintf(("ERROR: WriteFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",1486 pHMHandleData->hHMHandle,1487 lpBuffer,1488 nNumberOfBytesToWrite,1489 lpOverlapped,1490 lpCompletionRoutine));1491 return FALSE;1492 }1493 1422 1494 1423 /***************************************************************************** -
trunk/src/kernel32/hmdisk.h
r7457 r7549 1 /* $Id: hmdisk.h,v 1. 7 2001-11-26 14:54:01 sandervl Exp $ */1 /* $Id: hmdisk.h,v 1.8 2001-12-05 14:16:01 sandervl Exp $ */ 2 2 3 3 #ifndef __HMDISK_H__ … … 25 25 26 26 /* this is a handler method for calls to CreateFile() */ 27 virtual DWORD CreateFile (HANDLE hHandle, 28 LPCSTR lpFileName, 27 virtual DWORD CreateFile (LPCSTR lpFileName, 29 28 PHMHANDLEDATA pHMHandleData, 30 29 PVOID lpSecurityAttributes, … … 33 32 virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData); 34 33 35 /* this is a handler method for calls to ReadFile ()*/34 /* this is a handler method for calls to ReadFile/Ex */ 36 35 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 37 36 LPCVOID lpBuffer, 38 37 DWORD nNumberOfBytesToRead, 39 38 LPDWORD lpNumberOfBytesRead, 40 LPOVERLAPPED lpOverlapped); 39 LPOVERLAPPED lpOverlapped, 40 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 41 42 /* this is a handler method for calls to WriteFile/Ex */ 43 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 44 LPCVOID lpBuffer, 45 DWORD nNumberOfBytesToWrite, 46 LPDWORD lpNumberOfBytesWritten, 47 LPOVERLAPPED lpOverlapped, 48 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 41 49 42 50 /* this is a handler method for calls to SetFilePointer() */ … … 52 60 LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); 53 61 54 /* this is a handler method for calls to ReadFileEx() */ 55 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 56 LPVOID lpBuffer, 57 DWORD nNumberOfBytesToRead, 58 LPOVERLAPPED lpOverlapped, 59 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 60 61 /* this is a handler method for calls to WriteFile() */ 62 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 63 LPCVOID lpBuffer, 64 DWORD nNumberOfBytesToWrite, 65 LPDWORD lpNumberOfBytesWritten, 66 LPOVERLAPPED lpOverlapped); 67 68 /* this is a handler method for calls to WriteFileEx() */ 69 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 70 LPVOID lpBuffer, 71 DWORD nNumberOfBytesToWrite, 72 LPOVERLAPPED lpOverlapped, 73 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 74 75 /* this is a handler method for calls to GetFileType() */ 62 /* this is a handler method for calls to GetFileType() */ 76 63 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 77 64 -
trunk/src/kernel32/hmfile.cpp
r7474 r7549 1 /* $Id: hmfile.cpp,v 1.3 1 2001-11-28 23:33:36 phallerExp $ */1 /* $Id: hmfile.cpp,v 1.32 2001-12-05 14:16:01 sandervl Exp $ */ 2 2 3 3 /* … … 56 56 *****************************************************************************/ 57 57 58 DWORD HMDeviceFileClass::CreateFile (HANDLE hHandle, 59 LPCSTR lpFileName, 58 DWORD HMDeviceFileClass::CreateFile (LPCSTR lpFileName, 60 59 PHMHANDLEDATA pHMHandleData, 61 60 PVOID lpSecurityAttributes, … … 143 142 *****************************************************************************/ 144 143 145 DWORD HMDeviceFileClass::OpenFile (HANDLE hHandle, 146 LPCSTR lpszFileName, 144 DWORD HMDeviceFileClass::OpenFile (LPCSTR lpszFileName, 147 145 PHMHANDLEDATA pHMHandleData, 148 146 OFSTRUCT *pOFStruct, … … 337 335 duphdata.dwCreation = OPEN_EXISTING; 338 336 339 if(CreateFile( 0,srcfileinfo->lpszFileName, &duphdata,337 if(CreateFile(srcfileinfo->lpszFileName, &duphdata, 340 338 srcfileinfo->lpSecurityAttributes, NULL) == NO_ERROR) 341 339 { … … 436 434 DWORD nNumberOfBytesToRead, 437 435 LPDWORD lpNumberOfBytesRead, 438 LPOVERLAPPED lpOverlapped) 436 LPOVERLAPPED lpOverlapped, 437 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 439 438 { 440 439 LPVOID lpRealBuf; … … 501 500 } 502 501 503 /*****************************************************************************504 * Name : BOOL ReadFileEx505 * Purpose : The ReadFileEx function reads data from a file asynchronously.506 * It is designed solely for asynchronous operation, unlike the507 * ReadFile function, which is designed for both synchronous and508 * asynchronous operation. ReadFileEx lets an application perform509 * other processing during a file read operation.510 * The ReadFileEx function reports its completion status asynchronously,511 * calling a specified completion routine when reading is completed512 * and the calling thread is in an alertable wait state.513 * Parameters: HANDLE hFile handle of file to read514 * LPVOID lpBuffer address of buffer515 * DWORD nNumberOfBytesToRead number of bytes to read516 * LPOVERLAPPED lpOverlapped address of offset517 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine518 * Variables :519 * Result : TRUE / FALSE520 * Remark :521 * Status : UNTESTED STUB522 *523 * Author : Patrick Haller [Mon, 1998/06/15 08:00]524 *****************************************************************************/525 BOOL HMDeviceFileClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,526 LPVOID lpBuffer,527 DWORD nNumberOfBytesToRead,528 LPOVERLAPPED lpOverlapped,529 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)530 {531 dprintf(("ERROR: ReadFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",532 pHMHandleData->hHMHandle,533 lpBuffer,534 nNumberOfBytesToRead,535 lpOverlapped,536 lpCompletionRoutine));537 return FALSE;538 }539 540 502 541 503 /***************************************************************************** … … 559 521 DWORD nNumberOfBytesToWrite, 560 522 LPDWORD lpNumberOfBytesWritten, 561 LPOVERLAPPED lpOverlapped) 523 LPOVERLAPPED lpOverlapped, 524 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 562 525 { 563 526 LPVOID lpRealBuf; … … 621 584 } 622 585 623 /*****************************************************************************624 * Name : BOOL WriteFileEx625 * Purpose : The WriteFileEx function writes data to a file. It is designed626 * solely for asynchronous operation, unlike WriteFile, which is627 * designed for both synchronous and asynchronous operation.628 * WriteFileEx reports its completion status asynchronously,629 * calling a specified completion routine when writing is completed630 * and the calling thread is in an alertable wait state.631 * Parameters: HANDLE hFile handle of file to write632 * LPVOID lpBuffer address of buffer633 * DWORD nNumberOfBytesToRead number of bytes to write634 * LPOVERLAPPED lpOverlapped address of offset635 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine636 * Variables :637 * Result : TRUE / FALSE638 * Remark :639 * Status : UNTESTED STUB640 *641 * Author : Patrick Haller [Mon, 1998/06/15 08:00]642 *****************************************************************************/643 644 BOOL HMDeviceFileClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,645 LPVOID lpBuffer,646 DWORD nNumberOfBytesToWrite,647 LPOVERLAPPED lpOverlapped,648 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)649 {650 dprintf(("ERROR: WriteFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",651 pHMHandleData->hHMHandle,652 lpBuffer,653 nNumberOfBytesToWrite,654 lpOverlapped,655 lpCompletionRoutine));656 return FALSE;657 }658 586 659 587 /***************************************************************************** -
trunk/src/kernel32/hmfile.h
r7457 r7549 1 /* $Id: hmfile.h,v 1. 6 2001-11-26 14:54:02sandervl Exp $ */1 /* $Id: hmfile.h,v 1.7 2001-12-05 14:16:01 sandervl Exp $ */ 2 2 3 3 /* … … 45 45 46 46 /* this is a handler method for calls to CreateFile() */ 47 virtual DWORD CreateFile (HANDLE hHandle, 48 LPCSTR lpFileName, 47 virtual DWORD CreateFile (LPCSTR lpFileName, 49 48 PHMHANDLEDATA pHMHandleData, 50 49 PVOID lpSecurityAttributes, … … 52 51 53 52 /* this is a handler method for calls to OpenFile() */ 54 virtual DWORD OpenFile (HANDLE hHandle, 55 LPCSTR lpFileName, 53 virtual DWORD OpenFile (LPCSTR lpFileName, 56 54 PHMHANDLEDATA pHMHandleData, 57 55 OFSTRUCT* pOFStruct, … … 70 68 virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData); 71 69 72 /* this is a handler method for calls to ReadFile()*/70 /* this is a handler method for calls to ReadFile/Ex */ 73 71 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 74 72 LPCVOID lpBuffer, 75 73 DWORD nNumberOfBytesToRead, 76 74 LPDWORD lpNumberOfBytesRead, 77 LPOVERLAPPED lpOverlapped); 75 LPOVERLAPPED lpOverlapped, 76 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 78 77 79 /* this is a handler method for calls to ReadFileEx() */ 80 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 81 LPVOID lpBuffer, 82 DWORD nNumberOfBytesToRead, 83 LPOVERLAPPED lpOverlapped, 84 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 85 86 /* this is a handler method for calls to WriteFile() */ 78 /* this is a handler method for calls to WriteFile/Ex */ 87 79 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 88 80 LPCVOID lpBuffer, 89 81 DWORD nNumberOfBytesToWrite, 90 82 LPDWORD lpNumberOfBytesWritten, 91 LPOVERLAPPED lpOverlapped); 83 LPOVERLAPPED lpOverlapped, 84 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 92 85 93 /* this is a handler method for calls to WriteFileEx() */ 94 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 95 LPVOID lpBuffer, 96 DWORD nNumberOfBytesToWrite, 97 LPOVERLAPPED lpOverlapped, 98 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 99 100 /* this is a handler method for calls to GetFileType() */ 86 /* this is a handler method for calls to GetFileType() */ 101 87 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 102 88 -
trunk/src/kernel32/hmmailslot.cpp
r7489 r7549 1 /* $Id: hmmailslot.cpp,v 1. 5 2001-11-29 13:38:51 sandervl Exp $1 /* $Id: hmmailslot.cpp,v 1.6 2001-12-05 14:16:01 sandervl Exp $ 2 2 * 3 3 * Win32 mailslot APIs … … 176 176 *****************************************************************************/ 177 177 178 DWORD HMMailslotClass::CreateFile (HANDLE hHandle, 179 LPCSTR lpFileName, 178 DWORD HMMailslotClass::CreateFile (LPCSTR lpFileName, 180 179 PHMHANDLEDATA pHMHandleData, 181 180 PVOID lpSecurityAttributes, … … 361 360 DWORD nNumberOfBytesToRead, 362 361 LPDWORD lpNumberOfBytesRead, 363 LPOVERLAPPED lpOverlapped) 362 LPOVERLAPPED lpOverlapped, 363 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 364 364 { 365 365 HMMailSlotInfo *mailslot = (HMMailSlotInfo *)pHMHandleData->dwUserData; … … 380 380 return FALSE; 381 381 } 382 return ::ReadFile(mailslot->hPipe, (LPVOID)lpBuffer, nNumberOfBytesToRead, 383 lpNumberOfBytesRead, lpOverlapped); 384 } 385 386 /***************************************************************************** 387 * Name : BOOL ReadFileEx 388 * Purpose : The ReadFileEx function reads data from a file asynchronously. 389 * It is designed solely for asynchronous operation, unlike the 390 * ReadFile function, which is designed for both synchronous and 391 * asynchronous operation. ReadFileEx lets an application perform 392 * other processing during a file read operation. 393 * The ReadFileEx function reports its completion status asynchronously, 394 * calling a specified completion routine when reading is completed 395 * and the calling thread is in an alertable wait state. 396 * Parameters: HANDLE hFile handle of file to read 397 * LPVOID lpBuffer address of buffer 398 * DWORD nNumberOfBytesToRead number of bytes to read 399 * LPOVERLAPPED lpOverlapped address of offset 400 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine 401 * Variables : 402 * Result : TRUE / FALSE 403 * Remark : 404 * Status : UNTESTED STUB 405 * 406 * Author : Patrick Haller [Mon, 1998/06/15 08:00] 407 *****************************************************************************/ 408 BOOL HMMailslotClass::ReadFileEx(PHMHANDLEDATA pHMHandleData, 409 LPVOID lpBuffer, 410 DWORD nNumberOfBytesToRead, 411 LPOVERLAPPED lpOverlapped, 412 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 413 { 414 HMMailSlotInfo *mailslot = (HMMailSlotInfo *)pHMHandleData->dwUserData; 415 416 dprintf(("HMMailslotClass::ReadFileEx(%08xh,%08xh,%08xh,%08xh,%08xh)", pHMHandleData->hHMHandle, 417 lpBuffer, nNumberOfBytesToRead, lpOverlapped, lpCompletionRoutine)); 418 419 if(mailslot == NULL) { 420 DebugInt3(); 421 return FALSE; 422 } 423 if(mailslot->fServer == FALSE) { 424 dprintf(("ReadFile not allowed with client handle")); 425 SetLastError(ERROR_INVALID_FUNCTION); //TODO: right error? 426 return FALSE; 427 } 428 return ::ReadFileEx(mailslot->hPipe, lpBuffer, nNumberOfBytesToRead, lpOverlapped, lpCompletionRoutine); 429 } 430 382 if(lpCompletionRoutine) { 383 return ::ReadFileEx(mailslot->hPipe, (LPVOID)lpBuffer, nNumberOfBytesToRead, 384 lpOverlapped, lpCompletionRoutine); 385 } 386 else return ::ReadFile(mailslot->hPipe, (LPVOID)lpBuffer, nNumberOfBytesToRead, 387 lpNumberOfBytesRead, lpOverlapped); 388 } 431 389 432 390 /***************************************************************************** … … 447 405 448 406 BOOL HMMailslotClass::WriteFile(PHMHANDLEDATA pHMHandleData, 449 LPCVOID lpBuffer, 450 DWORD nNumberOfBytesToWrite, 451 LPDWORD lpNumberOfBytesWritten, 452 LPOVERLAPPED lpOverlapped) 407 LPCVOID lpBuffer, 408 DWORD nNumberOfBytesToWrite, 409 LPDWORD lpNumberOfBytesWritten, 410 LPOVERLAPPED lpOverlapped, 411 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 453 412 { 454 413 HMMailSlotInfo *mailslot = (HMMailSlotInfo *)pHMHandleData->dwUserData; … … 471 430 } 472 431 473 return ::WriteFile(mailslot->hPipe, lpBuffer, nNumberOfBytesToWrite, 474 lpNumberOfBytesWritten, lpOverlapped); 475 } 476 477 /***************************************************************************** 478 * Name : BOOL WriteFileEx 479 * Purpose : The WriteFileEx function writes data to a file. It is designed 480 * solely for asynchronous operation, unlike WriteFile, which is 481 * designed for both synchronous and asynchronous operation. 482 * WriteFileEx reports its completion status asynchronously, 483 * calling a specified completion routine when writing is completed 484 * and the calling thread is in an alertable wait state. 485 * Parameters: HANDLE hFile handle of file to write 486 * LPVOID lpBuffer address of buffer 487 * DWORD nNumberOfBytesToRead number of bytes to write 488 * LPOVERLAPPED lpOverlapped address of offset 489 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine 490 * Variables : 491 * Result : TRUE / FALSE 492 * Remark : 493 * Status : UNTESTED STUB 494 * 495 * Author : Patrick Haller [Mon, 1998/06/15 08:00] 496 *****************************************************************************/ 497 498 BOOL HMMailslotClass::WriteFileEx(PHMHANDLEDATA pHMHandleData, 499 LPVOID lpBuffer, 500 DWORD nNumberOfBytesToWrite, 501 LPOVERLAPPED lpOverlapped, 502 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 503 { 504 HMMailSlotInfo *mailslot = (HMMailSlotInfo *)pHMHandleData->dwUserData; 505 506 dprintf(("HMMailslotClass::WriteFileEx(%08xh,%08xh,%08xh,%08xh,%08xh)", 507 pHMHandleData->hHMHandle, lpBuffer, nNumberOfBytesToWrite, 508 lpOverlapped,lpCompletionRoutine)); 509 510 if(mailslot == NULL) { 511 DebugInt3(); 512 return FALSE; 513 } 514 if(mailslot->fServer == TRUE) { 515 dprintf(("ReadFile not allowed with server handle")); 516 SetLastError(ERROR_INVALID_FUNCTION); //TODO: right error? 517 return FALSE; 518 } 519 return ::WriteFileEx(mailslot->hPipe, lpBuffer, nNumberOfBytesToWrite,lpOverlapped,lpCompletionRoutine); 520 } 432 if(lpCompletionRoutine) { 433 return ::WriteFileEx(mailslot->hPipe, lpBuffer, nNumberOfBytesToWrite, 434 lpOverlapped, lpCompletionRoutine); 435 } 436 else return ::WriteFile(mailslot->hPipe, lpBuffer, nNumberOfBytesToWrite, 437 lpNumberOfBytesWritten, lpOverlapped); 438 } 439 -
trunk/src/kernel32/hmmailslot.h
r7457 r7549 69 69 70 70 /* this is a handler method for calls to CreateFile() */ 71 virtual DWORD CreateFile (HANDLE hHandle, 72 LPCSTR lpFileName, 71 virtual DWORD CreateFile (LPCSTR lpFileName, 73 72 PHMHANDLEDATA pHMHandleData, 74 73 PVOID lpSecurityAttributes, … … 79 78 80 79 81 /* this is a handler method for calls to ReadFile()*/80 /* this is a handler method for calls to ReadFile/Ex */ 82 81 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 83 82 LPCVOID lpBuffer, 84 83 DWORD nNumberOfBytesToRead, 85 84 LPDWORD lpNumberOfBytesRead, 86 LPOVERLAPPED lpOverlapped); 85 LPOVERLAPPED lpOverlapped, 86 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 87 87 88 /* this is a handler method for calls to ReadFileEx() */ 89 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 90 LPVOID lpBuffer, 91 DWORD nNumberOfBytesToRead, 92 LPOVERLAPPED lpOverlapped, 93 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 94 95 /* this is a handler method for calls to WriteFile() */ 88 /* this is a handler method for calls to WriteFile/Ex */ 96 89 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 97 90 LPCVOID lpBuffer, 98 91 DWORD nNumberOfBytesToWrite, 99 92 LPDWORD lpNumberOfBytesWritten, 100 LPOVERLAPPED lpOverlapped); 101 102 /* this is a handler method for calls to WriteFileEx() */ 103 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 104 LPVOID lpBuffer, 105 DWORD nNumberOfBytesToWrite, 106 LPOVERLAPPED lpOverlapped, 107 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 93 LPOVERLAPPED lpOverlapped, 94 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 108 95 109 96 private: -
trunk/src/kernel32/hmnpipe.cpp
r7489 r7549 1 /* $Id: hmnpipe.cpp,v 1. 6 2001-11-29 13:38:51sandervl Exp $ */1 /* $Id: hmnpipe.cpp,v 1.7 2001-12-05 14:16:02 sandervl Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 128 128 *****************************************************************************/ 129 129 130 DWORD HMDeviceNamedPipeClass::CreateFile (HANDLE hHandle, 131 LPCSTR lpFileName, 130 DWORD HMDeviceNamedPipeClass::CreateFile (LPCSTR lpFileName, 132 131 PHMHANDLEDATA pHMHandleData, 133 132 PVOID lpSecurityAttributes, … … 147 146 148 147 /***************************************************************************** 148 * Name : DWORD HMDeviceFileClass::GetFileType 149 * Purpose : determine the handle type 150 * Parameters: PHMHANDLEDATA pHMHandleData 151 * Variables : 152 * Result : API returncode 153 * Remark : 154 * Status : 155 * 156 * Author : SvL 157 *****************************************************************************/ 158 159 DWORD HMDeviceNamedPipeClass::GetFileType(PHMHANDLEDATA pHMHandleData) 160 { 161 dprintfl(("KERNEL32: HMDeviceNamedPipeClass::GetFileType %s(%08x)\n", 162 lpHMDeviceName, 163 pHMHandleData)); 164 165 return FILE_TYPE_PIPE; 166 } 167 168 /***************************************************************************** 149 169 * Name : DWORD HMDeviceNamedPipeClass::CloseHandle 150 170 * Purpose : close the handle -
trunk/src/kernel32/hmnpipe.h
r7457 r7549 1 /* $Id: hmnpipe.h,v 1. 4 2001-11-26 14:54:03sandervl Exp $ */1 /* $Id: hmnpipe.h,v 1.5 2001-12-05 14:16:02 sandervl Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 32 32 33 33 /* this is a handler method for calls to CreateFile() */ 34 virtual DWORD CreateFile (HANDLE hHandle, 35 LPCSTR lpFileName, 34 virtual DWORD CreateFile (LPCSTR lpFileName, 36 35 PHMHANDLEDATA pHMHandleData, 37 36 PVOID lpSecurityAttributes, 38 37 PHMHANDLEDATA pHMHandleDataTemplate); 38 39 /* this is a handler method for calls to GetFileType() */ 40 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 39 41 40 42 /* this is a handler method for calls to CloseHandle() */ -
trunk/src/kernel32/hmnul.cpp
r7476 r7549 1 /* $Id: hmnul.cpp,v 1. 1 2001-11-29 00:20:48 phallerExp $ */1 /* $Id: hmnul.cpp,v 1.2 2001-12-05 14:16:02 sandervl Exp $ */ 2 2 3 3 /* … … 60 60 } 61 61 62 DWORD HMDeviceNulClass::CreateFile(HANDLE hHandle, 63 LPCSTR lpFileName, 64 PHMHANDLEDATA pHMHandleData, 65 PVOID lpSecurityAttributes, 66 PHMHANDLEDATA pHMHandleDataTemplate) 62 DWORD HMDeviceNulClass::CreateFile(LPCSTR lpFileName, 63 PHMHANDLEDATA pHMHandleData, 64 PVOID lpSecurityAttributes, 65 PHMHANDLEDATA pHMHandleDataTemplate) 67 66 { 68 67 dprintf(("HMDeviceNulClass::CreateFile(%s,%08xh,%08xh,%08xh)\n", … … 107 106 108 107 BOOL HMDeviceNulClass::WriteFile(PHMHANDLEDATA pHMHandleData, 109 LPCVOID lpBuffer, 110 DWORD nNumberOfBytesToWrite, 111 LPDWORD lpNumberOfBytesWritten, 112 LPOVERLAPPED lpOverlapped) 108 LPCVOID lpBuffer, 109 DWORD nNumberOfBytesToWrite, 110 LPDWORD lpNumberOfBytesWritten, 111 LPOVERLAPPED lpOverlapped, 112 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 113 113 { 114 114 dprintf(("KERNEL32:HMDeviceNulClass::WriteFile %s(%08x,%08x,%08x,%08x,%08x)", … … 146 146 } 147 147 148 /*****************************************************************************149 * Name : BOOL WriteFileEx150 * Purpose : The WriteFileEx function writes data to a file. It is designed151 * solely for asynchronous operation, unlike WriteFile, which is152 * designed for both synchronous and asynchronous operation.153 * WriteFileEx reports its completion status asynchronously,154 * calling a specified completion routine when writing is completed155 * and the calling thread is in an alertable wait state.156 * Parameters: HANDLE hFile handle of file to write157 * LPVOID lpBuffer address of buffer158 * DWORD nNumberOfBytesToRead number of bytes to write159 * LPOVERLAPPED lpOverlapped address of offset160 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine161 * Variables :162 * Result : TRUE / FALSE163 * Remark :164 * Status : UNTESTED STUB165 *166 * Author : Patrick Haller [Mon, 1998/06/15 08:00]167 *****************************************************************************/168 169 BOOL HMDeviceNulClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,170 LPVOID lpBuffer,171 DWORD nNumberOfBytesToWrite,172 LPOVERLAPPED lpOverlapped,173 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)174 {175 dprintf(("ERROR: WriteFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",176 lpHMDeviceName,177 pHMHandleData->hHMHandle,178 lpBuffer,179 nNumberOfBytesToWrite,180 lpOverlapped,181 lpCompletionRoutine));182 183 SetLastError(ERROR_INVALID_FUNCTION);184 return FALSE;185 }186 148 187 149 /***************************************************************************** … … 202 164 203 165 BOOL HMDeviceNulClass::ReadFile(PHMHANDLEDATA pHMHandleData, 204 LPCVOID lpBuffer, 205 DWORD nNumberOfBytesToRead, 206 LPDWORD lpNumberOfBytesRead, 207 LPOVERLAPPED lpOverlapped) 166 LPCVOID lpBuffer, 167 DWORD nNumberOfBytesToRead, 168 LPDWORD lpNumberOfBytesRead, 169 LPOVERLAPPED lpOverlapped, 170 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 208 171 { 209 172 dprintf(("KERNEL32:HMDeviceNulClass::ReadFile %s(%08x,%08x,%08x,%08x,%08x)", … … 238 201 } 239 202 return ret; 240 }241 242 /*****************************************************************************243 * Name : BOOL ReadFileEx244 * Purpose : The ReadFileEx function reads data from a file asynchronously.245 * It is designed solely for asynchronous operation, unlike the246 * ReadFile function, which is designed for both synchronous and247 * asynchronous operation. ReadFileEx lets an application perform248 * other processing during a file read operation.249 * The ReadFileEx function reports its completion status asynchronously,250 * calling a specified completion routine when reading is completed251 * and the calling thread is in an alertable wait state.252 * Parameters: HANDLE hFile handle of file to read253 * LPVOID lpBuffer address of buffer254 * DWORD nNumberOfBytesToRead number of bytes to read255 * LPOVERLAPPED lpOverlapped address of offset256 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine257 * Variables :258 * Result : TRUE / FALSE259 * Remark :260 * Status : UNTESTED STUB261 *262 * Author : Patrick Haller [Mon, 1998/06/15 08:00]263 *****************************************************************************/264 BOOL HMDeviceNulClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,265 LPVOID lpBuffer,266 DWORD nNumberOfBytesToRead,267 LPOVERLAPPED lpOverlapped,268 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)269 {270 dprintf(("ERROR: ReadFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",271 lpHMDeviceName,272 pHMHandleData->hHMHandle,273 lpBuffer,274 nNumberOfBytesToRead,275 lpOverlapped,276 lpCompletionRoutine));277 278 SetLastError(ERROR_INVALID_FUNCTION);279 return FALSE;280 203 } 281 204 -
trunk/src/kernel32/hmnul.h
r7476 r7549 1 /* $Id: hmnul.h,v 1. 1 2001-11-29 00:20:48 phallerExp $ */1 /* $Id: hmnul.h,v 1.2 2001-12-05 14:16:03 sandervl Exp $ */ 2 2 3 3 /* … … 23 23 24 24 /* this is the handler method for calls to CreateFile() */ 25 virtual DWORD CreateFile (HANDLE hHandle, 26 LPCSTR lpFileName, 25 virtual DWORD CreateFile (LPCSTR lpFileName, 27 26 PHMHANDLEDATA pHMHandleData, 28 27 PVOID lpSecurityAttributes, … … 39 38 40 39 41 /* this is a handler method for calls to ReadFile()*/40 /* this is a handler method for calls to ReadFile/Ex */ 42 41 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 43 42 LPCVOID lpBuffer, 44 43 DWORD nNumberOfBytesToRead, 45 44 LPDWORD lpNumberOfBytesRead, 46 LPOVERLAPPED lpOverlapped); 45 LPOVERLAPPED lpOverlapped, 46 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 47 47 48 /* this is a handler method for calls to ReadFileEx() */ 49 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 50 LPVOID lpBuffer, 51 DWORD nNumberOfBytesToRead, 52 LPOVERLAPPED lpOverlapped, 53 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 54 55 /* this is a handler method for calls to WriteFile() */ 48 /* this is a handler method for calls to WriteFile/Ex */ 56 49 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 57 50 LPCVOID lpBuffer, 58 51 DWORD nNumberOfBytesToWrite, 59 52 LPDWORD lpNumberOfBytesWritten, 60 LPOVERLAPPED lpOverlapped); 61 62 /* this is a handler method for calls to WriteFileEx() */ 63 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 64 LPVOID lpBuffer, 65 DWORD nNumberOfBytesToWrite, 66 LPOVERLAPPED lpOverlapped, 67 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 53 LPOVERLAPPED lpOverlapped, 54 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 68 55 69 56 private: -
trunk/src/kernel32/hmparport.cpp
r7542 r7549 1 /* $Id: hmparport.cpp,v 1.1 5 2001-12-04 12:56:52 phallerExp $ */1 /* $Id: hmparport.cpp,v 1.16 2001-12-05 14:16:04 sandervl Exp $ */ 2 2 3 3 /* … … 232 232 } 233 233 234 DWORD HMDeviceParPortClass::CreateFile(HANDLE hHandle, 235 LPCSTR lpFileName, 234 DWORD HMDeviceParPortClass::CreateFile(LPCSTR lpFileName, 236 235 PHMHANDLEDATA pHMHandleData, 237 236 PVOID lpSecurityAttributes, … … 331 330 DWORD nNumberOfBytesToWrite, 332 331 LPDWORD lpNumberOfBytesWritten, 333 LPOVERLAPPED lpOverlapped) 332 LPOVERLAPPED lpOverlapped, 333 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 334 334 { 335 335 dprintf(("KERNEL32:HMDeviceParPortClass::WriteFile %s(%08x,%08x,%08x,%08x,%08x)", … … 364 364 365 365 return ret; 366 }367 368 /*****************************************************************************369 * Name : BOOL WriteFileEx370 * Purpose : The WriteFileEx function writes data to a file. It is designed371 * solely for asynchronous operation, unlike WriteFile, which is372 * designed for both synchronous and asynchronous operation.373 * WriteFileEx reports its completion status asynchronously,374 * calling a specified completion routine when writing is completed375 * and the calling thread is in an alertable wait state.376 * Parameters: HANDLE hFile handle of file to write377 * LPVOID lpBuffer address of buffer378 * DWORD nNumberOfBytesToRead number of bytes to write379 * LPOVERLAPPED lpOverlapped address of offset380 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine381 * Variables :382 * Result : TRUE / FALSE383 * Remark :384 * Status : UNTESTED STUB385 *386 * Author : Patrick Haller [Mon, 1998/06/15 08:00]387 *****************************************************************************/388 389 BOOL HMDeviceParPortClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,390 LPVOID lpBuffer,391 DWORD nNumberOfBytesToWrite,392 LPOVERLAPPED lpOverlapped,393 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)394 {395 dprintf(("ERROR: WriteFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",396 lpHMDeviceName,397 pHMHandleData->hHMHandle,398 lpBuffer,399 nNumberOfBytesToWrite,400 lpOverlapped,401 lpCompletionRoutine));402 403 SetLastError(ERROR_INVALID_FUNCTION);404 return FALSE;405 366 } 406 367 … … 425 386 DWORD nNumberOfBytesToRead, 426 387 LPDWORD lpNumberOfBytesRead, 427 LPOVERLAPPED lpOverlapped) 388 LPOVERLAPPED lpOverlapped, 389 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 428 390 { 429 391 dprintf(("KERNEL32:HMDeviceParPortClass::ReadFile %s(%08x,%08x,%08x,%08x,%08x)", … … 457 419 } 458 420 return ret; 459 }460 461 /*****************************************************************************462 * Name : BOOL ReadFileEx463 * Purpose : The ReadFileEx function reads data from a file asynchronously.464 * It is designed solely for asynchronous operation, unlike the465 * ReadFile function, which is designed for both synchronous and466 * asynchronous operation. ReadFileEx lets an application perform467 * other processing during a file read operation.468 * The ReadFileEx function reports its completion status asynchronously,469 * calling a specified completion routine when reading is completed470 * and the calling thread is in an alertable wait state.471 * Parameters: HANDLE hFile handle of file to read472 * LPVOID lpBuffer address of buffer473 * DWORD nNumberOfBytesToRead number of bytes to read474 * LPOVERLAPPED lpOverlapped address of offset475 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine476 * Variables :477 * Result : TRUE / FALSE478 * Remark :479 * Status : UNTESTED STUB480 *481 * Author : Patrick Haller [Mon, 1998/06/15 08:00]482 *****************************************************************************/483 BOOL HMDeviceParPortClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,484 LPVOID lpBuffer,485 DWORD nNumberOfBytesToRead,486 LPOVERLAPPED lpOverlapped,487 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)488 {489 dprintf(("ERROR: ReadFileEx %s (%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",490 lpHMDeviceName,491 pHMHandleData->hHMHandle,492 lpBuffer,493 nNumberOfBytesToRead,494 lpOverlapped,495 lpCompletionRoutine));496 497 SetLastError(ERROR_INVALID_FUNCTION);498 return FALSE;499 421 } 500 422 -
trunk/src/kernel32/hmparport.h
r7546 r7549 1 /* $Id: hmparport.h,v 1. 5 2001-12-05 09:09:52 phallerExp $ */1 /* $Id: hmparport.h,v 1.6 2001-12-05 14:16:05 sandervl Exp $ */ 2 2 3 3 /* … … 23 23 24 24 /* this is the handler method for calls to CreateFile() */ 25 virtual DWORD CreateFile (HANDLE hHandle, 26 LPCSTR lpFileName, 25 virtual DWORD CreateFile (LPCSTR lpFileName, 27 26 PHMHANDLEDATA pHMHandleData, 28 27 PVOID lpSecurityAttributes, … … 62 61 63 62 64 /* this is a handler method for calls to ReadFile()*/63 /* this is a handler method for calls to ReadFile/Ex */ 65 64 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 66 65 LPCVOID lpBuffer, 67 66 DWORD nNumberOfBytesToRead, 68 67 LPDWORD lpNumberOfBytesRead, 69 LPOVERLAPPED lpOverlapped); 68 LPOVERLAPPED lpOverlapped, 69 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 70 70 71 /* this is a handler method for calls to ReadFileEx() */ 72 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 73 LPVOID lpBuffer, 74 DWORD nNumberOfBytesToRead, 75 LPOVERLAPPED lpOverlapped, 76 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 77 78 /* this is a handler method for calls to WriteFile() */ 71 /* this is a handler method for calls to WriteFile/Ex */ 79 72 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 80 73 LPCVOID lpBuffer, 81 74 DWORD nNumberOfBytesToWrite, 82 75 LPDWORD lpNumberOfBytesWritten, 83 LPOVERLAPPED lpOverlapped); 84 85 /* this is a handler method for calls to WriteFileEx() */ 86 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 87 LPVOID lpBuffer, 88 DWORD nNumberOfBytesToWrite, 89 LPOVERLAPPED lpOverlapped, 90 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 76 LPOVERLAPPED lpOverlapped, 77 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 91 78 92 79 private: -
trunk/src/kernel32/hmstd.cpp
r6511 r7549 1 /* $Id: hmstd.cpp,v 1. 5 2001-08-10 19:32:28sandervl Exp $ */1 /* $Id: hmstd.cpp,v 1.6 2001-12-05 14:16:05 sandervl Exp $ */ 2 2 3 3 /* … … 68 68 DWORD nNumberOfBytesToRead, 69 69 LPDWORD lpNumberOfBytesRead, 70 LPOVERLAPPED lpOverlapped) 70 LPOVERLAPPED lpOverlapped, 71 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 71 72 { 72 73 BOOL bRC; … … 92 93 } 93 94 94 /*****************************************************************************95 * Name : BOOL ReadFileEx96 * Purpose : The ReadFileEx function reads data from a file asynchronously.97 * It is designed solely for asynchronous operation, unlike the98 * ReadFile function, which is designed for both synchronous and99 * asynchronous operation. ReadFileEx lets an application perform100 * other processing during a file read operation.101 * The ReadFileEx function reports its completion status asynchronously,102 * calling a specified completion routine when reading is completed103 * and the calling thread is in an alertable wait state.104 * Parameters: HANDLE hFile handle of file to read105 * LPVOID lpBuffer address of buffer106 * DWORD nNumberOfBytesToRead number of bytes to read107 * LPOVERLAPPED lpOverlapped address of offset108 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine109 * Variables :110 * Result : TRUE / FALSE111 * Remark :112 * Status : UNTESTED STUB113 *114 * Author : Patrick Haller [Mon, 1998/06/15 08:00]115 *****************************************************************************/116 BOOL HMDeviceStandardClass::ReadFileEx(PHMHANDLEDATA pHMHandleData,117 LPVOID lpBuffer,118 DWORD nNumberOfBytesToRead,119 LPOVERLAPPED lpOverlapped,120 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)121 {122 dprintf(("ERROR: ReadFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",123 pHMHandleData->hHMHandle,124 lpBuffer,125 nNumberOfBytesToRead,126 lpOverlapped,127 lpCompletionRoutine));128 129 return FALSE;130 }131 132 95 133 96 /***************************************************************************** … … 151 114 DWORD nNumberOfBytesToWrite, 152 115 LPDWORD lpNumberOfBytesWritten, 153 LPOVERLAPPED lpOverlapped) 116 LPOVERLAPPED lpOverlapped, 117 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) 154 118 { 155 119 DWORD byteswritten; … … 188 152 } 189 153 190 /*****************************************************************************191 * Name : BOOL WriteFileEx192 * Purpose : The WriteFileEx function writes data to a file. It is designed193 * solely for asynchronous operation, unlike WriteFile, which is194 * designed for both synchronous and asynchronous operation.195 * WriteFileEx reports its completion status asynchronously,196 * calling a specified completion routine when writing is completed197 * and the calling thread is in an alertable wait state.198 * Parameters: HANDLE hFile handle of file to write199 * LPVOID lpBuffer address of buffer200 * DWORD nNumberOfBytesToRead number of bytes to write201 * LPOVERLAPPED lpOverlapped address of offset202 * LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine address of completion routine203 * Variables :204 * Result : TRUE / FALSE205 * Remark :206 * Status : UNTESTED STUB207 *208 * Author : Patrick Haller [Mon, 1998/06/15 08:00]209 *****************************************************************************/210 211 BOOL HMDeviceStandardClass::WriteFileEx(PHMHANDLEDATA pHMHandleData,212 LPVOID lpBuffer,213 DWORD nNumberOfBytesToWrite,214 LPOVERLAPPED lpOverlapped,215 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)216 {217 dprintf(("ERROR: WriteFileEx(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",218 pHMHandleData->hHMHandle,219 lpBuffer,220 nNumberOfBytesToWrite,221 lpOverlapped,222 lpCompletionRoutine));223 return FALSE;224 }225 154 226 155 /***************************************************************************** -
trunk/src/kernel32/hmstd.h
r5019 r7549 1 /* $Id: hmstd.h,v 1. 1 2001-01-23 18:31:26sandervl Exp $ */1 /* $Id: hmstd.h,v 1.2 2001-12-05 14:16:05 sandervl Exp $ */ 2 2 3 3 /* … … 34 34 HMDeviceStandardClass(LPCSTR lpDeviceName) : HMDeviceOpen32Class(lpDeviceName) {} 35 35 36 /* this is a handler method for calls to ReadFile()*/36 /* this is a handler method for calls to ReadFile/Ex */ 37 37 virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData, 38 38 LPCVOID lpBuffer, 39 39 DWORD nNumberOfBytesToRead, 40 40 LPDWORD lpNumberOfBytesRead, 41 LPOVERLAPPED lpOverlapped); 41 LPOVERLAPPED lpOverlapped, 42 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 42 43 43 /* this is a handler method for calls to ReadFileEx() */ 44 virtual BOOL ReadFileEx(PHMHANDLEDATA pHMHandleData, 45 LPVOID lpBuffer, 46 DWORD nNumberOfBytesToRead, 47 LPOVERLAPPED lpOverlapped, 48 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 49 50 /* this is a handler method for calls to WriteFile() */ 44 /* this is a handler method for calls to WriteFile/Ex */ 51 45 virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData, 52 46 LPCVOID lpBuffer, 53 47 DWORD nNumberOfBytesToWrite, 54 48 LPDWORD lpNumberOfBytesWritten, 55 LPOVERLAPPED lpOverlapped); 49 LPOVERLAPPED lpOverlapped, 50 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 56 51 57 /* this is a handler method for calls to WriteFileEx() */ 58 virtual BOOL WriteFileEx(PHMHANDLEDATA pHMHandleData, 59 LPVOID lpBuffer, 60 DWORD nNumberOfBytesToWrite, 61 LPOVERLAPPED lpOverlapped, 62 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); 63 64 /* this is a handler method for calls to GetFileType() */ 52 /* this is a handler method for calls to GetFileType() */ 65 53 virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData); 66 54 };
Note:
See TracChangeset
for help on using the changeset viewer.