captive_Cc_IoPageRead(): Fixed to read full 'length', not just PAGE_SIZE.
authorshort <>
Wed, 16 Jul 2003 07:45:54 +0000 (07:45 +0000)
committershort <>
Wed, 16 Jul 2003 07:45:54 +0000 (07:45 +0000)
 - ntfs.sys of NT-5.1sp1 writes and reads everything OK.
 - FIXME: volume is still autochecked by chkdsk although it is no corruptions.
CcMapData(): Expect more than PAGE_SIZE to be read by captive_Cc_IoPageRead().

src/libcaptive/cc/map.c

index 7cd583c..df0dacc 100644 (file)
@@ -717,8 +717,8 @@ NTSTATUS err;
         * successfuly read the data. Workaround it - preclear (not postclear) the
         * buffer and do not make any other assumptions about the data read.
         */
-       memset(address,0,PAGE_SIZE);    /* pre-clear the buffer */
-       Mdl=MmCreateMdl(NULL,address,PAGE_SIZE);        /* FIXME: Deprecated in favor of IoAllocateMdl() */
+       memset(address,0,length);       /* pre-clear the buffer */
+       Mdl=MmCreateMdl(NULL,address,length);   /* FIXME: Deprecated in favor of IoAllocateMdl() */
        g_assert(Mdl!=NULL);
        MmBuildMdlForNonPagedPool(Mdl);
        KeInitializeEvent(&Event,NotificationEvent,FALSE);
@@ -1084,8 +1084,8 @@ struct page_position *pagepos_end;
                        if (after_eof)
                                g_assert(got==0);
                        else
-                               g_assert(got<=PAGE_SIZE);
-                       after_eof=(got<PAGE_SIZE);
+                               g_assert(got<=offset_end-offset_start);
+                       after_eof=(got<offset_end-offset_start);
                        /* Unmark 'building' flags. */
                        for (
                                        offset_built=offset_start;