Changeset 11273


Ignore:
Timestamp:
Aug 24, 1999, 4:36:05 PM (26 years ago)
Author:
phaller
Message:

Add: HandleManager support for memory mapped files

Location:
tags/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/include/HandleManager.h

    r10902 r11273  
    1 /* $Id: HandleManager.h,v 1.4 1999-07-06 15:48:44 phaller Exp $ */
     1/* $Id: HandleManager.h,v 1.5 1999-08-24 14:33:37 phaller Exp $ */
    22
    33/*
     
    268268                                     LPLONG                     lpPreviousCount);
    269269
     270HANDLE HMCreateFileMapping          (HANDLE                     hFile,
     271                                     LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
     272                                     DWORD                      flProtect,
     273                                     DWORD                      dwMaximumSizeHigh,
     274                                     DWORD                      dwMaximumSizeLow,
     275                                     LPCTSTR                    lpName);
     276
     277HANDLE HMOpenFileMapping            (DWORD                      fdwAccess,
     278                                     BOOL                       fInherit,
     279                                     LPCTSTR                    lpName);
     280
     281LPVOID HMMapViewOfFile              (HANDLE                     hFileMappingObject,
     282                                     DWORD                      dwDesiredAccess,
     283                                     DWORD                      dwFileOffsetHigh,
     284                                     DWORD                      dwFileOffsetLow,
     285                                     DWORD                      dwNumberOfBytesToMap);
     286
     287LPVOID HMMapViewOfFileEx            (HANDLE                     hFileMappingObject,
     288                                     DWORD                      dwDesiredAccess,
     289                                     DWORD                      dwFileOffsetHigh,
     290                                     DWORD                      dwFileOffsetLow,
     291                                     DWORD                      dwNumberOfBytesToMap,
     292                                     LPVOID                     lpBaseAddress);
     293
     294BOOL HMUnmapViewOfFile              (LPVOID                     lpBaseAddress);
     295
     296BOOL HMFlushViewOfFile              (LPVOID                     lpBaseAddress,
     297                                     DWORD                      dwNumberOfBytesToFlush);
    270298
    271299#ifdef __cplusplus__
  • TabularUnified tags/trunk/src/kernel32/HandleManager.cpp

    r11194 r11273  
    1 /* $Id: HandleManager.cpp,v 1.11 1999-08-19 12:57:41 phaller Exp $ */
     1/* $Id: HandleManager.cpp,v 1.12 1999-08-24 14:36:04 phaller Exp $ */
    22
    33/*
     
    5656#include "HMMutex.h"
    5757#include "HMSemaphore.h"
     58#include "HMFileMapping.h"
    5859
    5960
     
    121122  HMDeviceHandler        *pHMMutex;
    122123  HMDeviceHandler        *pHMSemaphore;
     124  HMDeviceHandler        *pHMFileMapping;
    123125
    124126  ULONG         ulHandleLast;                   /* index of last used handle */
     
    311313
    312314                        /* create handle manager instance for Open32 handles */
    313     HMGlobals.pHMOpen32     = new HMDeviceOpen32Class("\\\\.\\");
    314     HMGlobals.pHMEvent      = new HMDeviceEventClass("\\\\EVENT\\");
    315     HMGlobals.pHMMutex      = new HMDeviceMutexClass("\\\\MUTEX\\");
    316     HMGlobals.pHMSemaphore  = new HMDeviceSemaphoreClass("\\\\SEM\\");
     315    HMGlobals.pHMOpen32       = new HMDeviceOpen32Class("\\\\.\\");
     316    HMGlobals.pHMEvent        = new HMDeviceEventClass("\\\\EVENT\\");
     317    HMGlobals.pHMMutex        = new HMDeviceMutexClass("\\\\MUTEX\\");
     318    HMGlobals.pHMSemaphore    = new HMDeviceSemaphoreClass("\\\\SEM\\");
     319    HMGlobals.pHMFileMapping  = new HMDeviceFileMappingClass("\\\\FILEMAPPING\\");
    317320  }
    318321  return (NO_ERROR);
     
    340343  delete HMGlobals.pHMMutex;
    341344  delete HMGlobals.pHMSemaphore;
     345  delete HMGlobals.pHMFileMapping;
    342346
    343347  return (NO_ERROR);
     
    22372241}
    22382242
     2243
     2244/*****************************************************************************
     2245 * Name      : HANDLE  HMCreateFileMapping
     2246 * Purpose   : Wrapper for the CreateFileMapping() API
     2247 * Parameters:
     2248 * Variables :
     2249 * Result    :
     2250 * Remark    :
     2251 * Status    :
     2252 *
     2253 * Author    : Patrick Haller [Wed, 1998/02/11 20:44]
     2254 *****************************************************************************/
     2255
     2256HANDLE HMCreateFileMapping(HANDLE                hFile,
     2257                           LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
     2258                           DWORD                 flProtect,
     2259                           DWORD                 dwMaximumSizeHigh,
     2260                           DWORD                 dwMaximumSizeLow,
     2261                           LPCTSTR               lpName)
     2262{
     2263  int             iIndex;                     /* index into the handle table */
     2264  int             iIndexNew;                  /* index into the handle table */
     2265  HMDeviceHandler *pDeviceHandler;         /* device handler for this handle */
     2266  PHMHANDLEDATA   pHMHandleData;
     2267  DWORD           rc;                                     /* API return code */
     2268
     2269
     2270  pDeviceHandler = HMGlobals.pHMFileMapping;         /* device is predefined */
     2271
     2272  iIndexNew = _HMHandleGetFree();                         /* get free handle */
     2273  if (-1 == iIndexNew)                            /* oops, no free handles ! */
     2274  {
     2275    SetLastError(ERROR_NOT_ENOUGH_MEMORY);      /* use this as error message */
     2276    return (INVALID_HANDLE_VALUE);                           /* signal error */
     2277  }
     2278
     2279
     2280                           /* initialize the complete HMHANDLEDATA structure */
     2281  pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData;
     2282  pHMHandleData->dwType     = FILE_TYPE_UNKNOWN;      /* unknown handle type */
     2283  pHMHandleData->dwAccess   = 0;
     2284  pHMHandleData->dwShare    = 0;
     2285  pHMHandleData->dwCreation = 0;
     2286  pHMHandleData->dwFlags    = 0;
     2287  pHMHandleData->lpHandlerData = NULL;
     2288
     2289
     2290      /* we've got to mark the handle as occupied here, since another device */
     2291                   /* could be created within the device handler -> deadlock */
     2292
     2293          /* write appropriate entry into the handle table if open succeeded */
     2294  TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = iIndexNew;
     2295  TabWin32Handles[iIndexNew].pDeviceHandler         = pDeviceHandler;
     2296
     2297                                                  /* call the device handler */
     2298
     2299  // @@@PH: Note: hFile is a Win32-style handle, it's not (yet) converted to
     2300  //              a valid HandleManager-internal handle!
     2301  rc = pDeviceHandler->CreateFileMapping(&TabWin32Handles[iIndexNew].hmHandleData,
     2302                                         hFile,
     2303                                         lpFileMappingAttributes,
     2304                                         flProtect,
     2305                                         dwMaximumSizeHigh,
     2306                                         dwMaximumSizeLow,
     2307                                         lpName);
     2308
     2309  if (rc != NO_ERROR)     /* oops, creation failed within the device handler */
     2310  {
     2311    TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE;
     2312    SetLastError(rc);          /* Hehe, OS/2 and NT are pretty compatible :) */
     2313    return (INVALID_HANDLE_VALUE);                           /* signal error */
     2314  }
     2315
     2316  return iIndexNew;                                   /* return valid handle */
     2317}
     2318
     2319
     2320/*****************************************************************************
     2321 * Name      : HANDLE  HMOpenFileMapping
     2322 * Purpose   : Wrapper for the OpenFileMapping() API
     2323 * Parameters:
     2324 * Variables :
     2325 * Result    :
     2326 * Remark    :
     2327 * Status    :
     2328 *
     2329 * Author    : Patrick Haller [Wed, 1998/02/11 20:44]
     2330 *****************************************************************************/
     2331
     2332HANDLE HMOpenFileMapping(DWORD   fdwAccess,
     2333                         BOOL    fInherit,
     2334                         LPCTSTR lpName)
     2335{
     2336  int             iIndex;                     /* index into the handle table */
     2337  int             iIndexNew;                  /* index into the handle table */
     2338  HMDeviceHandler *pDeviceHandler;         /* device handler for this handle */
     2339  PHMHANDLEDATA   pHMHandleData;
     2340  DWORD           rc;                                     /* API return code */
     2341
     2342
     2343  pDeviceHandler = HMGlobals.pHMFileMapping;         /* device is predefined */
     2344
     2345  iIndexNew = _HMHandleGetFree();                         /* get free handle */
     2346  if (-1 == iIndexNew)                            /* oops, no free handles ! */
     2347  {
     2348    SetLastError(ERROR_NOT_ENOUGH_MEMORY);      /* use this as error message */
     2349    return (INVALID_HANDLE_VALUE);                           /* signal error */
     2350  }
     2351
     2352
     2353                           /* initialize the complete HMHANDLEDATA structure */
     2354  pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData;
     2355  pHMHandleData->dwType     = FILE_TYPE_UNKNOWN;      /* unknown handle type */
     2356  pHMHandleData->dwAccess   = fdwAccess;
     2357  pHMHandleData->dwShare    = 0;
     2358  pHMHandleData->dwCreation = 0;
     2359  pHMHandleData->dwFlags    = 0;
     2360  pHMHandleData->lpHandlerData = NULL;
     2361
     2362
     2363      /* we've got to mark the handle as occupied here, since another device */
     2364                   /* could be created within the device handler -> deadlock */
     2365
     2366          /* write appropriate entry into the handle table if open succeeded */
     2367  TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = iIndexNew;
     2368  TabWin32Handles[iIndexNew].pDeviceHandler         = pDeviceHandler;
     2369
     2370                                                  /* call the device handler */
     2371  rc = pDeviceHandler->OpenFileMapping(&TabWin32Handles[iIndexNew].hmHandleData,
     2372                                       fInherit,
     2373                                       lpName);
     2374  if (rc != NO_ERROR)     /* oops, creation failed within the device handler */
     2375  {
     2376    TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE;
     2377    SetLastError(rc);          /* Hehe, OS/2 and NT are pretty compatible :) */
     2378    return (INVALID_HANDLE_VALUE);                           /* signal error */
     2379  }
     2380
     2381  return iIndexNew;                                   /* return valid handle */
     2382}
     2383
     2384
     2385/*****************************************************************************
     2386 * Name      : HMMapViewOfFile
     2387 * Purpose   : router function for MapViewOfFile
     2388 * Parameters:
     2389 * Variables :
     2390 * Result    :
     2391 * Remark    :
     2392 * Status    :
     2393 *
     2394 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     2395 *****************************************************************************/
     2396
     2397LPVOID HMMapViewOfFile(HANDLE hFileMappingObject,
     2398                       DWORD  dwDesiredAccess,
     2399                       DWORD  dwFileOffsetHigh,
     2400                       DWORD  dwFileOffsetLow,
     2401                       DWORD  dwNumberOfBytesToMap)
     2402{
     2403  int       iIndex;                           /* index into the handle table */
     2404  LPVOID    lpResult;                /* result from the device handler's API */
     2405  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2406
     2407                                                          /* validate handle */
     2408  iIndex = _HMHandleQuery(hFileMappingObject);              /* get the index */
     2409  if (-1 == iIndex)                                               /* error ? */
     2410  {
     2411    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2412    return (NULL);                                         /* signal failure */
     2413  }
     2414
     2415  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2416  lpResult = pHMHandle->pDeviceHandler->MapViewOfFile(&pHMHandle->hmHandleData,
     2417                                                      dwDesiredAccess,
     2418                                                      dwFileOffsetHigh,
     2419                                                      dwFileOffsetLow,
     2420                                                      dwNumberOfBytesToMap);
     2421
     2422  return (lpResult);                                  /* deliver return code */
     2423}
     2424
     2425
     2426
     2427/*****************************************************************************
     2428 * Name      : HMMapViewOfFileEx
     2429 * Purpose   : router function for MapViewOfFileEx
     2430 * Parameters:
     2431 * Variables :
     2432 * Result    :
     2433 * Remark    :
     2434 * Status    :
     2435 *
     2436 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     2437 *****************************************************************************/
     2438
     2439LPVOID HMMapViewOfFileEx(HANDLE hFileMappingObject,
     2440                         DWORD  dwDesiredAccess,
     2441                         DWORD  dwFileOffsetHigh,
     2442                         DWORD  dwFileOffsetLow,
     2443                         DWORD  dwNumberOfBytesToMap,
     2444                         LPVOID lpBaseAddress)
     2445{
     2446  int       iIndex;                           /* index into the handle table */
     2447  LPVOID    lpResult;                /* result from the device handler's API */
     2448  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2449
     2450                                                          /* validate handle */
     2451  iIndex = _HMHandleQuery(hFileMappingObject);              /* get the index */
     2452  if (-1 == iIndex)                                               /* error ? */
     2453  {
     2454    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2455    return (NULL);                                         /* signal failure */
     2456  }
     2457
     2458  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2459  lpResult = pHMHandle->pDeviceHandler->MapViewOfFileEx(&pHMHandle->hmHandleData,
     2460                                                        dwDesiredAccess,
     2461                                                        dwFileOffsetHigh,
     2462                                                        dwFileOffsetLow,
     2463                                                        dwNumberOfBytesToMap,
     2464                                                        lpBaseAddress);
     2465
     2466  return (lpResult);                                  /* deliver return code */
     2467}
     2468
     2469
     2470/*****************************************************************************
     2471 * Name      : HMUnmapViewOfFile
     2472 * Purpose   : router function for UnmapViewOfFile
     2473 * Parameters:
     2474 * Variables :
     2475 * Result    :
     2476 * Remark    : No handle is specified, that makes things a bit more difficult!
     2477 *             We've got to identify the object by the base address and check
     2478 *             back with HandleManager manually!
     2479 * Status    :
     2480 *
     2481 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     2482 *****************************************************************************/
     2483
     2484BOOL HMUnmapViewOfFile(LPVOID lpBaseAddress)
     2485{
     2486  int       iIndex;                           /* index into the handle table */
     2487  BOOL      flResult;                /* result from the device handler's API */
     2488  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2489
     2490  // Identify the correct handle by the base address. Thus call a special
     2491  // static function within the FileMapping class.
     2492  iIndex = HMDeviceFileMappingClass::findByBaseAddress(lpBaseAddress);                                                          /* validate handle */
     2493  if (-1 == iIndex)                                               /* error ? */
     2494  {
     2495    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2496    return (FALSE);                                        /* signal failure */
     2497  }
     2498
     2499  flResult = pHMHandle->pDeviceHandler->UnmapViewOfFile(&pHMHandle->hmHandleData,
     2500                                                        lpBaseAddress);
     2501
     2502  // @@@PH automatically call CloseHandle of no more references to the object
     2503  //       are active.
     2504
     2505  return (flResult);                                  /* deliver return code */
     2506}
     2507
     2508
     2509/*****************************************************************************
     2510 * Name      : HMFlushViewOfFile
     2511 * Purpose   : router function for FlushViewOfFile
     2512 * Parameters:
     2513 * Variables :
     2514 * Result    :
     2515 * Remark    : No handle is specified, that makes things a bit more difficult!
     2516 *             We've got to identify the object by the base address and check
     2517 *             back with HandleManager manually!
     2518 * Status    :
     2519 *
     2520 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     2521 *****************************************************************************/
     2522
     2523BOOL HMFlushViewOfFile(LPVOID lpBaseAddress,
     2524                       DWORD  dwNumberOfBytesToFlush)
     2525{
     2526  int       iIndex;                           /* index into the handle table */
     2527  BOOL      flResult;                /* result from the device handler's API */
     2528  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2529
     2530  // Identify the correct handle by the base address. Thus call a special
     2531  // static function within the FileMapping class.
     2532  iIndex = HMDeviceFileMappingClass::findByBaseAddress(lpBaseAddress);                                                          /* validate handle */
     2533  if (-1 == iIndex)                                               /* error ? */
     2534  {
     2535    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
     2536    return (FALSE);                                        /* signal failure */
     2537  }
     2538
     2539  flResult = pHMHandle->pDeviceHandler->FlushViewOfFile(&pHMHandle->hmHandleData,
     2540                                                        lpBaseAddress,
     2541                                                        dwNumberOfBytesToFlush);
     2542
     2543  return (flResult);                                  /* deliver return code */
     2544}
  • TabularUnified tags/trunk/src/kernel32/hmdevice.cpp

    r10902 r11273  
    1 /* $Id: hmdevice.cpp,v 1.2 1999-07-06 15:48:46 phaller Exp $ */
     1/* $Id: hmdevice.cpp,v 1.3 1999-08-24 14:36:05 phaller Exp $ */
    22
    33/*
     
    890890           pHMHandleData->hHMHandle));
    891891
    892   return(ERROR_INVALID_FUNCTION);
     892  return(FALSE);
    893893}
    894894
     
    920920           arg4));
    921921
    922   return(ERROR_INVALID_FUNCTION);
    923 }
    924 
     922  return(FALSE);
     923}
     924
     925
     926/*****************************************************************************
     927 * Name      : DWORD HMDeviceHandler::CreateFileMapping
     928 * Purpose   : create memory mapped file
     929 * Parameters: PHMHANDLEDATA pHMHandleData
     930 *             LPSECURITY_ATTRIBUTES      lpFileMappingAttributes
     931 *             DWORD                      flProtect
     932 *             DWORD                      dwMaximumSizeHigh
     933 *             DWORD                      dwMaximumSizeLow
     934 *             LPCTSTR                    lpName
     935 * Variables :
     936 * Result    : API returncode
     937 * Remark    :
     938 * Status    :
     939 *
     940 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     941 *****************************************************************************/
     942
     943DWORD HMDeviceHandler::CreateFileMapping(PHMHANDLEDATA              pHMHandleData,
     944                                         HANDLE                     hFile,
     945                                         LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
     946                                         DWORD                      flProtect,
     947                                         DWORD                      dwMaximumSizeHigh,
     948                                         DWORD                      dwMaximumSizeLow,
     949                                         LPCTSTR                    lpName)
     950{
     951  dprintf(("KERNEL32: HandleManager::DeviceHandler::CreateFileMapping(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%s)\n",
     952           pHMHandleData->hHMHandle,
     953           hFile,
     954           lpFileMappingAttributes,
     955           flProtect,
     956           dwMaximumSizeHigh,
     957           dwMaximumSizeLow,
     958           lpName));
     959
     960  return(ERROR_INVALID_FUNCTION);
     961}
     962
     963
     964/*****************************************************************************
     965 * Name      : DWORD HMDeviceHandler::OpenFileMapping
     966 * Purpose   : open memory mapped file
     967 * Parameters: PHMHANDLEDATA pHMHandleData
     968 *             LPOVERLAPPED  arg2
     969 *             LPDWORD       arg3
     970 *             BOOL          arg4
     971 * Variables :
     972 * Result    : API returncode
     973 * Remark    :
     974 * Status    :
     975 *
     976 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     977 *****************************************************************************/
     978
     979DWORD HMDeviceHandler::OpenFileMapping(PHMHANDLEDATA pHMHandleData,
     980                                      BOOL          fInherit,
     981                                      LPCTSTR       lpName)
     982{
     983  dprintf(("KERNEL32: HandleManager::DeviceHandler::OpenFileMapping(%08xh,%08xh,%08xh)\n",
     984           pHMHandleData->hHMHandle,
     985           fInherit,
     986           lpName));
     987
     988  return(ERROR_INVALID_FUNCTION);
     989}
     990
     991
     992/*****************************************************************************
     993 * Name      : DWORD HMDeviceHandler::MapViewOfFile
     994 * Purpose   : map memory mapped file
     995 * Parameters: PHMHANDLEDATA pHMHandleData
     996 *             DWORD         dwDesiredAccess,
     997 *             DWORD         dwFileOffsetHigh,
     998 *             DWORD         dwFileOffsetLow,
     999 *             DWORD         dwNumberOfBytesToMap
     1000 * Variables :
     1001 * Result    : address to memory mapped region
     1002 * Remark    :
     1003 * Status    :
     1004 *
     1005 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     1006 *****************************************************************************/
     1007
     1008LPVOID HMDeviceHandler::MapViewOfFile(PHMHANDLEDATA pHMHandleData,
     1009                                      DWORD         dwDesiredAccess,
     1010                                      DWORD         dwFileOffsetHigh,
     1011                                      DWORD         dwFileOffsetLow,
     1012                                      DWORD         dwNumberOfBytesToMap)
     1013{
     1014  dprintf(("KERNEL32: HandleManager::DeviceHandler::MapViewOfFile(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
     1015           pHMHandleData->hHMHandle,
     1016           dwDesiredAccess,
     1017           dwFileOffsetHigh,
     1018           dwFileOffsetLow,
     1019           dwNumberOfBytesToMap));
     1020
     1021  return(NULL);
     1022}
     1023
     1024
     1025/*****************************************************************************
     1026 * Name      : DWORD HMDeviceHandler::MapViewOfFileEx
     1027 * Purpose   : map memory mapped file
     1028 * Parameters: PHMHANDLEDATA pHMHandleData
     1029 *             DWORD         dwDesiredAccess,
     1030 *             DWORD         dwFileOffsetHigh,
     1031 *             DWORD         dwFileOffsetLow,
     1032 *             DWORD         dwNumberOfBytesToMap
     1033 *             LPVOID        lpBaseAddress
     1034 * Variables :
     1035 * Result    : address to memory mapped region
     1036 * Remark    :
     1037 * Status    :
     1038 *
     1039 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     1040 *****************************************************************************/
     1041
     1042LPVOID HMDeviceHandler::MapViewOfFileEx(PHMHANDLEDATA pHMHandleData,
     1043                                        DWORD         dwDesiredAccess,
     1044                                        DWORD         dwFileOffsetHigh,
     1045                                        DWORD         dwFileOffsetLow,
     1046                                        DWORD         dwNumberOfBytesToMap,
     1047                                        LPVOID        lpBaseAddress)
     1048{
     1049  dprintf(("KERNEL32: HandleManager::DeviceHandler::MapViewOfFileEx(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n",
     1050           pHMHandleData->hHMHandle,
     1051           dwDesiredAccess,
     1052           dwFileOffsetHigh,
     1053           dwFileOffsetLow,
     1054           dwNumberOfBytesToMap,
     1055           lpBaseAddress));
     1056
     1057  return(NULL);
     1058}
     1059
     1060
     1061/*****************************************************************************
     1062 * Name      : DWORD HMDeviceHandler::UnmapViewOfFile
     1063 * Purpose   : unmap memory mapped file
     1064 * Parameters: PHMHANDLEDATA pHMHandleData
     1065 *             LPVOID        lpBaseAddress
     1066 * Variables :
     1067 * Result    : TRUE / FALSE
     1068 * Remark    :
     1069 * Status    :
     1070 *
     1071 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     1072 *****************************************************************************/
     1073
     1074BOOL HMDeviceHandler::UnmapViewOfFile(PHMHANDLEDATA pHMHandleData,
     1075                                      LPVOID        lpBaseAddress)
     1076{
     1077  dprintf(("KERNEL32: HandleManager::DeviceHandler::UnmapViewOfFile(%08xh,%08xh)\n",
     1078           pHMHandleData->hHMHandle,
     1079           lpBaseAddress));
     1080
     1081  return(FALSE);
     1082}
     1083
     1084
     1085/*****************************************************************************
     1086 * Name      : DWORD HMDeviceHandler::FlushViewOfFile
     1087 * Purpose   : flush memory mapped file
     1088 * Parameters: PHMHANDLEDATA pHMHandleData
     1089 *             LPVOID        lpBaseAddress
     1090 *             DWORD         dwNumberOfBytesToFlush
     1091 * Variables :
     1092 * Result    : TRUE / FALSE
     1093 * Remark    :
     1094 * Status    :
     1095 *
     1096 * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
     1097 *****************************************************************************/
     1098
     1099BOOL HMDeviceHandler::FlushViewOfFile(PHMHANDLEDATA pHMHandleData,
     1100                                      LPVOID        lpBaseAddress,
     1101                                      DWORD         dwNumberOfBytesToFlush)
     1102{
     1103  dprintf(("KERNEL32: HandleManager::DeviceHandler::FlushViewOfFile(%08xh,%08xh,%08xh)\n",
     1104           pHMHandleData->hHMHandle,
     1105           lpBaseAddress,
     1106           dwNumberOfBytesToFlush));
     1107
     1108  return(FALSE);
     1109}
     1110
  • TabularUnified tags/trunk/src/kernel32/hmdevice.h

    r10902 r11273  
    1 /* $Id: hmdevice.h,v 1.3 1999-07-06 15:48:46 phaller Exp $ */
     1/* $Id: hmdevice.h,v 1.4 1999-08-24 14:36:05 phaller Exp $ */
    22
    33/*
     
    238238                                 LONG          cReleaseCount,
    239239                                 LPLONG        lpPreviousCount);
     240
     241
     242  /***************************************************************************
     243   * File Mappings                                                           *
     244   ***************************************************************************/
     245
     246                /* this is a handler method for calls to CreateFileMapping() */
     247  virtual DWORD CreateFileMapping   (PHMHANDLEDATA              pHMHandleData,
     248                                     HANDLE                     hFile,
     249                                     LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
     250                                     DWORD                      flProtect,
     251                                     DWORD                      dwMaximumSizeHigh,
     252                                     DWORD                      dwMaximumSizeLow,
     253                                     LPCTSTR                    lpName);
     254
     255                  /* this is a handler method for calls to OpenFileMapping() */
     256  virtual DWORD OpenFileMapping     (PHMHANDLEDATA              pHMHandleData,
     257                                     BOOL                       fInherit,
     258                                     LPCTSTR                    lpName);
     259
     260                    /* this is a handler method for calls to MapViewOfFile() */
     261  virtual LPVOID MapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
     262                                     DWORD                      dwDesiredAccess,
     263                                     DWORD                      dwFileOffsetHigh,
     264                                     DWORD                      dwFileOffsetLow,
     265                                     DWORD                      dwNumberOfBytesToMap);
     266
     267                  /* this is a handler method for calls to MapViewOfFileEx() */
     268  virtual LPVOID MapViewOfFileEx    (PHMHANDLEDATA              pHMHandleData,
     269                                     DWORD                      dwDesiredAccess,
     270                                     DWORD                      dwFileOffsetHigh,
     271                                     DWORD                      dwFileOffsetLow,
     272                                     DWORD                      dwNumberOfBytesToMap,
     273                                     LPVOID                     lpBaseAddress);
     274
     275                  /* this is a handler method for calls to UnmapViewOfFile() */
     276  virtual BOOL UnmapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
     277                                     LPVOID                     lpBaseAddress);
     278
     279                  /* this is a handler method for calls to FlushViewOfFile() */
     280  virtual BOOL FlushViewOfFile      (PHMHANDLEDATA              pHMHandleData,
     281                                     LPVOID                     lpBaseAddress,
     282                                     DWORD                      dwNumberOfBytesToFlush);
     283
    240284};
    241285
  • TabularUnified tags/trunk/src/kernel32/makefile

    r11271 r11273  
    1 # $Id: makefile,v 1.27 1999-08-24 12:23:24 sandervl Exp $
     1# $Id: makefile,v 1.28 1999-08-24 14:36:05 phaller Exp $
    22
    33#
     
    2727 WIN32UTIL.OBJ heap.OBJ heapstring.obj os2heap.OBJ \
    2828 vmutex.OBJ initterm.OBJ os2util.OBJ handlemanager.OBJ \
    29  hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj \
     29 hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj hmfilemapping.obj \
    3030 hmmutex.obj hmsemaphore.obj wprocess.OBJ conprop.OBJ \
    3131 winimage.OBJ windll.OBJ winexe.OBJ time.obj mmap.obj \
     
    3333 atom.obj disk.obj directory.obj cvtbitmap.obj \
    3434 cvtmenu.obj cvtaccel.obj cvticon.obj cvticongrp.obj \
    35  cvtcursor.obj cvtcursorgrp.obj stubs.obj 
     35 cvtcursor.obj cvtcursorgrp.obj stubs.obj
    3636
    3737
     
    286286        .\hmopen32.h
    287287
     288hmfilemapping.obj: \
     289        .\hmfilemapping.cpp \
     290        .\hmfilemapping.h \
     291        .\hmdevice.h
     292
    288293conprop.OBJ: \
    289294        .\conprop.h \
Note: See TracChangeset for help on using the changeset viewer.