Welcome to MSDN Blogs Sign in | Join | Help

Pointless Blathering

Peter Wieland's thoughts on Windows driver development, and occasional rants about computing in general.
Not sure where to post a question?

If you have a question that's not related to any of the current blog entries, or aren't sure where to post a question, you can add it as a comment to this one.

Posted: Thursday, December 07, 2006 7:52 AM by PeterWie

Comments

Peter Gerrard said:

Hi there,

I'm trying to run the DTM "Unlassified Driver" tests for signing a very simple UMDF-based driver, but get stuck when running the pnpdtest (which is also in the WDK Tools directory).

It fails early on with a message "Unable to install filter driver...", and even has a file e:\vrtmtest\testsrc\basetest\pnp\pnpdtest\user\pnpdtest.c line:318.

Any suggestions on why this filter driver can not be installed? Something I need to implement in the UMDF framework? Any clues will be appreciated.

Thanks, Peter

# January 31, 2007 7:42 PM

Frankie said:

Hi- I am running WinXP, and was going through my Services because I got an error on reboot, and I see this "Windows User Mode Driver Framework" is set to start automatically, but there are no dependencies on it. A Google search turns up the fact that it is supposed to be a part of Vista, not XP, so I am thinking it probably got installed by Windows Update for some reason (as far as I know, I didn't install it - and I only choose to install the mandatory security updates) and that's why I am getting these errors. I would like to know if I can safely turn this off - I wasn't having any driver problems and I don't know why it was even installed on my machine. As a user, I really wonder what the decision process is for a piece of software like this to be installed for no reason onto a config that is working. This is a home PC that is used for basic tasks, I really do not want all the latest stuff, I can't see having any need for a piece of code that was written for Vista being installed onto my working XP. If you guys get paid based upon how many copies are downloaded, that should be changed, because it is a huge waste of time from my standpoint. I deal with technology for my job, and the process for maintaining Linux boxes is so much easier than with you guys - please pass my feedback up the chain, thanks. And also, can you tell me if I can remove this :-) ?

# February 3, 2007 6:24 PM

Frankie said:

Just an update. I disabled the "Windows User Mode Driver Framework" service and stopped it and my machine seems to be running fine (slightly faster response time in the UI also, but that may be due to some of the other services I turned off)

# February 3, 2007 7:28 PM

PeterWie said:

The PNPD test installs an upper filter driver on the device stack that it's testing.  Due to an oversight on our part we didn't add this to the list of allowed kernel-mode filter drivers for UMDF (the two entries on that list are the XP and Vista driver verifier).  So when PNPD test installs its upper filter the reflector sees this and refuses to start the device.

We're looking at getting the test fixed so that it will work with UMDF devices.  Sorry about that.

# February 5, 2007 4:57 PM

PeterWie said:

Frankie,

UMDF is available for XP as well as Vista.  It's typically installed when you install a device driver that needs it.  It also installs with Windows Media Player 11 to support media players that require it.

There's an older version which shipped with WMP 10 that provided the same sort of support.  I believe that one started by default (since it provided RPC calls that WMP 10 would depend on) so it's possible that it's the one you had installed.

I'd be amazed if either of these services had any impact on your system performance.  When idle they should be able to swap out entirely - i can't see how they'd bog down your UI responsiveness.

# February 5, 2007 5:05 PM

Frankie said:

Thanks for the reply, Peter.

Just out of curiosity, aside from DRM reasons, why would you ever want drivers to run in the user space? Is that the purpose of this code? To do DRM checks?

# February 7, 2007 2:32 AM

PeterWie said:

DRM has nothing to do with it.  The question you should ask yourself is why would you ever want drivers to run in the kernel space.  You've got some binary blob from a company you've never heard of that came with a USB device you bought at the store.  Why would you want to trust that blob of code to behave properly when running in the kernel.

There are a number of other reasons - it's easier to do the development, you can do it on a single machine (no bugchecks means you can safely run your test driver on your dev machine), your driver is isolated from other drivers which may misbehave, etc...

But the main reason is that you don't really want to run any more code in the kernel than you have to.

-p

# February 7, 2007 11:44 AM

Frankie said:

Wouldn't you expect faster performance if they are running in the kernel?

# February 10, 2007 6:30 PM

pilgrim9684 said:

I have been involved with a trade study using the real-time extension to Windows XP provided by Ardence Inc. called RTX. I am pleased with its real-time performance and the fact that my application can literally own the CPU for as long as it needs to do perform critical real-time tasks and to respond to interrupts on peripherla cards in a deterministic manner. I am running into some problems with IRQ assignments though for some of my PCI cards. I think the ACPI feature is getting in the way. Anyone familiar with RTX that can discuss this?

# February 10, 2007 7:12 PM

PeterWie said:

Frankie,

There is some extra overhead involved in moving the I/O to and from user-mode.  But it's a myth that kernel-mode code somehow "runs faster" than user-mode code.

And while a kernel-mode driver does have less overhead than a user-mode one, it's also a bigger risk to the end-user.  How much "performance" do you really need out of your keyboard driver?  Now balance that against the risk of some random keyboard filter driver that came with your keyboard having a bug and crashing your computer.

# February 12, 2007 11:50 AM

PeterWie said:

Pilgrim,

There are a number of community forrums listed on the left side of my blog (Driver Forums).  I would suggest that you ask your question on one of those.  This isn't really the right place to start a general discussion.

# February 12, 2007 11:51 AM

John Smith said:

For a Remote Control application, I need to simulate the "Secure Attention Sequence" (Ctrl-Alt-Delete), as the way used to work for XP doesn't work with Vista, I'm thinking about writing a UMDF instead of modifying the DDK WDM kbfilter. Do you know if there is some kind of HID supervisor which could block the SAS? (We really need to simulate the SAS, as it is required for log-in start on Vista machines operating on a Windows domain).

Thank you!

# March 3, 2007 6:01 PM

dzagar said:

I would like to use winusb driver from the perspective it was designed to be used - user mode application development. Default winusb.h and winusbio.h recurse deeply into the WinDDK source (header) tree, and there is no linkage library (.lib) available for Visual Studio.

Is there any kind of wapper available in the source code that would wrap all necessary things needed for application development without the need for WinDDK installation - in other words - straight from the Visual Studio :)

Thanks!

# March 8, 2007 10:36 AM

fredrik said:

Hi, I wan´t to build an application in C# that uses the winusb.dll, has someone ever tryed this? I can´t find any examples anywhere!

# March 21, 2007 9:21 AM

soumya said:

Hi,

I ve developed a simple upper filter driver for CDROM.I want to get responses on the debugview while reading and writting to the cdrom. But i am not getting any message over thr.

I used the devcon to install the driver.

And also I tried with create service,open service start service etc to install it. But none is working.

I am new to this area. Please help in solving this.

Thanks in advance,

Soumya

# May 11, 2007 1:07 AM

PeterWie said:

Soumya,

There is a storage filter driver sample in the WDK that you could probably start from (src\storage\filter\diskperf).  There is also a sample tool called "addfilter" in the src\storage\filter directory that will add your filter driver to a device.  I would suggest you start there.

There are generally two ways to install a filter driver:

1 - Install the filter files and service in the INF for the device & set one of the filter registry keys to list your filter driver.  See http://msdn2.microsoft.com/en-us/library/ms791322.aspx for an example.  This works best when you own the function driver for the device as well.

2 - Use a programatic tool like addFilter to modify the configuration for an already installed device stack.  

3 - Set your filter as a device-class filter so that it loads automatically on all instances of that device class.

# May 11, 2007 1:03 PM

alishoev said:

We are writing a special plotter driver and we are seeing some

strange things when we are looking at the GLYPHPOS structures being sent to OEMTextOut call...

 The glyphs start out their position correctly but at some point we get a negative Y coordinates or the offsets for the Y coordinates restart at low numbers and all text lines are getting mixed.

We noticed that it starts happening when Y > 7200 in

*PrintableArea: PAIR(7200, 7200) of GPD file

We need to support big table sizes 48x48 inches and have to have a good text quality for small fonts so we need to set

 *DPI: PAIR(1200,1200)

 *TextDPI: PAIR(1200, 1200)

If we set DPI for lower number Windows programs like Corel returns low quality Text. Setting DPI for low resolution but TextDPI for high resolution doesn't make text better. Are there any limitation on DPI * Y Size?

Any help would be greatly appreciated.

# May 16, 2007 10:44 PM

PeterWie said:

Alishoev,

I don't know anything about display devices so i can't help with that.  But there are several links on the left hand side of the page for community resources (newgroup & the ntdev mailing list) where you could ask this question.

Thanks,

-p

# May 17, 2007 11:23 AM

nkutty said:

Hi Peter,

Has there been any resolution wrt to the PNPD test failure for UMDF devices?

Can you provide guidance for obtaining WHQL certification for UMDF devices? In our case, it's for a SideShow device.

thanks,

Nanda

# July 2, 2007 5:31 PM

Nike said:

Hi everyone,

I want to write a UMDF driver.

I have a usb device,i want to send data to the device,the device can show

some information after the device receive the data.

I installed the driver.(windowssideshowbasicedriver.dll and windowssideshowbasicedriver.inf)

I want to debug the UMDF driver, so i can get a feel for how the driver works.

I do as follows.

First,install the windbg and set the HostProcessDbgBreakOnStart to 0x00000004(4).

Second,open the debugging environment.Start-All Programs-WDK-WDK6000-Build Environments-Windows Vista and windows server Longhorn x86 Checked Build Environment,

right click on the icon for the debugger, and choose “run as administrator”.

Change the directory to c:\program files\debugging Tools for windows,run windbg -pn WUDFHost.exe.

But it show,

"There is more than one 'WUDFHost.exe' process running .Find the process ID of the instance are interested in and use -p<pid>."

So i run follow command

tasklist.exe

I can see two WUDFHose.exe image , one WUDFHost PID  Session Name is 2408, other is  3032.

When i run windbg -p 2408 or windbg -p 3032 ,it will show

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\ntdll.dll -

ntdll!DbgBreakPoint:

77aa2ea8 cc              int     3

What is worry with this ?

Can you hele me ?

Thanks!

I get the debug information from  http://msdn2.microsoft.com/en-us/library/aa510991.aspx

but i can not success.

# July 4, 2007 9:37 PM

mintyice said:

I am trying to download WDK and I have an XP.

I went to MS Connect and I saw 2008 server and Vista.

Is 2008 server one compatible with XP?

# October 14, 2007 4:39 AM

feretich said:

I am writing a Windows XP (& later) WDM kernel driver for a USB device. The device sends asynchronous messages from a bulk transfer endpoint. I am trying to keep a read operation posted continuously to this endpoint. There are two major questions for which I need to find answers to move forward on the design.

Reads to this endpoint are accomplished via asynchronous Irps (created by IoAllocateIrp). If I receive certain messages, I need to quickly (in <8msec) send a message to a different endpoint. To meet this timing requirement, I have structured my ReadIrpCompletion routine (expected to be running at the DISPATCH_LEVEL) to:

1) Parse the received message.

2) If the message requires an immediate response, then start a write operation to the outbound pipe (this operation uses its own Irp.) by calling IoCallDriver with an appropriate URB.

3) Then reissue the read for the next inbound message by calling IoCallDriver reusing the original URB and Irp.

4) Perform some cleanup and queue management, then return STATUS_MORE_PROCESSING_REQUIRED.

My questions are:

1) When my ReadIrpCompletion routine reissues the read (step 3) is it possible that the lower level USB driver will call my ReadIrpCompletion routine to process the completion of the second read before it returns to me.

2) At what point does the lower level USB driver throw away an inbound message? That is, if a new inbound message(s) arrives during step 1 or 2 will I receive it when I issue the read in step 3?

Thanks,

Bob Feretich

# October 19, 2007 1:03 AM

feretich said:

After considering the problem for a day, I’m thinking that my best route is to have the ReadIrpCompletion routine reissue its Irp to read the next inbound message in a DPC. That way ReadIrpCompletion routine cannot be re-entered before it returns, thus making my design insensitive to the answers to the questions that I previously posed.

I still would appreciate your thoughts though.

Thanks,

Bob Feretich

# October 20, 2007 12:06 AM

krishhh said:

Hi,

I'm writing a driver for a storage controller. And I was thinking of doing it the WDF way. Are there any plans to move the ataport/+miniport (msahci & atapi.sys) to KMDF? If I want to do it by myself, which class drivers needs to be re-written? Any suggestions/opinions are most welcome. Thanks in anticipation.

# December 19, 2007 5:47 PM

Simon ATex said:

Hi Peter,

I'm a new new comer on driver land :(. After I read some introduction docs from MSDN about UMDF, I have some question I don't know where I can ask. Could you please help me?

1. Can I write a User-Mode driver to control copying some files (located by Database) to terminal devices like USB, DVD,...?

2. I know we can use Win32API in UMDF, but I don't know I can access to database by ADO here.

Thanks,

Simon.

# October 7, 2008 11:38 AM

alexlihk said:

Dear Expert,

I want to capture the disk change. How can I start to program storage addfilter?

which book I should read or any example for writing simple filter?

thx.

alexli

alexli@bizcon.org

# October 17, 2008 2:22 AM
Anonymous comments are disabled
Page view tracker