views:

456

answers:

4

Hi there!

I am a beginner at DDK/WDM driver developing field. I have a task which involves porting a virtual device driver from x86 to x64 (intel). I got the source code, I modified it a bit and compiled it succesfuly with DDK (build environments). But when I tried to load it on a ia64 Windows7 machine it didn't want to load. Then I tried some simple examples of device drivers from

--http://www.codeproject.com/KB/system/driverdev.aspx (I put '--' to be able to post the hyperlink) and from other links but still the same problem.

I hear on a forum that some libraries that you use to link are not compatible with the new machines and suggested to link to another similar libraries...but still didn't worked.

When I build I use "-cefw" command line parameters as suggested.

I do not have an *.inf file asociated but I'm copying it in system32/drivers and I'm using WinObj to see if next restart it's loaded into the memory.

I also tried this program ( http://www.codeproject.com/KB/system/tdriver.aspx ) to load the driver into the memory but still didn't worked for me.

Please please help me...I'm stuck on this and my deadline already passed. I feel I'driving nuts in here trying to discover what am I doing wrong.

A: 

I did not wrote a driver, but on the basis on what I hear from colleagues: Are your driver digitaly signed? If not, look for information on loading unsigned drivers on 64bit systems.

VitalyVal
No...it is not digitaly signed but I don't think that's it because at one hand it doesn't pop up with the warning/error message of not being digitally signed, on the second I disable the verification on booting and third because I used a program found on web that managed to get me an unverified license and to try to test my driver with that but still nothing.Thanks for your suggestion!Everyone out there ... please help me!
You can't load unsigned drivers under 64 bit windows. You simply can't. Even in test mode you need to sign it with a self signed test certificate. There is no pop up warning. It is impossible to do it without a certificate.
Aram Hăvărneanu
You can use F8 during boot to bypass the driver signature check.
msemack
A: 

Two things:

  1. You mention both x64 (also called x86-64, AMD64, or EMT64) and IA64 (Itanium). You understand they are two completely different architectures, right? Do you have an Itanium System? If not, you should not be compiling anything using the IA-64 build environment. It won't run on a standard PC (32 or 64).

  2. Under 64-bit, the driver must digitally signed for production use. You will need to get an Authenticode certificate from Verisign or similar. For testing purposes, you can bypass the signature check by pressing F8 at boot time. You can also sign with a test certificate.

    http://www.microsoft.com/whdc/winlogo/drvsign/drvsign.mspx

msemack
Even under Test mode, the driver *MUST* be signed by some bogus certificate (ex. test certificate). It won't load unsigned.
Aram Hăvărneanu
Afaik, the pressing F8 bypasses the signature check.
msemack
You are right, but the F8 thing isn't test mode. Test mode can be enabled permanently with bcdedit.
Aram Hăvărneanu
Yes, I know that. I said he could use F8, *OR* he could use a test certificate.
msemack
+1  A: 

Yeahhh ... I was confused about the architectures. Sorry!

So the machine where I tested the driver .sys file was equipped with an Intel 64 bit CPU. That means I can't use DDK build environment at all? If so I should compile it with Visual Studio on that machine, or?

Sorry for the late answer ... and thanks very much!

Cosmin Popescu
Yeahhh ... I was confused about the architectures. Sorry!So the machine where I tested the driver .sys file was equipped with an Intel 64 bit CPU. That means I can't use DDK build environment at all? If so I should compile it with Visual Studio on that machine, or?Sorry for the late answer ... and thanks very much!
You must use the x64 build environment, and you *MUST* sign your driver. If you boot in Test mode, with F8 at boot, you may sign it with a test, self signed certificate. Otherwise you'll need to buy a certificate for around $400 per year.
Aram Hăvărneanu
You *cannot* and *must* not use Visual Studio to build drivers. Always use the WDK.
Aram Hăvărneanu
Based on what you are saying, you don't have an IA64 machine. So you want to use the x64 (AMD64) build target.Yes, you still use the DDK to build it.
msemack
+1  A: 

So, to summarize everything:

  1. You need to build for the corect architecture (x64 for Intel/AMD CPUs).
  2. You MUST sign your driver. You must do this even in test mode with a self signed certificate. There is no alternative.
  3. You MUST use an .inf file to install. If the driver is non-pnp then you don't need an .inf file, but it is very unlikely that the driver is non-pnp. In that case you need to manually create the associated service for the driver in the service control manager with sc.exe or programmatically with the SCM API. If the driver isw pnp (most likely) you must install it via an .inf file (with devcon.exe or other way). Also, installing it is not the same as loading it. For that, the appropriate hardware must be present or you must enumerate it in software (with devcon.exe for exemple).
Aram Hăvărneanu
On point #2, "There is no alternative" is not strictly true, because you can use F8 to bypass the signature check. It can get you by to try a driver out, but it certainly won't be a viable solution to deploy the driver.
msemack