MmSetAddressRangeModified(): Set Cache Manager buffer dirty by its address.
authorshort <>
Sun, 30 Nov 2003 10:07:25 +0000 (10:07 +0000)
committershort <>
Sun, 30 Nov 2003 10:07:25 +0000 (10:07 +0000)
 - Required for writing >64MB files on some NTFS disk drives.
 - Bugreported by Charles Duffy.

src/libcaptive/cc/Makefile.am
src/libcaptive/cc/mm.c [new file with mode: 0644]
src/libcaptive/ke/exports.captivesym

index b13fecb..bf9f84d 100644 (file)
@@ -34,6 +34,7 @@ libcc_la_SOURCES= \
                io.h \
                loghandle.c \
                misc.c \
+               mm.c \
                privatebcb-priv.h \
                privatebcb.c \
                privatebcb.h \
diff --git a/src/libcaptive/cc/mm.c b/src/libcaptive/cc/mm.c
new file mode 100644 (file)
index 0000000..c73a2e1
--- /dev/null
@@ -0,0 +1,45 @@
+/* $Id$
+ * reactos Cache Manager (Cc*) memory management interaction of libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include "reactos/ddk/mmfuncs.h"       /* self */
+#include "sharedcachemap.h"
+
+
+/**
+ * MmSetAddressRangeModified:
+ * @Address: Start of the memory block.
+ * %NULL value is forbidden.
+ * FIXME: Must be the value %PAGE_SIZE aligned? libcaptive does not require it now.
+ * @Length: Length of the memory block.
+ * Value may not be %PAGE_SIZE aligned.
+ *
+ * Set the specified memory range as modified.
+ *
+ * Returns: %TRUE if any pages in the range were set as modified.
+ * FIXME: libcaptive currently returns %TRUE even if they were already set as modified.
+ * Is it W32 compliant?
+ */
+BOOLEAN MmSetAddressRangeModified(IN PVOID Address,IN SIZE_T Length)
+{
+       g_return_val_if_fail(Address!=NULL,FALSE);
+
+       return !!captive_shared_cache_map_memory_range_set_dirty(Address,Address+Length);
+}
index 556c468..75467bb 100644 (file)
@@ -354,6 +354,7 @@ ntoskrnl.exe        PsGetVersion
 ntoskrnl.exe   RtlIsGenericTableEmptyAvl       pass
 ntoskrnl.exe   RtlEnumerateGenericTable        pass
 ntoskrnl.exe   RtlEnumerateGenericTableAvl     pass
+ntoskrnl.exe   MmSetAddressRangeModified
 
 hal.dll        KfReleaseSpinLock
 hal.dll        KeGetCurrentIrql