captive_private_bcb_pin_object_get_ref(): Invalidate 'map'ped data optionally.
authorshort <>
Sat, 11 Oct 2003 12:54:54 +0000 (12:54 +0000)
committershort <>
Sat, 11 Oct 2003 12:54:54 +0000 (12:54 +0000)
src/libcaptive/cc/privatebcbpin.c
src/libcaptive/cc/privatebcbpin.h

index a89c9c2..fa77e1c 100644 (file)
@@ -279,7 +279,7 @@ CaptivePrivateBcbPinObject *captive_private_bcb_pin_object;
 }
 
 CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
-               guint64 offset)
+               guint64 offset,gboolean invalidate_new)
 {
 CaptivePrivateBcbPinObject *captive_private_bcb_pin_object;
 
@@ -292,14 +292,16 @@ CaptivePrivateBcbPinObject *captive_private_bcb_pin_object;
                return captive_private_bcb_pin_object;
                }
 
-       /* Invalide possibly only 'map'ped data as we need to re-read them.
-        * Otherwise any file written by fastfat.sys of NT-5.1sp1 will corrupt
-        * the code+55AA of DOS boot sector (disk offset 0x0).
-        */
-       captive_shared_cache_map_flush(captive_shared_cache_map_object,
-                       offset,offset+PAGE_SIZE);
-       captive_shared_cache_map_set_data_invalid(captive_shared_cache_map_object,
-                       offset,offset+PAGE_SIZE);
+       if (invalidate_new) {
+               /* Invalide possibly only 'map'ped data as we need to re-read them on CcPinRead().
+                * Otherwise any file written by fastfat.sys of NT-5.1sp1 will corrupt
+                * the code+55AA of DOS boot sector (disk offset 0x0).
+                */
+               captive_shared_cache_map_flush(captive_shared_cache_map_object,
+                               offset,offset+PAGE_SIZE);
+               captive_shared_cache_map_set_data_invalid(captive_shared_cache_map_object,
+                               offset,offset+PAGE_SIZE);
+               }
 
        return captive_private_bcb_pin_object_new(captive_shared_cache_map_object,offset);
 }
index 3922bdc..caafee3 100644 (file)
@@ -49,7 +49,7 @@ CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_new(CaptiveSharedCach
 CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
                guint64 offset);
 CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
-               guint64 offset);
+               guint64 offset,gboolean invalidate_new);
 gboolean captive_private_bcb_pin_object_is_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object);
 void captive_private_bcb_pin_object_flush(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object);
 void captive_private_bcb_pin_object_set_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object);