display mirror driver problem

Posted: 10-30-2003, 04:06 AM
I write a display mirror driver for capturing screen .
In this driver, I create a share memory and force GDI to output to this
memory with 16bit bitmap format. In user mode application, I read this
memory again to view the bitmap.

But, there is something wrong when the whole system memory utilization
becomes high, the bitmap becomes incorrect partly.

I'm sure it's the driver bug, Not user mode application bug!

Someone help me?!



Reply With Quote

Responses to "display mirror driver problem"

Tadd
Guest
Posts: n/a
 
Re: display mirror driver problem
Posted: 11-03-2003, 07:50 AM
How are you sharing (locking, etc.) your memory?

Your memory size and how it might be paged or swapped would be the first
thing I'd investigate and trial & error (for example, try allocating it to
be much larger -- do you see corruption earlier? i.e., maybe not on screen,
but if you zero the off-screen bytes and perhaps put in a quick loop to
check and ensure all those are zero... it being dependent on high system mem
usage seems very suspect)

"bubzhang news" wrote:
> I write a display mirror driver for capturing screen .
> In this driver, I create a share memory and force GDI to output to this
> memory with 16bit bitmap format. In user mode application, I read this
> memory again to view the bitmap.
>
> But, there is something wrong when the whole system memory utilization
> becomes high, the bitmap becomes incorrect partly.
>
> I'm sure it's the driver bug, Not user mode application bug!
>
> Someone help me?!

Reply With Quote
Nadav
Guest
Posts: n/a
 
Display Mirror Driver Problem
Posted: 02-11-2004, 10:24 PM
Hi,

I am trying to write a Display mirror driver based on the sample provided
with the DDK, I am trying to add some C++ classes to the sample. Defining a
class at global scope ( statically ) without calling any of it's functions
causes the driver to stop loading. no exception is being cached by WinDbg,
or NuMegas Visual SoftIce, I really want to use C++ with my driver... I
guess the problem related to the way the class is allocated in memory (
global scope ) as defining the class in a function scope doesn't produce the
problem. What may cause this problem? how could this problem be resolved?
any clues pointers or directions will be appreciated.

Nadav.


Reply With Quote
Brian Catlin
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-12-2004, 12:28 AM
"Nadav" <not@today> wrote in message
news:OIMKL3O8DHA.1948@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I am trying to write a Display mirror driver based on the sample provided
> with the DDK, I am trying to add some C++ classes to the sample. Defining a
> class at global scope ( statically ) without calling any of it's functions
> causes the driver to stop loading. no exception is being cached by WinDbg,
> or NuMegas Visual SoftIce, I really want to use C++ with my driver... I
> guess the problem related to the way the class is allocated in memory (
> global scope ) as defining the class in a function scope doesn't produce the
> problem. What may cause this problem? how could this problem be resolved?
> any clues pointers or directions will be appreciated.

The use of C++ in drivers is unsupported

-Brian

Brian Catlin, Sannas Consulting 310-944-9492
Windows Network, Video, WDM Device Driver Training & Consulting
See WWW.AZIUS.COM.bad for courses and scheduling
REMOVE .BAD FROM EMAIL AND WEB ADDRESS


Reply With Quote
Nadav
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-12-2004, 08:22 AM
Well, NuMegas DriverWorks include a whole bunch of C++ classes for driver
development... although no classes that provide video driver infer are
included.


"Brian Catlin" <brianc@sannas.org.bad> wrote in message
news:OASyf8P8DHA.1632@TK2MSFTNGP12.phx.gbl...
> "Nadav" <not@today> wrote in message
> news:OIMKL3O8DHA.1948@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I am trying to write a Display mirror driver based on the sample
provided
> > with the DDK, I am trying to add some C++ classes to the sample.
Defining a
> > class at global scope ( statically ) without calling any of it's
functions
> > causes the driver to stop loading. no exception is being cached by
WinDbg,
> > or NuMegas Visual SoftIce, I really want to use C++ with my driver... I
> > guess the problem related to the way the class is allocated in memory (
> > global scope ) as defining the class in a function scope doesn't produce
the
> > problem. What may cause this problem? how could this problem be
resolved?
> > any clues pointers or directions will be appreciated.
>
>
> The use of C++ in drivers is unsupported
>
> -Brian
>
> Brian Catlin, Sannas Consulting 310-944-9492
> Windows Network, Video, WDM Device Driver Training & Consulting
> See WWW.AZIUS.COM.bad for courses and scheduling
> REMOVE .BAD FROM EMAIL AND WEB ADDRESS
>
>

Reply With Quote
Philip Taylor [ATI]
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-12-2004, 02:57 PM
thats a separate product from the DDK.

one products requirements are most definitely not anothers.

"Nadav" <Not@today.com> wrote in message
news:O4KplGU8DHA.2832@tk2msftngp13.phx.gbl...
> Well, NuMegas DriverWorks include a whole bunch of C++ classes for driver
> development... although no classes that provide video driver infer are
> included.
>
>
> "Brian Catlin" <brianc@sannas.org.bad> wrote in message
> news:OASyf8P8DHA.1632@TK2MSFTNGP12.phx.gbl...
> > "Nadav" <not@today> wrote in message
> > news:OIMKL3O8DHA.1948@TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > I am trying to write a Display mirror driver based on the sample
> provided
> > > with the DDK, I am trying to add some C++ classes to the sample.
> Defining a
> > > class at global scope ( statically ) without calling any of it's
> functions
> > > causes the driver to stop loading. no exception is being cached by
> WinDbg,
> > > or NuMegas Visual SoftIce, I really want to use C++ with my driver...
I
> > > guess the problem related to the way the class is allocated in memory
(
> > > global scope ) as defining the class in a function scope doesn't
produce
> the
> > > problem. What may cause this problem? how could this problem be
> resolved?
> > > any clues pointers or directions will be appreciated.
> >
> >
> > The use of C++ in drivers is unsupported
> >
> > -Brian
> >
> > Brian Catlin, Sannas Consulting 310-944-9492
> > Windows Network, Video, WDM Device Driver Training & Consulting
> > See WWW.AZIUS.COM.bad for courses and scheduling
> > REMOVE .BAD FROM EMAIL AND WEB ADDRESS
> >
> >
>
>

Reply With Quote
Nadav
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-12-2004, 03:28 PM
So.. Please Fix me if I am wrong, Development of Video mirror drivers cannot be done with C++ while other drivers can be written using C++.

"Philip Taylor [ATI]" <ptaylor@online.newsgroup-poster.ati.com> wrote in message news:OGKi7hX8DHA.1428@TK2MSFTNGP12.phx.gbl...
> thats a separate product from the DDK.
>
> one products requirements are most definitely not anothers.
>
> "Nadav" <Not@today.com> wrote in message
> news:O4KplGU8DHA.2832@tk2msftngp13.phx.gbl...
> > Well, NuMegas DriverWorks include a whole bunch of C++ classes for driver
> > development... although no classes that provide video driver infer are
> > included.
> >
> >
> > "Brian Catlin" <brianc@sannas.org.bad> wrote in message
> > news:OASyf8P8DHA.1632@TK2MSFTNGP12.phx.gbl...
> > > "Nadav" <not@today> wrote in message
> > > news:OIMKL3O8DHA.1948@TK2MSFTNGP12.phx.gbl...
> > > > Hi,
> > > >
> > > > I am trying to write a Display mirror driver based on the sample
> > provided
> > > > with the DDK, I am trying to add some C++ classes to the sample.
> > Defining a
> > > > class at global scope ( statically ) without calling any of it's
> > functions
> > > > causes the driver to stop loading. no exception is being cached by
> > WinDbg,
> > > > or NuMegas Visual SoftIce, I really want to use C++ with my driver...
> I
> > > > guess the problem related to the way the class is allocated in memory
> (
> > > > global scope ) as defining the class in a function scope doesn't
> produce
> > the
> > > > problem. What may cause this problem? how could this problem be
> > resolved?
> > > > any clues pointers or directions will be appreciated.
> > >
> > >
> > > The use of C++ in drivers is unsupported
> > >
> > > -Brian
> > >
> > > Brian Catlin, Sannas Consulting 310-944-9492
> > > Windows Network, Video, WDM Device Driver Training & Consulting
> > > See WWW.AZIUS.COM.bad for courses and scheduling
> > > REMOVE .BAD FROM EMAIL AND WEB ADDRESS
> > >
> > >
> >
> >
>
>
Reply With Quote
Brian Catlin
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-12-2004, 06:41 PM
You may get it to work, but you will get absolutely no support from Microsoft. If you are determined to use C++, talk to NuMega, and see what kind of support they can give you - especially for video drivers

-Brian


"Nadav" <Not@today.com> wrote in message news:Olzzt0X8DHA.2480@TK2MSFTNGP10.phx.gbl...
So.. Please Fix me if I am wrong, Development of Video mirror drivers cannot be done with C++ while other drivers can be written using C++.

"Philip Taylor [ATI]" <ptaylor@online.newsgroup-poster.ati.com> wrote in message news:OGKi7hX8DHA.1428@TK2MSFTNGP12.phx.gbl...
> thats a separate product from the DDK.
>
> one products requirements are most definitely not anothers.
>
> "Nadav" <Not@today.com> wrote in message
> news:O4KplGU8DHA.2832@tk2msftngp13.phx.gbl...
> > Well, NuMegas DriverWorks include a whole bunch of C++ classes for driver
> > development... although no classes that provide video driver infer are
> > included.
> >
> >
> > "Brian Catlin" <brianc@sannas.org.bad> wrote in message
> > news:OASyf8P8DHA.1632@TK2MSFTNGP12.phx.gbl...
> > > "Nadav" <not@today> wrote in message
> > > news:OIMKL3O8DHA.1948@TK2MSFTNGP12.phx.gbl...
> > > > Hi,
> > > >
> > > > I am trying to write a Display mirror driver based on the sample
> > provided
> > > > with the DDK, I am trying to add some C++ classes to the sample.
> > Defining a
> > > > class at global scope ( statically ) without calling any of it's
> > functions
> > > > causes the driver to stop loading. no exception is being cached by
> > WinDbg,
> > > > or NuMegas Visual SoftIce, I really want to use C++ with my driver...
> I
> > > > guess the problem related to the way the class is allocated in memory
> (
> > > > global scope ) as defining the class in a function scope doesn't
> produce
> > the
> > > > problem. What may cause this problem? how could this problem be
> > resolved?
> > > > any clues pointers or directions will be appreciated.
> > >
> > >
> > > The use of C++ in drivers is unsupported
> > >
> > > -Brian
> > >
> > > Brian Catlin, Sannas Consulting 310-944-9492
> > > Windows Network, Video, WDM Device Driver Training & Consulting
> > > See WWW.AZIUS.COM.bad for courses and scheduling
> > > REMOVE .BAD FROM EMAIL AND WEB ADDRESS
> > >
> > >
> >
> >
>
>
Reply With Quote
DemoForge.com
Guest
Posts: n/a
 
Re: Display Mirror Driver Problem
Posted: 02-15-2004, 09:06 PM

> So.. Please Fix me if I am wrong, Development of Video mirror
> drivers cannot be done with C++ while other drivers can be written using
C++.

You can't use unrestricted C++ in kernel environment anyway.
For example one can employ C++ exceptions and RTTI neither in regular
NT device driver nor in display driver.

Display drivers world imposes additional restrictions on what you can do.
May be you remember the restriction of global variables. You cant use them
in display driver. This is a matter of security. When the display (PDEV)
is switched, than no state from the previous display can be attributed
to the newly activated one. It is substantial architectural issue. If you
were allowed to have global vars, you easily could make a mistake in your
driver that probably compromise the system security.
Another restriction is that you are not allowed to link to anything
except win32k. The reason is alike.
These restrictions are not just words. They are enforced.
The loader of display drivers behaves differently compared to regular
driver modules. This loader will not bind the display driver
to anything except win32k. It also does not perform the full
initialization prescribed by complier.
It only does what is allowed. It seems that it loads nothing
except .idata, .text and win32k import sections.

So, the loader will silently refuse to load your driver if it references
things outside win32k. It also will not call the ctors/dtors of the global
objects. It will not initialize vtables of your classes. If you decide to
use virtual methods in display driver, you're out of luck. There are
other restrictions as well.

So you may use C++ only as better C. Usual classes w/o virtual methods,
single inheritance, overloading, templates are all allowed.
The understanding of how C++ complier works
will be of much help.
Just FYI, I do use C++ in mirror drivers. It performs perfectly
when used with care.

--------------------
Lev Kazarkin
Mirror drivers. Consulting and custom development.


Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
display driver gary Windows XP Video 22 08-10-2006 07:47 PM
Need Display adapter driver and Audio Driver POKEBRON Windows XP Device Drivers 1 10-21-2003 05:09 AM
problem creating mirror disk with management console microsoft Windows XP Help & Support 0 10-17-2003 02:13 PM
PRB - display driver sjojackson Windows XP Embedded 1 07-25-2003 08:07 PM
Display Driver-Updates? Help... Donna Windows XP Performance & Maintenance 2 07-06-2003 09:49 PM