Without this patch the memory pointed to by context->in_buff gets leaked on each call to GetVolumeInformationByHandleW and the memory usage of winedevice.exe grows.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52322
-- v3: ntoskrnl: Do not leak memory by setting input buffer to NULL.
From: Bernhard Übelacker bernhardu@mailbox.org
Without this patch the memory pointed to by context->in_buff gets leaked on each call to GetVolumeInformationByHandleW and the memory usage of winedevice.exe grows.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52322 --- dlls/ntoskrnl.exe/ntoskrnl.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 2d506402036..02b58d1311e 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -832,7 +832,6 @@ static NTSTATUS dispatch_volume( struct dispatch_context *context ) irp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread(); irp->Tail.Overlay.OriginalFileObject = file; irp->RequestorMode = UserMode; - context->in_buff = NULL;
irp->Flags |= IRP_DEALLOCATE_BUFFER; /* deallocate out_buff */ return dispatch_irp( device, irp, context );
On Sat Apr 15 13:20:49 2023 +0000, Bernhard Übelacker wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/2439/diffs?diff_id=42578&start_sha=1a30d59d3227cd9f0a0e5c00cdaf0039fbaca8ae#3eb3d3add1e5d8cfd0ee9f9e23d3c3e84cc1580d_836_835)
Thanks for looking into it. That is way better. I modified the patch as you suggested and rebased it to wine-8.6.