hi Calvin:
I just posted another question but I see your email answered most of my questions - thank you for the detailed response. I was using the mirror driver and was trying to call ExAllocatePool with tag in the mirror driver’s display driver. I actually created a static library that wrapped the call to ExAllocatePool and linked against it (specified this lib TARGETLIB in the sources files of the display driver.)
I will try your suggestion of calling EngAllocMem.
Do you have a suggestion on how to recover my machine? When I ran with the driver with the call made to the export library that contained a function that wrapped ExAllocatePool, I got a nasty Message Box saying my viga driver was out of date and it was reverting back to a default vga driver. I uninstalled the mirror driver and whacked the mirror.dll and mirror.sys in my c:\windows\system32 and c:\windows\system32\drivers directories, rebooted, and reinstalled an old version of the driver that didn’t link to the export lib. But, things are very hosed. I never reach the DrvEscape function in the mirror display driver any longer. (I have KdPrints in there and an _asm int 3 and have a testapp that makes a driver escape call.)I guess the OS refuses to load it with the default vga driver it said it was going to run. I did try renaming mirror.dll and mirror.sys to mirror_0.dll and mirror_0.sys as well, but no luck.
I’m will try to locate the correct vga display driver for my PC (it’s really old) or resort to reimaging my PC, but hope you have some other suggestions. It’s a painful way to recover.
By the way, what does “session based” mean? This is the first time I’m doing anything with video drivers.
thanks for the helpful responses!
----- Original Message -----
From: Calvin Guan
To: Windows System Software Devs Interest List
Sent: Sunday, July 17, 2005 2:07 PM
Subject: Re: [ntdev] Where do I find Microsoft’s gexport.exe sample?
By “Video Driver”, there are two very distinctive:
- MINIPORT driver (general kernel mode) that links to
ntoskrnl/hal, videoprt.sys
- DISPLAY DRIVER (session based kernel mode) that
only links to win32k.sys.
Which one do you mean? You can only call GDI
functions (EngXxx) in a kernel mode DISPLAY DRIVER and
exported DLL that’s going to be loaded by the DISPLAY
DRIVER. That’s to say, 1) if you call
ExAllocatePoolWithTag in a DISPLAY DRIVER, GDI won’t
load it. 2) If you call ExAllocatePoolWithTag in a
kernel mode DLL, your DISPLAY DRIVER can NOT load it
(EngLoadImage will fail.) These behaviors are by
design and are enforced by GDI loader.
On the flip side, calling GDI andor DISPLAY DRIVER
functions from MINIPORT drivers is bad in general. It
can be done safely in some cases with some additional
work. (Remember GDI is session based where MINIPORT
isn’t)
To allocate memory in DISPLAY DRIVER (GDI), use
EngAllocMem. To do it in MINIPORT driver, use
VideoPortAllocatePool. If you want to do something in
the display driver that GDI doesn’t facilitate, you
send an IOCTL to the miniport driver and let the
MINIPORT does it (if videoport allowed). Perhaps I
didn’t fully understand what you are trying to do?
Humble opinion from a former ATI Radeon Graphics
Driver developer.
–
Calvin Guan (Windows DDK MVP)
Staff SW Engineer NetXtreme MINIPORT
Broadcom Corp. Irvine, CA
www.broadcom.com
— “S. Drasnin” wrote:
> hi
>
> I am looking for the Microsoft sample gexport.exe
> that shows you how to create a kernel export dll and
> import functions in it into a video driver. A old
> driver posting on the web said it was on an ftp
> site, but that was years ago.
>
> Can somebody (maybe some Microsoft folks?) point me
> to where I can find it or send me a zip file?
>
> I’ve found out the hard way that my driver fails to
> link because I’m calling things like
> ExAllocatePoolWithTag, and apparently calling HAL
> Functions from a video driver isn’t allowed, hence
> the export dll route.
>
> thanks in advance…
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown
> lmsubst tag argument: ‘’
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@msn.com
To unsubscribe send a blank email to xxxxx@lists.osr.com