Update NTOSKRNL/CC/cclazywriter.cpp

This commit is contained in:
Dibyamartanda Samanta 2024-05-21 14:46:57 +02:00
parent a8a6e6be35
commit 88449693d4

View File

@ -474,13 +474,13 @@ NTAPI
CcSetValidData(IN PFILE_OBJECT FileObject, CcSetValidData(IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileSize) IN PLARGE_INTEGER FileSize)
{ {
FILE_END_OF_FILE_INFORMATION FileInfo; // Structure to hold end-of-file information FILE_END_OF_FILE_INFORMATION FileInfo = {0};
PDEVICE_OBJECT DeviceObject; // Pointer to the device object associated with the file PDEVICE_OBJECT DeviceObject = nullptr;
PIO_STACK_LOCATION IoStack; // Pointer to an I/O stack location structure PIO_STACK_LOCATION IoStack = nullptr;
IO_STATUS_BLOCK IoStatus; // I/O status block structure IO_STATUS_BLOCK IoStatus = nullptr;
KEVENT Event; // Kernel event object for synchronization KEVENT Event;
PIRP Irp; // Pointer to an I/O request packet structure PIRP Irp;
NTSTATUS Status; // Status of the operation NTSTATUS Status;
/*Initialize a kernel event object for synchronization */ /*Initialize a kernel event object for synchronization */
KeInitializeEvent(&Event, NotificationEvent, FALSE); KeInitializeEvent(&Event, NotificationEvent, FALSE);
@ -984,9 +984,9 @@ NTAPI CcLazyWriteScan()
NTSTATUS CcWaitForCurrentLazyWriterActivity() NTSTATUS CcWaitForCurrentLazyWriterActivity()
{ {
NTSTATUS result; NTSTATUS result;
PWORK_QUEUE_ENTRY WorkQueueEntry; PWORK_QUEUE_ENTRY WorkQueueEntry = nullptr;
KEVENT Event; KEVENT Event = {0};
KIRQL irql; KIRQL irql = {0};
result = CcAllocateWorkQueueEntry(&WorkQueueEntry); result = CcAllocateWorkQueueEntry(&WorkQueueEntry);
if (NT_SUCCESS(result)) if (NT_SUCCESS(result))
@ -1030,7 +1030,7 @@ CcWorkerThread(PVOID Parameter)
PWORK_QUEUE_ENTRY WorkEntry = nullptr; PWORK_QUEUE_ENTRY WorkEntry = nullptr;
PLIST_ENTRY Entry = nullptr; PLIST_ENTRY Entry = nullptr;
PKPRCB Prcb = nullptr; PKPRCB Prcb = nullptr;
IO_STATUS_BLOCK IoStatus = {}; IO_STATUS_BLOCK IoStatus = {0};
KIRQL OldIrql = PASSIVE_LEVEL; KIRQL OldIrql = PASSIVE_LEVEL;
BOOLEAN DropThrottle = FALSE; BOOLEAN DropThrottle = FALSE;
BOOLEAN WritePerformed = FALSE; BOOLEAN WritePerformed = FALSE;
@ -1246,13 +1246,13 @@ CcAllocateWorkQueueEntry(PWORK_QUEUE_ENTRY &workQueueEntry)
NTSTATUS CcWaitForCurrentLazyWriterActivity() NTSTATUS CcWaitForCurrentLazyWriterActivity()
{ {
NTSTATUS status; // Status of the operation NTSTATUS status;
PWORK_QUEUE_ENTRY workQueueEntry; // Work queue entry PWORK_QUEUE_ENTRY workQueueEntry = nullptr;
PLIST_ENTRY blink; PLIST_ENTRY blink = nullptr;
KIRQL irql; KIRQL irql = PASSIVE_LEVEL;
KEVENT event; // Event object KEVENT event = {0};
// Allocate a work queue entry /* Allocate a work queue entry*/
status = CcAllocateWorkQueueEntry(&workQueueEntry); status = CcAllocateWorkQueueEntry(&workQueueEntry);
if (NT_SUCCESS(status)) // Check if the status is a success if (NT_SUCCESS(status)) // Check if the status is a success
{ {