Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display Mirror Driver disables DirectDraw Overlays, DVD playback

57 views
Skip to first unread message

Andy Stevenson

unread,
May 23, 2005, 11:39:09 PM5/23/05
to
Hi,

I'm having the same problem that was referenced about a year ago in this
thread:
http://groups-beta.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/51715b3805247298/6b3237452b8466b1?q=%22mirror+driver%22+overlay&rnum=1#6b3237452b8466b1

However, the above thread ends without a confirmed resolution of the issue.
Curious if there is any more information available. I have tried all the
same tests described in that thread. I am also targeting DX7, but if it
would resolve the issue could target DX8.


Specifically, I have written a simple mirror driver based on the mirror
sample that is able to capture the coordinates (but not contents) of most
on-screen changes. Unfortunately, when this driver is active (attached to
the desktop), Windows disables DirectDraw support. This in turn, breaks DVD
playback, among other things. I do not care to capture the contents of any
updates (just the coordinates), but people get cranky when DVD playback is
broken.

Simply detaching the driver from the desktop resolves the problem, but
ordinary users cannot set the necessary registry setting to turn on/off the
driver as necessary. Also, this causes additional repaints of the entire
desktop when Windows modifies the display devices.

Another wrinkle, as mentioned in a different thread, is that if I test on a
multi-monitor system with the desktop extended that the problem does not
occur at all -- DirectDraw remains enabled despite the presence of the
mirror driver. If I could cause this behavior on a single-monitor system, I
would be all set.


I am looking for any of the following solutions:

1) A setting I may use to cause Windows to keep DirectDraw enabled when my
mirror driver is enabled. I would be very happy if Windows would simply
overlook my driver for the purposes of DirectDraw without hampering other
applications.

2) An example of a working DrvGetDirectDrawInfo for a mirror device. As
described in the previous thread on this topic, I see 2 calls to
DrvGetDirectDrawInfo, but no other DD calls. It would be helpful if this
were in the DDK sample code.

3) Suggestions of alternate workarounds.

Thanks,
Andy


Art Trumble[MSFT]

unread,
May 24, 2005, 6:23:38 PM5/24/05
to
In order to correct this problem you have to implement DrvGetDirectDrawInfo
and DdGetDriverInfo as described in the DDK under "Direct3D Driver
Initialization".

Thank you for choosing the MSDN Managed Newsgroups,

Art Trumble
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.

Andy Stevenson

unread,
May 25, 2005, 6:33:12 PM5/25/05
to

"Art Trumble[MSFT]" <atr...@online.microsoft.com> wrote in message
news:B7a988K...@TK2MSFTNGXA01.phx.gbl...

> In order to correct this problem you have to implement
> DrvGetDirectDrawInfo
> and DdGetDriverInfo as described in the DDK under "Direct3D Driver
> Initialization".

I had already implemented both of those methods, but I walked through
section that section of the DDK docs that you suggested and double-checked
everything. I still see the same results (DirectDraw disabled)

I see DrvGetDirectDrawInfo called twice (as expected), but neither
DdGetDriverInfo nor any other dd callback are called after that.

I have filled out the lpD3DGlobalDriverData and lpD3DHALCallbacks entries in
the DD_HALINFO. I have added stub methods for the listed callbacks that
would at least produce debug output in windbg, but they are never called.

Question 1: It seems that there is some sort of litmus test occurring after
DrvGetDirectDrawInfo is called to determine whether my driver is worthy or
not. Is there any way to get insight into what exactly is failing?

Question 2: Does the miniport need to return valid display modes or fully
support any of the other commands in HwStartIO in order for DirectDraw to
work?
Right now, I just do this for IOCTL_VIDEO_QUERY_AVAIL_MODES and several
of the other IOCTLs
RequestPacket->StatusBlock->Status = NO_ERROR;
RequestPacket->StatusBlock->Information = 0;

Question 3: I am using dxdiag and the DirectX Caps Viewer to check the
status of my driver. Is there a better or more interactive way to check the
functionality?


I can attach source snippets if that would help (or email them offline)
Thank you again for your help.


Art Trumble[MSFT]

unread,
May 26, 2005, 12:20:51 PM5/26/05
to
1. DDRAW,DLL is verifying your driver caps. You can get debug info if you
install the checked version of ddraw.dll and add the following rgistry
entries.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\IniFileMapping\win.ini]
"DirectX"="SYS:Debug"

[HKEY_LOCAL_MACHINE\SOFTWARE\Debug]
"DDrawDebug"="0-9!^#>&+$"

This should cause ddraw.dll to spew error messages to your debugger. Your
looking for something like "****DirectDraw/Direct3D DRIVER DISABLING
ERROR****: ..."

If you want to fine tune the debug spew:

The output filter level ranging from 0->9. Almost all the information above
level 0 (error) is useless from the point of view of debugging an app. In
addition to the number, there are other characters that can be used to get
additional info. The full list of characters

! Break on asserts
^ Print TID of calling thread
# Print PID of calling process
> Indent on message detail levels
& Print the topic and detail level of each message
= Print function name
+ Print all topics, including topic-less
- Do not allow topic-less messages
$ Print source filename and line number of DPF


2. I don't think this will cause any dd problems.

3.dxdiag and the DirectX Caps Viewer are the best way to check your driver
functionality.

Andy Stevenson

unread,
May 26, 2005, 5:03:39 PM5/26/05
to
Sorry for the rudimentary question, but what's the most efficient way to
obtain the checked version of ddraw.dll?
Do I need to install the checked build of XP, or is there an easier way to
get that single DLL? (SDK, etc)

Thanks.


Art Trumble[MSFT]

unread,
May 26, 2005, 6:08:16 PM5/26/05
to
The short answer:

Download the checked version of the service pack update.
Use winzip to extract ddraw.dl_.
In a command window type "expand ddraw.dl_ ddraw.dll"
In safe mode copy ddraw.dll to %systemeroot%\system32

If you need more detail let me know.

Andy Stevenson

unread,
May 26, 2005, 6:38:45 PM5/26/05
to
That was perfect - I am now seeing messages. Thanks.

(I am debugging against a virtual PC image, if that matters).

I see this:
Direct3D8: (Px6c,Tx01bc):: ddcreate.c@6041( 5): DirectDrawCreate: pid =
0000006c

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@6046( 4): Reading Registry

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@4976( 5): createDC(display)

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@2861( 4): DirectDrawObjectCreate:
oldpdd == 0x00000000, reset = 0

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@2872( 5): DIRECTDRAW object passed in
= 0x00000000

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@2972( 4): oldpdd == 0x00000000, reset
= 0

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@2987( 5): Driver Object: 2992 base
bytes

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@3036( 5): WinNT driver conversation
started

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@4976( 5): createDC(display)

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@4865( 5): DeleteDC 0x0101006C

Direct3D8: (WARN) :(Px6c,Tx01bc):: ddcreate.c@3076( 1):
****DirectDraw/Direct3D DRIVER DISABLING ERROR****:First call to
DdQueryDirectDrawObject failed!

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@6977( 5): pdrv = 0x00000000

Direct3D8: (Px6c,Tx01bc):: ddcreate.c@6980( 3): Got returned NULL pdrv!

Wondering why the "WinNT driver conversion" message...

I am investigating the DdQueryDirectDrawObject message.

Thank you for your help!


Andy Stevenson

unread,
May 26, 2005, 7:44:06 PM5/26/05
to
Update: I ran the same tests with and without my driver enabled. and the
"WinNT driver conversion" message happens regarless, so I believe that's a
red herring.

Is there any way to find out why the DdQueryDirectDrawObject call fails?
There is the error regarding 'pdrv being null', but I don't see that in any
of the structures I'm filling out in the driver.


Debugger output snippet, mirror driver DISABLED:
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3036( 5): WinNT driver
conversation started
Direct3D8: (Px57c,Tx0594):: ddcreate.c@4976( 5): createDC(display)
Direct3D8: (Px57c,Tx0594):: ddcreate.c@4865( 5): DeleteDC 0x0101006F
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3096( 5): numheaps = 0,
numfourcc = 0
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3097( 5): ptrs: 0x00779B3C,
0x00779B14
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3168( 5): NT driver video ram
data as reported by driver:
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3169( 5):
VIDMEMINFO.fpPrimary =00000000
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3170( 5): VIDMEMINFO.dwFlags
=00000000
Direct3D8: (Px57c,Tx0594):: ddcreate.c@3171( 5):
VIDMEMINFO.dwDisplayWidth =00000320
....

Debugger output snippet, mirror driver ENABLED:
Direct3D8: (Px450,Tx0454):: ddcreate.c@3036( 5): WinNT driver
conversation started
Direct3D8: (Px450,Tx0454):: ddcreate.c@4976( 5): createDC(display)
Direct3D8: (Px450,Tx0454):: ddcreate.c@4865( 5): DeleteDC 0x0101006C
Direct3D8: (WARN) :(Px450,Tx0454):: ddcreate.c@3076( 1):

****DirectDraw/Direct3D DRIVER DISABLING ERROR****:First call to
DdQueryDirectDrawObject failed!

Direct3D8: (Px450,Tx0454):: ddcreate.c@6977( 5): pdrv = 0x00000000
Direct3D8: (Px450,Tx0454):: ddcreate.c@6980( 3): Got returned NULL pdrv!
Direct3D8: (Px450,Tx0454):: ddfake.c@95( 5): getDisplayMode:
Direct3D8: (Px450,Tx0454):: ddfake.c@96( 5): bpp=32, refresh=75
Direct3D8: (Px450,Tx0454):: ddfake.c@97( 5): dwHeight=600,
dwWidth=800
Direct3D8: (Px450,Tx0454):: ddfake.c@98( 5): lStride=800
.....


Thanks for your help!


Tim Roberts

unread,
May 26, 2005, 10:45:48 PM5/26/05
to
"Andy Stevenson" <Andy_Stev...@community.nospam> wrote:
>
>Update: I ran the same tests with and without my driver enabled. and the
>"WinNT driver conversion" message happens regarless, so I believe that's a
>red herring.

Check again. It doesn't say "driver conversion". It says "driver
conversation", as in "I'm starting to talk to your driver now."
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc

Andy Stevenson

unread,
May 27, 2005, 12:12:21 PM5/27/05
to
"Tim Roberts" <ti...@probo.com> wrote in message
news:0c2d911tabqo4q9vp...@4ax.com...

> "Andy Stevenson" <Andy_Stev...@community.nospam> wrote:
>>
>>Update: I ran the same tests with and without my driver enabled. and the
>>"WinNT driver conversion" message happens regarless, so I believe that's a
>>red herring.
>
> Check again. It doesn't say "driver conversion". It says "driver
> conversation", as in "I'm starting to talk to your driver now."

Clearly my mind is already on vacation for the long weekend.

Now hopefully the other problem I'm seeing is an equally straightforward
case of blurry vision.


Andy Stevenson

unread,
May 27, 2005, 1:40:09 PM5/27/05
to
Alternate path:
Since this works fine on a multiple-monitor system, is there any way to
trigger whatever condition allows DirectDraw to function despite the mirror
driver? I don't know if that's a bug or feature in DirectDraw, but from my
perspective the behavior is preferable to the single-monitor situation.

I don't want to distract the mainline debugging with this, but I figured
it's worth asking.

Thanks.


Art Trumble[MSFT]

unread,
May 27, 2005, 2:21:00 PM5/27/05
to
It looks like the most likely cause is an excetion when the code is probing
your driver data. Take a close look at your HalInfo.

You need to install the checked build of dxg.sys in
%systemroot%\system32\drivers.

If you don't see helpfull debug messages use the windbg command "ed
dxg!gWarningLevel ffff"

Andy Stevenson

unread,
May 27, 2005, 3:37:30 PM5/27/05
to
Installing the checked version of dxg.sys did the trick:

DXG: vDdEnableDriver: Driver returned invalid vmiData.pvPrimary

I was intentionally not allocating display memory for this device.

So... I allocated the necessary space and now I get further (DXG Assertion:
HalInfo.ddCaps.dwCaps indicate driver must hook Blt)
I will trod this path for a bit and see where it leads.


1) Is providing valid display a requirement to support DirectDraw?
2) Does it need to match the screen resolution/depth of the mirrored surface
in order to work correctly? (or can it be a small fixed size)

Thanks


Andy Stevenson

unread,
May 27, 2005, 7:47:30 PM5/27/05
to
Update: I have implemented the necessary stub hooks now.
The "DXG" messages are now gone, and I'm back in the same condition where
dxdiag fails with the messages:

Direct3D8: (WARN) :(Px604,Tx0608):: ddcreate.c@3076( 1):

****DirectDraw/Direct3D DRIVER DISABLING ERROR****:First call to
DdQueryDirectDrawObject failed!

Direct3D8: (Px604,Tx0608):: ddcreate.c@6977( 5): pdrv = 0x00000000

Direct3D8: (Px604,Tx0608):: ddcreate.c@6980( 3): Got returned NULL pdrv!


I will return to debugging on Tuesday. Any suggestions for obtaining more
debug detail are welcome. Thanks.


Otto

unread,
May 30, 2005, 10:48:03 AM5/30/05
to
Hi Andy,

If you do manage to get this working, you would be doing the world (and
more precisely, me) a great service, if you let us know how you did it
:)

I'm itching to get back into this, but I just don't have time right
now...

Thanks,
Otto

Art Trumble[MSFT]

unread,
May 31, 2005, 12:34:47 PM5/31/05
to
1. I'm not sure exactly what you mean by "valid display".
2.You don't need to match the screen resolution or depth. You can position
the mirrored surface anywhere you like. For example you could set the
position to 100,100 and the size to 150,150. Your mirrored surface would
receive only the drawing commands that overlap this area. I suspect this
has something to do with your working multimon scenario.

Andy Stevenson

unread,
Jun 1, 2005, 2:10:06 PM6/1/05
to
> 1. I'm not sure exactly what you mean by "valid display".

I was referring to display memory, as pointed-to by pvPrimary. I would
rather not provide this because then I need to allocate enough memory to
cover the screen. However, this seems to be required with DirectDraw, so I
will deal with it. :)

> 2.You don't need to match the screen resolution or depth. You can position
> the mirrored surface anywhere you like. For example you could set the
> position to 100,100 and the size to 150,150. Your mirrored surface would
> receive only the drawing commands that overlap this area. I suspect this
> has something to do with your working multimon scenario.

I plan to cover the whole screen.. probably the entire virtual desktop in a
multi-monitor situation.


Do you have any more suggestions for obtaining additional information from
the Direct3D8 driver about the reason for this message:
Direct3D8: (WARN) :(Px604,Tx0608):: ddcreate.c@3076( 1):

****DirectDraw/Direct3D DRIVER DISABLING ERROR****:First call to
DdQueryDirectDrawObject failed!

After providing valid display memory and implementing the suggested HAL and
DdGetDriverInfo callbacks, I am back to this original message.... and
DirectDraw (and AGP Texture Acceleration) are disabled.


Is there better debugging information available if I upgrade my test box to
DX9? My end-goal is to support DX7, but I can test anywhere if it helps me
solve this problem.

Thanks.


Art Trumble[MSFT]

unread,
Jun 1, 2005, 6:17:13 PM6/1/05
to
You should upgrade to DX9. "First call to DdQueryDirectDrawObject failed!"
indicated there is still something wrong with your ddinfo. I haven't tried
it recently but I think the perm3 sample code still works. Maybe you should
model you model your dd support from the sample.

Bill Scoville

unread,
Jun 28, 2005, 2:48:01 PM6/28/05
to
Andy,
Did you get any further with this, I'm facing the same issue with my
mirror driver and basically followed the same path as you and I'm also back
to the same error. If you got this resolved could you share the solution with
me - Thanks...

Bill Scoville

unread,
Jun 28, 2005, 2:46:01 PM6/28/05
to
I'm dealing with the same issue with my mirror driver.
I fixed some of the issues with info from this thread, but I don't see
additional debug info with the checked version of dxg.sys.
When I try the "ed dxg!gWarningLevel ffff" I get back "Memory access error
in 'ed dxg!gWarningLevel ffff'", do you have any ideas what I'm doing wrong?
0 new messages