From: short <> Date: Sun, 30 Nov 2003 10:07:25 +0000 (+0000) Subject: MmSetAddressRangeModified(): Set Cache Manager buffer dirty by its address. X-Git-Tag: captive-1_1_1_2~3 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=a9587ac76d44bee16d36c4b571f630b6773069f8;hp=3522c07fd5f3d3025126bc5206d141a34774fe33;p=captive.git MmSetAddressRangeModified(): Set Cache Manager buffer dirty by its address. - Required for writing >64MB files on some NTFS disk drives. - Bugreported by Charles Duffy. --- diff --git a/src/libcaptive/cc/Makefile.am b/src/libcaptive/cc/Makefile.am index b13fecb..bf9f84d 100644 --- a/src/libcaptive/cc/Makefile.am +++ b/src/libcaptive/cc/Makefile.am @@ -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 index 0000000..c73a2e1 --- /dev/null +++ b/src/libcaptive/cc/mm.c @@ -0,0 +1,45 @@ +/* $Id$ + * reactos Cache Manager (Cc*) memory management interaction of libcaptive + * Copyright (C) 2003 Jan Kratochvil + * + * 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); +} diff --git a/src/libcaptive/ke/exports.captivesym b/src/libcaptive/ke/exports.captivesym index 556c468..75467bb 100644 --- a/src/libcaptive/ke/exports.captivesym +++ b/src/libcaptive/ke/exports.captivesym @@ -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