Symbolic Link for raw PDO

Hi,

Is it possible create symbolic link for raw PDO?
I tried to use WdfDeviceCreateSymbolicLink(), but the error 0xc0000184(STATUS_INVALID_DEVICE_STATE) is returned.

Thank you,

My answer on the forum was insufficient?

d

Bent from my Phone


From: xxxxx@rambler.rumailto:xxxxx
Sent: ?6/?20/?2013 4:23 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Symbolic Link for raw PDO

Hi,

Is it possible create symbolic link for raw PDO?
I tried to use WdfDeviceCreateSymbolicLink(), but the error 0xc0000184(STATUS_INVALID_DEVICE_STATE) is returned.

Thank you,


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

You keep in mind this message?
“Use the symlink name as the filename to createfile, not the name of the pdo
(which is an NT name not visible to user mode which is why symbolic link names
exist). Look at the enum exe in the toaster sample on how to enumerate instances
of the device interface and open them.”

Yes, probably have to go that route. Although it is not the answer to my original question.

You know… you could always just call IoCreateSymbolicLink if the KMDF interface isn’t sufficient. You WOULD need the name of the PDO in order to call that.

I’m not sure why WdfDeviceCreateSymbolicLink wouldn’t work with a raw PDO, but if it doesn’t I’m sure it’s by design.

Peter
OSR

It will work, but for the API to work, we rely on IoGetDevice Property to get the pdo name to link to (for all device toles, fdo, pdo). Since that API requires a reported pdo, you can’t assign a symlink on a pdo immediately after creation. The workaround is to register an EvtDeviceSelfMAnagedIoInit callback on the pdo (not the parent!) and register the symlink then.

d

Bent from my Phone


From: xxxxx@osr.commailto:xxxxx
Sent: ?6/?21/?2013 6:08 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Symbolic Link for raw PDO

You know… you could always just call IoCreateSymbolicLink if the KMDF interface isn’t sufficient. You WOULD need the name of the PDO in order to call that.

I’m not sure why WdfDeviceCreateSymbolicLink wouldn’t work with a raw PDO, but if it doesn’t I’m sure it’s by design.

Peter
OSR


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

Clever.

Thanks Doron. Good to know.

Peter
OSR

“The workaround is to register an EvtDeviceSelfMAnagedIoInit callback
on the pdo (not the parent!) and register the symlink then.”

Thanks Doron! It works.

If possible, have one more question.
Is it possible to change the deviceId raw PDO after its creation and, accordingly, inform the PNP manager?

Regards,

No, its id is its id. Why do you want to change it after reporting it?

d

Bent from my Phone


From: xxxxx@rambler.rumailto:xxxxx
Sent: ?6/?27/?2013 8:35 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Symbolic Link for raw PDO

“The workaround is to register an EvtDeviceSelfMAnagedIoInit callback
on the pdo (not the parent!) and register the symlink then.”

Thanks Doron! It works.

If possible, have one more question.
Is it possible to change the deviceId raw PDO after its creation and, accordingly, inform the PNP manager?

Regards,


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

I would like to re-create without PDO load FDO driver for the device or unload it. That is trivial to change the device type.
Probably more appropriate to create another PDO with the “right” device id?

What bigger problem are you trying to solve?

d

Bent from my Phone


From: xxxxx@rambler.rumailto:xxxxx
Sent: ?6/?27/?2013 10:07 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Symbolic Link for raw PDO

I would like to re-create without PDO load FDO driver for the device or unload it. That is trivial to change the device type.
Probably more appropriate to create another PDO with the “right” device id?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

It is driver of the network device, which can be in different states. Depending on the device state it must be available for user via FDO driver or not. In any case it must be accessed via IOCTL interface.

Thank you for your patience,

Reenumerate the pdo

d

Bent from my Phone


From: xxxxx@rambler.rumailto:xxxxx
Sent: ?6/?28/?2013 4:33 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Symbolic Link for raw PDO

It is driver of the network device, which can be in different states. Depending on the device state it must be available for user via FDO driver or not. In any case it must be accessed via IOCTL interface.

Thank you for your patience,


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

(1) Is it possible start/stop the network protocol driver from another driver in kernel mode?
(2) Or is it possible represented the network protocol driver as the PnP driver?

> (1) Is it possible start/stop the network protocol driver from another driver in kernel mode?

Any driver can be a network protocol, i.e. to have a network protocol lower edge.

This does not impose any requirements on how the driver is loaded etc.

Actually, “network protocol” in Windows is “a kernel module which talks to network at raw MAC level”. Any driver can.

The only requirements is to communicate to NDIS in the code (NdisRegisterProtocol etc), AND register the driver properly as a protocol at install time. There is an INF syntax for this, as also IBindCfg family of COM interfaces.

(2) Or is it possible represented the network protocol driver as the PnP driver?

Surely yes. With root-enumerated PDOs, for instance.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Thank you! Could you tell me the key points of the network protocol inf-file to support PnP driver management?

> Thank you! Could you tell me the key points of the network protocol inf-file to support PnP driver

Network protocol driver automatically supports PnP and Power on adapter devices, provided it is developed to a modern version of NDIS.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com