Index: trunk/src/kernel32/HandleManager.cpp
===================================================================
--- trunk/src/kernel32/HandleManager.cpp	(revision 657)
+++ trunk/src/kernel32/HandleManager.cpp	(revision 659)
@@ -1,3 +1,3 @@
-/* $Id: HandleManager.cpp,v 1.11 1999-08-19 12:57:41 phaller Exp $ */
+/* $Id: HandleManager.cpp,v 1.12 1999-08-24 14:36:04 phaller Exp $ */
 
 /*
@@ -56,4 +56,5 @@
 #include "HMMutex.h"
 #include "HMSemaphore.h"
+#include "HMFileMapping.h"
 
 
@@ -121,4 +122,5 @@
   HMDeviceHandler        *pHMMutex;
   HMDeviceHandler        *pHMSemaphore;
+  HMDeviceHandler        *pHMFileMapping;
 
   ULONG         ulHandleLast;                   /* index of last used handle */
@@ -311,8 +313,9 @@
 
                         /* create handle manager instance for Open32 handles */
-    HMGlobals.pHMOpen32     = new HMDeviceOpen32Class("\\\\.\\");
-    HMGlobals.pHMEvent      = new HMDeviceEventClass("\\\\EVENT\\");
-    HMGlobals.pHMMutex      = new HMDeviceMutexClass("\\\\MUTEX\\");
-    HMGlobals.pHMSemaphore  = new HMDeviceSemaphoreClass("\\\\SEM\\");
+    HMGlobals.pHMOpen32       = new HMDeviceOpen32Class("\\\\.\\");
+    HMGlobals.pHMEvent        = new HMDeviceEventClass("\\\\EVENT\\");
+    HMGlobals.pHMMutex        = new HMDeviceMutexClass("\\\\MUTEX\\");
+    HMGlobals.pHMSemaphore    = new HMDeviceSemaphoreClass("\\\\SEM\\");
+    HMGlobals.pHMFileMapping  = new HMDeviceFileMappingClass("\\\\FILEMAPPING\\");
   }
   return (NO_ERROR);
@@ -340,4 +343,5 @@
   delete HMGlobals.pHMMutex;
   delete HMGlobals.pHMSemaphore;
+  delete HMGlobals.pHMFileMapping;
 
   return (NO_ERROR);
@@ -2237,2 +2241,304 @@
 }
 
+
+/*****************************************************************************
+ * Name      : HANDLE  HMCreateFileMapping
+ * Purpose   : Wrapper for the CreateFileMapping() API
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1998/02/11 20:44]
+ *****************************************************************************/
+
+HANDLE HMCreateFileMapping(HANDLE                hFile,
+                           LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
+                           DWORD                 flProtect,
+                           DWORD                 dwMaximumSizeHigh,
+                           DWORD                 dwMaximumSizeLow,
+                           LPCTSTR               lpName)
+{
+  int             iIndex;                     /* index into the handle table */
+  int             iIndexNew;                  /* index into the handle table */
+  HMDeviceHandler *pDeviceHandler;         /* device handler for this handle */
+  PHMHANDLEDATA   pHMHandleData;
+  DWORD           rc;                                     /* API return code */
+
+
+  pDeviceHandler = HMGlobals.pHMFileMapping;         /* device is predefined */
+
+  iIndexNew = _HMHandleGetFree();                         /* get free handle */
+  if (-1 == iIndexNew)                            /* oops, no free handles ! */
+  {
+    SetLastError(ERROR_NOT_ENOUGH_MEMORY);      /* use this as error message */
+    return (INVALID_HANDLE_VALUE);                           /* signal error */
+  }
+
+
+                           /* initialize the complete HMHANDLEDATA structure */
+  pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData;
+  pHMHandleData->dwType     = FILE_TYPE_UNKNOWN;      /* unknown handle type */
+  pHMHandleData->dwAccess   = 0;
+  pHMHandleData->dwShare    = 0;
+  pHMHandleData->dwCreation = 0;
+  pHMHandleData->dwFlags    = 0;
+  pHMHandleData->lpHandlerData = NULL;
+
+
+      /* we've got to mark the handle as occupied here, since another device */
+                   /* could be created within the device handler -> deadlock */
+
+          /* write appropriate entry into the handle table if open succeeded */
+  TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = iIndexNew;
+  TabWin32Handles[iIndexNew].pDeviceHandler         = pDeviceHandler;
+
+                                                  /* call the device handler */
+
+  // @@@PH: Note: hFile is a Win32-style handle, it's not (yet) converted to
+  //              a valid HandleManager-internal handle!
+  rc = pDeviceHandler->CreateFileMapping(&TabWin32Handles[iIndexNew].hmHandleData,
+                                         hFile,
+                                         lpFileMappingAttributes,
+                                         flProtect,
+                                         dwMaximumSizeHigh,
+                                         dwMaximumSizeLow,
+                                         lpName);
+
+  if (rc != NO_ERROR)     /* oops, creation failed within the device handler */
+  {
+    TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE;
+    SetLastError(rc);          /* Hehe, OS/2 and NT are pretty compatible :) */
+    return (INVALID_HANDLE_VALUE);                           /* signal error */
+  }
+
+  return iIndexNew;                                   /* return valid handle */
+}
+
+
+/*****************************************************************************
+ * Name      : HANDLE  HMOpenFileMapping
+ * Purpose   : Wrapper for the OpenFileMapping() API
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1998/02/11 20:44]
+ *****************************************************************************/
+
+HANDLE HMOpenFileMapping(DWORD   fdwAccess,
+                         BOOL    fInherit,
+                         LPCTSTR lpName)
+{
+  int             iIndex;                     /* index into the handle table */
+  int             iIndexNew;                  /* index into the handle table */
+  HMDeviceHandler *pDeviceHandler;         /* device handler for this handle */
+  PHMHANDLEDATA   pHMHandleData;
+  DWORD           rc;                                     /* API return code */
+
+
+  pDeviceHandler = HMGlobals.pHMFileMapping;         /* device is predefined */
+
+  iIndexNew = _HMHandleGetFree();                         /* get free handle */
+  if (-1 == iIndexNew)                            /* oops, no free handles ! */
+  {
+    SetLastError(ERROR_NOT_ENOUGH_MEMORY);      /* use this as error message */
+    return (INVALID_HANDLE_VALUE);                           /* signal error */
+  }
+
+
+                           /* initialize the complete HMHANDLEDATA structure */
+  pHMHandleData = &TabWin32Handles[iIndexNew].hmHandleData;
+  pHMHandleData->dwType     = FILE_TYPE_UNKNOWN;      /* unknown handle type */
+  pHMHandleData->dwAccess   = fdwAccess;
+  pHMHandleData->dwShare    = 0;
+  pHMHandleData->dwCreation = 0;
+  pHMHandleData->dwFlags    = 0;
+  pHMHandleData->lpHandlerData = NULL;
+
+
+      /* we've got to mark the handle as occupied here, since another device */
+                   /* could be created within the device handler -> deadlock */
+
+          /* write appropriate entry into the handle table if open succeeded */
+  TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = iIndexNew;
+  TabWin32Handles[iIndexNew].pDeviceHandler         = pDeviceHandler;
+
+                                                  /* call the device handler */
+  rc = pDeviceHandler->OpenFileMapping(&TabWin32Handles[iIndexNew].hmHandleData,
+                                       fInherit,
+                                       lpName);
+  if (rc != NO_ERROR)     /* oops, creation failed within the device handler */
+  {
+    TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE;
+    SetLastError(rc);          /* Hehe, OS/2 and NT are pretty compatible :) */
+    return (INVALID_HANDLE_VALUE);                           /* signal error */
+  }
+
+  return iIndexNew;                                   /* return valid handle */
+}
+
+
+/*****************************************************************************
+ * Name      : HMMapViewOfFile
+ * Purpose   : router function for MapViewOfFile
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMMapViewOfFile(HANDLE hFileMappingObject,
+                       DWORD  dwDesiredAccess,
+                       DWORD  dwFileOffsetHigh,
+                       DWORD  dwFileOffsetLow,
+                       DWORD  dwNumberOfBytesToMap)
+{
+  int       iIndex;                           /* index into the handle table */
+  LPVOID    lpResult;                /* result from the device handler's API */
+  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
+
+                                                          /* validate handle */
+  iIndex = _HMHandleQuery(hFileMappingObject);              /* get the index */
+  if (-1 == iIndex)                                               /* error ? */
+  {
+    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
+    return (NULL);                                         /* signal failure */
+  }
+
+  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
+  lpResult = pHMHandle->pDeviceHandler->MapViewOfFile(&pHMHandle->hmHandleData,
+                                                      dwDesiredAccess,
+                                                      dwFileOffsetHigh,
+                                                      dwFileOffsetLow,
+                                                      dwNumberOfBytesToMap);
+
+  return (lpResult);                                  /* deliver return code */
+}
+
+
+
+/*****************************************************************************
+ * Name      : HMMapViewOfFileEx
+ * Purpose   : router function for MapViewOfFileEx
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMMapViewOfFileEx(HANDLE hFileMappingObject,
+                         DWORD  dwDesiredAccess,
+                         DWORD  dwFileOffsetHigh,
+                         DWORD  dwFileOffsetLow,
+                         DWORD  dwNumberOfBytesToMap,
+                         LPVOID lpBaseAddress)
+{
+  int       iIndex;                           /* index into the handle table */
+  LPVOID    lpResult;                /* result from the device handler's API */
+  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
+
+                                                          /* validate handle */
+  iIndex = _HMHandleQuery(hFileMappingObject);              /* get the index */
+  if (-1 == iIndex)                                               /* error ? */
+  {
+    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
+    return (NULL);                                         /* signal failure */
+  }
+
+  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
+  lpResult = pHMHandle->pDeviceHandler->MapViewOfFileEx(&pHMHandle->hmHandleData,
+                                                        dwDesiredAccess,
+                                                        dwFileOffsetHigh,
+                                                        dwFileOffsetLow,
+                                                        dwNumberOfBytesToMap,
+                                                        lpBaseAddress);
+
+  return (lpResult);                                  /* deliver return code */
+}
+
+
+/*****************************************************************************
+ * Name      : HMUnmapViewOfFile
+ * Purpose   : router function for UnmapViewOfFile
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : No handle is specified, that makes things a bit more difficult!
+ *             We've got to identify the object by the base address and check
+ *             back with HandleManager manually!
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMUnmapViewOfFile(LPVOID lpBaseAddress)
+{
+  int       iIndex;                           /* index into the handle table */
+  BOOL      flResult;                /* result from the device handler's API */
+  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
+
+  // Identify the correct handle by the base address. Thus call a special
+  // static function within the FileMapping class.
+  iIndex = HMDeviceFileMappingClass::findByBaseAddress(lpBaseAddress);                                                          /* validate handle */
+  if (-1 == iIndex)                                               /* error ? */
+  {
+    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
+    return (FALSE);                                        /* signal failure */
+  }
+
+  flResult = pHMHandle->pDeviceHandler->UnmapViewOfFile(&pHMHandle->hmHandleData,
+                                                        lpBaseAddress);
+
+  // @@@PH automatically call CloseHandle of no more references to the object
+  //       are active.
+
+  return (flResult);                                  /* deliver return code */
+}
+
+
+/*****************************************************************************
+ * Name      : HMFlushViewOfFile
+ * Purpose   : router function for FlushViewOfFile
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : No handle is specified, that makes things a bit more difficult!
+ *             We've got to identify the object by the base address and check
+ *             back with HandleManager manually!
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMFlushViewOfFile(LPVOID lpBaseAddress,
+                       DWORD  dwNumberOfBytesToFlush)
+{
+  int       iIndex;                           /* index into the handle table */
+  BOOL      flResult;                /* result from the device handler's API */
+  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
+
+  // Identify the correct handle by the base address. Thus call a special
+  // static function within the FileMapping class.
+  iIndex = HMDeviceFileMappingClass::findByBaseAddress(lpBaseAddress);                                                          /* validate handle */
+  if (-1 == iIndex)                                               /* error ? */
+  {
+    SetLastError(ERROR_INVALID_HANDLE);       /* set win32 error information */
+    return (FALSE);                                        /* signal failure */
+  }
+
+  flResult = pHMHandle->pDeviceHandler->FlushViewOfFile(&pHMHandle->hmHandleData,
+                                                        lpBaseAddress,
+                                                        dwNumberOfBytesToFlush);
+
+  return (flResult);                                  /* deliver return code */
+}
Index: trunk/src/kernel32/hmdevice.cpp
===================================================================
--- trunk/src/kernel32/hmdevice.cpp	(revision 657)
+++ trunk/src/kernel32/hmdevice.cpp	(revision 659)
@@ -1,3 +1,3 @@
-/* $Id: hmdevice.cpp,v 1.2 1999-07-06 15:48:46 phaller Exp $ */
+/* $Id: hmdevice.cpp,v 1.3 1999-08-24 14:36:05 phaller Exp $ */
 
 /*
@@ -890,5 +890,5 @@
            pHMHandleData->hHMHandle));
 
-  return(ERROR_INVALID_FUNCTION);
+  return(FALSE);
 }
 
@@ -920,5 +920,191 @@
            arg4));
 
-  return(ERROR_INVALID_FUNCTION);
-}
-
+  return(FALSE);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::CreateFileMapping
+ * Purpose   : create memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPSECURITY_ATTRIBUTES      lpFileMappingAttributes
+ *             DWORD                      flProtect
+ *             DWORD                      dwMaximumSizeHigh
+ *             DWORD                      dwMaximumSizeLow
+ *             LPCTSTR                    lpName
+ * Variables :
+ * Result    : API returncode
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+DWORD HMDeviceHandler::CreateFileMapping(PHMHANDLEDATA              pHMHandleData,
+                                         HANDLE                     hFile,
+                                         LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
+                                         DWORD                      flProtect,
+                                         DWORD                      dwMaximumSizeHigh,
+                                         DWORD                      dwMaximumSizeLow,
+                                         LPCTSTR                    lpName)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::CreateFileMapping(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%s)\n",
+           pHMHandleData->hHMHandle,
+           hFile,
+           lpFileMappingAttributes,
+           flProtect,
+           dwMaximumSizeHigh,
+           dwMaximumSizeLow,
+           lpName));
+
+  return(ERROR_INVALID_FUNCTION);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::OpenFileMapping
+ * Purpose   : open memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPOVERLAPPED  arg2
+ *             LPDWORD       arg3
+ *             BOOL          arg4
+ * Variables :
+ * Result    : API returncode
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+DWORD HMDeviceHandler::OpenFileMapping(PHMHANDLEDATA pHMHandleData,
+                                      BOOL          fInherit,
+                                      LPCTSTR       lpName)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::OpenFileMapping(%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           fInherit,
+           lpName));
+
+  return(ERROR_INVALID_FUNCTION);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::MapViewOfFile
+ * Purpose   : map memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             DWORD         dwDesiredAccess,
+ *             DWORD         dwFileOffsetHigh,
+ *             DWORD         dwFileOffsetLow,
+ *             DWORD         dwNumberOfBytesToMap
+ * Variables :
+ * Result    : address to memory mapped region
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMDeviceHandler::MapViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                      DWORD         dwDesiredAccess,
+                                      DWORD         dwFileOffsetHigh,
+                                      DWORD         dwFileOffsetLow,
+                                      DWORD         dwNumberOfBytesToMap)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::MapViewOfFile(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           dwDesiredAccess,
+           dwFileOffsetHigh,
+           dwFileOffsetLow,
+           dwNumberOfBytesToMap));
+
+  return(NULL);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::MapViewOfFileEx
+ * Purpose   : map memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             DWORD         dwDesiredAccess,
+ *             DWORD         dwFileOffsetHigh,
+ *             DWORD         dwFileOffsetLow,
+ *             DWORD         dwNumberOfBytesToMap
+ *             LPVOID        lpBaseAddress
+ * Variables :
+ * Result    : address to memory mapped region
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMDeviceHandler::MapViewOfFileEx(PHMHANDLEDATA pHMHandleData,
+                                        DWORD         dwDesiredAccess,
+                                        DWORD         dwFileOffsetHigh,
+                                        DWORD         dwFileOffsetLow,
+                                        DWORD         dwNumberOfBytesToMap,
+                                        LPVOID        lpBaseAddress)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::MapViewOfFileEx(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           dwDesiredAccess,
+           dwFileOffsetHigh,
+           dwFileOffsetLow,
+           dwNumberOfBytesToMap,
+           lpBaseAddress));
+
+  return(NULL);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::UnmapViewOfFile
+ * Purpose   : unmap memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPVOID        lpBaseAddress
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMDeviceHandler::UnmapViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                      LPVOID        lpBaseAddress)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::UnmapViewOfFile(%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           lpBaseAddress));
+
+  return(FALSE);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceHandler::FlushViewOfFile
+ * Purpose   : flush memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPVOID        lpBaseAddress
+ *             DWORD         dwNumberOfBytesToFlush
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMDeviceHandler::FlushViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                      LPVOID        lpBaseAddress,
+                                      DWORD         dwNumberOfBytesToFlush)
+{
+  dprintf(("KERNEL32: HandleManager::DeviceHandler::FlushViewOfFile(%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           lpBaseAddress,
+           dwNumberOfBytesToFlush));
+
+  return(FALSE);
+}
+
Index: trunk/src/kernel32/hmdevice.h
===================================================================
--- trunk/src/kernel32/hmdevice.h	(revision 657)
+++ trunk/src/kernel32/hmdevice.h	(revision 659)
@@ -1,3 +1,3 @@
-/* $Id: hmdevice.h,v 1.3 1999-07-06 15:48:46 phaller Exp $ */
+/* $Id: hmdevice.h,v 1.4 1999-08-24 14:36:05 phaller Exp $ */
 
 /*
@@ -238,4 +238,48 @@
                                  LONG          cReleaseCount,
                                  LPLONG        lpPreviousCount);
+
+
+  /***************************************************************************
+   * File Mappings                                                           *
+   ***************************************************************************/
+
+                /* this is a handler method for calls to CreateFileMapping() */
+  virtual DWORD CreateFileMapping   (PHMHANDLEDATA              pHMHandleData,
+                                     HANDLE                     hFile,
+                                     LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
+                                     DWORD                      flProtect,
+                                     DWORD                      dwMaximumSizeHigh,
+                                     DWORD                      dwMaximumSizeLow,
+                                     LPCTSTR                    lpName);
+
+                  /* this is a handler method for calls to OpenFileMapping() */
+  virtual DWORD OpenFileMapping     (PHMHANDLEDATA              pHMHandleData,
+                                     BOOL                       fInherit,
+                                     LPCTSTR                    lpName);
+
+                    /* this is a handler method for calls to MapViewOfFile() */
+  virtual LPVOID MapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     DWORD                      dwDesiredAccess,
+                                     DWORD                      dwFileOffsetHigh,
+                                     DWORD                      dwFileOffsetLow,
+                                     DWORD                      dwNumberOfBytesToMap);
+
+                  /* this is a handler method for calls to MapViewOfFileEx() */
+  virtual LPVOID MapViewOfFileEx    (PHMHANDLEDATA              pHMHandleData,
+                                     DWORD                      dwDesiredAccess,
+                                     DWORD                      dwFileOffsetHigh,
+                                     DWORD                      dwFileOffsetLow,
+                                     DWORD                      dwNumberOfBytesToMap,
+                                     LPVOID                     lpBaseAddress);
+
+                  /* this is a handler method for calls to UnmapViewOfFile() */
+  virtual BOOL UnmapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     LPVOID                     lpBaseAddress);
+
+                  /* this is a handler method for calls to FlushViewOfFile() */
+  virtual BOOL FlushViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     LPVOID                     lpBaseAddress,
+                                     DWORD                      dwNumberOfBytesToFlush);
+
 };
 
Index: trunk/src/kernel32/hmfilemapping.cpp
===================================================================
--- trunk/src/kernel32/hmfilemapping.cpp	(revision 659)
+++ trunk/src/kernel32/hmfilemapping.cpp	(revision 659)
@@ -0,0 +1,254 @@
+/* $Id: hmfilemapping.cpp,v 1.1 1999-08-24 14:36:05 phaller Exp $ */
+
+/*
+ * Project Odin Software License can be found in LICENSE.TXT
+ * Win32 Unified Handle Manager for OS/2
+ * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de)
+ */
+
+#undef DEBUG_LOCAL
+//#define DEBUG_LOCAL
+
+
+/*****************************************************************************
+ * Remark                                                                    *
+ *****************************************************************************
+
+ */
+
+
+/*****************************************************************************
+ * Includes                                                                  *
+ *****************************************************************************/
+
+#include <os2win.h>
+#include <stdlib.h>
+#include <string.h>
+#include "unicode.h"
+#include "misc.h"
+
+#include "HandleManager.H"
+#include "HMFileMapping.h"
+
+
+/*****************************************************************************
+ * Defines                                                                   *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Structures                                                                *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Local Prototypes                                                          *
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::findByBaseAddress
+ * Purpose   : file memory mapped object by base address
+ * Parameters: LPVOID        lpBaseAddress
+ * Variables :
+ * Result    : index in Handlemanager handle table
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+int HMDeviceFileMappingClass::findByBaseAddress(LPVOID lpBaseAddress)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::findByBaseAddress(%08xh)\n",
+           lpBaseAddress));
+
+  return(-1); // not found
+}
+
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::CreateFileMapping
+ * Purpose   : create memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPSECURITY_ATTRIBUTES      lpFileMappingAttributes
+ *             DWORD                      flProtect
+ *             DWORD                      dwMaximumSizeHigh
+ *             DWORD                      dwMaximumSizeLow
+ *             LPCTSTR                    lpName
+ * Variables :
+ * Result    : API returncode
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+DWORD HMDeviceFileMappingClass::CreateFileMapping(PHMHANDLEDATA              pHMHandleData,
+                                                  HANDLE                     hFile,
+                                                  LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
+                                                  DWORD                      flProtect,
+                                                  DWORD                      dwMaximumSizeHigh,
+                                                  DWORD                      dwMaximumSizeLow,
+                                                  LPCTSTR                    lpName)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::CreateFileMapping(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%s)\n",
+           pHMHandleData->hHMHandle,
+           hFile,
+           lpFileMappingAttributes,
+           flProtect,
+           dwMaximumSizeHigh,
+           dwMaximumSizeLow,
+           lpName));
+
+  return(ERROR_INVALID_FUNCTION);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::OpenFileMapping
+ * Purpose   : open memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPOVERLAPPED  arg2
+ *             LPDWORD       arg3
+ *             BOOL          arg4
+ * Variables :
+ * Result    : API returncode
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+DWORD HMDeviceFileMappingClass::OpenFileMapping(PHMHANDLEDATA pHMHandleData,
+                                                BOOL          fInherit,
+                                                LPCTSTR       lpName)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::OpenFileMapping(%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           fInherit,
+           lpName));
+
+  return(ERROR_INVALID_FUNCTION);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::MapViewOfFile
+ * Purpose   : map memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             DWORD         dwDesiredAccess,
+ *             DWORD         dwFileOffsetHigh,
+ *             DWORD         dwFileOffsetLow,
+ *             DWORD         dwNumberOfBytesToMap
+ * Variables :
+ * Result    : address to memory mapped region
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMDeviceFileMappingClass::MapViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                               DWORD         dwDesiredAccess,
+                                               DWORD         dwFileOffsetHigh,
+                                               DWORD         dwFileOffsetLow,
+                                               DWORD         dwNumberOfBytesToMap)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::MapViewOfFile(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           dwDesiredAccess,
+           dwFileOffsetHigh,
+           dwFileOffsetLow,
+           dwNumberOfBytesToMap));
+
+  return(NULL);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::MapViewOfFileEx
+ * Purpose   : map memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             DWORD         dwDesiredAccess,
+ *             DWORD         dwFileOffsetHigh,
+ *             DWORD         dwFileOffsetLow,
+ *             DWORD         dwNumberOfBytesToMap
+ *             LPVOID        lpBaseAddress
+ * Variables :
+ * Result    : address to memory mapped region
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+LPVOID HMDeviceFileMappingClass::MapViewOfFileEx(PHMHANDLEDATA pHMHandleData,
+                                                 DWORD         dwDesiredAccess,
+                                                 DWORD         dwFileOffsetHigh,
+                                                 DWORD         dwFileOffsetLow,
+                                                 DWORD         dwNumberOfBytesToMap,
+                                                 LPVOID        lpBaseAddress)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::MapViewOfFileEx(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           dwDesiredAccess,
+           dwFileOffsetHigh,
+           dwFileOffsetLow,
+           dwNumberOfBytesToMap,
+           lpBaseAddress));
+
+  return(NULL);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::UnmapViewOfFile
+ * Purpose   : unmap memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPVOID        lpBaseAddress
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMDeviceFileMappingClass::UnmapViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                               LPVOID        lpBaseAddress)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::UnmapViewOfFile(%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           lpBaseAddress));
+
+  return(FALSE);
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD HMDeviceFileMappingClass::FlushViewOfFile
+ * Purpose   : flush memory mapped file
+ * Parameters: PHMHANDLEDATA pHMHandleData
+ *             LPVOID        lpBaseAddress
+ *             DWORD         dwNumberOfBytesToFlush
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ * Status    :
+ *
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ *****************************************************************************/
+
+BOOL HMDeviceFileMappingClass::FlushViewOfFile(PHMHANDLEDATA pHMHandleData,
+                                               LPVOID        lpBaseAddress,
+                                               DWORD         dwNumberOfBytesToFlush)
+{
+  dprintf(("KERNEL32: HandleManager::FileMapping::FlushViewOfFile(%08xh,%08xh,%08xh)\n",
+           pHMHandleData->hHMHandle,
+           lpBaseAddress,
+           dwNumberOfBytesToFlush));
+
+  return(FALSE);
+}
+
+
Index: trunk/src/kernel32/hmfilemapping.h
===================================================================
--- trunk/src/kernel32/hmfilemapping.h	(revision 659)
+++ trunk/src/kernel32/hmfilemapping.h	(revision 659)
@@ -0,0 +1,81 @@
+/* $Id: hmfilemapping.h,v 1.1 1999-08-24 14:36:05 phaller Exp $ */
+
+/*
+ * Project Odin Software License can be found in LICENSE.TXT
+ * Win32 Unified Handle Manager for OS/2
+ * 1999/06/17 PH Patrick Haller (phaller@gmx.net)
+ */
+
+#ifndef _HM_DEVICE_FILEMAPPING_H_
+#define _HM_DEVICE_FILEMAPPING_H_
+
+
+/*****************************************************************************
+ * Remark                                                                    *
+ *****************************************************************************
+ */
+
+
+/*****************************************************************************
+ * Includes                                                                  *
+ *****************************************************************************/
+
+#include "HMDevice.h"
+#include "HMObjects.h"
+
+
+/*****************************************************************************
+ * Structures                                                                *
+ *****************************************************************************/
+
+class HMDeviceFileMappingClass : public HMDeviceKernelObjectClass
+{
+public:
+  HMDeviceFileMappingClass(LPCSTR lpDeviceName) : HMDeviceKernelObjectClass(lpDeviceName) {}
+
+                              /* identify mapping object by the base address */
+  static  int   findByBaseAddress   (LPVOID                     lpBaseAddress);
+
+                /* this is a handler method for calls to CreateFileMapping() */
+  virtual DWORD CreateFileMapping   (PHMHANDLEDATA              pHMHandleData,
+                                     HANDLE                     hFile,
+                                     LPSECURITY_ATTRIBUTES      lpFileMappingAttributes,
+                                     DWORD                      flProtect,
+                                     DWORD                      dwMaximumSizeHigh,
+                                     DWORD                      dwMaximumSizeLow,
+                                     LPCTSTR                    lpName);
+
+                  /* this is a handler method for calls to OpenFileMapping() */
+  virtual DWORD OpenFileMapping     (PHMHANDLEDATA              pHMHandleData,
+                                     BOOL                       fInherit,
+                                     LPCTSTR                    lpName);
+
+                    /* this is a handler method for calls to MapViewOfFile() */
+  virtual LPVOID MapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     DWORD                      dwDesiredAccess,
+                                     DWORD                      dwFileOffsetHigh,
+                                     DWORD                      dwFileOffsetLow,
+                                     DWORD                      dwNumberOfBytesToMap);
+
+                  /* this is a handler method for calls to MapViewOfFileEx() */
+  virtual LPVOID MapViewOfFileEx    (PHMHANDLEDATA              pHMHandleData,
+                                     DWORD                      dwDesiredAccess,
+                                     DWORD                      dwFileOffsetHigh,
+                                     DWORD                      dwFileOffsetLow,
+                                     DWORD                      dwNumberOfBytesToMap,
+                                     LPVOID                     lpBaseAddress);
+
+                  /* this is a handler method for calls to UnmapViewOfFile() */
+  virtual BOOL UnmapViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     LPVOID                     lpBaseAddress);
+
+                  /* this is a handler method for calls to FlushViewOfFile() */
+  virtual BOOL FlushViewOfFile      (PHMHANDLEDATA              pHMHandleData,
+                                     LPVOID                     lpBaseAddress,
+                                     DWORD                      dwNumberOfBytesToFlush);
+
+};
+
+
+#endif /* _HM_DEVICE_FILEMAPPING_H_ */
+
Index: trunk/src/kernel32/makefile
===================================================================
--- trunk/src/kernel32/makefile	(revision 657)
+++ trunk/src/kernel32/makefile	(revision 659)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.27 1999-08-24 12:23:24 sandervl Exp $
+# $Id: makefile,v 1.28 1999-08-24 14:36:05 phaller Exp $
 
 #
@@ -27,5 +27,5 @@
  WIN32UTIL.OBJ heap.OBJ heapstring.obj os2heap.OBJ \
  vmutex.OBJ initterm.OBJ os2util.OBJ handlemanager.OBJ \
- hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj \
+ hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj hmfilemapping.obj \
  hmmutex.obj hmsemaphore.obj wprocess.OBJ conprop.OBJ \
  winimage.OBJ windll.OBJ winexe.OBJ time.obj mmap.obj \
@@ -33,5 +33,5 @@
  atom.obj disk.obj directory.obj cvtbitmap.obj \
  cvtmenu.obj cvtaccel.obj cvticon.obj cvticongrp.obj \
- cvtcursor.obj cvtcursorgrp.obj stubs.obj 
+ cvtcursor.obj cvtcursorgrp.obj stubs.obj
 
 
@@ -286,4 +286,9 @@
         .\hmopen32.h
 
+hmfilemapping.obj: \
+        .\hmfilemapping.cpp \
+        .\hmfilemapping.h \
+        .\hmdevice.h
+
 conprop.OBJ: \
         .\conprop.h \
