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.....

Re: NDIS5.1 driver in Vista by Eliyas

Eliyas
Thu Oct 12 09:26:26 CDT 2006

How do you get the name of your NDIS device?

-Eliyas



Re: NDIS5.1 driver in Vista by soviet_bloke

soviet_bloke
Thu Oct 12 13:52:37 CDT 2006

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.....


Re: NDIS5.1 driver in Vista by Amit

Amit
Fri Oct 13 00:27:25 CDT 2006

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@hotmail.com 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.....


Re: NDIS5.1 driver in Vista by soviet_bloke

soviet_bloke
Fri Oct 13 00:57:53 CDT 2006

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@hotmail.com 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.....


Re: NDIS5.1 driver in Vista by Amit

Amit
Fri Oct 13 01:52:38 CDT 2006

>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@hotmail.com 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@hotmail.com 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.....


Re: NDIS5.1 driver in Vista by Stephan

Stephan
Fri Oct 13 04:20:22 CDT 2006

Not sure whether the WinObj tool runs under Vista, but give it a try.
See

http://www.sysinternals.com/Utilities/WinObj.html

Stephan
---
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.....


Re: NDIS5.1 driver in Vista by soviet_bloke

soviet_bloke
Fri Oct 13 04:26:57 CDT 2006

Amit,

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

In fact, unlike ZwCreateFile(), IoGetDeviceObjectPointer() returns a
pointer, rather than handle. Therefore, you can deal directly with
DEVICE_OBJECT if you have used IoGetDeviceObjectPointer(), and there is
nothing that can be done about you (apart from either deleting
DEVICE_OBJECT you have opened or blocking all "inappropriate" requests
to it). However, ZwCreateFile() opens a file that can get closed.
Therefore, IO can get easily prevented simply by closing a file - this
is why IRP_MJ_CREATE gets immediately followed by IRP_MJ_CLOSE

I just thought that NDIS may be blocking the requests to DEVICE_OBJECT
that has been opened with IoGetDeviceObjectPointer(), but, as you say,
this is not the case - even on XP

In fact, I think that you have found not so bad solution - once
NdisMRegisterDevice() is not supported on Vista, you just provided your
own implementation of it, and everything seems to work fine.....

Anton Bassov




Amit wrote:
> >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@hotmail.com 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@hotmail.com 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.....


Re: NDIS5.1 driver in Vista by fat_boy

fat_boy
Fri Oct 13 04:57:09 CDT 2006


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.....

Hi

You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
more advanced than the older funbction, you can set the security
yourself to govern what can and cant open the handle, and what access
you provide.

Unfortunately, it is broken on RC1. The symbolic link cant be opened
form user land.


Re: NDIS5.1 driver in Vista by Amit

Amit
Fri Oct 13 05:27:51 CDT 2006

> You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> more advanced than the older funbction, you can set the security
> yourself to govern what can and cant open the handle, and what access
> you provide.

Hi,
I agree with your above statement, But it is not just
NdisRegisterDeviceEx() which, I have to change in the code, I have to
modify even the way the miniport is registered with NDIS...and that
goes on...where in finally i will end up with porting my miniport
driver to NDIS 6.

I am in a search for the reason for failure in getting the handle. Is
that the new NDIS 6 dosent support this way of accessing its device
object? Which is that interface I have to look for to get this done in
Vista?

The workaround is not a stable solution I guess...I am still in dark
for if it has any side effects....

> Unfortunately, it is broken on RC1. The symbolic link cant be opened
> form user land.

The DeviceObject is not even accessible in kernel mode...

fat_boy wrote:
> 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.....
>
> Hi
>
> You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> more advanced than the older funbction, you can set the security
> yourself to govern what can and cant open the handle, and what access
> you provide.
>
> Unfortunately, it is broken on RC1. The symbolic link cant be opened
> form user land.


Re: NDIS5.1 driver in Vista by Amit

Amit
Fri Oct 13 07:50:49 CDT 2006


What could be the reason for this behavior in NDIS 6 version. Do i have
to change the security atributes of the DeviceObject to get this
done....if so what access should I have to give to the DeviceObject?



Amit wrote:
> > You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> > more advanced than the older funbction, you can set the security
> > yourself to govern what can and cant open the handle, and what access
> > you provide.
>
> Hi,
> I agree with your above statement, But it is not just
> NdisRegisterDeviceEx() which, I have to change in the code, I have to
> modify even the way the miniport is registered with NDIS...and that
> goes on...where in finally i will end up with porting my miniport
> driver to NDIS 6.
>
> I am in a search for the reason for failure in getting the handle. Is
> that the new NDIS 6 dosent support this way of accessing its device
> object? Which is that interface I have to look for to get this done in
> Vista?
>
> The workaround is not a stable solution I guess...I am still in dark
> for if it has any side effects....
>
> > Unfortunately, it is broken on RC1. The symbolic link cant be opened
> > form user land.
>
> The DeviceObject is not even accessible in kernel mode...
>
> fat_boy wrote:
> > 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.....
> >
> > Hi
> >
> > You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> > more advanced than the older funbction, you can set the security
> > yourself to govern what can and cant open the handle, and what access
> > you provide.
> >
> > Unfortunately, it is broken on RC1. The symbolic link cant be opened
> > form user land.


Re: NDIS5.1 driver in Vista by Eliyas

Eliyas
Fri Oct 13 08:11:44 CDT 2006

Every aspect of NDIS5.1 driver should work on Vista. Otherwise we are going
to have major compatibility issues. Can you try my netvmini sample from WDK
on Vista, and use the app to open the control-device that it creates using
NdisMRegisterDevice. If that doesn't work, I will find out what the problem
is.

-Eliyas



Re: NDIS5.1 driver in Vista by Calvin

Calvin
Fri Oct 13 16:29:20 CDT 2006

"fat_boy" <zzebowa@hotmail.com> wrote in message
news:1160733429.748140.171660@m73g2000cwd.googlegroups.com...
> You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> more advanced than the older funbction, you can set the security
> yourself to govern what can and cant open the handle, and what access
> you provide.
>
> Unfortunately, it is broken on RC1. The symbolic link cant be opened
> form user land.

CreateFile and NdisRegisterDeviceEx work fine for me in RC 1.

--
Calvin Guan (DDK MVP)
Sr. Staff Engineer
NetXtreme Vista/LH Server Miniport
Broadcom Corporation
Connecting Everything(r)



Re: NDIS5.1 driver in Vista by Maxim

Maxim
Sat Oct 14 14:03:19 CDT 2006

> In fact, unlike ZwCreateFile(), IoGetDeviceObjectPointer() returns a

IoGetDeviceObjectPointer is a sequence of:

ZwCreateFile
ObReferenceObjectByHandle
ZwClose
IoGetRelatedDeviceObject

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Re: NDIS5.1 driver in Vista by fat_boy

fat_boy
Mon Oct 16 04:47:42 CDT 2006


Calvin Guan wrote:
> "fat_boy" <zzebowa@hotmail.com> wrote in message
> news:1160733429.748140.171660@m73g2000cwd.googlegroups.com...
> > You should use NdisRegisterDeviceEx() on Vista. It is quite a bit
> > more advanced than the older funbction, you can set the security
> > yourself to govern what can and cant open the handle, and what access
> > you provide.
> >
> > Unfortunately, it is broken on RC1. The symbolic link cant be opened
> > form user land.
>
> CreateFile and NdisRegisterDeviceEx work fine for me in RC 1.

Here is the security string I am using in the driver:
RtlInitUnicodeString( &sddlString,
L"D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;BU)(A;;GA;;;WD)");


Here is the CretaFile() call:
CreateFile("\\\\.\\GTNDIS0", MAXIMUM_ALLOWED , 0, 0, OPEN_EXISTING,
0, 0);

This fails in Vista RC1.


(I have ot use MAXIMUM_ALLOWED to allow the interface to work in non
admin profiles on XP)








> --
> Calvin Guan (DDK MVP)
> Sr. Staff Engineer
> NetXtreme Vista/LH Server Miniport
> Broadcom Corporation
> Connecting Everything(r)