Re: [ntdev] Re: [ntdev] Question regarding export drivers

For many reasons, the standard kind of driver interfaces in Windows abstract the consuming application(s) from the nature of the hardware that they are using. The driver, by definition, must be cognisant of the hardware and understand how to program it but generally applications should not be.

All that being said, your list of APIs looks suspect. Generally API sets fall into two categories

Acquire, use, release; and

Request, cancel complete

If you have no release API, how can the driver know that a resource can be reused?

In general (and this is very general) Window drivers implement only the second kind of interface as it conforms to the IRP model and the application does not need to know how many hardware resources exist or which one is used.

Sent from Surface Pro

From: Driver Learner
Sent: ‎Monday‎, ‎April‎ ‎13‎, ‎2015 ‎8‎:‎16‎ ‎PM
To: Windows System Software Devs Interest List

Sure Doron.

Let’s say if I have array of similar resources (for convenience, assume four same sized memory blobs) and the driver only maintains which consumer uses which resource and gates access to other resources. Apart from this, there is no other functionality needed.

The list of APIs will be say,

GetResource(consumerId) - returns a resource id

AccessResource(consumerId, resourceId)

PutResource(consumerId, resourceId).

I was trying to check if this simple functionality can be achieved by using simple shared library.

Best regards,

Chakri

On Mon, Apr 13, 2015 at 10:55 AM, Don Burn wrote:

Lets step back and ask the “standard question” why do you wish to use an export driver? I.E. What problem are you trying to solve, by doing this? There are a lot of solutions to code sharing in the kernel, what is the problem you are trying to solve?

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Driver Learner
Sent: Monday, April 13, 2015 1:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Re: [ntdev] Question regarding export drivers

First of all, thanks a lot for the responses. I am so grateful to get responses on such an off topic.

“There’s really no good mechanism to manage a shared export driver across multiple driver packages” - exactly what I found with my experiments and hence the question if the driver can act as both regular driver and export driver.

Doron,
Can you elaborate on load order problems?

If I am able to work around whatever problems are, will such driver be eligible for certification?

Regards,
Chakri

On Mon, Apr 13, 2015 at 4:52 AM, Martin O’Brien wrote:

So true – unless you really need them (which sometimes you do), DLL’s are just more trouble than they are worth, IMO.

mm

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Marion Bond
Sent: Monday, April 13, 2015 7:35 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: [ntdev] Question regarding export drivers

Note that source code can easily be shared via encapsulation in a static library. This produces a duplicated memory footprint, but avoids all load order and versioning issued associated with sharing

Sent from Surface Pro

From: Peter Wieland mailto:xxxxx
Sent: ‎Sunday‎, ‎April‎ ‎12‎, ‎2015 ‎6‎:‎14‎ ‎PM
To: Windows System Software Devs Interest List mailto:xxxxx

There’s really no good mechanism to manage a shared export driver across multiple driver packages. Since, as Doron pointed out, the versioning is done at the package level, it’s very easy for package B, which contains an older version of the export driver, to install and roll the export driver back to something older than package A requires.

PNP also doesn’t know how to shut down an export driver, so when you install package B PNP will copy the export driver, but may not be able to ensure that it unloads and the newer version loads.

Generally the rule is not to try and share drivers between packages.

-p

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, April 11, 2015 9:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding export drivers

1 yes, but it can get a little complicated with respect to load order

2 each package should install the export driver

3 versioning is done at the driver package level for pnp install, not at the binary level, so export drives are versioned by the containing pnp driver package that installs it

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Driver Learner
Sent: Saturday, April 11, 2015 1:49 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question regarding export drivers

Hello Gurus,

I have few questions on export drivers.

1. Can an export driver also implement and act as regular driver?

2. If more than one driver uses the export driver, how should it be packaged for install?

3. How is versioning maintained for the export driver? Is it same as regular driver?

My questions are in pure academic interest and maybe dumb. Please bear with me.

Best regards,

Chakri

— 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


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


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


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


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

— 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


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

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