Use of a Device Extension!

Hello

I am writing a WDM driver and I have some global data structures (DS) which
has to
be accessed by various functions in my driver. I had planned to store it in
my Device Extension and pass my device object to each of those functions,
which
access these global DS. I find it little tedious to pass it to each of these
functions. is there a way to get away from this?

I dont think I have a way of accessing my device object from any point in my
driver (without passing it). I am used to working with an RTOS kind of
envt.,
where if i have a global variable, it can be accessed by any function. Here
in
windows, if i create a global variable, it will be global only within that
process context. But if I need a variable to be accessed across processes,
then
I have to store it in a shared memory.

I was also told that using Device extension is a better option than using
shared memory
to share the data structures. Will somebody advise as to which is the better
and suitable option for sharing global data structues writing windows
drivers?

Thanks a lot
Venky


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Your driver can have data objects that are link object global. Just declare
them outside of function scope. Your device extensions are a good place to
put information that is specific to a particular device object (your driver
could have more than one device object.) Device extensions are in general
NOT a good place to put information that is global across and/or independent
of each device object managed by your driver.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Varadan Venkatesh [mailto:xxxxx@tataelxsi.co.in]
Sent: Wednesday, May 02, 2001 6:01 AM
To: NT Developers Interest List
Subject: [ntdev] Use of a Device Extension!

Hello

I am writing a WDM driver and I have some global data structures (DS) which
has to
be accessed by various functions in my driver. I had planned to store it in
my Device Extension and pass my device object to each of those functions,
which
access these global DS. I find it little tedious to pass it to each of these
functions. is there a way to get away from this?

I dont think I have a way of accessing my device object from any point in my
driver (without passing it). I am used to working with an RTOS kind of
envt.,
where if i have a global variable, it can be accessed by any function. Here
in
windows, if i create a global variable, it will be global only within that
process context. But if I need a variable to be accessed across processes,
then
I have to store it in a shared memory.

I was also told that using Device extension is a better option than using
shared memory
to share the data structures. Will somebody advise as to which is the better
and suitable option for sharing global data structues writing windows
drivers?

Thanks a lot
Venky


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Note that Win2K has threads and processes. If you just use threads, you can
share global variables, provided of course you watch out for synchronization
issues. If you need processes, however, that’s a different story. But shared
globals are a bit dirty, they can be a source of problems, are you sure you
want to go that way ?

Incidentally - and I don’t want to open a religious war here - this is the
situation where a bit of C++ might come in handy. If your Device Extension
is an object, not just a data structure, wherever it goes, the member
functions go with it. All you need is one pointer.

Hope this helps,

Alberto.

-----Original Message-----
From: Varadan Venkatesh [mailto:xxxxx@tataelxsi.co.in]
Sent: Wednesday, May 02, 2001 6:01 AM
To: NT Developers Interest List
Subject: [ntdev] Use of a Device Extension!

Hello

I am writing a WDM driver and I have some global data structures (DS) which
has to
be accessed by various functions in my driver. I had planned to store it in
my Device Extension and pass my device object to each of those functions,
which
access these global DS. I find it little tedious to pass it to each of these
functions. is there a way to get away from this?

I dont think I have a way of accessing my device object from any point in my
driver (without passing it). I am used to working with an RTOS kind of
envt.,
where if i have a global variable, it can be accessed by any function. Here
in
windows, if i create a global variable, it will be global only within that
process context. But if I need a variable to be accessed across processes,
then
I have to store it in a shared memory.

I was also told that using Device extension is a better option than using
shared memory
to share the data structures. Will somebody advise as to which is the better
and suitable option for sharing global data structues writing windows
drivers?

Thanks a lot
Venky


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Can you expatiate on “a bit dirty”? I’ve heard that sort of thing before
but never heard a good account of the reasons behind it.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Well, if multiple threads can write to a shared variable, we need
synchronization. Synchronization eats resources. Synchronization is
error-prone. It’s easy to introduce programming errors that leave windows of
opportunity for access conflicts. A shared variable becomes a resource that
can, given the right sequence of events, lead to a deadlock. In
multiprocessor systems, access to shared variables may generate a
bottleneck. If in the long run you add new threads to your system, and those
threads need access to the shared variable, you may end up having to change
the synchronization mechanism for the whole system. It may be my personal
bias, but I prefer message passing to shared variables!

Alberto.

-----Original Message-----
From: James Antognini [mailto:antognini@us.ibm.com]
Sent: Thursday, May 03, 2001 10:51 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

Can you expatiate on “a bit dirty”? I’ve heard that sort of thing before
but never heard a good account of the reasons behind it.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

OK, I know what you mean about shared resources. I was thinking more
specifically of variables in a C (eg, driver) program, outside the scope
of any function in that program, the ones that go into the module’s
writeable storage. For example, it’s handy to save a pointer to the
driver object in a global program variable, since any routine can locate
the driver object with minimum effort; but no routine updates the
variable once it is set by DriverEntry.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I’m a C++ convert, so I would probably use a static member variable for this
kind of thing: write it once in DriverEntry, everyone else reads it. Or
better, I might make the routines be member functions of my driver object,
meaning, make it a real object! That would carry the routines with the
object, wherever the object goes. But then, I’m a graphics guy, I don’t have
that much experience with WDM drivers.

Alberto.

-----Original Message-----
From: James Antognini [mailto:antognini@us.ibm.com]
Sent: Thursday, May 03, 2001 11:56 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

OK, I know what you mean about shared resources. I was thinking more
specifically of variables in a C (eg, driver) program, outside the scope
of any function in that program, the ones that go into the module’s
writeable storage. For example, it’s handy to save a pointer to the
driver object in a global program variable, since any routine can locate
the driver object with minimum effort; but no routine updates the
variable once it is set by DriverEntry.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Global data is not ‘a bit dirty’. If your driver has global state - that is
state that is shared across device objects - that state should be stored in
global data structures. Trying to wedge such information into per-device
object storage would be silly. Device extensions are excellent for storing
device object specific state, and that is essentially all they are good for.

Of course global data structures need to be protected from re-entrancy
issues, as do all of your data structures that can be accessed by multiple
threads of execution, e.g. device extensions, so there is no difference
there. Global data does introduce locking hierarchy issues that cannot be
ignored, as any thread that accesses both device extension data and global
data will have to acquire separate locks for both data objects.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: James Antognini [mailto:antognini@us.ibm.com]
Sent: Thursday, May 03, 2001 11:56 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

OK, I know what you mean about shared resources. I was thinking more
specifically of variables in a C (eg, driver) program, outside the scope
of any function in that program, the ones that go into the module’s
writeable storage. For example, it’s handy to save a pointer to the
driver object in a global program variable, since any routine can locate
the driver object with minimum effort; but no routine updates the
variable once it is set by DriverEntry.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Alberto,

isn’t it a bit religious? There is no real difference between C global and
static member variables if used the way James mentioned. Also, driver object
makes no change. There are the same synchronization issues mentioned in
another mails. The only difference is compiler checking and object
encapsulation which of course can be an advantage but you need address to
driver object whenever you want access globals (you can store it to global
pointer :). Globals aren’t a bit dirty if used correctly.

Michal

P.S. Just curious: do you convert SoftICE code to C++?

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
Reply To: NT Developers Interest List
Sent: Thursday, May 03, 2001 6:07 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

I’m a C++ convert, so I would probably use a static member variable for
this
kind of thing: write it once in DriverEntry, everyone else reads it. Or
better, I might make the routines be member functions of my driver object,
meaning, make it a real object! That would carry the routines with the
object, wherever the object goes. But then, I’m a graphics guy, I don’t
have
that much experience with WDM drivers.

Alberto.

-----Original Message-----
From: James Antognini [mailto:antognini@us.ibm.com]
Sent: Thursday, May 03, 2001 11:56 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

OK, I know what you mean about shared resources. I was thinking more
specifically of variables in a C (eg, driver) program, outside the scope
of any function in that program, the ones that go into the module’s
writeable storage. For example, it’s handy to save a pointer to the
driver object in a global program variable, since any routine can locate
the driver object with minimum effort; but no routine updates the
variable once it is set by DriverEntry.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

It’s a question of personal preference, yes. I don’t like writable globals,
not in a multithreaded environment. But a static member variable is only
visible inside the class, and I find that a great sanity check. A writable
global inside a class, which can only be accessible by member functions of
that class, is, give or take, a monitor - a great synchronization concept,
one of the best. But then, it doesn’t need to be global, it can be addressed
through pointers to the object itself, and that can be an effective way of
serializing.

And SoftIce itself is an older animal, we still have plenty of machine code
in there! Newer drivers, such as the TrueTime driver, however, are written
in C++. Most of the samples in DriverWorks and DriverNetworks are also
written in C++.

Alberto.

-----Original Message-----
From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
Sent: Thursday, May 03, 2001 4:07 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

Alberto,

isn’t it a bit religious? There is no real difference between C global and
static member variables if used the way James mentioned. Also, driver object
makes no change. There are the same synchronization issues mentioned in
another mails. The only difference is compiler checking and object
encapsulation which of course can be an advantage but you need address to
driver object whenever you want access globals (you can store it to global
pointer :). Globals aren’t a bit dirty if used correctly.

Michal

P.S. Just curious: do you convert SoftICE code to C++?

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
Reply To: NT Developers Interest List
Sent: Thursday, May 03, 2001 6:07 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

I’m a C++ convert, so I would probably use a static member variable for
this
kind of thing: write it once in DriverEntry, everyone else reads it. Or
better, I might make the routines be member functions of my driver object,
meaning, make it a real object! That would carry the routines with the
object, wherever the object goes. But then, I’m a graphics guy, I don’t
have
that much experience with WDM drivers.

Alberto.

-----Original Message-----
From: James Antognini [mailto:antognini@us.ibm.com]
Sent: Thursday, May 03, 2001 11:56 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

OK, I know what you mean about shared resources. I was thinking more
specifically of variables in a C (eg, driver) program, outside the scope
of any function in that program, the ones that go into the module’s
writeable storage. For example, it’s handy to save a pointer to the
driver object in a global program variable, since any routine can locate
the driver object with minimum effort; but no routine updates the
variable once it is set by DriverEntry.


James Antognini
IBM Watson Research


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Just out of curiosity Alberto , in what way did you used C++ ? As a superset
of C , or you abused it’s OOP capabilites ?

Dan
----- Original Message -----
From: “Moreira, Alberto”
To: “NT Developers Interest List”
Sent: Thursday, May 03, 2001 11:27 PM
Subject: [ntdev] Re: Use of a Device Extension!

> It’s a question of personal preference, yes. I don’t like writable
globals,
> not in a multithreaded environment. But a static member variable is only
> visible inside the class, and I find that a great sanity check. A writable
> global inside a class, which can only be accessible by member functions of
> that class, is, give or take, a monitor - a great synchronization concept,
> one of the best. But then, it doesn’t need to be global, it can be
addressed
> through pointers to the object itself, and that can be an effective way of
> serializing.
>
> And SoftIce itself is an older animal, we still have plenty of machine
code
> in there! Newer drivers, such as the TrueTime driver, however, are written
> in C++. Most of the samples in DriverWorks and DriverNetworks are also
> written in C++.
>
> Alberto.
> =========================================
>
>
> -----Original Message-----
> From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
> Sent: Thursday, May 03, 2001 4:07 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> Alberto,
>
> isn’t it a bit religious? There is no real difference between C global and
> static member variables if used the way James mentioned. Also, driver
object
> makes no change. There are the same synchronization issues mentioned in
> another mails. The only difference is compiler checking and object
> encapsulation which of course can be an advantage but you need address to
> driver object whenever you want access globals (you can store it to global
> pointer :). Globals aren’t a bit dirty if used correctly.
>
> Michal
>
> P.S. Just curious: do you convert SoftICE code to C++?
>
> Best regards,
>
> Michal Vodicka
> Veridicom
> (RKK - Skytale)
> [WWW: http://www.veridicom.com , http://www.skytale.com]
>
>
>
> > ----------
> > From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
> > Reply To: NT Developers Interest List
> > Sent: Thursday, May 03, 2001 6:07 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> > I’m a C++ convert, so I would probably use a static member variable for
> > this
> > kind of thing: write it once in DriverEntry, everyone else reads it. Or
> > better, I might make the routines be member functions of my driver
object,
> > meaning, make it a real object! That would carry the routines with the
> > object, wherever the object goes. But then, I’m a graphics guy, I don’t
> > have
> > that much experience with WDM drivers.
> >
> > Alberto.
> >
> >
> > -----Original Message-----
> > From: James Antognini [mailto:antognini@us.ibm.com]
> > Sent: Thursday, May 03, 2001 11:56 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> >
> > OK, I know what you mean about shared resources. I was thinking more
> > specifically of variables in a C (eg, driver) program, outside the scope
> > of any function in that program, the ones that go into the module’s
> > writeable storage. For example, it’s handy to save a pointer to the
> > driver object in a global program variable, since any routine can locate
> > the driver object with minimum effort; but no routine updates the
> > variable once it is set by DriverEntry.
> >
> > –
> > James Antognini
> > IBM Watson Research
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@compuware.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@rkk.cz
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: danp@jb.rdsor.ro
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yes, I agree. For writeable globals I use similar approach in C if it makes
sense. Object programming is a way of thinking and mostly language
independent.

I wanted to point out there is nothing bad with global variables in drivers.
It can be common feeling; years before when I wrote the first driver after
DDK reading I was also confused and tried to store everything in device
extension. When my driver became more complicated it caused many problems
and globals solved everything. It was something in DDK which induced my
feeling that globals in drivers is bad evil. Nope, they are appropriate for
global driver data as in any other program.

In quite unrelated note today I’ve got a mail with a link to famous “Real
Programmers don’t use Pascal” article:
http://www.engelschall.com/u/sb/realmen/. 30 years old and still applicable
:wink:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
Reply To: NT Developers Interest List
Sent: Thursday, May 03, 2001 10:27 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

It’s a question of personal preference, yes. I don’t like writable
globals,
not in a multithreaded environment. But a static member variable is only
visible inside the class, and I find that a great sanity check. A writable
global inside a class, which can only be accessible by member functions of
that class, is, give or take, a monitor - a great synchronization concept,
one of the best. But then, it doesn’t need to be global, it can be
addressed
through pointers to the object itself, and that can be an effective way of
serializing.

And SoftIce itself is an older animal, we still have plenty of machine
code
in there! Newer drivers, such as the TrueTime driver, however, are written
in C++. Most of the samples in DriverWorks and DriverNetworks are also
written in C++.

Alberto.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The TrueTime driver uses C++ pretty efficiently, and the data reduction
library abuses of STL. I didn’t write the DriverWorks or DriverNetworks
code, so I can’t really say. The compiler I’m writing is totally OOP,
there’s little if any resemblance to a plain vanilla C program.

Alberto.

-----Original Message-----
From: Dan Partelly [mailto:danp@jb.rdsor.ro]
Sent: Thursday, May 03, 2001 5:21 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

Just out of curiosity Alberto , in what way did you used C++ ? As a superset
of C , or you abused it’s OOP capabilites ?

Dan
----- Original Message -----
From: “Moreira, Alberto”
To: “NT Developers Interest List”
Sent: Thursday, May 03, 2001 11:27 PM
Subject: [ntdev] Re: Use of a Device Extension!

> It’s a question of personal preference, yes. I don’t like writable
globals,
> not in a multithreaded environment. But a static member variable is only
> visible inside the class, and I find that a great sanity check. A writable
> global inside a class, which can only be accessible by member functions of
> that class, is, give or take, a monitor - a great synchronization concept,
> one of the best. But then, it doesn’t need to be global, it can be
addressed
> through pointers to the object itself, and that can be an effective way of
> serializing.
>
> And SoftIce itself is an older animal, we still have plenty of machine
code
> in there! Newer drivers, such as the TrueTime driver, however, are written
> in C++. Most of the samples in DriverWorks and DriverNetworks are also
> written in C++.
>
> Alberto.
> =========================================
>
>
> -----Original Message-----
> From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
> Sent: Thursday, May 03, 2001 4:07 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> Alberto,
>
> isn’t it a bit religious? There is no real difference between C global and
> static member variables if used the way James mentioned. Also, driver
object
> makes no change. There are the same synchronization issues mentioned in
> another mails. The only difference is compiler checking and object
> encapsulation which of course can be an advantage but you need address to
> driver object whenever you want access globals (you can store it to global
> pointer :). Globals aren’t a bit dirty if used correctly.
>
> Michal
>
> P.S. Just curious: do you convert SoftICE code to C++?
>
> Best regards,
>
> Michal Vodicka
> Veridicom
> (RKK - Skytale)
> [WWW: http://www.veridicom.com , http://www.skytale.com]
>
>
>
> > ----------
> > From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
> > Reply To: NT Developers Interest List
> > Sent: Thursday, May 03, 2001 6:07 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> > I’m a C++ convert, so I would probably use a static member variable for
> > this
> > kind of thing: write it once in DriverEntry, everyone else reads it. Or
> > better, I might make the routines be member functions of my driver
object,
> > meaning, make it a real object! That would carry the routines with the
> > object, wherever the object goes. But then, I’m a graphics guy, I don’t
> > have
> > that much experience with WDM drivers.
> >
> > Alberto.
> >
> >
> > -----Original Message-----
> > From: James Antognini [mailto:antognini@us.ibm.com]
> > Sent: Thursday, May 03, 2001 11:56 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> >
> > OK, I know what you mean about shared resources. I was thinking more
> > specifically of variables in a C (eg, driver) program, outside the scope
> > of any function in that program, the ones that go into the module’s
> > writeable storage. For example, it’s handy to save a pointer to the
> > driver object in a global program variable, since any routine can locate
> > the driver object with minimum effort; but no routine updates the
> > variable once it is set by DriverEntry.
> >
> > –
> > James Antognini
> > IBM Watson Research
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@compuware.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@rkk.cz
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: danp@jb.rdsor.ro
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Alberto,
Can you please point to a good discussion on the DriverWorks.
It looks like an excelent library, especially when you are tired of DDK.
I haven’t used it until now but I’m willing to give it a try.
Regards,
Stas.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Moreira, Alberto
Sent: Thursday, May 03, 2001 11:37 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

The TrueTime driver uses C++ pretty efficiently, and the data reduction
library abuses of STL. I didn’t write the DriverWorks or DriverNetworks
code, so I can’t really say. The compiler I’m writing is totally OOP,
there’s little if any resemblance to a plain vanilla C program.

Alberto.

-----Original Message-----
From: Dan Partelly [mailto:danp@jb.rdsor.ro]
Sent: Thursday, May 03, 2001 5:21 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Use of a Device Extension!

Just out of curiosity Alberto , in what way did you used C++ ? As a superset
of C , or you abused it’s OOP capabilites ?

Dan
----- Original Message -----
From: “Moreira, Alberto”
To: “NT Developers Interest List”
Sent: Thursday, May 03, 2001 11:27 PM
Subject: [ntdev] Re: Use of a Device Extension!

> It’s a question of personal preference, yes. I don’t like writable
globals,
> not in a multithreaded environment. But a static member variable is only
> visible inside the class, and I find that a great sanity check. A writable
> global inside a class, which can only be accessible by member functions of
> that class, is, give or take, a monitor - a great synchronization concept,
> one of the best. But then, it doesn’t need to be global, it can be
addressed
> through pointers to the object itself, and that can be an effective way of
> serializing.
>
> And SoftIce itself is an older animal, we still have plenty of machine
code
> in there! Newer drivers, such as the TrueTime driver, however, are written
> in C++. Most of the samples in DriverWorks and DriverNetworks are also
> written in C++.
>
> Alberto.
> =========================================
>
>
> -----Original Message-----
> From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
> Sent: Thursday, May 03, 2001 4:07 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> Alberto,
>
> isn’t it a bit religious? There is no real difference between C global and
> static member variables if used the way James mentioned. Also, driver
object
> makes no change. There are the same synchronization issues mentioned in
> another mails. The only difference is compiler checking and object
> encapsulation which of course can be an advantage but you need address to
> driver object whenever you want access globals (you can store it to global
> pointer :). Globals aren’t a bit dirty if used correctly.
>
> Michal
>
> P.S. Just curious: do you convert SoftICE code to C++?
>
> Best regards,
>
> Michal Vodicka
> Veridicom
> (RKK - Skytale)
> [WWW: http://www.veridicom.com , http://www.skytale.com]
>
>
>
> > ----------
> > From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
> > Reply To: NT Developers Interest List
> > Sent: Thursday, May 03, 2001 6:07 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> > I’m a C++ convert, so I would probably use a static member variable for
> > this
> > kind of thing: write it once in DriverEntry, everyone else reads it. Or
> > better, I might make the routines be member functions of my driver
object,
> > meaning, make it a real object! That would carry the routines with the
> > object, wherever the object goes. But then, I’m a graphics guy, I don’t
> > have
> > that much experience with WDM drivers.
> >
> > Alberto.
> >
> >
> > -----Original Message-----
> > From: James Antognini [mailto:antognini@us.ibm.com]
> > Sent: Thursday, May 03, 2001 11:56 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> >
> > OK, I know what you mean about shared resources. I was thinking more
> > specifically of variables in a C (eg, driver) program, outside the scope
> > of any function in that program, the ones that go into the module’s
> > writeable storage. For example, it’s handy to save a pointer to the
> > driver object in a global program variable, since any routine can locate
> > the driver object with minimum effort; but no routine updates the
> > variable once it is set by DriverEntry.
> >
> > –
> > James Antognini
> > IBM Watson Research
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@compuware.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@rkk.cz
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: danp@jb.rdsor.ro
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@powernetsys.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Stas,

You can check on
http://www.numega.com/drivercentral/previews/previews.shtml

DriverWorks is a library for NT and WDM drivers, which is currently
shipped with NuMega DriverStudio Suite. Another new library you might
want to check is DriverNetworks, which is targeted for NDIS and TDI
drivers.
Both are C++ frameworks, which come with a code wizard support,
Visual Studio IDE integration, and more; W98/ME/NT/W2K/XP targets.

  • Vitaly

On 05/06/01, ““stas” ” wrote:
> Hi Alberto,
> Can you please point to a good discussion on the DriverWorks.
> It looks like an excelent library, especially when you are tired of DDK.
> I haven’t used it until now but I’m willing to give it a try.
> Regards,
> Stas.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Moreira, Alberto
> Sent: Thursday, May 03, 2001 11:37 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> The TrueTime driver uses C++ pretty efficiently, and the data reduction
> library abuses of STL. I didn’t write the DriverWorks or DriverNetworks
> code, so I can’t really say. The compiler I’m writing is totally OOP,
> there’s little if any resemblance to a plain vanilla C program.
>
> Alberto.
>
> -----Original Message-----
> From: Dan Partelly [mailto:danp@jb.rdsor.ro]
> Sent: Thursday, May 03, 2001 5:21 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> Just out of curiosity Alberto , in what way did you used C++ ? As a superset
> of C , or you abused it’s OOP capabilites ?
>
> Dan
> ----- Original Message -----
> From: “Moreira, Alberto”
> To: “NT Developers Interest List”
> Sent: Thursday, May 03, 2001 11:27 PM
> Subject: [ntdev] Re: Use of a Device Extension!
>
>
> > It’s a question of personal preference, yes. I don’t like writable
> globals,
> > not in a multithreaded environment. But a static member variable is only
> > visible inside the class, and I find that a great sanity check. A writable
> > global inside a class, which can only be accessible by member functions of
> > that class, is, give or take, a monitor - a great synchronization concept,
> > one of the best. But then, it doesn’t need to be global, it can be
> addressed
> > through pointers to the object itself, and that can be an effective way of
> > serializing.
> >
> > And SoftIce itself is an older animal, we still have plenty of machine
> code
> > in there! Newer drivers, such as the TrueTime driver, however, are written
> > in C++. Most of the samples in DriverWorks and DriverNetworks are also
> > written in C++.
> >
> > Alberto.
> > =========================================
> >
> >
> > -----Original Message-----
> > From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
> > Sent: Thursday, May 03, 2001 4:07 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Use of a Device Extension!
> >
> >
> > Alberto,
> >
> > isn’t it a bit religious? There is no real difference between C global and
> > static member variables if used the way James mentioned. Also, driver
> object
> > makes no change. There are the same synchronization issues mentioned in
> > another mails. The only difference is compiler checking and object
> > encapsulation which of course can be an advantage but you need address to
> > driver object whenever you want access globals (you can store it to global
> > pointer :). Globals aren’t a bit dirty if used correctly.
> >
> > Michal
> >
> > P.S. Just curious: do you convert SoftICE code to C++?
> >
> > Best regards,
> >
> > Michal Vodicka
> > Veridicom
> > (RKK - Skytale)
> > [WWW: http://www.veridicom.com , http://www.skytale.com]
> >
> >
> >
> > > ----------
> > > From: Moreira, Alberto[SMTP:xxxxx@compuware.com]
> > > Reply To: NT Developers Interest List
> > > Sent: Thursday, May 03, 2001 6:07 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] Re: Use of a Device Extension!
> > >
> > > I’m a C++ convert, so I would probably use a static member variable for
> > > this
> > > kind of thing: write it once in DriverEntry, everyone else reads it. Or
> > > better, I might make the routines be member functions of my driver
> object,
> > > meaning, make it a real object! That would carry the routines with the
> > > object, wherever the object goes. But then, I’m a graphics guy, I don’t
> > > have
> > > that much experience with WDM drivers.
> > >
> > > Alberto.
> > >
> > >
> > > -----Original Message-----
> > > From: James Antognini [mailto:antognini@us.ibm.com]
> > > Sent: Thursday, May 03, 2001 11:56 AM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] Re: Use of a Device Extension!
> > >
> > >
> > > OK, I know what you mean about shared resources. I was thinking more
> > > specifically of variables in a C (eg, driver) program, outside the scope
> > > of any function in that program, the ones that go into the module’s
> > > writeable storage. For example, it’s handy to save a pointer to the
> > > driver object in a global program variable, since any routine can locate
> > > the driver object with minimum effort; but no routine updates the
> > > variable once it is set by DriverEntry.
> > >
> > > –
> > > James Antognini
> > > IBM Watson Research
> > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@compuware.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@rkk.cz
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@compuware.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: danp@jb.rdsor.ro
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@powernetsys.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com