memset(address,0,PAGE_SIZE); /* pre-clear the buffer */
Mdl=MmCreateMdl(NULL,address,PAGE_SIZE); /* FIXME: Deprecated in favor of IoAllocateMdl() */
g_assert(Mdl!=NULL);
+ MmBuildMdlForNonPagedPool(Mdl);
KeInitializeEvent(&Event,NotificationEvent,FALSE);
IoStatus.Information=0; /* preventive pre-clear for buggy filesystems */
err=IoPageRead(FileObject,Mdl,FileOffset,&Event,&IoStatus);
g_assert(pagepos->shmid==-1);
if (-1==(pagepos->shmid=shmget(IPC_PRIVATE,PAGE_SIZE,IPC_CREAT|IPC_CREAT|0600)))
g_error("Failed shmget(2), you may be out of maximum system IPC shared pages");
- g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: created shmid %d out of mmap() for offset %llu to new pagepos %p to address %p",
+ g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: created shmid %d out of mmap() for offset %llu to existing pagepos %p to address %p",
G_STRLOC,pagepos->shmid,(unsigned long long)offset,pagepos,pageaddr);
}
else { /* already >=2 mappings, already IPC shared mem */
- g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: shared-mmap of offset %llu by pagepos %p shmid %d to address %p",
+ g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: already shared shmid of offset %llu by existing pagepos %p shmid %d to address %p",
G_STRLOC,(unsigned long long)offset,pagepos,pagepos->shmid,pageaddr);
g_assert(pagepos->shmid!=-1);
g_assert(pagepos->privbcb_list!=NULL);
Mdl=MmCreateMdl(NULL,base_sectoraligned,length_sectoraligned);
g_assert(Mdl!=NULL);
+ MmBuildMdlForNonPagedPool(Mdl);
KeInitializeEvent(&Event,NotificationEvent,FALSE);
* @SectionObjectPointer: Pointer specifying file to purge;
* %NULL value is forbidden.
* libcaptive interprets only #SharedCacheMap field as #PUBLIC_BCB pointer.
- * Field #SharedCacheMap value %NULL is permitted; libcaptive does a NOP with %FALSE return code in such case.
+ * Field #SharedCacheMap value %NULL is permitted; libcaptive does a NOP with %TRUE return code in such case.
* @FileOffset: Starting offset of the ranger to purge.
* %NULL pointer is permitted and it means to purge the whole whole.
* FIXME: Non %NULL pointer is NOT IMPLEMENTED YET by libcaptive.
* Drop any caching for shrunken file which is not being deleted.
* libcaptive will no longer consider such #BCB as dirty.
*
+ * Undocumented: It is required during %FSCTL_LOCK_VOLUME by ntfs.sys of NT-5.1sp1
+ * to return %TRUE value if #SharedCacheMap value is %NULL.
+ *
* Returns: %TRUE if the range was purged successfuly.
*/
BOOLEAN CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
g_return_val_if_fail(SectionObjectPointer!=NULL,FALSE);
if (SectionObjectPointer->SharedCacheMap==NULL)
- return FALSE; /* failed - nothing to purge */
+ return TRUE; /* nothing to purge; never return FALSE for ntfs.sys of NT-5.1sp1! */
g_return_val_if_fail(FileOffset==NULL,FALSE); /* NOT IMPLEMENTED YET */
PublicBcb=SectionObjectPointer->SharedCacheMap;
{
/* FIXME: {{%fs:[0]}+0x4E0}:LONG++ */
}
+
+
+NTSTATUS CcWaitForCurrentLazyWriterActivity(VOID)
+{
+ return STATUS_SUCCESS;
+}