Mirror display driver with video memory

I am learning mirror display driver from the DDK sample.
I want to get the changed RECT area and the video memory data from user mode
app through mirror driver.
As i know, i’ve been allocate memory to cache the changed video memory and
RECT.

But I couldn’t find where to get the video memory and rect. I looked the
output information in DrvCopyBits, DrvBitBlt etc. and i found that these
functions are called very frequently, and also i don’t know how to get the
changed RECT and video memory from the parameters of DrvCopyBits…

I would appreciate any information on the subject.

Thank you

krShan

(1) I did this technique and is now used in TightVNC I believe.
(2) One of the parameters to the DDI calls is a DSURF for the Destination. You need to look at one its parameters that lets you know the Destination is for the visible framebuffer. Use can then stored its RECT struct that is the surrounding RECT for it drawing. You can can store this a driver allocated memory.
(3) Now you can then pass this memory containing all the changed RECT to an app and let the app periodically call the driver with a DeviceIoctl() that you define.
(4) Within the app use the GDI Region calls to take all the RECT “Which are overlapping” to break these into a non-overlapping partition.
(5) This is from my memory so you have to fill in the holes, but you should get the outline.

Regards,
William Michael Jones “Mike”

“kr shan” wrote in message news:xxxxx@ntdev…
I am learning mirror display driver from the DDK sample.
I want to get the changed RECT area and the video memory data from user mode app through mirror driver.
As i know, i’ve been allocate memory to cache the changed video memory and RECT.

But I couldn’t find where to get the video memory and rect. I looked the output information in DrvCopyBits, DrvBitBlt etc. and i found that these functions are called very frequently, and also i don’t know how to get the changed RECT and video memory from the parameters of DrvCopyBits…

I would appreciate any information on the subject.

Thank you

krShan

Jones, How can i express my pleasure for your help, thank you very much.
But i still have some questions in the problem of the changed RECT and the
changed video.
(1) In the ddk sample, look at the snip code

BOOL DrvCopyBits(
OUT SURFOBJ *psoDst,
IN SURFOBJ *psoSrc,
IN CLIPOBJ *pco,
IN XLATEOBJ *pxlo,
IN RECTL *prclDst,
IN POINTL *pptlSrc
)
{
INT cnt1 = 0, cnt2 = 0;

DISPDBG((1,“S_Mirror Driver DrvCopyBits: \n”));

if (psoSrc)
{
if (psoSrc->dhsurf)
{
MIRRSURF *mirrsurf = (MIRRSURF *)psoSrc->dhsurf;

if (mirrsurf->bIsScreen)
{
DISPDBG((1, "S_From Mirror Screen "));
}
else
{
DISPDBG((1, "S_From Mirror DFB "));
}
cnt1 ++;
}
else
{
DISPDBG((1, "S_From DIB "));
}
}

if (psoDst)
{
if (psoDst->dhsurf)
{
MIRRSURF *mirrsurf = (MIRRSURF *)psoDst->dhsurf;

if (mirrsurf->bIsScreen)
{

// place1
// do something here? Shankr
// memcpy( ((PPDEV)(psoSrc->dhpdev))->pUserData, psoSrc->pvBits,
psoSrc->cjBits);

DISPDBG((1, "S_to MirrorScreen "));
}
else
{
DISPDBG((1, "S_to Mirror DFB "));
}
cnt2 ++;
}
else
{
DISPDBG((1, "S_to DIB "));
}
}

if (cnt1 && cnt2)
{
DISPDBG((1, “S_[Send Request Over Wire]\n”));
}
else if (cnt1)
{
DISPDBG((1, “S_[Read Cached Bits, Or Pull Bits]\n”));
}
else if (cnt2)
{
DISPDBG((1, “S_[Push Bits/Compress]\n”));
}
else
{
DISPDBG((1, “S_[What Are We Doing Here?]\n”));
}

The code has point the surface copied from source to destination, but the
source may be MirrorScreen, Mirror DFB, DIB and the destination also may
be one of MirrorScreen, Mirror DFB, DIB.
Follow your views, if i want to get the desktop changed area, is it right to
only look at the destination of MirrorScreen, so in the snip code it will be
the place1 where i have been marked?
(2) I found that the DrvCopyBits and some other functions like DrvTextOut
and so on which are hooked are called very very frequently about 1 time per
millisecond even nothing changed in my computer screen, so i am very
puzzled.
(3) In your opinion, i should store all the changed RECT in the memory, then
the app will periodically call the driver to get all the RECT, then take all
the RECT “Which are overlapping” to break these into a non-overlapping
partition. but if in one period there is only a small rect changed on
left-top corner and also a small rect changed on right-down corner, then if
i take the two partition to a non-overlapping partition, what will happen?
a very large RECT almost entire screen area will be produced? If this
happened, i think it will be very awful. And also how i break down the
changed memory data(the actual bitmap data, not the RECT) of overlapping
partition?
(4) I have googled TightVNC, it is hardly to find it now, could your help
me?

Thank you again!
2006/1/20, Mike Jones :
>
> (1) I did this technique and is now used in TightVNC I believe.
> (2) One of the parameters to the DDI calls is a DSURF for the
> Destination. You need to look at one its parameters that lets you know the
> Destination is for the visible framebuffer. Use can then stored its RECT
> struct that is the surrounding RECT for it drawing. You can can store this
> a driver allocated memory.
> (3) Now you can then pass this memory containing all the changed RECT to
> an app and let the app periodically call the driver with a DeviceIoctl()
> that you define.
> (4) Within the app use the GDI Region calls to take all the RECT “Which
> are overlapping” to break these into a non-overlapping partition.
> (5) This is from my memory so you have to fill in the holes, but you
> should get the outline.
>
> Regards,
> William Michael Jones “Mike”
>
>
> “kr shan” wrote in message news:xxxxx@ntdev…
> I am learning mirror display driver from the DDK sample.
> I want to get the changed RECT area and the video memory data from user
> mode app through mirror driver.
> As i know, i’ve been allocate memory to cache the changed video memory and
> RECT.
>
> But I couldn’t find where to get the video memory and rect. I looked the
> output information in DrvCopyBits, DrvBitBlt etc. and i found that these
> functions are called very frequently, and also i don’t know how to get the
> changed RECT and video memory from the parameters of DrvCopyBits…
>
> I would appreciate any information on the subject.
>
> Thank you
>
> krShan
>
>
>
> —
> 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

(1) That is right.
(2) The prclDst you contain the “smallest circumsribing rectangle” of the drawing and will not be as you described as far as I have seen. When I developed this I had the Application XOR the rects returned. I “synchronized” the application XORin the changed twice with two different keys. I could see the 2-D animation effects of Windows, cool. NOTE: A gotcha, you will have to look at the CLIPOBJ and if it is a complex type you will have to keep calling windows to get all the rects assoicated with that DDI call. Look at a display driver sample to see this.
(3) I only designed, developed and tested this solution. I was not involved with VNC. You will have to do this yourself.

By the whay kr shan. I go by William or Michael as my name is William Michael Jones. I do not prefer going by last name. You can call me Michael or Mike.

Regards,
William Michel Jones “Mike”
“kr shan” wrote in message news:xxxxx@ntdev…
Jones, How can i express my pleasure for your help, thank you very much.
But i still have some questions in the problem of the changed RECT and the changed video.
(1) In the ddk sample, look at the snip code
BOOL DrvCopyBits(
OUT SURFOBJ *psoDst,
IN SURFOBJ *psoSrc,
IN CLIPOBJ *pco,
IN XLATEOBJ *pxlo,
IN RECTL *prclDst,
IN POINTL *pptlSrc
)
{
INT cnt1 = 0, cnt2 = 0;

DISPDBG((1,“S_Mirror Driver DrvCopyBits: \n”));

if (psoSrc)
{
if (psoSrc->dhsurf)
{
MIRRSURF *mirrsurf = (MIRRSURF *)psoSrc->dhsurf;

if (mirrsurf->bIsScreen)
{
DISPDBG((1, "S_From Mirror Screen "));
}
else
{
DISPDBG((1, "S_From Mirror DFB "));
}
cnt1 ++;
}
else
{
DISPDBG((1, "S_From DIB "));
}
}

if (psoDst)
{
if (psoDst->dhsurf)
{
MIRRSURF *mirrsurf = (MIRRSURF *)psoDst->dhsurf;

if (mirrsurf->bIsScreen)
{

// place1
// do something here? Shankr
// memcpy( ((PPDEV)(psoSrc->dhpdev))->pUserData, psoSrc->pvBits, psoSrc->cjBits);

DISPDBG((1, "S_to MirrorScreen "));
}
else
{
DISPDBG((1, "S_to Mirror DFB "));
}
cnt2 ++;
}
else
{
DISPDBG((1, "S_to DIB "));
}
}

if (cnt1 && cnt2)
{
DISPDBG((1, “S_[Send Request Over Wire]\n”));
}
else if (cnt1)
{
DISPDBG((1, “S_[Read Cached Bits, Or Pull Bits]\n”));
}
else if (cnt2)
{
DISPDBG((1, “S_[Push Bits/Compress]\n”));
}
else
{
DISPDBG((1, “S_[What Are We Doing Here?]\n”));
}

The code has point the surface copied from source to destination, but the source may be MirrorScreen, Mirror DFB, DIB and the destination also may be one of MirrorScreen, Mirror DFB, DIB.
Follow your views, if i want to get the desktop changed area, is it right to only look at the destination of MirrorScreen, so in the snip code it will be the place1 where i have been marked?
(2) I found that the DrvCopyBits and some other functions like DrvTextOut and so on which are hooked are called very very frequently about 1 time per millisecond even nothing changed in my computer screen, so i am very puzzled.
(3) In your opinion, i should store all the changed RECT in the memory, then the app will periodically call the driver to get all the RECT, then take all the RECT “Which are overlapping” to break these into a non-overlapping partition. but if in one period there is only a small rect changed on left-top corner and also a small rect changed on right-down corner, then if i take the two partition to a non-overlapping partition, what will happen? a very large RECT almost entire screen area will be produced? If this happened, i think it will be very awful. And also how i break down the changed memory data(the actual bitmap data, not the RECT) of overlapping partition?
(4) I have googled TightVNC, it is hardly to find it now, could your help me?

Thank you again!

2006/1/20, Mike Jones :
(1) I did this technique and is now used in TightVNC I believe.
(2) One of the parameters to the DDI calls is a DSURF for the Destination. You need to look at one its parameters that lets you know the Destination is for the visible framebuffer. Use can then stored its RECT struct that is the surrounding RECT for it drawing. You can can store this a driver allocated memory.
(3) Now you can then pass this memory containing all the changed RECT to an app and let the app periodically call the driver with a DeviceIoctl() that you define.
(4) Within the app use the GDI Region calls to take all the RECT “Which are overlapping” to break these into a non-overlapping partition.
(5) This is from my memory so you have to fill in the holes, but you should get the outline.

Regards,
William Michael Jones “Mike”

“kr shan” wrote in message news:xxxxx@ntdev…
I am learning mirror display driver from the DDK sample.
I want to get the changed RECT area and the video memory data from user mode app through mirror driver.
As i know, i’ve been allocate memory to cache the changed video memory and RECT.

But I couldn’t find where to get the video memory and rect. I looked the output information in DrvCopyBits, DrvBitBlt etc. and i found that these functions are called very frequently, and also i don’t know how to get the changed RECT and video memory from the parameters of DrvCopyBits…

I would appreciate any information on the subject.

Thank you

krShan


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