FltGetMessage with variable size buffer

I would like to send a variable size buffer from the filter to the user mode program as my message. Looking at the past forum entries and elsewhere I don’t see a good solution to this. I’m wondering if anyone has a solution to this problem. BTW, my code is based off of the scanner example in the DDK.

The reason to send a variable size buffer is that I want to send a pathname string to the user mode program and don’t want to build any path length assumption into my code.

You should estimate a maximum size for the buffer and use that size.
I’ve implemented solutions where the kernel can notify the user mode
component, through a status returned within the shared structure, that
it needs a larger buffer than the current one. The user mode module
would then re-allocate a larger buffer and pass it in.

While this can get cumbersome, the assumption here is that your initial
estimation of the maximum size should handle nearly all requests and
only occasionally would you fall into the back and forth protocol.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295

------ Original Message ------
From: xxxxx@adobe.com
To: “Windows File Systems Devs Interest List”
Sent: 4/8/2015 4:09:00 PM
Subject: [ntfsd] FltGetMessage with variable size buffer

>I would like to send a variable size buffer from the filter to the user
>mode program as my message. Looking at the past forum entries and
>elsewhere I don’t see a good solution to this. I’m wondering if anyone
>has a solution to this problem. BTW, my code is based off of the
>scanner example in the DDK.
>
>The reason to send a variable size buffer is that I want to send a
>pathname string to the user mode program and don’t want to build any
>path length assumption into my code.
>
>—
>NTFSD is sponsored by OSR
>
>OSR is hiring!! Info at http://www.osr.com/careers
>
>For our schedule of debugging and file system seminars visit:
>http://www.osr.com/seminars
>
>To unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

That makes sense. It’s unclear to me how to negotiate the request for a larger buffer using the communications port interface. Do you know of some sample code or recommendation? Does it involve use of the OVERLAPPED structure?

Thanks.

Nabeel