Re: NDIS5.1 driver in Vista



I am not surprized that calls to IoCreateDeivce()
and IoCreateSymbolicLink() were successfull, but, in my experience, if
you do thing this way IRP_MJ_CREATE gets immediately followed by
IRP_MJ_CLOSE whenever you call ZwCreateFile()

It shouldn't matter which way you are trying to get the handle either
IoGetDeviceObjectPointer() or the ZwCreatefile()

what I did was just the low level implementation of the
NdisMRegisterDevice() does....internally it does the same functionality
as I did...apart it takes care of all the PNP Irps which NDIS library
handles on it own....Our Miniport drivers need not worry abt the PNP
irp's. This workaround will work even in the WinXP...

soviet_bloke@xxxxxxxxxxx wrote:
Amit,

For a workaround I created the device object using the IoCreateDeivce()
and further creating the Symbolic link using the
IoCreateSymbolicLink(), Offcourse I am taking care abt the distach
routines initialization for if not done it would crash..
With this workaround I am able to get the handle and setup a normal
behaviour...

Sorry, I just overlooked the fact that you were speaking about
Vista..... In Vista NdisMRegisterDevice() is not supported - this is
why you get STATUS_NOT_SUPPORTED. This is what I can tell you for sure,
although, unfortunately, I am unable to offer you any workaround -all
my statements about Vista are based upon MSDN, rather than upon my own
experience.

However, it looks like you made an interesting experiment.....

Do you mean that you actually managed to send the request to the device
this way??? In fact, I am not surprized that calls to IoCreateDeivce()
and IoCreateSymbolicLink() were successfull, but, in my experience, if
you do thing this way IRP_MJ_CREATE gets immediately followed by
IRP_MJ_CLOSE whenever you call ZwCreateFile() , so that the whole thing
is, for the practical purposes, unusable (in fact, I never tried
IoGetDeviceObjectPointer(), just because the failure seemed to be
inevitable, so that there is no need to waste time on the experiment).
This is how it works on W2K and XP. However, as it turns out, on
Vista it may work differently......

Anton Bassov



Amit wrote:
Hi ,
I am registering my mniport driver with NDIS as below,

Status = NdisMRegisterDevice(
NdisWrapperHandle,
&ustrDeviceName,
&ustrSymbolicName,
dispatch_table,
&Adapter->psDeviceObj,
&Adapter->NdisDeviceHandle);

using this method I am unable to get the device handle. ( call from
both IoGetDeviceObjectPointer() and CreateFile() FAIL) . I checked
even the Symbolic link with WinObj.exe and is created.

For a workaround I created the device object using the IoCreateDeivce()
and further creating the Symbolic link using the
IoCreateSymbolicLink(), Offcourse I am taking care abt the distach
routines initialization for if not done it would crash..
With this workaround I am able to get the handle and setup a normal
behaviour...But this workaround is not the right way to register...So
please help me to get a solution and what is the reason for such
behaviour?

Regards,
Amit
soviet_bloke@xxxxxxxxxxx wrote:
Hi mate

I am trying to get the handle using the IoGetDeviceObjectPointer()
function from another driver, But it always returns
STATUS_NOT_SUPPORTED. What could be the reason for such behaviour?

"The reason for such behaviour" is obvious-- you are just not supposed
to access miniport drivers this way. If you want someoene, apart from
NDIS library, to call your miniport driver, you have to register a
standalone device with NdisMRegisterDevice(), and forward all calls to
this device

Anton Bassov

Amit wrote:
Hi All,
I am using my NDIS 5.1 miniport driver written for WinXP prof in
Vista Build 5600 (Vista RC1).
The driver is running fine for it supports the backward compatibility,
but I am unable to get the handle for my network device for the driver
I have.
I am trying to get the handle using the IoGetDeviceObjectPointer()
function from another driver, But it always returns
STATUS_NOT_SUPPORTED. What could be the reason for such behaviour?

The same setup ( NDIS miniport driver and the other driver from which i
am trying to get the NDIS handle ) works fine.

Looking forward for your response.....

.



Relevant Pages

  • Re: NDIS5.1 driver in Vista
    ... IoCreateSymbolicLink(), Offcourse I am taking care abt the distach ... In Vista NdisMRegisterDevice() is not supported - this is ... I am registering my mniport driver with NDIS as below, ...
    (microsoft.public.development.device.drivers)
  • Re: Question about FILE_OBJECT
    ... NDIS IM is a driver that fully conforms to the model, ... I.E. every time they allocated a new context object they ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Running NDISTest on Vista with an NDIS IM Driver
    ... I had a quick look at the ndistest stuff in the WLK1.0c, ... actually some ndis driver in the ... I tried using the version that comes with WLK/DTM on PassThru (NDIS IM ...
    (microsoft.public.development.device.drivers)
  • Re: NDIS functionality details
    ... In my driver I need to decompress compressed video data and provide ... >> NDIS subsystem exports a lot of functions with Ndis* prefix. ... >> DDK says, that there is two ways, one is to copy each packet to driver ...
    (microsoft.public.development.device.drivers)
  • Re: NDIS Intermediate (passthru) communicates with second driver
    ... already occupied by NDIS. ... Now PASSTHRU is an NDIS intermediate driver, ... implements both an NDIS miniport and an NDIS protocol. ... device object via IoCreateDevicein the standard way in your IM. ...
    (microsoft.public.development.device.drivers)