NDIS driver install...

I’m trying to install my ndis driver skeleton and its failing to execute
its Initialize function after insertion.

First I install my bus driver and enumerate a PDO for the ndis driver.
The bus driver seems to install correctly.

When I insert my ndis driver, it seems to install, my DriverEntry is
called and completes with NDIS_STATUS_SUCCESS. (From my trace msgs)

The only interesting thing that I can find in the setupapi log is:

dvi: {Restarting Devices} 13:57:18.062
dvi: Restart: VBUS\TEST_DEV_10
\4&306CFD90&0&10
dvi: Restart complete.
!!! dvi: Device not started: Device has
problem: 0x1f: CM_PROB_FAILED_ADD.
dvi: {Restarting Devices exit} 13:57:18.156

IOW, the log seems to find things ok and match them up with my bus
driver.

I also know that the ‘unload’ callback was executed from a trace msg as
well.

Now this is (basically) the first time I’ve attempted to install so I
certainly could have a problem with the .inf file, I’m working off the
usbnwifi example, with a little netvmini thrown in for good luck.

The DriverEntry calls WdfDriverCreate(), and then
NdisMRegisterMiniportDriver() with the “Type” set to:

NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS

I set all the struct members the same way as usbnwifi does, with my data
or course…

The .inx I use is a modified version of the one also used by usbnwifi.

Any suggestions? I am starting to miss that lovely shade of blue I get
when I first (somewhat) successfully install a driver… :wink:

Thanks,
-PWM

Peter W. Morreale wrote:

I’m trying to install my ndis driver skeleton and its failing to execute
its Initialize function after insertion.

First I install my bus driver and enumerate a PDO for the ndis driver.
The bus driver seems to install correctly.

When I insert my ndis driver, it seems to install, my DriverEntry is
called and completes with NDIS_STATUS_SUCCESS. (From my trace msgs)

The only interesting thing that I can find in the setupapi log is:

dvi: {Restarting Devices} 13:57:18.062
dvi: Restart: VBUS\TEST_DEV_10
\4&306CFD90&0&10
dvi: Restart complete.
!!! dvi: Device not started: Device has
problem: 0x1f: CM_PROB_FAILED_ADD.
dvi: {Restarting Devices exit} 13:57:18.156

IOW, the log seems to find things ok and match them up with my bus
driver.

I also know that the ‘unload’ callback was executed from a trace msg as
well.

Good. Load and unload were called, but your driver returned a failure
in its AddDevice routine. You did specify an AddDevice callback, didn’t
you?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Do I have this right? The MiniportInitialize() entry you registered with
NDIS does not get called?

What is the error code in Device Manager associated with your device?

Does your PDO correctly ‘start’?

Clearly PnP has figured out that your NDIS Miniport driver is the Function
Driver and in all likelyhood has called the AddDevice handler that NDIS
stuck in your PDRIVER_OBJECT.

However, NDIS does not call MiniportInitialize until the device stack is
‘started’. A whole lot can go wrong (and seemingly may have) before that
point.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter W. Morreale
Sent: Wednesday, December 09, 2009 4:57 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS driver install…

I’m trying to install my ndis driver skeleton and its failing to execute
its Initialize function after insertion.

First I install my bus driver and enumerate a PDO for the ndis driver.
The bus driver seems to install correctly.

When I insert my ndis driver, it seems to install, my DriverEntry is
called and completes with NDIS_STATUS_SUCCESS. (From my trace msgs)

The only interesting thing that I can find in the setupapi log is:

dvi: {Restarting Devices} 13:57:18.062
dvi: Restart: VBUS\TEST_DEV_10
\4&306CFD90&0&10
dvi: Restart complete.
!!! dvi: Device not started: Device has
problem: 0x1f: CM_PROB_FAILED_ADD.
dvi: {Restarting Devices exit} 13:57:18.156

IOW, the log seems to find things ok and match them up with my bus
driver.

I also know that the ‘unload’ callback was executed from a trace msg as
well.

Now this is (basically) the first time I’ve attempted to install so I
certainly could have a problem with the .inf file, I’m working off the
usbnwifi example, with a little netvmini thrown in for good luck.

The DriverEntry calls WdfDriverCreate(), and then
NdisMRegisterMiniportDriver() with the “Type” set to:

NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS

I set all the struct members the same way as usbnwifi does, with my data
or course…

The .inx I use is a modified version of the one also used by usbnwifi.

Any suggestions? I am starting to miss that lovely shade of blue I get
when I first (somewhat) successfully install a driver… :wink:

Thanks,
-PWM


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

On Wed, 2009-12-09 at 14:14 -0800, Tim Roberts wrote:

Peter W. Morreale wrote:

>
> I also know that the ‘unload’ callback was executed from a trace msg as
> well.
>

Good. Load and unload were called, but your driver returned a failure
in its AddDevice routine. You did specify an AddDevice callback, didn’t
you?

Well, no. usbnwifi doesn’t either:

WDF_DRIVER_CONFIG_INIT(&config, WDF_NO_EVENT_CALLBACK);
//
// Set WdfDriverInitNoDispatchOverride flag to tell the framework
// not to provide dispatch routines for the driver. In other words,
// the framework must not intercept IRPs that the I/O manager has
// directed to the driver. In this case, it will be handled by NDIS
// port driver.
//
config.DriverInitFlags |= WdfDriverInitNoDispatchOverride;

ntStatus = WdfDriverCreate(DriverObject,
RegistryPath,
WDF_NO_OBJECT_ATTRIBUTES,
&config,
&hDriver); //vm control

After the above, usbnwifi merely fills in the NDIS struct, calls
register-miniport and returns.

Thx
-PWM

On Wed, 2009-12-09 at 17:59 -0500, David R. Cattley wrote:

Do I have this right? The MiniportInitialize() entry you registered with
NDIS does not get called?

Correct. The first executable line I have in there is a trace msg. It
does not appear. (Others do)

My tracing is simple, this is a VM and I write to COM1. The hypervisor
spews on its window.

What is the error code in Device Manager associated with your device?

Code 31. Which implies that device manager cannot find the drivers for
this device.

Which is completely confusing since this is supposed to be an ethernet
NIC driver. So I clearly have something completely screwed up.

Is it merely because I didn’t try to configure this NIC device?

Does your PDO correctly ‘start’?

Ummm … errr…

The bus driver loads, starts, and is hard coded to create 2 PDO’s. The
PDO create routine followed the toaster bus sample. Device Manager
tells me that the bus driver is installed and working correctly. Is
this what you meant by PDO start?

Clearly PnP has figured out that your NDIS Miniport driver is the Function
Driver and in all likelyhood has called the AddDevice handler that NDIS
stuck in your PDRIVER_OBJECT.

I just followed the usbnwifi sample, it didn’t add a specific
callback.

However, NDIS does not call MiniportInitialize until the device stack is
‘started’. A whole lot can go wrong (and seemingly may have) before that
point.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter W. Morreale
Sent: Wednesday, December 09, 2009 4:57 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS driver install…

I’m trying to install my ndis driver skeleton and its failing to execute
its Initialize function after insertion.

First I install my bus driver and enumerate a PDO for the ndis driver.
The bus driver seems to install correctly.

When I insert my ndis driver, it seems to install, my DriverEntry is
called and completes with NDIS_STATUS_SUCCESS. (From my trace msgs)

The only interesting thing that I can find in the setupapi log is:

dvi: {Restarting Devices} 13:57:18.062
dvi: Restart: VBUS\TEST_DEV_10
\4&306CFD90&0&10
dvi: Restart complete.
!!! dvi: Device not started: Device has
problem: 0x1f: CM_PROB_FAILED_ADD.
dvi: {Restarting Devices exit} 13:57:18.156

IOW, the log seems to find things ok and match them up with my bus
driver.

I also know that the ‘unload’ callback was executed from a trace msg as
well.

Now this is (basically) the first time I’ve attempted to install so I
certainly could have a problem with the .inf file, I’m working off the
usbnwifi example, with a little netvmini thrown in for good luck.

The DriverEntry calls WdfDriverCreate(), and then
NdisMRegisterMiniportDriver() with the “Type” set to:

NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS

I set all the struct members the same way as usbnwifi does, with my data
or course…

The .inx I use is a modified version of the one also used by usbnwifi.

Any suggestions? I am starting to miss that lovely shade of blue I get
when I first (somewhat) successfully install a driver… :wink:

Thanks,
-PWM


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


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