Allocating driver extension in kmdf driver

Hi Dears,
Its my first post. Please help me.

I have faced a critical problem while I am porting a camera card wdm
driver to
WDF(KMDF) driver. I was allocating my driver extension using
IoAllocateDriverObjectExtension in my old wdm driver. How the same will
be done in KMDF?

thanks&rgrds
sreejeshs

Every WDF object may have one (or more) contexts associated with it, which are the equivalent of driver object extensions (or device extensions, or file object extensions, etc…)

Lookup the macro WDF_DECLARE_CONTEXT_TYPE for an example of how to declare a context and to specify the context that goes with an object when you allocate it.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sreejesh S. Warrier
Sent: Tuesday, June 24, 2008 4:52 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Allocating driver extension in kmdf driver

Hi Dears,
Its my first post. Please help me.

I have faced a critical problem while I am porting a camera card wdm
driver to
WDF(KMDF) driver. I was allocating my driver extension using
IoAllocateDriverObjectExtension in my old wdm driver. How the same will
be done in KMDF?

thanks&rgrds
sreejeshs


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

Like peter said you can allocate a WDF based context on the WDFDRIVER, but it is important to know if you really need a driver extension. Who consumes the driver extension that you created? If it is some port driver, you need to keep the io driver extension, if it is only your code, you should use the context on the WDFDRIVER object

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Tuesday, June 24, 2008 8:21 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Allocating driver extension in kmdf driver

Every WDF object may have one (or more) contexts associated with it, which are the equivalent of driver object extensions (or device extensions, or file object extensions, etc…)

Lookup the macro WDF_DECLARE_CONTEXT_TYPE for an example of how to declare a context and to specify the context that goes with an object when you allocate it.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sreejesh S. Warrier
Sent: Tuesday, June 24, 2008 4:52 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Allocating driver extension in kmdf driver

Hi Dears,
Its my first post. Please help me.

I have faced a critical problem while I am porting a camera card wdm
driver to
WDF(KMDF) driver. I was allocating my driver extension using
IoAllocateDriverObjectExtension in my old wdm driver. How the same will
be done in KMDF?

thanks&rgrds
sreejeshs


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

Sreejesh S. Warrier wrote:

I have faced a critical problem while I am porting a camera card wdm
driver to WDF(KMDF) driver. I was allocating my driver extension using
IoAllocateDriverObjectExtension in my old wdm driver. How the same will
be done in KMDF?

Very few drivers need a driver extension. Remember that there is only
one driver extension in the entire system, no matter how many devices it
is handling. It is, essentially, just like using a global variable.
Most drivers need to use a device extension, not a driver extension.

What are you storing in the driver extension?


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

> Remember that there is only

one driver extension in the entire system, no matter how many devices it
is handling.

There can be many (1+) driver object extensions associated with ay DRIVER_OBJECT. Say port driver allocates a drv_obj_ext for miniport driver A’s drv_obj. it doesn’t prohibit miniport A from allocating another drv_obj_ext for his drv_obj iif he wants to.

But I agree that OP may not really need a drvobjext unless he is writing some sort of port driver.


Calvin Guan
Principal Engineer
NetXtreme 10Gbps Converged NIC Bus Driver
Broadcom Corporation
Connecting Everything(r)

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Sreejesh S. Warrier wrote:
>>
>> I have faced a critical problem while I am porting a camera card wdm
>> driver to WDF(KMDF) driver. I was allocating my driver extension using
>> IoAllocateDriverObjectExtension in my old wdm driver. How the same will
>> be done in KMDF?
>>
>
> Very few drivers need a driver extension. Remember that there is only
> one driver extension in the entire system, no matter how many devices it
> is handling. It is, essentially, just like using a global variable.
> Most drivers need to use a device extension, not a driver extension.
>
> What are you storing in the driver extension?
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>

There was using a ClientIdentificationAddress to get driver
extension(IoGetDriverObjectExtension) in WDM.
But now in KMDF there is no such unique identifier.
Why does it so? (Please consider I am very new to WDF driver writing
world)

thanks
sreejeshs

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com
mailto:xxxxx ] On Behalf Of Peter Wieland
Sent: Tuesday, June 24, 2008 8:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Allocating driver extension in kmdf driver

Every WDF object may have one (or more) contexts associated with it,
which are the equivalent of driver object extensions (or device
extensions, or file object extensions, etc…)

Lookup the macro WDF_DECLARE_CONTEXT_TYPE for an example of how to
declare a context and to specify the context that goes with an object
when you allocate it.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com
mailto:xxxxx] On Behalf Of Sreejesh S.
Warrier
Sent: Tuesday, June 24, 2008 4:52 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Allocating driver extension in kmdf driver

Hi Dears,
Its my first post. Please help me.

I have faced a critical problem while I am porting a camera card wdm
driver to
WDF(KMDF) driver. I was allocating my driver extension using
IoAllocateDriverObjectExtension in my old wdm driver. How the same will
be done in KMDF?

thanks&rgrds
sreejeshs


NTDEV is sponsored by OSR

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

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


NTDEV is sponsored by OSR

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

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

What port driver are you linking against? Who defined ClientIdentificationAddress?

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sreejesh S. Warrier
Sent: Thursday, June 26, 2008 11:45 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Allocating driver extension in kmdf driver

There was using a ClientIdentificationAddress to get driver extension(IoGetDriverObjectExtension) in WDM.
But now in KMDF there is no such unique identifier.
Why does it so? (Please consider I am very new to WDF driver writing world)

thanks
sreejeshs

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Tuesday, June 24, 2008 8:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Allocating driver extension in kmdf driver

Every WDF object may have one (or more) contexts associated with it, which are the equivalent of driver object extensions (or device extensions, or file object extensions, etc…)

Lookup the macro WDF_DECLARE_CONTEXT_TYPE for an example of how to declare a context and to specify the context that goes with an object when you allocate it.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sreejesh S. Warrier
Sent: Tuesday, June 24, 2008 4:52 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Allocating driver extension in kmdf driver

Hi Dears,
Its my first post. Please help me.

I have faced a critical problem while I am porting a camera card wdm driver to
WDF(KMDF) driver. I was allocating my driver extension using IoAllocateDriverObjectExtension in my old wdm driver. How the same will be done in KMDF?

thanks&rgrds
sreejeshs


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


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