UMDF Timer,

Hi,

Just trying to get to grips with driver development. Working my way through some of the skeletion examples etc.

I’m trying to make a software only UMDF driver and I want a implement a timer so i can do work periodicaily.

Where should this timer be implemented. CMyDriver::Initialize in driver.cpp??
And the function I want the timer to trigger where does could that go.

Maybe I’m trying to run before I can crawel here, so if someone could point be towards some reading material on software only drivers I would be much appricated. Or an Example of a timer implementation would be great.

Have already ordered “Developing Drivers with the Microsoft Windows Driver Foundation” Should i just hold out for that.

Let me preface all of this by saying that I really don’t much about
UMDF.

For WDF, I believe that is all there is at the moment. The OSR book is
forthcoming. It sounds like you’ve got the right idea about how to
begin - using samples and the WDK. Unless you have a specific reason
for using UMDF, it is, in my opinion, probably not the best thing to
learn first. I may be easier or harder; I really don’t know. I don’t
know very much about UMDF. The two issues, in my mind, are that most
drivers can’t be written in UMDF, and, in my opinion, not very many
people on this list are presently using UMDF, and I’m not sure how much
that is going to change among existing driver writers (total opinion),
as the implementation is quite different from KMDF, and, for reasons
that I will never understand, Microsoft has once again chosen to base
another technology on COM. In my mind, that is a real issue, as I’ve
yet to meet the kernel developer who would rather spend his or her time
doing COM. So, all in all, there are considerably fewer resources for
UMDF than KMDF. While the same argument can be made for KMDF v. other
driver styles - and that is a real issue at the moment - in my opinion,
overall, KMDF is well worth it, because it really is nice. If this is
your first driver and you are using software only samples, I personally
would consider starting with a native NT style driver (like IOCTL)
purely as a one time step, because it is less of a learning curve than
KMDF is initially, and then look at KMDF once you feel that you have a
grip on the environment. The reason I say this is because, truth be
told, the real learning curve is going to be learning to use WinDbg for
kernel debugging, and the simplest driver possible as a first step is
paramount. That being said, for software only drivers, all the
frameworks, in my opinion, result in something that is harder to
understand than a native DDK style driver. Once hardware comes in to
play, KMDF is clearly the way to go.

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Wednesday, July 25, 2007 20:32
To: Windows System Software Devs Interest List
Subject: [ntdev] UMDF Timer,

Hi,

Just trying to get to grips with driver development. Working my way
through some of the skeletion examples etc.

I’m trying to make a software only UMDF driver and I want a implement a
timer so i can do work periodicaily.

Where should this timer be implemented. CMyDriver::Initialize in
driver.cpp??
And the function I want the timer to trigger where does could that go.

Maybe I’m trying to run before I can crawel here, so if someone could
point be towards some reading material on software only drivers I would
be much appricated. Or an Example of a timer implementation would be
great.

Have already ordered “Developing Drivers with the Microsoft Windows
Driver Foundation” Should i just hold out for that.


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

xxxxx@yahoo.com wrote:

I’m trying to make a software only UMDF driver and I want a implement a timer so i can do work periodicaily.

I’m not sure that a software-only UMDF driver is possible today. A UMDF
driver is tightly connected to a kernel helper; it doesn’t exist on its
own. And the kernel helpers are only there for a few types of devices
(like USB).

Maybe I’m trying to run before I can crawel here, so if someone could point be towards some reading material on software only drivers I would be much appricated. Or an Example of a timer implementation would be great.

What are you really trying to do?


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

You absolutely can create a software only UMDF driver, that is what the
skeleton driver is. Since a software only driver does not send i/o down
the stack, there is no specialized helper that needs to be used. Back
to the OP question, you don’t want to create the timer in the driver
init routine, you want to create the timer and associate it with the
device. When you implement your device interface, implement
IPnpCallbackSelfManagedIo. In OnSelfManagedIoInit(), create the timer
and start it. In OnSelfManagedIoSuspend stop the timer, in
OnSelfManagedIoSuspend start the timer. That should be it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, July 25, 2007 6:19 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] UMDF Timer,

xxxxx@yahoo.com wrote:

I’m trying to make a software only UMDF driver and I want a implement
a timer so i can do work periodicaily.

I’m not sure that a software-only UMDF driver is possible today. A UMDF
driver is tightly connected to a kernel helper; it doesn’t exist on its
own. And the kernel helpers are only there for a few types of devices
(like USB).

Maybe I’m trying to run before I can crawel here, so if someone could
point be towards some reading material on software only drivers I would
be much appricated. Or an Example of a timer implementation would be
great.

What are you really trying to do?


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


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

I take a bit of exception to what you wrote. UMDF and KMDF are the
same, they present the same rules, structure and programming patterns.
They differ in how they expose their APIs and callbacks, but if you look
at the COM vs flat APIs/callbacks, they match nearly 1:1. As for public
support, both the KMDF and UMDF dev and test teams are on NTDEV and
always ready to help. As for you guys helping UMDF folks, I think that
will grow in time, just like in the beginning very few non MSFT folks
answered KMDF questions.

In my mind, that is a real issue, as I’ve yet to meet the kernel
developer who would rather spend his or her
time doing COM.
You are missing the point. The point of UMDF is to help programmers
used to COM and writing normal UM applications to be able to write
driver, to lower the barrier of entry in writing a UMDF driver. Having
a KM driver writer move up and dealing with COM was secondary.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin O’Brien
Sent: Wednesday, July 25, 2007 5:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] UMDF Timer,

Let me preface all of this by saying that I really don’t much about
UMDF.

For WDF, I believe that is all there is at the moment. The OSR book is
forthcoming. It sounds like you’ve got the right idea about how to
begin - using samples and the WDK. Unless you have a specific reason
for using UMDF, it is, in my opinion, probably not the best thing to
learn first. I may be easier or harder; I really don’t know. I don’t
know very much about UMDF. The two issues, in my mind, are that most
drivers can’t be written in UMDF, and, in my opinion, not very many
people on this list are presently using UMDF, and I’m not sure how much
that is going to change among existing driver writers (total opinion),
as the implementation is quite different from KMDF, and, for reasons
that I will never understand, Microsoft has once again chosen to base
another technology on COM. In my mind, that is a real issue, as I’ve
yet to meet the kernel developer who would rather spend his or her time
doing COM. So, all in all, there are considerably fewer resources for
UMDF than KMDF. While the same argument can be made for KMDF v. other
driver styles - and that is a real issue at the moment - in my opinion,
overall, KMDF is well worth it, because it really is nice. If this is
your first driver and you are using software only samples, I personally
would consider starting with a native NT style driver (like IOCTL)
purely as a one time step, because it is less of a learning curve than
KMDF is initially, and then look at KMDF once you feel that you have a
grip on the environment. The reason I say this is because, truth be
told, the real learning curve is going to be learning to use WinDbg for
kernel debugging, and the simplest driver possible as a first step is
paramount. That being said, for software only drivers, all the
frameworks, in my opinion, result in something that is harder to
understand than a native DDK style driver. Once hardware comes in to
play, KMDF is clearly the way to go.

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Wednesday, July 25, 2007 20:32
To: Windows System Software Devs Interest List
Subject: [ntdev] UMDF Timer,

Hi,

Just trying to get to grips with driver development. Working my way
through some of the skeletion examples etc.

I’m trying to make a software only UMDF driver and I want a implement a
timer so i can do work periodicaily.

Where should this timer be implemented. CMyDriver::Initialize in
driver.cpp??
And the function I want the timer to trigger where does could that go.

Maybe I’m trying to run before I can crawel here, so if someone could
point be towards some reading material on software only drivers I would
be much appricated. Or an Example of a timer implementation would be
great.

Have already ordered “Developing Drivers with the Microsoft Windows
Driver Foundation” Should i just hold out for that.


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

Martin O’Brien wrote:

…for reasons
that I will never understand, Microsoft has once again chosen to base
another technology on COM. In my mind, that is a real issue, as I’ve
yet to meet the kernel developer who would rather spend his or her time
doing COM.

This is a unhealthy exaggeration. COM is very little more than a
standard way of using C++ virtual functions. The whole “interface”
concept is incredibly useful, because it allows you to limit the
dependencies between objects to narrow and well-defined contracts. It
doesn’t matter how my object is architected internally; as long as I
implement the IBaseFilter interface properly, every DirectShow
application in the world can use it.

Further, audio, multimedia, and kernel streaming drivers have used a
COM-like architecture for years.


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

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Tim Roberts[SMTP:xxxxx@probo.com]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, July 26, 2007 8:07 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] UMDF Timer,

This is a unhealthy exaggeration. COM is very little more than a
standard way of using C++ virtual functions. The whole “interface”
concept is incredibly useful, because it allows you to limit the
dependencies between objects to narrow and well-defined contracts. It
doesn’t matter how my object is architected internally; as long as I
implement the IBaseFilter interface properly, every DirectShow
application in the world can use it.

Don’t you need a window and process messages to use COM? It may not be a problem for full application but when we develop a library (both static and dynamic) which’d our or customers’ apps (including console) use, we try to avoid it whenever possible. Yes, there can be hidden window and thread created by library but it leads to unclean design.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

Michal Vodicka wrote:

> This is a unhealthy exaggeration. COM is very little more than a
> standard way of using C++ virtual functions. The whole “interface”
> concept is incredibly useful, because it allows you to limit the
> dependencies between objects to narrow and well-defined contracts. It
> doesn’t matter how my object is architected internally; as long as I
> implement the IBaseFilter interface properly, every DirectShow
> application in the world can use it.
>
>
Don’t you need a window and process messages to use COM?

No, not at all. Many people have a strangely inflated idea of what COM
is. There are certainly sophisticated COM services and scenarios in
which you need to exchange messages, but that’s just a support service.
The basic “interface” concept doesn’t take any operating system support
at all.


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

Fair enough, Doron, about COM, that is. My assumption was that the dev
was interested in learning to write drivers in general, which is why I
said UMDF might not be the best choice in that case, but I definitely
see your point about going from user to kernel. My statement about
support for UMDF is based on reading this list, because there is to date
one book on the subject, and fewer samples in the WDK. In my opinion,
there is more material about KMDF than UMDF, and it’s not even close. I
don’t personally see any obvious reason why that would change, but, as
you correctly pointed out, I hadn’t considered the idea of user mode
developers writing drivers. I have to say that I still have my doubts,
but only time will tell.

Overall, what I was trying to say was that, assuming interest in drivers
in general (which may not be correct), given that he knows neither, I
would personally chose KMDF over UMDF.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Thursday, July 26, 2007 12:40
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] UMDF Timer,

I take a bit of exception to what you wrote. UMDF and KMDF are the
same, they present the same rules, structure and programming patterns.
They differ in how they expose their APIs and callbacks, but if you look
at the COM vs flat APIs/callbacks, they match nearly 1:1. As for public
support, both the KMDF and UMDF dev and test teams are on NTDEV and
always ready to help. As for you guys helping UMDF folks, I think that
will grow in time, just like in the beginning very few non MSFT folks
answered KMDF questions.

In my mind, that is a real issue, as I’ve yet to meet the kernel
developer who would rather spend his or her
time doing COM.
You are missing the point. The point of UMDF is to help programmers
used to COM and writing normal UM applications to be able to write
driver, to lower the barrier of entry in writing a UMDF driver. Having
a KM driver writer move up and dealing with COM was secondary.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin O’Brien
Sent: Wednesday, July 25, 2007 5:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] UMDF Timer,

Let me preface all of this by saying that I really don’t much about
UMDF.

For WDF, I believe that is all there is at the moment. The OSR book is
forthcoming. It sounds like you’ve got the right idea about how to
begin - using samples and the WDK. Unless you have a specific reason
for using UMDF, it is, in my opinion, probably not the best thing to
learn first. I may be easier or harder; I really don’t know. I don’t
know very much about UMDF. The two issues, in my mind, are that most
drivers can’t be written in UMDF, and, in my opinion, not very many
people on this list are presently using UMDF, and I’m not sure how much
that is going to change among existing driver writers (total opinion),
as the implementation is quite different from KMDF, and, for reasons
that I will never understand, Microsoft has once again chosen to base
another technology on COM. In my mind, that is a real issue, as I’ve
yet to meet the kernel developer who would rather spend his or her time
doing COM. So, all in all, there are considerably fewer resources for
UMDF than KMDF. While the same argument can be made for KMDF v. other
driver styles - and that is a real issue at the moment - in my opinion,
overall, KMDF is well worth it, because it really is nice. If this is
your first driver and you are using software only samples, I personally
would consider starting with a native NT style driver (like IOCTL)
purely as a one time step, because it is less of a learning curve than
KMDF is initially, and then look at KMDF once you feel that you have a
grip on the environment. The reason I say this is because, truth be
told, the real learning curve is going to be learning to use WinDbg for
kernel debugging, and the simplest driver possible as a first step is
paramount. That being said, for software only drivers, all the
frameworks, in my opinion, result in something that is harder to
understand than a native DDK style driver. Once hardware comes in to
play, KMDF is clearly the way to go.

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Wednesday, July 25, 2007 20:32
To: Windows System Software Devs Interest List
Subject: [ntdev] UMDF Timer,

Hi,

Just trying to get to grips with driver development. Working my way
through some of the skeletion examples etc.

I’m trying to make a software only UMDF driver and I want a implement a
timer so i can do work periodicaily.

Where should this timer be implemented. CMyDriver::Initialize in
driver.cpp??
And the function I want the timer to trigger where does could that go.

Maybe I’m trying to run before I can crawel here, so if someone could
point be towards some reading material on software only drivers I would
be much appricated. Or an Example of a timer implementation would be
great.

Have already ordered “Developing Drivers with the Microsoft Windows
Driver Foundation” Should i just hold out for that.


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

>Don’t you need a window and process messages to use COM?

Only in some specific cases, and in these cases the necessary window is created
by COM internally. There is no requirement of having even 1 CreateWindow call
in your app code to use COM.

static and dynamic) which’d our or customers’ apps (including console) use, we
try to avoid it whenever possible. Yes, there can be hidden window and thread
created by library but it leads to unclean design.

This hidden window will be created by ole32.dll itself from CoInitialize(Ex),
if needed.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com