[ros-diffs] [dchapyshev] 40129: - Implement NdisMapFile - Implement NdisUnmapFile

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Fri Mar 20 11:21:18 CET 2009


Author: dchapyshev
Date: Fri Mar 20 13:21:17 2009
New Revision: 40129

URL: http://svn.reactos.org/svn/reactos?rev=40129&view=rev
Log:
- Implement NdisMapFile
- Implement NdisUnmapFile

Modified:
    trunk/reactos/drivers/network/ndis/ndis/stubs.c

Modified: trunk/reactos/drivers/network/ndis/ndis/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/stubs.c?rev=40129&r1=40128&r2=40129&view=diff
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/stubs.c [iso-8859-1] Fri Mar 20 13:21:17 2009
@@ -82,20 +82,6 @@
   return ExInterlockedRemoveHeadList ( ListHead, (PKSPIN_LOCK)SpinLock );
 }
 
-
-/*
- * @unimplemented
- */
-VOID
-EXPORT
-NdisMapFile(
-    OUT PNDIS_STATUS    Status,
-    OUT PVOID           * MappedBuffer,
-    IN  NDIS_HANDLE     FileHandle)
-{
-    UNIMPLEMENTED
-}
-
 typedef struct _NDIS_HANDLE_OBJECT
 {
   HANDLE FileHandle;
@@ -119,6 +105,34 @@
 }
 
 const WCHAR* NDIS_FILE_FOLDER = L"\\SystemRoot\\System32\\Drivers\\";
+
+/*
+ * @implemented
+ */
+VOID
+EXPORT
+NdisMapFile(
+    OUT PNDIS_STATUS    Status,
+    OUT PVOID           *MappedBuffer,
+    IN  NDIS_HANDLE     FileHandle)
+{
+  PNDIS_HANDLE_OBJECT HandleObject = (PNDIS_HANDLE_OBJECT) FileHandle;
+
+  NDIS_DbgPrint(MAX_TRACE, ("called: FileHandle 0x%x\n", FileHandle));
+
+  if (HandleObject->Mapped)
+  {
+      /* If a file already mapped we will return an error code */
+      *Status = NDIS_STATUS_ALREADY_MAPPED;
+      return;
+  }
+
+  HandleObject->Mapped = TRUE;
+  *MappedBuffer = HandleObject->MapBuffer;
+
+  /* Set returned status */
+  *Status = STATUS_SUCCESS;
+}
 
 /*
  * @implemented
@@ -389,14 +403,16 @@
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 VOID
 EXPORT
 NdisUnmapFile(
     IN  NDIS_HANDLE FileHandle)
 {
-    UNIMPLEMENTED
+  PNDIS_HANDLE_OBJECT HandleObject = (PNDIS_HANDLE_OBJECT) FileHandle;
+
+  HandleObject->Mapped = FALSE;
 }
 
 



More information about the Ros-diffs mailing list