X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=src%2Flibcaptive%2Fclient%2Finit.c;h=781437d438be5c6744d961b338d2086331ee05ac;hb=8e2faebf77ac4acc19fc094fcb6a9cfc2b9fefbf;hp=7a963a07519707dc9c75cb02d1ab474371bcf84f;hpb=38d3238459b9a3f74d618cf4c77915d3a12d51ee;p=captive.git diff --git a/src/libcaptive/client/init.c b/src/libcaptive/client/init.c index 7a963a0..781437d 100644 --- a/src/libcaptive/client/init.c +++ b/src/libcaptive/client/init.c @@ -53,6 +53,7 @@ #include #include "captive/macros.h" #include "../storage/relastblock.h" /* for captive_storage_relastblock() */ +#include "../cc/sharedcachemap.h" /* for captive_shared_cache_map_flush_all() */ struct captive_options *captive_options; @@ -365,7 +366,7 @@ gboolean errbool; static void dismount_volume(void) { IO_STATUS_BLOCK IoStatusBlock; -PIO_STACK_LOCATION StackPtr; +PEXTENDED_IO_STACK_LOCATION StackPtr; PIRP Irp; NTSTATUS Status; DEVICE_OBJECT *DeviceObject=captive_DriverObject.DeviceObject; @@ -375,10 +376,8 @@ FILE_OBJECT *FileObject; GnomeVFSResult errvfsresult; NTSTATUS err; IO_STATUS_BLOCK dir_IoStatusBlock; -#if 0 static const ULONG fsctls[2]={ FSCTL_LOCK_VOLUME,FSCTL_DISMOUNT_VOLUME }; int fsctlsi; -#endif WCHAR wzero; errvfsresult=captive_ObjectAttributes_init("/!Captive!del",&dir_ObjectAttributes); @@ -423,10 +422,7 @@ WCHAR wzero; FileObject->FileName.MaximumLength=2; FileObject->FileName.Buffer=&wzero; -#if 0 - for (fsctlsi=0;fsctlsi<2;fsctlsi++) -#endif - { + for (fsctlsi=0;fsctlsi<2;fsctlsi++) { Irp=IoAllocateIrp(DeviceObject->StackSize,TRUE); g_return_if_fail(Irp!=NULL); @@ -434,8 +430,8 @@ WCHAR wzero; Irp->UserEvent=&FileObject->Event; Irp->Tail.Overlay.Thread=PsGetCurrentThread(); - StackPtr=IoGetNextIrpStackLocation(Irp); -#if 0 + StackPtr=(EXTENDED_IO_STACK_LOCATION *)IoGetNextIrpStackLocation(Irp); +#if 1 StackPtr->MajorFunction=IRP_MJ_FILE_SYSTEM_CONTROL; StackPtr->MinorFunction=IRP_MN_USER_FS_REQUEST; #else @@ -447,7 +443,7 @@ WCHAR wzero; StackPtr->FileObject=FileObject; StackPtr->CompletionRoutine=NULL; -#if 0 +#if 1 StackPtr->Parameters.FileSystemControl.OutputBufferLength=0; StackPtr->Parameters.FileSystemControl.InputBufferLength=0; StackPtr->Parameters.FileSystemControl.FsControlCode=fsctls[fsctlsi]; @@ -503,8 +499,16 @@ GIOStatus erriostatus; * replaced by IRP_MJ_FLUSH_BUFFERS. */ +#if 0 + captive_shared_cache_map_flush_all(); +#endif + dismount_volume(); +#if 0 + captive_shared_cache_map_flush_all(); +#endif + /* Invoke all pending idle functions just to not to forget for anything... */ while (g_main_context_iteration( NULL, /* context; NULL means default one */