From fefa87dfab6aa01e5d61b401e4fc68fe5297de06 Mon Sep 17 00:00:00 2001 From: short <> Date: Wed, 8 Oct 2003 20:50:43 +0000 Subject: [PATCH] captive_private_bcb_pin_object_get_ref(): - Fixes FAT32 bootability after any file written. - Invalide possibly only 'map'ped data as we need to re-read them. - Bugreported by Pavouk. --- src/libcaptive/cc/privatebcbpin.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcaptive/cc/privatebcbpin.c b/src/libcaptive/cc/privatebcbpin.c index 9f7deef..a89c9c2 100644 --- a/src/libcaptive/cc/privatebcbpin.c +++ b/src/libcaptive/cc/privatebcbpin.c @@ -291,6 +291,16 @@ CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; g_object_ref(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); + return captive_private_bcb_pin_object_new(captive_shared_cache_map_object,offset); } -- 1.8.3.1