xxxxx@hotmail.com wrote:
I’m a display driver author. Miniport drivers and Display Drivers cannot call ANY standard Windows NT service routines. In fact, for display drivers, if you even attempt to link to something besides Win32k.sys, Windows will refuse to load your driver and you’ll be stuck in VGA mode. As far as I know the same is true of video miniport drivers.
This is simply *not true*. You are correct about display drivers, but
you are definitely *wrong *about miniports.
It is true that the ntddvdeo.h header file does not include headers for
functions outside of videoprt.sys. However, there are no restrictions
on which APIs a miniport driver may link to. As long as you have a
separate source file that #includes <ntddk.h>, you can call whatever
kernel APIs you wish, and everything will be hunky-dory.
It has to be this way. There has to be an escape hatch. Some video
drivers are simply going to have needs that the port driver doesn’t supply.
The spartan limitations of the display driver environment means that the
escape hatch has to be in the miniport.
Now, Microsoft would *like *you to stick with the videoprt.sys
functions, but they do not prevent you from going outside.
> This ultrarestrictive linkage approach is part of the reason that Microsoft was able to port display drivers out of the kernel and into user mode.
>
Did you mean the reverse? It was the fact that display drivers started
out in user mode that led to them having these severe restrictions, and
indeed it was this architecture that led to the requirement for a
display/miniport split from the beginning.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.</ntddk.h>
xxxxx@gmail.com wrote:
Tim, are you sure that miniport driver can call kernel function?
Yes, I am sure.
As I have understood, I read here
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/25afa8659e9db6e9/055651f73bd54a5c?lnk=gst&q=Miniport+ntddk.h#055651f73bd54a5c
that the video miniport driver can call only VideoXxxx and AgpXxx functions.
This is a philosophy rule, not a technology rule. Display drivers are
limited by force; the operating system will simply refuse to load a
display driver that violates this rule.
Miniport drivers, on the other hand, are limited by convention.
Microsoft would like you to limit yourself to Video and Agp functions,
but nothing enforces this.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
xxxxx@gmail.com wrote:
I still don’t get all kernel resources.
I tried all the ways I can, but I doesn’t work.
How can I define a function in one file and call it from another file? What steps I need to do this?
No. This is something you learn in your first term of C programming.
In fact, I suspect you already know this, but haven’t thought about what
you’re asking. (Hint: how do you call EngCopyBits in your mirror
driver? That’s defined in one file and called from another.)
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> This is simply *not true*. You are correct about display drivers, but> you are definitely *wrong *about miniports.
Hmm, perhaps I am, I’m not sure. I didn’t realize that miniport restrictions were true by convention. I must have misinterpreted the “can only” part of the following from the DDK to mean “is able” and not “should”:
A miniport driver can only make calls exported by videoprt.sys
A dependency view of the video miniport driver in my system shows that it imports standard NT service calls, so I guess you are right about that.
> This ultrarestrictive linkage approach is part of the reason that Microsoft was able to port display drivers out of the kernel and into user mode.> > > > Did you mean the reverse? It was the fact that display drivers started> out in user mode that led to them having these severe restrictions, and> indeed it was this architecture that led to the requirement for a> display/miniport split from the beginning.
No, I mean what I said in this case. Display drivers started in user mode, left user mode, and return to user mode with the advent of Vista. A lot of the driver has to be stripped during this switch (primarily the GDI-related stuff) but a whole bunch of the DX-related stuff can be kept without any problems.
Help yourself to FREE treats served up daily at the Messenger Caf?. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline