From: fat_boy on
Yeah. the symbolic link is there, and the CreateFile() call uses
MAXIMUM_ALLOWED so it should suceed with at least something.

Here is the code from the driver:


RtlInitUnicodeString( &sddlString,
L"D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;BU)(A;;GA;;;WD)");


NdisZeroMemory(DispatchTable, (IRP_MJ_MAXIMUM_FUNCTION+1) *
sizeof(PDRIVER_DISPATCH));


DispatchTable[IRP_MJ_CREATE] = GPRSioctlDispatch;
DispatchTable[IRP_MJ_CLEANUP] = GPRSioctlDispatch;
DispatchTable[IRP_MJ_CLOSE] = GPRSioctlDispatch;
DispatchTable[IRP_MJ_DEVICE_CONTROL] = GPRSioctlDispatch;
DispatchTable[IRP_MJ_READ] = GPRSioctlDispatch;

RtlStringCbPrintfW(deviceString, 64, L"\\Device\\GTNDIS%d", i);
RtlStringCbPrintfW(linkString, 64, L"\\DosDevices\\GTNDIS%d", i);

NdisInitUnicodeString(&deviceName, deviceString);
NdisInitUnicodeString(&linkName, linkString);

NdisZeroMemory(&devObjAttrs, sizeof( NDIS_DEVICE_OBJECT_ATTRIBUTES));

devObjAttrs.Header.Type = NDIS_OBJECT_TYPE_DEVICE_OBJECT_ATTRIBUTES;
devObjAttrs.Header.Revision =
NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_1;
devObjAttrs.Header.Size = sizeof(NDIS_DEVICE_OBJECT_ATTRIBUTES);
devObjAttrs.DeviceName = &deviceName;
devObjAttrs.SymbolicName = &linkName;
devObjAttrs.MajorFunctions = &DispatchTable[0];
devObjAttrs.ExtensionSize = 10;
devObjAttrs.DefaultSDDLString = &sddlString;
devObjAttrs.DeviceClassGuid = 0;


Status = NdisRegisterDeviceEx(GPRSNdisMiniportDriverHandle,
&devObjAttrs,
&pAdapter->pIoctlDevice,
&pAdapter->ioctlHandle);


And it returns NDIS_STATUS_SUCCESS

Cheers.



















Eliyas Yakub [MSFT] wrote:
> There are several inbox and test drivers using this function. So I suspect
> that you are doing something wrong.
>
> Can you post the code that calls NdisRegisterDeviceEx?
>
> Can you break into the debugger and see if the deviceobject and symbolic
> link are created?
>
> kd> !object \Device
>
> kd> !object \GLOBAL??
>
> -Eliyas
>
>
> "fat_boy" <zzebowa(a)hotmail.com> wrote in message
> news:1157368278.385896.11260(a)b28g2000cwb.googlegroups.com...
> >I have the same problem, the user mode code cant open the device, it
> > gets an acces denied. This is regardles of what security string I put
> > in the call to NdisRegisterDeviceEx().
> >
> > I think this is just plain broken. (along with quite a lot of the rest
> > of Vista)
> >
> >
> > What you could do for the moment is prototype the old version of this
> > func in your ode and link to the old verion in ndis.lib. This does at
> > least still work.
> >
> >
> >
> >
> > Soquel Dude wrote:
> >> I'm porting an NDIS miniport driver for a WLAN device from XP to Vista.
> >> This
> >> driver supported an IOCTL interface for query/set requests from the
> >> client
> >> application.
> >>
> >> Following the mux sample driver in the WDK, the driver now calls
> >> NdisRegisterDeviceEx() to register the device. Stepping through this in
> >> WinDbg, I see the call succeed and return NDIS_STATUS_SUCCESS. However,
> >> when
> >> the client application calls CreateFile(), the call fails and
> >> GetLastError()
> >> returns 53 (ERROR_BAD_NETPATH).
> >>
> >> This was seen on Vista build 5536.
> >>
> >> Does Vista's NWF framework allow NDIS miniport drivers to export their
> >> own
> >> IOCTL interface? If not, what should NWF miniport drivers do instead?
> >

From: Eliyas Yakub [MSFT] on
I plugged in your code as is in one of my ndis 60 sample and it worked fine.
So it's time for you to hook up a debugger, step thru CreateFile fail code
and find out why it fails.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/driver/tips/default.mspx

From: fat_boy on

Eliyas Yakub [MSFT] wrote:
> I plugged in your code as is in one of my ndis 60 sample and it worked fine.
> So it's time for you to hook up a debugger, step thru CreateFile fail code
> and find out why it fails.


What parameters did you use for CreateFile()? Perhaps Vista wants a
different set to XP?


>
> --
> -Eliyas
> This posting is provided "AS IS" with no warranties, and confers no rights.
> http://www.microsoft.com/whdc/driver/tips/default.mspx

From: fat_boy on

Eliyas Yakub [MSFT] wrote:
> I plugged in your code as is in one of my ndis 60 sample and it worked fine.
> So it's time for you to hook up a debugger, step thru CreateFile fail code
> and find out why it fails.
>
> --
> -Eliyas
> This posting is provided "AS IS" with no warranties, and confers no rights.
> http://www.microsoft.com/whdc/driver/tips/default.mspx

Scrub that, it works on RC1.

From: fat_boy on

Eliyas Yakub [MSFT] wrote:
> I plugged in your code as is in one of my ndis 60 sample and it worked fine.
> So it's time for you to hook up a debugger, step thru CreateFile fail code
> and find out why it fails.

Scrub that, it is still broken. I had an Ndis 5.1 driver running by
mistake.

So, what params did you use to get CreateFile() to work?
>
> --
> -Eliyas
> This posting is provided "AS IS" with no warranties, and confers no rights.
> http://www.microsoft.com/whdc/driver/tips/default.mspx