Problem with MB Miniport Ndis 6.20 Driver Initialization

Hi All,

I trying to write Ndis 6.20 Mobile broadband Miniport Driver(WWAN). I have made required changes mentioned in Mobile Broadband Docs. Problem with my driver is its not getting internalized properly. As per documentation What are the minimum OID which any MB driver should support , I am also supporting those.
Following OID I am supporting in my driver.
OID_GEN_SUPPORTED_LIST,
OID_GEN_MEDIA_SUPPORTED,
OID_GEN_PHYSICAL_MEDIUM,
OID_WWAN_DRIVER_CAPS,
OID_WWAN_DEVICE_CAPS,
OID_WWAN_READY_INFO,
OID_WWAN_HOME_PROVIDER,
OID_WWAN_REGISTER_STATE,
OID_WWAN_PACKET_SERVICE,
OID_WWAN_CONNECT

But problem is initially I am receiving OID_GEN_SUPPORTED_LIST with zero InformationBufferLength and then with proper value. This is repeating many times.

Afterword I am receiving OID_GEN_MEDIA_SUPPORTED with zero InformationBufferLength . There I am assigning required value to Byteneeded. but still next time it does not send me OID_GEN_MEDIA_SUPPORTED with InformationBufferLength =Byteneeded. I am not receiving this OID again.

Even I do not receive any OID which is required for initialization such is OID_GEN_PHYSICAL_MEDIUM, OID_WWAN_DRIVER_CAPS,OID_WWAN_DEVICE_CAPS .

Can any one tell me what is the problem ?

Amit

What status are you completing the zero-length buffer OIDs with?

While the documentation tends to say that either NDIS_STATUS_INVALID_LENGTH
and NDIS_STATUS_BUFFER_TOO_SHORT are ‘equivalent’ I think that
NDIS_STATUS_BUFFER_TOO_SHORT is the ‘more correct’ result in this case.

I also recommend that you always write the BytesWritten field to zero if you
do not write any bytes to the supplied buffer.

Have you tried this with a checked build of NDIS?

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, October 15, 2010 6:47 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Problem with MB Miniport Ndis 6.20 Driver Initialization

Hi All,

I trying to write Ndis 6.20 Mobile broadband Miniport Driver(WWAN). I have
made required changes mentioned in Mobile Broadband Docs. Problem with my
driver is its not getting internalized properly. As per documentation What
are the minimum OID which any MB driver should support , I am also
supporting those.
Following OID I am supporting in my driver.
OID_GEN_SUPPORTED_LIST,
OID_GEN_MEDIA_SUPPORTED,
OID_GEN_PHYSICAL_MEDIUM,
OID_WWAN_DRIVER_CAPS,
OID_WWAN_DEVICE_CAPS,
OID_WWAN_READY_INFO,
OID_WWAN_HOME_PROVIDER,
OID_WWAN_REGISTER_STATE,
OID_WWAN_PACKET_SERVICE,
OID_WWAN_CONNECT

But problem is initially I am receiving OID_GEN_SUPPORTED_LIST with zero
InformationBufferLength and then with proper value. This is repeating many
times.

Afterword I am receiving OID_GEN_MEDIA_SUPPORTED with zero
InformationBufferLength . There I am assigning required value to Byteneeded.
but still next time it does not send me OID_GEN_MEDIA_SUPPORTED with
InformationBufferLength =Byteneeded. I am not receiving this OID again.

Even I do not receive any OID which is required for initialization such is
OID_GEN_PHYSICAL_MEDIUM, OID_WWAN_DRIVER_CAPS,OID_WWAN_DEVICE_CAPS .

Can any one tell me what is the problem ?

Amit


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi David ,

Thanks for your prompt reply.

>What status are you completing the zero-length buffer OIDs with?

Actually I tried with both NDIS_STATUS_INVALID_LENGTH and NDIS_STATUS_BUFFER_TOO_SHORT, but still result was same.

>I also recommend that you always write the BytesWritten field to zero if you do not write any >>bytes to the supplied buffer.

I am initializing both fields BytesWritten and BytesNeeded to zero . When InformationBufferLength is non zero then only I am updating value of BytesWritten.

>Have you tried this with a checked build of NDIS?

Did you mean building code with checked build? I am building it with checked build.

Amit

> Did you mean building code with checked build? I am building it with
checked build.

No, I mean running your driver on the Checked build of the OS.

Or in some cases, you can disable System File Protection and install just
the checked build of NDIS.SYS on your test (target) system and get the
benefit of the added diagnostics. I have not tried that with any NT6
version (Vista/2K8/Win7) but it is pretty common practice on NT5. Since
you are working with the WWAN stack on Win7, you might just try installing a
full checked build of Win7, attaching the debugger, using the ndiskd
extension to enable the debug systems and levels useful, and see what
happens.

Good Luck,
Dave Cattley

> you are working with the WWAN stack on Win7, you might just try installing a

full checked build of Win7, attaching the debugger

Can .kdfiles work for NDIS.SYS?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> Or in some cases, you can disable System File Protection

IIRC SFP is gone in Vista+, being replace with WinSxS directory of hardlinks and ACL-based protection with TrustedInstaller account.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

I believe that .kdfiles works with boot drivers on Win7 (and presumably
win2k8r2).

Indeed, on Vista+, all you have to do to replace a formerly ‘protected’ file
is take ownership of it.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, October 15, 2010 10:48 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Problem with MB Miniport Ndis 6.20 Driver Initialization

Or in some cases, you can disable System File Protection

IIRC SFP is gone in Vista+, being replace with WinSxS directory of hardlinks
and ACL-based protection with TrustedInstaller account.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Yes, it should work for ndis.sys. Remember that you must use win7 and enable boot debugging (bcdedit /set bootdebug on) in order to use .kdfile for boot start drivers.

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, October 15, 2010 7:48 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Problem with MB Miniport Ndis 6.20 Driver Initialization

you are working with the WWAN stack on Win7, you might just try
installing a full checked build of Win7, attaching the debugger

Can .kdfiles work for NDIS.SYS?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

wrote in message news:xxxxx@ntdev…
> Hi All,
>
> I trying to write Ndis 6.20 Mobile broadband Miniport Driver(WWAN). I have
> made required changes mentioned in Mobile Broadband Docs. Problem with my
> driver is its not getting internalized properly. As per documentation
> What are the minimum OID which any MB driver should support , I am also
> supporting those.
> Following OID I am supporting in my driver.
> OID_GEN_SUPPORTED_LIST,
> OID_GEN_MEDIA_SUPPORTED,
> OID_GEN_PHYSICAL_MEDIUM,
> OID_WWAN_DRIVER_CAPS,
> OID_WWAN_DEVICE_CAPS,
> OID_WWAN_READY_INFO,
> OID_WWAN_HOME_PROVIDER,
> OID_WWAN_REGISTER_STATE,
> OID_WWAN_PACKET_SERVICE,
> OID_WWAN_CONNECT
>
> But problem is initially I am receiving OID_GEN_SUPPORTED_LIST with zero
> InformationBufferLength and then with proper value. This is repeating many
> times.

And for OID_GEN_SUPPORTED_LIST, do you return proper BytesNeeded and
NDIS_STATUS_BUFFER_TOO_SHORT ?
– pa

> Afterword I am receiving OID_GEN_MEDIA_SUPPORTED with zero
> InformationBufferLength . There I am assigning required value to
> Byteneeded. but still next time it does not send me
> OID_GEN_MEDIA_SUPPORTED with InformationBufferLength =Byteneeded. I am not
> receiving this OID again.
>
> Even I do not receive any OID which is required for initialization such is
> OID_GEN_PHYSICAL_MEDIUM, OID_WWAN_DRIVER_CAPS,OID_WWAN_DEVICE_CAPS .
>
> Can any one tell me what is the problem ?
>
> Amit
>
>
>

@ Maxim: replacing just ndis.sys is probably not enough for Mobile broadband wwan, it involves more stuff.

–pa

Hi Pavel ,

Thanks for your prompt reply.

>And for OID_GEN_SUPPORTED_LIST, do you return proper BytesNeeded and >>NDIS_STATUS_BUFFER_TOO_SHORT ?

Yes I do return proper value in BytesNeeded i.e. size of NICSupportedOids which is array of NDIS_OID.

NDIS_OID NICSupportedOids =
{
OID_GEN_SUPPORTED_LIST,
OID_GEN_MEDIA_SUPPORTED,
OID_GEN_PHYSICAL_MEDIUM,
OID_WWAN_DRIVER_CAPS,
OID_WWAN_DEVICE_CAPS,
OID_WWAN_READY_INFO,
OID_WWAN_HOME_PROVIDER,
OID_WWAN_REGISTER_STATE,
OID_WWAN_PACKET_SERVICE,
OID_WWAN_CONNECT };

I have tried with both status i.e. NDIS_STATUS_BUFFER_TOO_SHORT and NDIS_STATUS_INVALID_LENGTH. But still result was same in both cases.

Amit

Are those all of the mandatory OIDs that you need to support?

Thomas F. Divine
http://www.pcausa.com


From:
Sent: Monday, October 18, 2010 1:16 AM
To: “Windows System Software Devs Interest List”
Subject: RE:[ntdev] Problem with MB Miniport Ndis 6.20 Driver Initialization

>
> Hi Pavel ,
>
> Thanks for your prompt reply.
>
>>>And for OID_GEN_SUPPORTED_LIST, do you return proper BytesNeeded and
>>> >>NDIS_STATUS_BUFFER_TOO_SHORT ?
>
> Yes I do return proper value in BytesNeeded i.e. size of NICSupportedOids
> which is array of NDIS_OID.
>
> NDIS_OID NICSupportedOids =
> {
> OID_GEN_SUPPORTED_LIST,
> OID_GEN_MEDIA_SUPPORTED,
> OID_GEN_PHYSICAL_MEDIUM,
> OID_WWAN_DRIVER_CAPS,
> OID_WWAN_DEVICE_CAPS,
> OID_WWAN_READY_INFO,
> OID_WWAN_HOME_PROVIDER,
> OID_WWAN_REGISTER_STATE,
> OID_WWAN_PACKET_SERVICE,
> OID_WWAN_CONNECT };
>
> I have tried with both status i.e. NDIS_STATUS_BUFFER_TOO_SHORT and
> NDIS_STATUS_INVALID_LENGTH. But still result was same in both cases.
>
> Amit
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Yeah , As per the Mobile Broadband doc these are all mandatory OID which any MB driver should support.

Amit