LONG Count;
KEVENT Wait;
} POP_FLUSH_VOLUME, *PPOP_FLUSH_VOLUME;
-
+
ULONG PopFlushPolicy = 0;
KGUARDED_MUTEX PopVolumeLock;
/* Make sure only one caller can assign dope to a device */
KeAcquireSpinLock(&PopDopeGlobalLock, &OldIrql);
-
+
/* Make sure the device still has no dope */
if (!DeviceExtension->Dope)
{
/* Allow other dope transactions now */
KeReleaseSpinLock(&PopDopeGlobalLock, OldIrql);
-
+
/* Check if someone other than us already assigned the dope, so free ours */
if (Dope) ExFreePoolWithTag(Dope, 'Dope');
/* Add this volume into the list of power-manager volumes */
if (!Dope->Volume.Flink) InsertTailList(&PopVolumeDevices, &Dope->Volume);
-
+
/* Allow flushes to go through */
KeReleaseGuardedMutex(&PopVolumeLock);
}
/* Grab the next (ie: current) entry and remove it */
NextEntry = FlushContext->List.Flink;
RemoveEntryList(NextEntry);
-
+
/* Add it back on the volume list */
InsertTailList(&PopVolumeDevices, NextEntry);
-
+
/* Done touching the volume list */
KeReleaseGuardedMutex(&PopVolumeLock);
if ((NT_SUCCESS(Status)) && (NameInfo->Name.Buffer))
{
/* Open the volume */
- DPRINT1("Opening: %wZ\n", &NameInfo->Name);
+ DPRINT("Opening: %wZ\n", &NameInfo->Name);
InitializeObjectAttributes(&ObjectAttributes,
&NameInfo->Name,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
if (NT_SUCCESS(Status))
{
/* Flush it and close it */
- DPRINT1("Sending flush to: %lx\n", VolumeHandle);
+ DPRINT("Sending flush to: %p\n", VolumeHandle);
ZwFlushBuffersFile(VolumeHandle, &IoStatusBlock);
ZwClose(VolumeHandle);
}
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE RegistryHandle;
PLIST_ENTRY NextEntry;
- PDEVICE_OBJECT_POWER_EXTENSION Dope;
+ PDEVICE_OBJECT_POWER_EXTENSION Dope;
ULONG VolumeCount = 0;
NTSTATUS Status;
HANDLE ThreadHandle;
if ((FlushPolicy & 1))
{
/* Registry flush requested, so open it */
- DPRINT1("Opening registry\n");
+ DPRINT("Opening registry\n");
InitializeObjectAttributes(&ObjectAttributes,
&RegistryName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
if (NT_SUCCESS(Status))
{
/* Flush the registry */
- DPRINT1("Flushing registry\n");
+ DPRINT("Flushing registry\n");
ZwFlushKey(RegistryHandle);
ZwClose(RegistryHandle);
}
/* Serialize with other flushes */
KeAcquireGuardedMutex(&PopVolumeLock);
-
+
/* Scan the volume list */
NextEntry = PopVolumeDevices.Flink;
while (NextEntry != &PopVolumeDevices)
{
/* Get the dope from the link */
Dope = CONTAINING_RECORD(NextEntry, DEVICE_OBJECT_POWER_EXTENSION, Volume);
-
+
/* Grab the next entry now, since we'll be modifying the list */
NextEntry = NextEntry->Flink;
/* Remove it from the dope and add it to the flush context list */
RemoveEntryList(&Dope->Volume);
InsertTailList(&FlushContext.List, &Dope->Volume);
-
+
/* Next */
VolumeCount++;
}
if (!(FlushPolicy & 2))
{
/* ReactOS only implements this routine for shutdown, which requires it */
- UNIMPLEMENTED_DBGBREAK();
+ UNIMPLEMENTED;
}
/* Check if there were no volumes at all */
/* We will ourselves become a flusher thread */
FlushContext.Count = 1;
ThreadCount--;
-
+
/* Look for any extra ones we might need */
while (ThreadCount > 0)
{
/* Create a new one */
ThreadCount--;
- DPRINT1("Creating flush thread\n");
+ DPRINT("Creating flush thread\n");
Status = PsCreateSystemThread(&ThreadHandle,
THREAD_ALL_ACCESS,
&ObjectAttributes,
KeReleaseGuardedMutex(&PopVolumeLock);
/* Enter the flush work */
- DPRINT1("Local flush\n");
+ DPRINT("Local flush\n");
PopFlushVolumeWorker(&FlushContext);
-
+
/* Wait for all flushes to be over */
- DPRINT1("Waiting for flushes\n");
+ DPRINT("Waiting for flushes\n");
KeWaitForSingleObject(&FlushContext.Wait, Executive, KernelMode, FALSE, NULL);
- DPRINT1("Flushes have completed\n");
+ DPRINT("Flushes have completed\n");
}
VOID