Hi,
I’m trying to retrieve the IP address of the local host in my NT kernel
mode driver. It seems like the TDI_QUERY_INFORMATION function should be
able to return this information, but I haven’t been able to get it to work.
I set up the IRP using TDI_QUERY_INFORMATION, the device handle for the
TCP device (I’ve also tried the UDP and raw IP devices), the file handle
for the TCP device, and the subfunction TDI_QUERY_NETWORK_ADDRESS. When I
call IoCallDriver, I get status 0xC0000002 (not implemented) back from the
driver. Please give me a hand!
best regards
brucie
Look at TdiRegisterPnPHandlers. The obsolete
TdiRegisterAddressChangeHandler is a little
easier to use and still works for now.
-----Original Message-----
From: brucie [mailto:brucie@263.net]
Sent: Tuesday, March 12, 2002 5:27 AM
To: NT Developers Interest List
Subject: [ntdev] TDI_QUERY_INFORMATION
Hi,
I’m trying to retrieve the IP address of the local host in my NT kernel
mode driver. It seems like the TDI_QUERY_INFORMATION function should be
able to return this information, but I haven’t been able to get it to work.
I set up the IRP using TDI_QUERY_INFORMATION, the device handle for the
TCP device (I’ve also tried the UDP and raw IP devices), the file handle
for the TCP device, and the subfunction TDI_QUERY_NETWORK_ADDRESS. When I
call IoCallDriver, I get status 0xC0000002 (not implemented) back from the
driver. Please give me a hand!
best regards
brucie
b???.???????v??ׯj?j?^??^??'r???ޱ??i?Z?G?j)m?W???u??۟M?-??+
Probably your mistake is that you set up IRP with “file handle of TCP
device”. According to DDK documentation for TDI_QUERY_NETWORK_ADDRESS
“IrpSp->FileObject must point to a file object representing a control
channel”. Did you do this?
vlad-ntdev
Hi,
I’m trying to retrieve the IP address of the local host in my NT kernel
mode driver. It seems like the TDI_QUERY_INFORMATION function should be
able to return this information, but I haven’t been able to get it to
work.
I set up the IRP using TDI_QUERY_INFORMATION, the device handle for the
TCP device (I’ve also tried the UDP and raw IP devices), the file handle
for the TCP device, and the subfunction TDI_QUERY_NETWORK_ADDRESS. When I
call IoCallDriver, I get status 0xC0000002 (not implemented) back from the
driver. Please give me a hand!
best regards
brucie
When Open a control channel, TdiDispatchCreate is called and then if
the Irp->AssociatedIrp.SystemBuffer == NULL it means an control channel
will be opened. I try to retrieve IP address at this time but still get
status xC0000002 (not implemented).
Another question: I can hook tcpip protocol successful but when I try
to hook NDISWAN it doesnt work. Would u like to give me some ideas?
Probably your mistake is that you set up IRP with “file handle of TCP
device”. According to DDK documentation for TDI_QUERY_NETWORK_ADDRESS
“IrpSp->FileObject must point to a file object representing a control
channel”. Did you do this?
vlad-ntdev
> Hi,
>
> I’m trying to retrieve the IP address of the local host in my NT kernel
> mode driver. It seems like the TDI_QUERY_INFORMATION function should be
> able to return this information, but I haven’t been able to get it to
work.
> I set up the IRP using TDI_QUERY_INFORMATION, the device handle for the
> TCP device (I’ve also tried the UDP and raw IP devices), the file handle
> for the TCP device, and the subfunction TDI_QUERY_NETWORK_ADDRESS. When I
> call IoCallDriver, I get status 0xC0000002 (not implemented) back from the
> driver. Please give me a hand!
>
>
> best regards
> brucie
You are currently subscribed to ntdev as: brucie@263.net
To unsubscribe send a blank email to xxxxx@lists.osr.com
“brucie” wrote in message news:xxxxx@ntdev…
<snip…>
> Another question: I can hook tcpip protocol successful but when I try
> to hook NDISWAN it doesnt work. Would u like to give me some ideas?
> >Probably your mistake is that you set up IRP with “file handle of TCP
> >device”. According to DDK documentation for TDI_QUERY_NETWORK_ADDRESS
> >“IrpSp->FileObject must point to a file object representing a control
> >channel”. Did you do this?
> >
NDISWAN is not a high-level transport that uses TDI. No joy to be found in
this pursuit.
Regards,
–
Thomas F. Divine
PCAUSA - Tools & Resources For Network Software Developers
NDIS Protocol/Intermediate/Hooking - TDI Client/Filter
http: - http:</http:></http:></snip…>
yes, NDISWAN is not a high-level transport.
I can hook tcpip’s NDIS_PROTOCOL_BLOCK by registering a fake protocol.
But when I try to use this way to hook NDISWAN. It seems it doesnt work.
DDK said: “NDISWAN converts an out-going packet from LAN to PPP format” .
I guess whether I can get this “LAN format out-going packet” using the hook
technique by registering a fake protocol to get the NDIS_PROTOCOL_BLOCK of
NDISWAN protocol?
Please give me some ideas.
“brucie” wrote in message news:xxxxx@ntdev…
>
><snip…>
>
>> Another question: I can hook tcpip protocol successful but when I try
>> to hook NDISWAN it doesnt work. Would u like to give me some ideas?
>> >Probably your mistake is that you set up IRP with “file handle of TCP
>> >device”. According to DDK documentation for TDI_QUERY_NETWORK_ADDRESS
>> >“IrpSp->FileObject must point to a file object representing a control
>> >channel”. Did you do this?
>> >
>NDISWAN is not a high-level transport that uses TDI. No joy to be found in
>this pursuit.
>
>Regards,
>–
>Thomas F. Divine
>
>PCAUSA - Tools & Resources For Network Software Developers
>NDIS Protocol/Intermediate/Hooking - TDI Client/Filter
>http: - http:
>
>
>
>—
>You are currently subscribed to ntdev as: brucie@263.net
>To unsubscribe send a blank email to xxxxx@lists.osr.com</http:></http:></snip…>
> When Open a control channel, TdiDispatchCreate is called and then if
the Irp->AssociatedIrp.SystemBuffer == NULL it means an control channel
will be opened. I try to retrieve IP address at this time but still get
status xC0000002 (not implemented).
Yes, this method doesn’t supported by tcpip.sys. You should try another
method to gather this information.
yes, NDISWAN is not a high-level transport.
I can hook tcpip’s NDIS_PROTOCOL_BLOCK by registering a fake protocol.
But when I try to use this way to hook NDISWAN. It seems it doesnt work.
DDK said: “NDISWAN converts an out-going packet from LAN to PPP format” .
I guess whether I can get this “LAN format out-going packet” using the
hook
technique by registering a fake protocol to get the NDIS_PROTOCOL_BLOCK of
NDISWAN protocol?
No, you can’t intercept outgoing NDISWAN packets with NDIS protocol driver.
It’s a famous problem. I suppose NDIS hooking only helps you with NDISWAN.
vlad-ntdev
> ----------
From: xxxxx@unshadow.net[SMTP:xxxxx@unshadow.net]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, March 14, 2002 10:11 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Re: TDI_QUERY_INFORMATION
No, you can’t intercept outgoing NDISWAN packets with NDIS protocol
driver.
It’s a famous problem. I suppose NDIS hooking only helps you with NDISWAN.
No problem at all. Standard NDIS IM or filter driver is a solution for w2k
and XP, NDIS IM or hook driver for NT4 and hook driver for w9x.
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]