| 1 | /* $Id: hmopen32.cpp,v 1.12 1999-11-13 14:21:30 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 5 | * Win32 Unified Handle Manager for OS/2
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 | /*****************************************************************************
|
|---|
| 10 | * Remark *
|
|---|
| 11 | *****************************************************************************
|
|---|
| 12 | */
|
|---|
| 13 |
|
|---|
| 14 | //#define DEBUG_LOCAL
|
|---|
| 15 |
|
|---|
| 16 | #ifdef DEBUG_LOCAL
|
|---|
| 17 | # define dprintfl(a) dprintf(a)
|
|---|
| 18 | #else
|
|---|
| 19 | inline void ignore_dprintf(...){}
|
|---|
| 20 | # define dprintfl(a) ignore_dprintf(a)
|
|---|
| 21 | #endif
|
|---|
| 22 |
|
|---|
| 23 | /*****************************************************************************
|
|---|
| 24 | * Includes *
|
|---|
| 25 | *****************************************************************************/
|
|---|
| 26 |
|
|---|
| 27 | #include <os2win.h>
|
|---|
| 28 | #include <string.h>
|
|---|
| 29 | #include "HandleManager.h"
|
|---|
| 30 | #include "HMOpen32.h"
|
|---|
| 31 | #include "mmap.h"
|
|---|
| 32 |
|
|---|
| 33 | /*****************************************************************************
|
|---|
| 34 | * Defines *
|
|---|
| 35 | *****************************************************************************/
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 | /*****************************************************************************
|
|---|
| 39 | * Structures *
|
|---|
| 40 | *****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | /*****************************************************************************
|
|---|
| 43 | * Name : HMDeviceOpen32Class::_DeviceRequest
|
|---|
| 44 | * Purpose : entry method for special request functions
|
|---|
| 45 | * Parameters: ULONG ulRequestCode
|
|---|
| 46 | * various parameters as required
|
|---|
| 47 | * Variables :
|
|---|
| 48 | * Result :
|
|---|
| 49 | * Remark : the standard behaviour is to return an error code for non-
|
|---|
| 50 | * existant request codes
|
|---|
| 51 | * Status :
|
|---|
| 52 | *
|
|---|
| 53 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 54 | *****************************************************************************/
|
|---|
| 55 | DWORD HMDeviceOpen32Class::_DeviceRequest (PHMHANDLEDATA pHMHandleData,
|
|---|
| 56 | ULONG ulRequestCode,
|
|---|
| 57 | ULONG arg1,
|
|---|
| 58 | ULONG arg2,
|
|---|
| 59 | ULONG arg3,
|
|---|
| 60 | ULONG arg4)
|
|---|
| 61 | {
|
|---|
| 62 | dprintfl(("KERNEL32: HandleManager::Open32::_DeviceRequest %s(%08x,%08x) - stub?\n",
|
|---|
| 63 | lpHMDeviceName,
|
|---|
| 64 | pHMHandleData,
|
|---|
| 65 | ulRequestCode));
|
|---|
| 66 |
|
|---|
| 67 | return(ERROR_INVALID_FUNCTION);
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | /*****************************************************************************
|
|---|
| 72 | * Name : HMDeviceHandler::DuplicateHandle
|
|---|
| 73 | * Purpose : dummy version
|
|---|
| 74 | * Parameters:
|
|---|
| 75 | * various parameters as required
|
|---|
| 76 | * Variables :
|
|---|
| 77 | * Result :
|
|---|
| 78 | * Remark : the standard behaviour is to return an error code for non-
|
|---|
| 79 | * existant request codes
|
|---|
| 80 | * Status :
|
|---|
| 81 | *
|
|---|
| 82 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 83 | *****************************************************************************/
|
|---|
| 84 | BOOL HMDeviceOpen32Class::DuplicateHandle(PHMHANDLEDATA pHMHandleData, HANDLE srcprocess,
|
|---|
| 85 | PHMHANDLEDATA pHMSrcHandle,
|
|---|
| 86 | HANDLE destprocess,
|
|---|
| 87 | PHANDLE desthandle,
|
|---|
| 88 | DWORD fdwAccess,
|
|---|
| 89 | BOOL fInherit,
|
|---|
| 90 | DWORD fdwOptions)
|
|---|
| 91 | {
|
|---|
| 92 | BOOL rc;
|
|---|
| 93 |
|
|---|
| 94 | dprintf(("KERNEL32:HandleManager::Open32::DuplicateHandle %s(%08x,%08x,%08x,%08x,%08x)\n",
|
|---|
| 95 | lpHMDeviceName,
|
|---|
| 96 | pHMHandleData,
|
|---|
| 97 | srcprocess, pHMSrcHandle->hHMHandle, destprocess, desthandle));
|
|---|
| 98 |
|
|---|
| 99 | #if 1
|
|---|
| 100 | rc = O32_DuplicateHandle(srcprocess, pHMSrcHandle->hHMHandle, destprocess, desthandle, fdwAccess, fInherit, fdwOptions);
|
|---|
| 101 |
|
|---|
| 102 | if(rc == TRUE) {
|
|---|
| 103 | pHMHandleData->hHMHandle = *desthandle;
|
|---|
| 104 | return (NO_ERROR);
|
|---|
| 105 | }
|
|---|
| 106 | else return(O32_GetLastError());
|
|---|
| 107 | #else
|
|---|
| 108 | rc = OSLibDosDupHandle(pHMSrcHandle->hHMHandle, desthandle);
|
|---|
| 109 | if(rc == NO_ERROR)
|
|---|
| 110 | {
|
|---|
| 111 | pHMHandleData->hHMHandle = *desthandle;
|
|---|
| 112 | return (NO_ERROR);
|
|---|
| 113 | }
|
|---|
| 114 | else
|
|---|
| 115 | {
|
|---|
| 116 | dprintfl(("KERNEL32: HandleManager::Open32::DuplicateHandle Error %d\n",rc));
|
|---|
| 117 | O32_SetLastError(rc);
|
|---|
| 118 | return(rc);
|
|---|
| 119 | }
|
|---|
| 120 | #endif
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | /*****************************************************************************
|
|---|
| 124 | * Name : DWORD HMDeviceOpen32Class::CreateFile
|
|---|
| 125 | * Purpose : this is called from the handle manager if a CreateFile() is
|
|---|
| 126 | * performed on a handle
|
|---|
| 127 | * Parameters: LPCSTR lpFileName name of the file / device
|
|---|
| 128 | * PHMHANDLEDATA pHMHandleData data of the NEW handle
|
|---|
| 129 | * PVOID lpSecurityAttributes ignored
|
|---|
| 130 | * PHMHANDLEDATA pHMHandleDataTemplate data of the template handle
|
|---|
| 131 | * Variables :
|
|---|
| 132 | * Result :
|
|---|
| 133 | * Remark :
|
|---|
| 134 | * Status : NO_ERROR - API succeeded
|
|---|
| 135 | * other - what is to be set in SetLastError
|
|---|
| 136 | *
|
|---|
| 137 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 138 | *****************************************************************************/
|
|---|
| 139 |
|
|---|
| 140 | DWORD HMDeviceOpen32Class::CreateFile (LPCSTR lpFileName,
|
|---|
| 141 | PHMHANDLEDATA pHMHandleData,
|
|---|
| 142 | PVOID lpSecurityAttributes,
|
|---|
| 143 | PHMHANDLEDATA pHMHandleDataTemplate)
|
|---|
| 144 | {
|
|---|
| 145 | HFILE hFile;
|
|---|
| 146 | HFILE hTemplate;
|
|---|
| 147 |
|
|---|
| 148 | dprintfl(("KERNEL32: HandleManager::Open32::CreateFile %s(%s,%08x,%08x,%08x) - stub?\n",
|
|---|
| 149 | lpHMDeviceName,
|
|---|
| 150 | lpFileName,
|
|---|
| 151 | pHMHandleData,
|
|---|
| 152 | lpSecurityAttributes,
|
|---|
| 153 | pHMHandleDataTemplate));
|
|---|
| 154 |
|
|---|
| 155 | if (strncmp(lpFileName, // "support" for local unc names
|
|---|
| 156 | "\\\\.\\",
|
|---|
| 157 | 4) == 0)
|
|---|
| 158 | {
|
|---|
| 159 | lpFileName+=4;
|
|---|
| 160 | }
|
|---|
| 161 |
|
|---|
| 162 | // create from template
|
|---|
| 163 | if (pHMHandleDataTemplate != NULL)
|
|---|
| 164 | hTemplate = pHMHandleDataTemplate->hHMHandle;
|
|---|
| 165 | else
|
|---|
| 166 | hTemplate = 0;
|
|---|
| 167 |
|
|---|
| 168 | #if 1
|
|---|
| 169 | hFile = O32_CreateFile(lpFileName,
|
|---|
| 170 | pHMHandleData->dwAccess,
|
|---|
| 171 | pHMHandleData->dwShare,
|
|---|
| 172 | //(LPSECURITY_ATTRIBUTES)lpSecurityAttributes,
|
|---|
| 173 | NULL,
|
|---|
| 174 | pHMHandleData->dwCreation,
|
|---|
| 175 | pHMHandleData->dwFlags,
|
|---|
| 176 | hTemplate);
|
|---|
| 177 | if (hFile != INVALID_HANDLE_ERROR)
|
|---|
| 178 | {
|
|---|
| 179 | pHMHandleData->hHMHandle = hFile;
|
|---|
| 180 | return (NO_ERROR);
|
|---|
| 181 | }
|
|---|
| 182 | else
|
|---|
| 183 | return(O32_GetLastError());
|
|---|
| 184 | #else
|
|---|
| 185 |
|
|---|
| 186 | rc = OSLibDosCreate((char *)lpFileName,
|
|---|
| 187 | pHMHandleData->dwAccess,
|
|---|
| 188 | pHMHandleData->dwShare,
|
|---|
| 189 | //(LPSECURITY_ATTRIBUTES)lpSecurityAttributes,
|
|---|
| 190 | NULL,
|
|---|
| 191 | pHMHandleData->dwCreation,
|
|---|
| 192 | pHMHandleData->dwFlags,
|
|---|
| 193 | hTemplate, &hFile);
|
|---|
| 194 | if(rc)
|
|---|
| 195 | {
|
|---|
| 196 | dprintfl(("KERNEL32: HandleManager::Open32::CreateFile Error %d\n",rc));
|
|---|
| 197 | O32_SetLastError(rc);
|
|---|
| 198 | return(rc);
|
|---|
| 199 | }
|
|---|
| 200 | else
|
|---|
| 201 | {
|
|---|
| 202 | pHMHandleData->hHMHandle = hFile;
|
|---|
| 203 | return (NO_ERROR);
|
|---|
| 204 | }
|
|---|
| 205 | #endif
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 | /*****************************************************************************
|
|---|
| 210 | * Name : DWORD HMDeviceOpen32Class::CloseHandle
|
|---|
| 211 | * Purpose : close the handle
|
|---|
| 212 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 213 | * Variables :
|
|---|
| 214 | * Result : API returncode
|
|---|
| 215 | * Remark :
|
|---|
| 216 | * Status :
|
|---|
| 217 | *
|
|---|
| 218 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 219 | *****************************************************************************/
|
|---|
| 220 |
|
|---|
| 221 | DWORD HMDeviceOpen32Class::CloseHandle(PHMHANDLEDATA pHMHandleData)
|
|---|
| 222 | {
|
|---|
| 223 | BOOL bRC;
|
|---|
| 224 |
|
|---|
| 225 | dprintfl(("KERNEL32: HandleManager::Open32::CloseHandle(%08x)\n",
|
|---|
| 226 | pHMHandleData->hHMHandle));
|
|---|
| 227 |
|
|---|
| 228 | #if 1
|
|---|
| 229 | bRC = O32_CloseHandle(pHMHandleData->hHMHandle);
|
|---|
| 230 |
|
|---|
| 231 | dprintfl(("KERNEL32: HandleManager::Open32::CloseHandle returned %08xh\n",
|
|---|
| 232 | bRC));
|
|---|
| 233 |
|
|---|
| 234 | return (DWORD)bRC;
|
|---|
| 235 | #else
|
|---|
| 236 | bRC = OSLibDosClose(pHMHandleData->hHMHandle);
|
|---|
| 237 | if(bRC)
|
|---|
| 238 | {
|
|---|
| 239 | dprintfl(("KERNEL32: HandleManager::Open32::CloseHandle Error %d\n",bRC));
|
|---|
| 240 | O32_SetLastError(bRC);
|
|---|
| 241 | return TRUE; // MUTEX Problem
|
|---|
| 242 | return FALSE;
|
|---|
| 243 | }
|
|---|
| 244 | else
|
|---|
| 245 | {
|
|---|
| 246 | return TRUE;
|
|---|
| 247 | }
|
|---|
| 248 | #endif
|
|---|
| 249 | }
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 | /*****************************************************************************
|
|---|
| 253 | * Name : DWORD HMDeviceOpen32Class::ReadFile
|
|---|
| 254 | * Purpose : read data from handle / device
|
|---|
| 255 | * Parameters: PHMHANDLEDATA pHMHandleData,
|
|---|
| 256 | * LPCVOID lpBuffer,
|
|---|
| 257 | * DWORD nNumberOfBytesToRead,
|
|---|
| 258 | * LPDWORD lpNumberOfBytesRead,
|
|---|
| 259 | * LPOVERLAPPED lpOverlapped
|
|---|
| 260 | * Variables :
|
|---|
| 261 | * Result : API returncode
|
|---|
| 262 | * Remark :
|
|---|
| 263 | * Status :
|
|---|
| 264 | *
|
|---|
| 265 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 266 | *****************************************************************************/
|
|---|
| 267 |
|
|---|
| 268 | DWORD HMDeviceOpen32Class::ReadFile(PHMHANDLEDATA pHMHandleData,
|
|---|
| 269 | LPCVOID lpBuffer,
|
|---|
| 270 | DWORD nNumberOfBytesToRead,
|
|---|
| 271 | LPDWORD lpNumberOfBytesRead,
|
|---|
| 272 | LPOVERLAPPED lpOverlapped)
|
|---|
| 273 | {
|
|---|
| 274 | BOOL bRC;
|
|---|
| 275 | LPVOID lpRealBuf;
|
|---|
| 276 |
|
|---|
| 277 | dprintfl(("KERNEL32: HandleManager::Open32::ReadFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n",
|
|---|
| 278 | lpHMDeviceName,
|
|---|
| 279 | pHMHandleData,
|
|---|
| 280 | lpBuffer,
|
|---|
| 281 | nNumberOfBytesToRead,
|
|---|
| 282 | lpNumberOfBytesRead,
|
|---|
| 283 | lpOverlapped));
|
|---|
| 284 |
|
|---|
| 285 | #if 1
|
|---|
| 286 | Win32MemMap *map;
|
|---|
| 287 | DWORD offset;
|
|---|
| 288 |
|
|---|
| 289 | //SvL: DosRead doesn't like writing to memory addresses returned by
|
|---|
| 290 | // DosAliasMem -> search for original memory mapped pointer and use
|
|---|
| 291 | // that one
|
|---|
| 292 | map = Win32MemMapView::findMapByView((ULONG)lpBuffer, &offset, MEMMAP_ACCESS_READ);
|
|---|
| 293 | if(map) {
|
|---|
| 294 | lpRealBuf = (LPVOID)((ULONG)map->getMappingAddr() + offset);
|
|---|
| 295 | }
|
|---|
| 296 | else lpRealBuf = (LPVOID)lpBuffer;
|
|---|
| 297 |
|
|---|
| 298 | bRC = O32_ReadFile(pHMHandleData->hHMHandle,
|
|---|
| 299 | (PVOID)lpRealBuf,
|
|---|
| 300 | nNumberOfBytesToRead,
|
|---|
| 301 | lpNumberOfBytesRead,
|
|---|
| 302 | lpOverlapped);
|
|---|
| 303 |
|
|---|
| 304 | if(bRC == 0) {
|
|---|
| 305 | dprintf(("KERNEL32: HandleManager::Open32::ReadFile returned %08xh %x\n",
|
|---|
| 306 | bRC, GetLastError()));
|
|---|
| 307 | dprintf(("%x -> %d", lpBuffer, IsBadWritePtr((LPVOID)lpBuffer, nNumberOfBytesToRead)));
|
|---|
| 308 | }
|
|---|
| 309 | else dprintfl(("KERNEL32: HandleManager::Open32::ReadFile returned %08xh\n",
|
|---|
| 310 | bRC));
|
|---|
| 311 |
|
|---|
| 312 | return (DWORD)bRC;
|
|---|
| 313 | #else
|
|---|
| 314 | rc = OSLibDosRead(pHMHandleData->hHMHandle,
|
|---|
| 315 | (PVOID) lpBuffer,
|
|---|
| 316 | nNumberOfBytesToRead,
|
|---|
| 317 | lpNumberOfBytesRead);
|
|---|
| 318 | if(rc)
|
|---|
| 319 | {
|
|---|
| 320 | dprintfl(("KERNEL32: HandleManager::Open32::ReadFile Error %d\n",rc));
|
|---|
| 321 | O32_SetLastError(rc);
|
|---|
| 322 | return FALSE;
|
|---|
| 323 | }
|
|---|
| 324 | else
|
|---|
| 325 | {
|
|---|
| 326 | return TRUE;
|
|---|
| 327 | }
|
|---|
| 328 | #endif
|
|---|
| 329 | }
|
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 | /*****************************************************************************
|
|---|
| 333 | * Name : DWORD HMDeviceOpen32Class::WriteFile
|
|---|
| 334 | * Purpose : write data to handle / device
|
|---|
| 335 | * Parameters: PHMHANDLEDATA pHMHandleData,
|
|---|
| 336 | * LPCVOID lpBuffer,
|
|---|
| 337 | * DWORD nNumberOfBytesToWrite,
|
|---|
| 338 | * LPDWORD lpNumberOfBytesWritten,
|
|---|
| 339 | * LPOVERLAPPED lpOverlapped
|
|---|
| 340 | * Variables :
|
|---|
| 341 | * Result : API returncode
|
|---|
| 342 | * Remark :
|
|---|
| 343 | * Status :
|
|---|
| 344 | *
|
|---|
| 345 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 346 | *****************************************************************************/
|
|---|
| 347 |
|
|---|
| 348 | DWORD HMDeviceOpen32Class::WriteFile(PHMHANDLEDATA pHMHandleData,
|
|---|
| 349 | LPCVOID lpBuffer,
|
|---|
| 350 | DWORD nNumberOfBytesToWrite,
|
|---|
| 351 | LPDWORD lpNumberOfBytesWritten,
|
|---|
| 352 | LPOVERLAPPED lpOverlapped)
|
|---|
| 353 | {
|
|---|
| 354 | BOOL bRC;
|
|---|
| 355 |
|
|---|
| 356 | dprintfl(("KERNEL32: HandleManager::Open32::WriteFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n",
|
|---|
| 357 | lpHMDeviceName,
|
|---|
| 358 | pHMHandleData,
|
|---|
| 359 | lpBuffer,
|
|---|
| 360 | nNumberOfBytesToWrite,
|
|---|
| 361 | lpNumberOfBytesWritten,
|
|---|
| 362 | lpOverlapped));
|
|---|
| 363 |
|
|---|
| 364 | #if 1
|
|---|
| 365 | bRC = O32_WriteFile(pHMHandleData->hHMHandle,
|
|---|
| 366 | lpBuffer,
|
|---|
| 367 | nNumberOfBytesToWrite,
|
|---|
| 368 | lpNumberOfBytesWritten,
|
|---|
| 369 | lpOverlapped);
|
|---|
| 370 |
|
|---|
| 371 | dprintfl(("KERNEL32: HandleManager::Open32::WriteFile returned %08xh\n",
|
|---|
| 372 | bRC));
|
|---|
| 373 |
|
|---|
| 374 | return (DWORD)bRC;
|
|---|
| 375 | #else
|
|---|
| 376 | rc = OSLibDosWrite(pHMHandleData->hHMHandle,
|
|---|
| 377 | (PVOID) lpBuffer,
|
|---|
| 378 | nNumberOfBytesToWrite,
|
|---|
| 379 | lpNumberOfBytesWritten);
|
|---|
| 380 | if(rc)
|
|---|
| 381 | {
|
|---|
| 382 | dprintfl(("KERNEL32: HandleManager::Open32::WriteFile Error %d\n",rc));
|
|---|
| 383 | O32_SetLastError(rc);
|
|---|
| 384 | return FALSE;
|
|---|
| 385 | }
|
|---|
| 386 | else
|
|---|
| 387 | {
|
|---|
| 388 | return TRUE;
|
|---|
| 389 | }
|
|---|
| 390 | #endif
|
|---|
| 391 | }
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 | /*****************************************************************************
|
|---|
| 395 | * Name : DWORD HMDeviceOpen32Class::GetFileType
|
|---|
| 396 | * Purpose : determine the handle type
|
|---|
| 397 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 398 | * Variables :
|
|---|
| 399 | * Result : API returncode
|
|---|
| 400 | * Remark :
|
|---|
| 401 | * Status :
|
|---|
| 402 | *
|
|---|
| 403 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 404 | *****************************************************************************/
|
|---|
| 405 |
|
|---|
| 406 | DWORD HMDeviceOpen32Class::GetFileType(PHMHANDLEDATA pHMHandleData)
|
|---|
| 407 | {
|
|---|
| 408 | dprintfl(("KERNEL32: HandleManager::Open32::GetFileType %s(%08x)\n",
|
|---|
| 409 | lpHMDeviceName,
|
|---|
| 410 | pHMHandleData));
|
|---|
| 411 |
|
|---|
| 412 | #if 1
|
|---|
| 413 | return O32_GetFileType(pHMHandleData->hHMHandle);
|
|---|
| 414 | #else
|
|---|
| 415 | // TODO: FILE_TYPE_DISK
|
|---|
| 416 | return FILE_TYPE_CHAR;
|
|---|
| 417 | #endif
|
|---|
| 418 | }
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 | /*****************************************************************************
|
|---|
| 422 | * Name : DWORD HMDeviceOpen32Class::GetFileInformationByHandle
|
|---|
| 423 | * Purpose : determine the handle type
|
|---|
| 424 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 425 | * BY_HANDLE_FILE_INFORMATION* pHFI
|
|---|
| 426 | * Variables :
|
|---|
| 427 | * Result : API returncode
|
|---|
| 428 | * Remark :
|
|---|
| 429 | * Status :
|
|---|
| 430 | *
|
|---|
| 431 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 432 | *****************************************************************************/
|
|---|
| 433 |
|
|---|
| 434 | DWORD HMDeviceOpen32Class::GetFileInformationByHandle(PHMHANDLEDATA pHMHandleData,
|
|---|
| 435 | BY_HANDLE_FILE_INFORMATION* pHFI)
|
|---|
| 436 | {
|
|---|
| 437 | dprintfl(("KERNEL32: HandleManager::Open32::GetFileInformationByHandle %s(%08xh,%08xh)\n",
|
|---|
| 438 | lpHMDeviceName,
|
|---|
| 439 | pHMHandleData,
|
|---|
| 440 | pHFI));
|
|---|
| 441 |
|
|---|
| 442 | return O32_GetFileInformationByHandle(pHMHandleData->hHMHandle,
|
|---|
| 443 | pHFI);
|
|---|
| 444 | }
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 | /*****************************************************************************
|
|---|
| 448 | * Name : BOOL HMDeviceOpen32Class::SetEndOfFile
|
|---|
| 449 | * Purpose : set end of file marker
|
|---|
| 450 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 451 | * Variables :
|
|---|
| 452 | * Result : API returncode
|
|---|
| 453 | * Remark :
|
|---|
| 454 | * Status :
|
|---|
| 455 | *
|
|---|
| 456 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 457 | *****************************************************************************/
|
|---|
| 458 |
|
|---|
| 459 | BOOL HMDeviceOpen32Class::SetEndOfFile(PHMHANDLEDATA pHMHandleData)
|
|---|
| 460 | {
|
|---|
| 461 | dprintfl(("KERNEL32: HandleManager::Open32::SetEndOfFile %s(%08xh)\n",
|
|---|
| 462 | lpHMDeviceName,
|
|---|
| 463 | pHMHandleData));
|
|---|
| 464 |
|
|---|
| 465 | return O32_SetEndOfFile(pHMHandleData->hHMHandle);
|
|---|
| 466 | }
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 | /*****************************************************************************
|
|---|
| 470 | * Name : BOOL HMDeviceOpen32Class::SetFileTime
|
|---|
| 471 | * Purpose : set file time
|
|---|
| 472 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 473 | * PFILETIME pFT1
|
|---|
| 474 | * PFILETIME pFT2
|
|---|
| 475 | * PFILETIME pFT3
|
|---|
| 476 | * Variables :
|
|---|
| 477 | * Result : API returncode
|
|---|
| 478 | * Remark :
|
|---|
| 479 | * Status :
|
|---|
| 480 | *
|
|---|
| 481 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 482 | *****************************************************************************/
|
|---|
| 483 |
|
|---|
| 484 | BOOL HMDeviceOpen32Class::SetFileTime(PHMHANDLEDATA pHMHandleData,
|
|---|
| 485 | LPFILETIME pFT1,
|
|---|
| 486 | LPFILETIME pFT2,
|
|---|
| 487 | LPFILETIME pFT3)
|
|---|
| 488 | {
|
|---|
| 489 | dprintfl(("KERNEL32: HandleManager::Open32::SetFileTime %s(%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 490 | lpHMDeviceName,
|
|---|
| 491 | pHMHandleData,
|
|---|
| 492 | pFT1,
|
|---|
| 493 | pFT2,
|
|---|
| 494 | pFT3));
|
|---|
| 495 |
|
|---|
| 496 | return O32_SetFileTime(pHMHandleData->hHMHandle,
|
|---|
| 497 | pFT1,
|
|---|
| 498 | pFT2,
|
|---|
| 499 | pFT3);
|
|---|
| 500 | }
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 | /*****************************************************************************
|
|---|
| 504 | * Name : DWORD HMDeviceOpen32Class::GetFileSize
|
|---|
| 505 | * Purpose : set file time
|
|---|
| 506 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 507 | * PDWORD pSize
|
|---|
| 508 | * Variables :
|
|---|
| 509 | * Result : API returncode
|
|---|
| 510 | * Remark :
|
|---|
| 511 | * Status :
|
|---|
| 512 | *
|
|---|
| 513 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 514 | *****************************************************************************/
|
|---|
| 515 |
|
|---|
| 516 | DWORD HMDeviceOpen32Class::GetFileSize(PHMHANDLEDATA pHMHandleData,
|
|---|
| 517 | PDWORD lpdwFileSizeHigh)
|
|---|
| 518 | {
|
|---|
| 519 | dprintfl(("KERNEL32: HandleManager::Open32::GetFileSize %s(%08xh,%08xh)\n",
|
|---|
| 520 | lpHMDeviceName,
|
|---|
| 521 | pHMHandleData,
|
|---|
| 522 | lpdwFileSizeHigh));
|
|---|
| 523 |
|
|---|
| 524 | #if 1
|
|---|
| 525 | if(lpdwFileSizeHigh)
|
|---|
| 526 | *lpdwFileSizeHigh = 0;
|
|---|
| 527 |
|
|---|
| 528 | return O32_GetFileSize(pHMHandleData->hHMHandle,
|
|---|
| 529 | lpdwFileSizeHigh);
|
|---|
| 530 | #else
|
|---|
| 531 | size = OSLibDosGetFileSize(pHMHandleData->hHMHandle);
|
|---|
| 532 | if(pSize)
|
|---|
| 533 | *pSize = 0;
|
|---|
| 534 | return size;
|
|---|
| 535 | #endif
|
|---|
| 536 | }
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 | /*****************************************************************************
|
|---|
| 540 | * Name : DWORD HMDeviceOpen32Class::SetFilePointer
|
|---|
| 541 | * Purpose : set file pointer
|
|---|
| 542 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 543 | * LONG lDistanceToMove
|
|---|
| 544 | * PLONG lpDistanceToMoveHigh
|
|---|
| 545 | * DWORD dwMoveMethod
|
|---|
| 546 | * Variables :
|
|---|
| 547 | * Result : API returncode
|
|---|
| 548 | * Remark :
|
|---|
| 549 | * Status :
|
|---|
| 550 | *
|
|---|
| 551 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 552 | *****************************************************************************/
|
|---|
| 553 |
|
|---|
| 554 | DWORD HMDeviceOpen32Class::SetFilePointer(PHMHANDLEDATA pHMHandleData,
|
|---|
| 555 | LONG lDistanceToMove,
|
|---|
| 556 | PLONG lpDistanceToMoveHigh,
|
|---|
| 557 | DWORD dwMoveMethod)
|
|---|
| 558 | {
|
|---|
| 559 | dprintfl(("KERNEL32: HandleManager::Open32::SetFilePointer %s(%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 560 | lpHMDeviceName,
|
|---|
| 561 | pHMHandleData,
|
|---|
| 562 | lDistanceToMove,
|
|---|
| 563 | lpDistanceToMoveHigh,
|
|---|
| 564 | dwMoveMethod));
|
|---|
| 565 |
|
|---|
| 566 | #if 1
|
|---|
| 567 | if(lpDistanceToMoveHigh)
|
|---|
| 568 | *lpDistanceToMoveHigh = 0;
|
|---|
| 569 |
|
|---|
| 570 | return O32_SetFilePointer(pHMHandleData->hHMHandle,
|
|---|
| 571 | lDistanceToMove,
|
|---|
| 572 | lpDistanceToMoveHigh,
|
|---|
| 573 | dwMoveMethod);
|
|---|
| 574 | #else
|
|---|
| 575 |
|
|---|
| 576 | if(lpDistanceToMoveHigh)
|
|---|
| 577 | *lpDistanceToMoveHigh = 0;
|
|---|
| 578 | pos = OSLibDosSetFilePtr2(pHMHandleData->hHMHandle, lDistanceToMove, dwMoveMethod);
|
|---|
| 579 | return pos;
|
|---|
| 580 | #endif
|
|---|
| 581 | }
|
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 | /*****************************************************************************
|
|---|
| 585 | * Name : DWORD HMDeviceOpen32Class::LockFile
|
|---|
| 586 | * Purpose : file locking
|
|---|
| 587 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 588 | * DWORD arg2
|
|---|
| 589 | * DWORD arg3
|
|---|
| 590 | * DWORD arg4
|
|---|
| 591 | * DWORD arg5
|
|---|
| 592 | * Variables :
|
|---|
| 593 | * Result : API returncode
|
|---|
| 594 | * Remark :
|
|---|
| 595 | * Status :
|
|---|
| 596 | *
|
|---|
| 597 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 598 | *****************************************************************************/
|
|---|
| 599 |
|
|---|
| 600 | DWORD HMDeviceOpen32Class::LockFile(PHMHANDLEDATA pHMHandleData,
|
|---|
| 601 | DWORD arg2,
|
|---|
| 602 | DWORD arg3,
|
|---|
| 603 | DWORD arg4,
|
|---|
| 604 | DWORD arg5)
|
|---|
| 605 | {
|
|---|
| 606 | dprintfl(("KERNEL32: HandleManager::Open32::LockFile %s(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 607 | lpHMDeviceName,
|
|---|
| 608 | pHMHandleData,
|
|---|
| 609 | arg2,
|
|---|
| 610 | arg3,
|
|---|
| 611 | arg4,
|
|---|
| 612 | arg5));
|
|---|
| 613 |
|
|---|
| 614 | return O32_LockFile(pHMHandleData->hHMHandle,
|
|---|
| 615 | arg2,
|
|---|
| 616 | arg3,
|
|---|
| 617 | arg4,
|
|---|
| 618 | arg5);
|
|---|
| 619 | }
|
|---|
| 620 |
|
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 | /*****************************************************************************
|
|---|
| 624 | * Name : DWORD HMDeviceOpen32Class::LockFileEx
|
|---|
| 625 | * Purpose : file locking
|
|---|
| 626 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 627 | * DWORD dwFlags
|
|---|
| 628 | * DWORD dwReserved
|
|---|
| 629 | * DWORD nNumberOfBytesToLockLow
|
|---|
| 630 | * DWORD nNumberOfBytesToLockHigh
|
|---|
| 631 | * LPOVERLAPPED lpOverlapped
|
|---|
| 632 | * Variables :
|
|---|
| 633 | * Result : API returncode
|
|---|
| 634 | * Remark :
|
|---|
| 635 | * Status :
|
|---|
| 636 | *
|
|---|
| 637 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 638 | *****************************************************************************/
|
|---|
| 639 |
|
|---|
| 640 | DWORD HMDeviceOpen32Class::LockFileEx(PHMHANDLEDATA pHMHandleData,
|
|---|
| 641 | DWORD dwFlags,
|
|---|
| 642 | DWORD dwReserved,
|
|---|
| 643 | DWORD nNumberOfBytesToLockLow,
|
|---|
| 644 | DWORD nNumberOfBytesToLockHigh,
|
|---|
| 645 | LPOVERLAPPED lpOverlapped)
|
|---|
| 646 | {
|
|---|
| 647 |
|
|---|
| 648 | dprintfl(("KERNEL32: HandleManager::Open32::LockFileEx %s(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 649 | lpHMDeviceName,
|
|---|
| 650 | pHMHandleData,
|
|---|
| 651 | dwFlags,
|
|---|
| 652 | dwReserved,
|
|---|
| 653 | nNumberOfBytesToLockLow,
|
|---|
| 654 | nNumberOfBytesToLockHigh,
|
|---|
| 655 | lpOverlapped));
|
|---|
| 656 |
|
|---|
| 657 |
|
|---|
| 658 | return(O32_LockFile(pHMHandleData->hHMHandle,
|
|---|
| 659 | lpOverlapped->Offset,
|
|---|
| 660 | lpOverlapped->OffsetHigh,
|
|---|
| 661 | nNumberOfBytesToLockLow,
|
|---|
| 662 | nNumberOfBytesToLockHigh));
|
|---|
| 663 | }
|
|---|
| 664 |
|
|---|
| 665 |
|
|---|
| 666 | /*****************************************************************************
|
|---|
| 667 | * Name : DWORD HMDeviceOpen32Class::OpenFile
|
|---|
| 668 | * Purpose : this is called from the handle manager if a OpenFile() is
|
|---|
| 669 | * performed on a handle
|
|---|
| 670 | * Parameters: LPCSTR lpFileName name of the file / device
|
|---|
| 671 | * PHMHANDLEDATA pHMHandleData data of the NEW handle
|
|---|
| 672 | * PVOID lpSecurityAttributes ignored
|
|---|
| 673 | * PHMHANDLEDATA pHMHandleDataTemplate data of the template handle
|
|---|
| 674 | * Variables :
|
|---|
| 675 | * Result :
|
|---|
| 676 | * Remark :
|
|---|
| 677 | * Status : NO_ERROR - API succeeded
|
|---|
| 678 | * other - what is to be set in SetLastError
|
|---|
| 679 | *
|
|---|
| 680 | * Author : Patrick Haller [Wed, 1998/02/11 20:44]
|
|---|
| 681 | *****************************************************************************/
|
|---|
| 682 |
|
|---|
| 683 | DWORD HMDeviceOpen32Class::OpenFile (LPCSTR lpFileName,
|
|---|
| 684 | PHMHANDLEDATA pHMHandleData,
|
|---|
| 685 | OFSTRUCT *pOFStruct,
|
|---|
| 686 | UINT arg3)
|
|---|
| 687 | {
|
|---|
| 688 | HFILE hFile;
|
|---|
| 689 | FILETIME filetime;
|
|---|
| 690 | WORD filedatetime[2];
|
|---|
| 691 |
|
|---|
| 692 | dprintfl(("KERNEL32: HandleManager::Open32::OpenFile %s(%s,%08x,%08x,%08x) - stub?\n",
|
|---|
| 693 | lpHMDeviceName,
|
|---|
| 694 | lpFileName,
|
|---|
| 695 | pHMHandleData,
|
|---|
| 696 | pOFStruct,
|
|---|
| 697 | arg3));
|
|---|
| 698 |
|
|---|
| 699 | if (strcmp(lpFileName, // "support" for local unc names
|
|---|
| 700 | "\\\\.\\") == 0)
|
|---|
| 701 | lpFileName+=4;
|
|---|
| 702 |
|
|---|
| 703 | // filling OFSTRUCT
|
|---|
| 704 | pOFStruct->cBytes = sizeof(OFSTRUCT);
|
|---|
| 705 | pOFStruct->nErrCode = 0;
|
|---|
| 706 |
|
|---|
| 707 | hFile = O32_OpenFile(lpFileName,
|
|---|
| 708 | pOFStruct,
|
|---|
| 709 | arg3);
|
|---|
| 710 | if (hFile != INVALID_HANDLE_ERROR)
|
|---|
| 711 | {
|
|---|
| 712 | pHMHandleData->hHMHandle = hFile;
|
|---|
| 713 |
|
|---|
| 714 | GetFileTime(hFile,
|
|---|
| 715 | NULL,
|
|---|
| 716 | NULL,
|
|---|
| 717 | &filetime );
|
|---|
| 718 | FileTimeToDosDateTime(&filetime,
|
|---|
| 719 | &filedatetime[0],
|
|---|
| 720 | &filedatetime[1] );
|
|---|
| 721 | memcpy(pOFStruct->reserved,
|
|---|
| 722 | filedatetime,
|
|---|
| 723 | sizeof(pOFStruct->reserved) );
|
|---|
| 724 |
|
|---|
| 725 | return (NO_ERROR);
|
|---|
| 726 | }
|
|---|
| 727 |
|
|---|
| 728 | // error branch
|
|---|
| 729 | pOFStruct->nErrCode = O32_GetLastError();
|
|---|
| 730 | dprintf(("KERNEL32: HandleManager::Open32::OpenFile Error %08xh\n",
|
|---|
| 731 | pOFStruct->nErrCode));
|
|---|
| 732 |
|
|---|
| 733 | // return != NO_ERROR => error code
|
|---|
| 734 | return(hFile);
|
|---|
| 735 | }
|
|---|
| 736 |
|
|---|
| 737 |
|
|---|
| 738 | /*****************************************************************************
|
|---|
| 739 | * Name : DWORD HMDeviceOpen32Class::UnlockFile
|
|---|
| 740 | * Purpose : file locking
|
|---|
| 741 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 742 | * DWORD arg2
|
|---|
| 743 | * DWORD arg3
|
|---|
| 744 | * DWORD arg4
|
|---|
| 745 | * DWORD arg5
|
|---|
| 746 | * Variables :
|
|---|
| 747 | * Result : API returncode
|
|---|
| 748 | * Remark :
|
|---|
| 749 | * Status :
|
|---|
| 750 | *
|
|---|
| 751 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 752 | *****************************************************************************/
|
|---|
| 753 |
|
|---|
| 754 | DWORD HMDeviceOpen32Class::UnlockFile(PHMHANDLEDATA pHMHandleData,
|
|---|
| 755 | DWORD arg2,
|
|---|
| 756 | DWORD arg3,
|
|---|
| 757 | DWORD arg4,
|
|---|
| 758 | DWORD arg5)
|
|---|
| 759 | {
|
|---|
| 760 | dprintfl(("KERNEL32: HandleManager::Open32::UnlockFile %s(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 761 | lpHMDeviceName,
|
|---|
| 762 | pHMHandleData,
|
|---|
| 763 | arg2,
|
|---|
| 764 | arg3,
|
|---|
| 765 | arg4,
|
|---|
| 766 | arg5));
|
|---|
| 767 |
|
|---|
| 768 | return O32_UnlockFile(pHMHandleData->hHMHandle,
|
|---|
| 769 | arg2,
|
|---|
| 770 | arg3,
|
|---|
| 771 | arg4,
|
|---|
| 772 | arg5);
|
|---|
| 773 | }
|
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 |
|
|---|
| 777 | /*****************************************************************************
|
|---|
| 778 | * Name : DWORD HMDeviceOpen32Class::UnlockFileEx
|
|---|
| 779 | * Purpose : file locking
|
|---|
| 780 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 781 | * DWORD dwFlags
|
|---|
| 782 | * DWORD dwReserved
|
|---|
| 783 | * DWORD nNumberOfBytesToLockLow
|
|---|
| 784 | * DWORD nNumberOfBytesToLockHigh
|
|---|
| 785 | * LPOVERLAPPED lpOverlapped
|
|---|
| 786 | * Variables :
|
|---|
| 787 | * Result : API returncode
|
|---|
| 788 | * Remark :
|
|---|
| 789 | * Status :
|
|---|
| 790 | *
|
|---|
| 791 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 792 | *****************************************************************************/
|
|---|
| 793 |
|
|---|
| 794 | DWORD HMDeviceOpen32Class::UnlockFileEx(PHMHANDLEDATA pHMHandleData,
|
|---|
| 795 | DWORD dwFlags,
|
|---|
| 796 | DWORD dwReserved,
|
|---|
| 797 | DWORD nNumberOfBytesToLockLow,
|
|---|
| 798 | DWORD nNumberOfBytesToLockHigh,
|
|---|
| 799 | LPOVERLAPPED lpOverlapped)
|
|---|
| 800 | {
|
|---|
| 801 |
|
|---|
| 802 | dprintfl(("KERNEL32: HandleManager::Open32::UnlockFileEx %s(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 803 | lpHMDeviceName,
|
|---|
| 804 | pHMHandleData,
|
|---|
| 805 | dwFlags,
|
|---|
| 806 | dwReserved,
|
|---|
| 807 | nNumberOfBytesToLockLow,
|
|---|
| 808 | nNumberOfBytesToLockHigh,
|
|---|
| 809 | lpOverlapped));
|
|---|
| 810 |
|
|---|
| 811 | return(O32_UnlockFile(pHMHandleData->hHMHandle,
|
|---|
| 812 | lpOverlapped->Offset,
|
|---|
| 813 | lpOverlapped->OffsetHigh,
|
|---|
| 814 | nNumberOfBytesToLockLow,
|
|---|
| 815 | nNumberOfBytesToLockHigh));
|
|---|
| 816 | }
|
|---|
| 817 |
|
|---|
| 818 |
|
|---|
| 819 | /*****************************************************************************
|
|---|
| 820 | * Name : DWORD HMDeviceOpen32Class::WaitForSingleObject
|
|---|
| 821 | * Purpose : object synchronization
|
|---|
| 822 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 823 | * DWORD dwTimeout
|
|---|
| 824 | * Variables :
|
|---|
| 825 | * Result : API returncode
|
|---|
| 826 | * Remark :
|
|---|
| 827 | * Status :
|
|---|
| 828 | *
|
|---|
| 829 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 830 | *****************************************************************************/
|
|---|
| 831 |
|
|---|
| 832 | DWORD HMDeviceOpen32Class::WaitForSingleObject(PHMHANDLEDATA pHMHandleData,
|
|---|
| 833 | DWORD dwTimeout)
|
|---|
| 834 | {
|
|---|
| 835 | dprintfl(("KERNEL32: HandleManager::Open32::WaitForSingleObject(%08xh,%08h)\n",
|
|---|
| 836 | pHMHandleData->hHMHandle,
|
|---|
| 837 | dwTimeout));
|
|---|
| 838 |
|
|---|
| 839 | return (O32_WaitForSingleObject(pHMHandleData->hHMHandle,
|
|---|
| 840 | dwTimeout));
|
|---|
| 841 | }
|
|---|
| 842 |
|
|---|
| 843 |
|
|---|
| 844 | /*****************************************************************************
|
|---|
| 845 | * Name : DWORD HMDeviceOpen32Class::WaitForSingleObjectEx
|
|---|
| 846 | * Purpose : object synchronization
|
|---|
| 847 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 848 | * DWORD dwTimeout
|
|---|
| 849 | * BOOL fAlertable
|
|---|
| 850 | * Variables :
|
|---|
| 851 | * Result : API returncode
|
|---|
| 852 | * Remark :
|
|---|
| 853 | * Status :
|
|---|
| 854 | *
|
|---|
| 855 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 856 | *****************************************************************************/
|
|---|
| 857 |
|
|---|
| 858 | DWORD HMDeviceOpen32Class::WaitForSingleObjectEx(PHMHANDLEDATA pHMHandleData,
|
|---|
| 859 | DWORD dwTimeout,
|
|---|
| 860 | BOOL fAlertable)
|
|---|
| 861 | {
|
|---|
| 862 | dprintfl(("KERNEL32: HandleManager::Open32::WaitForSingleObjectEx(%08xh,%08h,%08xh) not implemented correctly.\n",
|
|---|
| 863 | pHMHandleData->hHMHandle,
|
|---|
| 864 | dwTimeout,
|
|---|
| 865 | fAlertable));
|
|---|
| 866 |
|
|---|
| 867 | //@@@PH: WARNING mapped to WaitForSingleObject simply. fAlertable missing!
|
|---|
| 868 | return (O32_WaitForSingleObject(pHMHandleData->hHMHandle,
|
|---|
| 869 | dwTimeout));
|
|---|
| 870 | }
|
|---|
| 871 |
|
|---|
| 872 |
|
|---|
| 873 | /*****************************************************************************
|
|---|
| 874 | * Name : DWORD HMDeviceOpen32Class::FlushFileBuffers
|
|---|
| 875 | * Purpose : flush the buffers of a file
|
|---|
| 876 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 877 | * Variables :
|
|---|
| 878 | * Result : API returncode
|
|---|
| 879 | * Remark :
|
|---|
| 880 | * Status :
|
|---|
| 881 | *
|
|---|
| 882 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 883 | *****************************************************************************/
|
|---|
| 884 |
|
|---|
| 885 | BOOL HMDeviceOpen32Class::FlushFileBuffers(PHMHANDLEDATA pHMHandleData)
|
|---|
| 886 | {
|
|---|
| 887 | dprintfl(("KERNEL32: HandleManager::Open32:FlushFileBuffers(%08xh)\n",
|
|---|
| 888 | pHMHandleData->hHMHandle));
|
|---|
| 889 |
|
|---|
| 890 | return(O32_FlushFileBuffers(pHMHandleData->hHMHandle));
|
|---|
| 891 | }
|
|---|
| 892 |
|
|---|
| 893 |
|
|---|
| 894 | /*****************************************************************************
|
|---|
| 895 | * Name : DWORD HMDeviceOpen32Class::GetOverlappedResult
|
|---|
| 896 | * Purpose : asynchronus I/O
|
|---|
| 897 | * Parameters: PHMHANDLEDATA pHMHandleData
|
|---|
| 898 | * LPOVERLAPPED arg2
|
|---|
| 899 | * LPDWORD arg3
|
|---|
| 900 | * BOOL arg4
|
|---|
| 901 | * Variables :
|
|---|
| 902 | * Result : API returncode
|
|---|
| 903 | * Remark :
|
|---|
| 904 | * Status :
|
|---|
| 905 | *
|
|---|
| 906 | * Author : Patrick Haller [Wed, 1999/06/17 20:44]
|
|---|
| 907 | *****************************************************************************/
|
|---|
| 908 |
|
|---|
| 909 | BOOL HMDeviceOpen32Class::GetOverlappedResult(PHMHANDLEDATA pHMHandleData,
|
|---|
| 910 | LPOVERLAPPED arg2,
|
|---|
| 911 | LPDWORD arg3,
|
|---|
| 912 | BOOL arg4)
|
|---|
| 913 | {
|
|---|
| 914 | dprintfl(("KERNEL32: HandleManager::Open32::GetOverlappedResult(%08xh,%08xh,%08xh,%08xh)\n",
|
|---|
| 915 | pHMHandleData->hHMHandle,
|
|---|
| 916 | arg2,
|
|---|
| 917 | arg3,
|
|---|
| 918 | arg4));
|
|---|
| 919 |
|
|---|
| 920 | return(O32_GetOverlappedResult(pHMHandleData->hHMHandle,
|
|---|
| 921 | arg2,
|
|---|
| 922 | arg3,
|
|---|
| 923 | arg4));
|
|---|
| 924 | }
|
|---|
| 925 |
|
|---|