Changeset 678 for trunk/src/kernel32/HandleManager.cpp
- Timestamp:
- Aug 25, 1999, 12:28:41 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r673 r678 1 /* $Id: HandleManager.cpp,v 1.1 4 1999-08-25 08:55:17 phallerExp $ */1 /* $Id: HandleManager.cpp,v 1.15 1999-08-25 10:28:39 sandervl Exp $ */ 2 2 3 3 /* … … 2279 2279 /* call the device handler */ 2280 2280 rc = pDeviceHandler->OpenFileMapping(&TabWin32Handles[iIndexNew].hmHandleData, 2281 2281 fdwAccess, 2282 2282 fInherit, 2283 2283 lpName); … … 2290 2290 2291 2291 return iIndexNew; /* return valid handle */ 2292 }2293 2294 2295 /*****************************************************************************2296 * Name : HMMapViewOfFile2297 * Purpose : router function for MapViewOfFile2298 * Parameters:2299 * Variables :2300 * Result :2301 * Remark :2302 * Status :2303 *2304 * Author : Patrick Haller [Wed, 1999/06/17 20:44]2305 *****************************************************************************/2306 2307 LPVOID HMMapViewOfFile(HANDLE hFileMappingObject,2308 DWORD dwDesiredAccess,2309 DWORD dwFileOffsetHigh,2310 DWORD dwFileOffsetLow,2311 DWORD dwNumberOfBytesToMap)2312 {2313 int iIndex; /* index into the handle table */2314 LPVOID lpResult; /* result from the device handler's API */2315 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */2316 2317 /* validate handle */2318 iIndex = _HMHandleQuery(hFileMappingObject); /* get the index */2319 if (-1 == iIndex) /* error ? */2320 {2321 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */2322 return (NULL); /* signal failure */2323 }2324 2325 pHMHandle = &TabWin32Handles[iIndex]; /* call device handler */2326 lpResult = pHMHandle->pDeviceHandler->MapViewOfFile(&pHMHandle->hmHandleData,2327 dwDesiredAccess,2328 dwFileOffsetHigh,2329 dwFileOffsetLow,2330 dwNumberOfBytesToMap);2331 2332 return (lpResult); /* deliver return code */2333 2292 } 2334 2293 … … 2376 2335 } 2377 2336 2378 2379 /*****************************************************************************2380 * Name : HMUnmapViewOfFile2381 * Purpose : router function for UnmapViewOfFile2382 * Parameters:2383 * Variables :2384 * Result :2385 * Remark :2386 * Status :2387 *2388 * Author : Patrick Haller [Wed, 1999/06/17 20:44]2389 *****************************************************************************/2390 2391 BOOL HMUnmapViewOfFile(LPVOID lpBaseAddress)2392 {2393 int iIndex; /* index into the handle table */2394 BOOL bResult; /* result from the device handler's API */2395 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */2396 2397 /* validate handle */2398 iIndex = HMDeviceMemMapClass::findByBaseAddress(lpBaseAddress);2399 if (-1 == iIndex) /* error ? */2400 {2401 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */2402 return (NULL); /* signal failure */2403 }2404 2405 bResult = pHMHandle->pDeviceHandler->UnmapViewOfFile(&pHMHandle->hmHandleData,2406 lpBaseAddress);2407 2408 return (bResult); /* deliver return code */2409 }2410 2411 2412 /*****************************************************************************2413 * Name : HMFlushViewOfFile2414 * Purpose : router function for FlushViewOfFile2415 * Parameters:2416 * Variables :2417 * Result :2418 * Remark :2419 * Status :2420 *2421 * Author : Patrick Haller [Wed, 1999/06/17 20:44]2422 *****************************************************************************/2423 2424 BOOL HMFlushViewOfFile(LPVOID lpBaseAddress,2425 DWORD dwNumberOfBytesToFlush)2426 {2427 int iIndex; /* index into the handle table */2428 BOOL bResult; /* result from the device handler's API */2429 PHMHANDLE pHMHandle; /* pointer to the handle structure in the table */2430 2431 /* validate handle */2432 iIndex = HMDeviceMemMapClass::findByBaseAddress(lpBaseAddress);2433 if (-1 == iIndex) /* error ? */2434 {2435 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */2436 return (NULL); /* signal failure */2437 }2438 2439 bResult = pHMHandle->pDeviceHandler->FlushViewOfFile(&pHMHandle->hmHandleData,2440 lpBaseAddress,2441 dwNumberOfBytesToFlush);2442 2443 return (bResult); /* deliver return code */2444 }2445 2446 2447 2448 2337 /***************************************************************************** 2449 2338 * Name : HMWaitForMultipleObjects
Note:
See TracChangeset
for help on using the changeset viewer.