Mirror Driver Mode change

Hi
Iam working on mirror driver and iam new to this area. I have few doubts regarding the mirror driver.

1)While System is booting, after DrvEnableDriver, DrvEnablePDEV will be called. How will the GDI fill the DEVMODE structure for DRVEnablePDEV?

2)When we change screen resolution by rightclick and screen resolution, do we have to explicitly call the changedisplaysettings for mirror driver from an application or changedisplaysettings will be called automatically internally for mirror driver?

Thanks.

Vish wrote:

>1)While System is booting, after DrvEnableDriver, DrvEnablePDEV will be
called. How >>will the GDI fill the DEVMODE structure for DRVEnablePDEV?

I wanted to rephrase your sentence, While system is booting DrvEnableDriver
will get called by OS but DrvEnablePDEV will only get called when your
application will call changeDisplaySettings()/changeDisplaySettingsEx() and
if you see 2nd argument, it is of type DEVMODE which application is suppose
to fill. Make sense?

>2)When we change screen resolution by rightclick and screen resolution, do
we have to >>explicitly call the changedisplaysettings for mirror driver
from an application or >>changedisplaysettings will be called automatically
internally for mirror driver?

Ideally we should call ChangeDisaplySettings on any resolution change but if
we don’t want to call or some how we missed to call then it will be depend
on which OS you are using. For XP OS will unload and reload the driver on
every resolution change but for Vista and above driver will hit an assert
and it is upto you how you want to handle this.

/sarbojit

On Wed, Oct 20, 2010 at 11:18 PM, wrote:

> Hi
> Iam working on mirror driver and iam new to this area. I have few doubts
> regarding the mirror driver.
>
> 1)While System is booting, after DrvEnableDriver, DrvEnablePDEV will be
> called. How will the GDI fill the DEVMODE structure for DRVEnablePDEV?
>
> 2)When we change screen resolution by rightclick and screen resolution, do
> we have to explicitly call the changedisplaysettings for mirror driver from
> an application or changedisplaysettings will be called automatically
> internally for mirror driver?
>
> Thanks.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Hi Sarbojit,
Thanks for your reply.
What i mean to ask is will there be any registry location where the screen resolution is stored and changedisplaysettings automatically called by the system?
Or
we have to capture each and every screen resolution change through WM_DISPLAY_CHANGE and call changedisplaysettings explicitly?

Thanks.

That’s what I said,
For XP it will get called automatically but not in case of vista/win7. For
vista and above you have to catch the message and need to call
CanngeDispalySettings().

/sarbojit

On Mon, Oct 25, 2010 at 10:56 AM, wrote:

> Hi Sarbojit,
> Thanks for your reply.
> What i mean to ask is will there be any registry location where the screen
> resolution is stored and changedisplaysettings automatically called by the
> system?
> Or
> we have to capture each and every screen resolution change through
> WM_DISPLAY_CHANGE and call changedisplaysettings explicitly?
>
> Thanks.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Hi Sarbojit
Thanks again for your kind reply. Now i understood it.

Vishnu.

Now Iam a bit confused with mirror driver mode change. Any information would be of great help.

What are different ways to catch the display change message? As one option ,i can hook the changeDisplaySettings of User32.dll and call changedisplaysettings on mirror driver. Are there any other better ways to do this?

Thanks.