Mirror Driver / DrvTransparentBlt question

Hello,
I am currently implementing a mirror driver under XP and 2000. My
question is how to determine the source bitmap format of the primary
display, and in the case of DrvTransparentBlt, the format that the iColor
member is in.
The DDK mentions 2 routes of interest, XLATEOBJ_cGetPalette and
EngQueryPalette. XLATEOBJ_cGetPalette, when used to try and grab the format
for the source and destination SURFOBJs passed into DrvTransparentBlt, will
return 0 for both surfaces, regardless of the parameters passed in. I am
sure that at least the destination surface is in bitfield format and should
be queryable with XO_DESTBITFIELDS (it’s 32bpp) , but XLATEOBJ_cGetPalette
ends up referencing a field that is apparently about 0x14 bytes past the
end of the XLATEOBJ passed into it…
On the other hand, EngQueryPalette requires a handle to a palette to
query… and the DDK says:
“EngQueryPalette is intended for use by mirroring drivers that need to know
the color format of the primary display. A mirroring driver typically calls
this function in its DrvEnablePDEV routine”.
How can I get the handle for the primary display’s format? I checked
the DEVINFO that I am passed in DrvEnablePDEV to see if maybe GDI gave me
the main driver’s information, but it is indeed zero’d out before I get it.
Thus the only HPALETTE that I have is the one I receive when I create a new
palette and specify the bitfields… EngQueryPalette is indeed used by
NetMeeting, which is a mirror display driver, but not in any of the
examples in the DDK…

Any help would be greatly appreciated…

Thanks,
sean


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The iBitmapFormat field of the SURFOBJ tells you the bitmap format. Or am I
misunderstanding your question ?

Alberto.

-----Original Message-----
From: xxxxx@stg.com [mailto:xxxxx@stg.com]
Sent: Sunday, December 09, 2001 8:00 PM
To: NT Developers Interest List
Subject: [ntdev] Mirror Driver / DrvTransparentBlt question

Hello,
I am currently implementing a mirror driver under XP and 2000. My
question is how to determine the source bitmap format of the primary
display, and in the case of DrvTransparentBlt, the format that the iColor
member is in.
The DDK mentions 2 routes of interest, XLATEOBJ_cGetPalette and
EngQueryPalette. XLATEOBJ_cGetPalette, when used to try and grab the format
for the source and destination SURFOBJs passed into DrvTransparentBlt, will
return 0 for both surfaces, regardless of the parameters passed in. I am
sure that at least the destination surface is in bitfield format and should
be queryable with XO_DESTBITFIELDS (it’s 32bpp) , but XLATEOBJ_cGetPalette
ends up referencing a field that is apparently about 0x14 bytes past the
end of the XLATEOBJ passed into it…
On the other hand, EngQueryPalette requires a handle to a palette to
query… and the DDK says:
“EngQueryPalette is intended for use by mirroring drivers that need to know
the color format of the primary display. A mirroring driver typically calls
this function in its DrvEnablePDEV routine”.
How can I get the handle for the primary display’s format? I checked
the DEVINFO that I am passed in DrvEnablePDEV to see if maybe GDI gave me
the main driver’s information, but it is indeed zero’d out before I get it.
Thus the only HPALETTE that I have is the one I receive when I create a new
palette and specify the bitfields… EngQueryPalette is indeed used by
NetMeeting, which is a mirror display driver, but not in any of the
examples in the DDK…

Any help would be greatly appreciated…

Thanks,
sean


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

What I’m trying to get is the bitfield layout of the primary display /
iTransColor. IE: You can have a layout of RGB (bitfield 0xff0000 for Red,
0x00ff00 for green, 0x0000ff for blue)… So say for a bitmap format of
BMF_24BPP, you could have a layout of RGB, BGR, GRB, etc… depending on
how your device wants to handle colors. For 16bpp you could have the first
5 bits for blue, or for red, etc. and the same for 32bpp.
I want to be able to tell if the primary display has a different layout
than the palette I am using in my mirror driver so that I can convert the
colors as necessary.

For example, in DrvTransparentBlt, the iTransColor member is sent in
“source surface format. It is a color index value that has been translated
to the source surface’s palette”. So I need to be able to translate this to
my correct bitfield layout so that I can correctly tell which color is
supposed to be transparent…

Thanks for the help,
sean


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Did you try calling DrvDescribePixelFormat, passing the iPixelFormat given
by the SURFOBJ ? Also, there’s a DdGetDriverInfo call that gives you a
DDPIXELFORMAT structure.

Alberto.

-----Original Message-----
From: xxxxx@stg.com [mailto:xxxxx@stg.com]
Sent: Monday, December 10, 2001 12:48 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Mirror Driver / DrvTransparentBlt question

What I’m trying to get is the bitfield layout of the primary display /
iTransColor. IE: You can have a layout of RGB (bitfield 0xff0000 for Red,
0x00ff00 for green, 0x0000ff for blue)… So say for a bitmap format of
BMF_24BPP, you could have a layout of RGB, BGR, GRB, etc… depending on
how your device wants to handle colors. For 16bpp you could have the first
5 bits for blue, or for red, etc. and the same for 32bpp.
I want to be able to tell if the primary display has a different layout
than the palette I am using in my mirror driver so that I can convert the
colors as necessary.

For example, in DrvTransparentBlt, the iTransColor member is sent in
“source surface format. It is a color index value that has been translated
to the source surface’s palette”. So I need to be able to translate this to
my correct bitfield layout so that I can correctly tell which color is
supposed to be transparent…

Thanks for the help,
sean


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com