I use sample Scanner Minifilter Sample
(http://msdn.microsoft.com/en-us/library/dd163282.aspx) from DDK.
It's works well, but when I modify code for using variable sized message
(http://aonprog.wordpress.com/2009/02/23/file-minifilter-part4-sending-huge-
data-from-kernel-to-user-mode-efficiently-using-variable-sized-structures/),
I have a trouble:
The call GetQueuedCompletionStatus in User mode returns
ERROR_INSUFFICIENT_BUFFER and
in Kernel mode FltSendMessage returns STATUS_PORT_DISCONNECTED.
What is a problem?
Best regards,
Yaroslav Naglya
Well, is the buffer large enough for the structure?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
"Tim Roberts" <ti...@probo.com> wrote in message
news:g4ok05dk15pcmsihl...@4ax.com...
So I guess GetQueuedCompletionStatus succeeds and returns the completion
status of your queued operation, which would then happen to be a failure
with an error code of ERROR_INSUFFICIENT_BUFFER.
So is the buffer in your original queued/overlapped request large enough?
(See the 3rd paragraph under "Return Values" in the description of
GetQueuedCompletionStatus() on MSDN).
--
Jakob Bøhm, M.Sc.Eng. * j...@danware.dk * direct tel:+45-45-90-25-33
Netop Solutions A/S * Bregnerodvej 127 * DK-3460 Birkerod * DENMARK
http://www.netop.com * tel:+45-45-90-25-25 * fax:+45-45-90-25-26
Information in this mail is hasty, not binding and may not be right.
Information in this posting may not be the official position of Netop
Solutions A/S, only the personal opinions of the author.
When I use stack allocation in diver:
#define SCANNER_READ_BUFFER_SIZE 1024
typedef struct _SCANNER_NOTIFICATION
{
ULONG BytesToScan;
ULONG Reserved; // for quad-word alignement of the Contents structure
UCHAR Contents[SCANNER_READ_BUFFER_SIZE];
} SCANNER_NOTIFICATION, *PSCANNER_NOTIFICATION;
SCANNER_NOTIFICATION notification;
ULONG length = sizeof(notification);
status = FltSendMessage( ScannerData.Filter, &ScannerData.ClientPort,
¬ification, length,
NULL, NULL, NULL );
length = 1032 bytes. All works well.
BUT when I allocate buffer with same size:
#define SCANNER_READ_BUFFER_SIZE 1
typedef struct _SCANNER_NOTIFICATION
{
ULONG BytesToScan;
ULONG Reserved; // for quad-word alignement of the Contents structure
UCHAR Contents[SCANNER_READ_BUFFER_SIZE];
} SCANNER_NOTIFICATION, *PSCANNER_NOTIFICATION;
PSCANNER_NOTIFICATION pNotification = NULL;
ULONG ulBufferSize = 1024;
ULONG length = FIELD_OFFSET(SCANNER_NOTIFICATION, Contents[ulBufferSize]);
pNotification = ExAllocatePoolWithTag( NonPagedPool, length, 'info' );
status = FltSendMessage( ScannerData.Filter, &ScannerData.ClientPort,
pNotification, length,
NULL, NULL, NULL );
length = 1032. but it doesn't work
:(
"Jakob Bohm" <j...@danware.dk> wrote in message
news:OBoEoe80...@TK2MSFTNGP05.phx.gbl...
Yaroslav Naglya wrote:
>> Well, is the buffer large enough for the structure?
> Function call GetQueuedCompletionStatus doesn't requre to allocate any
> buffer.
>
So I guess GetQueuedCompletionStatus succeeds and returns the completion
status of your queued operation, which would then happen to be a failure
with an error code of ERROR_INSUFFICIENT_BUFFER.
So is the buffer in your original queued/overlapped request large enough?
(See the 3rd paragraph under "Return Values" in the description of
GetQueuedCompletionStatus() on MSDN).
--
Jakob B�hm, M.Sc.Eng. * j...@danware.dk * direct tel:+45-45-90-25-33
You need to allocate similar structure in your user mode application
from where you are retrieving this structure.
> Jakob Bøhm, M.Sc.Eng. * j...@danware.dk * direct tel:+45-45-90-25-33
> Netop Solutions A/S * Bregnerodvej 127 * DK-3460 Birkerod * DENMARKhttp://www.netop.com* tel:+45-45-90-25-25 * fax:+45-45-90-25-26