Help IPFilterHookDriver Problem............

Hi ,
I am working on an IPfilter hook driver.As the DDK says that i can provide my hook function by sending IOCTL_PF_SET_EXTENSION_POINTER to ipfilterdriver .The code below shows what i am doing but when i run the checked build in the debugger ipfilter driver displays " PointerIOCTL request failed " –
I dont know what is the problem pls help me on this…

RtlInitUnicodeString(&ustrObjectName,L"\Device\IPFILTERDRIVER" );

status = IoGetDeviceObjectPointer(&ustrObjectName,
FILE_READ_DATA | FILE_WRITE_DATA,
&pFileObject,
&pIPFilterDevObj); // first i collect the pointer to ipfilterdriver object

ExtensionHookInfo = PacketFilterExtension; // this is my packet filter function

pExtensionIrp = IoBuildDeviceIoControlRequest( IOCTL_PF_SET_EXTENSION_POINTER , pIPFilterDevObj,
ExtensionHookInfo,
sizeof(ExtensionHookInfo),
NULL,
OutputBufferLength,
FALSE,
NULL,
pIoStatusBlock
);

status = IoCallDriver(pIPFilterDevObj,pExtensionIrp); // calling ipfilterdriver to set it

Any Help is appreciated…

— Subodh

Did you check status from IoGetDeviceObjectPointer?

Driver sceleton from http://ntdev.h1.ru/ipfilter.html works under checked
build without problems. Hope it helps.

vlad-ntdev

----- Original Message -----
From: “Subodh Gupta”
To: “NT Developers Interest List”
Sent: Tuesday, August 06, 2002 5:35 PM
Subject: [ntdev] Help IPFilterHookDriver Problem…

Hi ,
I am working on an IPfilter hook driver.As the DDK says that i can
provide my hook function by sending IOCTL_PF_SET_EXTENSION_POINTER to
ipfilterdriver .The code below shows what i am doing but when i run the
checked build in the debugger ipfilter driver displays " PointerIOCTL
request failed " –
I dont know what is the problem pls help me on this…

RtlInitUnicodeString(&ustrObjectName,L"\Device\IPFILTERDRIVER"
);

status = IoGetDeviceObjectPointer(&ustrObjectName,
FILE_READ_DATA | FILE_WRITE_DATA,
&pFileObject,
&pIPFilterDevObj); // first i collect the pointer to
ipfilterdriver object

ExtensionHookInfo = PacketFilterExtension; // this is my
packet filter function

pExtensionIrp = IoBuildDeviceIoControlRequest(
IOCTL_PF_SET_EXTENSION_POINTER , pIPFilterDevObj,
ExtensionHookInfo,
sizeof(ExtensionHookInfo),
NULL,
OutputBufferLength,
FALSE,
NULL,
pIoStatusBlock
);

status = IoCallDriver(pIPFilterDevObj,pExtensionIrp); //
calling ipfilterdriver to set it

Any Help is appreciated…

— Subodh


You are currently subscribed to ntdev as: xxxxx@unshadow.net
To unsubscribe send a blank email to %%email.unsub%%

If ExtensionHookInfo is a pointer then sizeof(ExtensionHookInfo) is the
wrong size.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Subodh Gupta
Sent: Tuesday, August 06, 2002 9:35 AM
To: NT Developers Interest List
Subject: [ntdev] Help IPFilterHookDriver Problem…

Hi ,
I am working on an IPfilter hook driver.As the DDK says that i can provide
my hook function by sending IOCTL_PF_SET_EXTENSION_POINTER to ipfilterdriver
.The code below shows what i am doing but when i run the checked build in
the debugger ipfilter driver displays " PointerIOCTL request failed " –
I dont know what is the problem pls help me on this…

RtlInitUnicodeString(&ustrObjectName,L"\Device\IPFILTERDRIVER" );

status = IoGetDeviceObjectPointer(&ustrObjectName,
FILE_READ_DATA | FILE_WRITE_DATA,
&pFileObject,
&pIPFilterDevObj); // first i collect the pointer to
ipfilterdriver object

ExtensionHookInfo = PacketFilterExtension; // this is my packet
filter function

pExtensionIrp =
oBuildDeviceIoControlRequest( IOCTL_PF_SET_EXTENSION_POINTER ,
pIPFilterDevObj,
ExtensionHookInfo,
sizeof(ExtensionHookInfo),
NULL,
OutputBufferLength,
FALSE,
NULL,
pIoStatusBlock
);

status = IoCallDriver(pIPFilterDevObj,pExtensionIrp); // calling
ipfilterdriver to set it

Any Help is appreciated…

— Subodh


You are currently subscribed to ntdev as: xxxxx@bwandel.com
To unsubscribe send a blank email to %%email.unsub%%

Dear All,
This may be a simple Q to post. But am not getting any help on
this…

Is there anyway we can register a function along with a timer so
that the function will be called when the timer expires?

cheers
Sesha.
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

Hi All,
Thanks for the valuable help now everything is working fine.Last time i was
also checking status from IoGetDeviceObjectPointer it.was STATUS_SUCCESS.

What was the reason for that??

– Subodh
----- Original Message -----
From: “vlad-ntdev”
To: “NT Developers Interest List”
Sent: Tuesday, August 06, 2002 8:06 PM
Subject: [ntdev] Re: Help IPFilterHookDriver Problem…

> Did you check status from IoGetDeviceObjectPointer?
>
> Driver sceleton from http://ntdev.h1.ru/ipfilter.html works under checked
> build without problems. Hope it helps.
>
> vlad-ntdev
>
> ----- Original Message -----
> From: “Subodh Gupta”
> To: “NT Developers Interest List”
> Sent: Tuesday, August 06, 2002 5:35 PM
> Subject: [ntdev] Help IPFilterHookDriver Problem…
>
>
> Hi ,
> I am working on an IPfilter hook driver.As the DDK says that i can
> provide my hook function by sending IOCTL_PF_SET_EXTENSION_POINTER to
> ipfilterdriver .The code below shows what i am doing but when i run the
> checked build in the debugger ipfilter driver displays " PointerIOCTL
> request failed " –
> I dont know what is the problem pls help me on this…
>
> RtlInitUnicodeString(&ustrObjectName,L"\Device\IPFILTERDRIVER"
> );
>
> status = IoGetDeviceObjectPointer(&ustrObjectName,
> FILE_READ_DATA | FILE_WRITE_DATA,
> &pFileObject,
> &pIPFilterDevObj); // first i collect the pointer to
> ipfilterdriver object
>
> ExtensionHookInfo = PacketFilterExtension; // this is my
> packet filter function
>
> pExtensionIrp = IoBuildDeviceIoControlRequest(
> IOCTL_PF_SET_EXTENSION_POINTER , pIPFilterDevObj,
> ExtensionHookInfo,
> sizeof(ExtensionHookInfo),
> NULL,
> OutputBufferLength,
> FALSE,
> NULL,
> pIoStatusBlock
> );
>
> status = IoCallDriver(pIPFilterDevObj,pExtensionIrp); //
> calling ipfilterdriver to set it
>
>
> Any Help is appreciated…
>
> — Subodh
>
> —
> You are currently subscribed to ntdev as: xxxxx@unshadow.net
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@leadbyte.com
> To unsubscribe send a blank email to %%email.unsub%%
>

----- Original Message -----
From: “Subodh Gupta”
To: “NT Developers Interest List”
Sent: Wednesday, August 07, 2002 3:37 PM
Subject: [ntdev] Re: Help IPFilterHookDriver Problem…

> Hi All,
> Thanks for the valuable help now everything is working fine.Last time i
was
> also checking status from IoGetDeviceObjectPointer it.was STATUS_SUCCESS.
>
> What was the reason for that??
>
> – Subodh

I supposed that device IPFILTERDRIVER probably was not exists. And
IoGetDeviceObjectPointer didn’t initialize its output parameters. And you
created IRP with them and passed it to function. But I didn’t think a lot
about your question and was wrong. You told that your code worked under free
build but had problems under checked build. Sorry.

vlad-ntdev