Page 1 of 1

IDisplay::TakeScreenshot crashes the VM

Posted: 25. Jan 2011, 07:56
by concretemixer
Hello

I'm trying to take screen shot of the virtual machine using c++. The code is like this.

Code: Select all

display->GetScreenResolution(0,&width,&height,&bpp);
buffersize = width*height*4;
databuff = (BYTE*)CoTaskMemAlloc(buffersize);
rc = display->TakeScreenShot(0,databuff,width,height);
This code crashes the virtual mashine, and the return code of the last call is 0x800706BE (Remote procedure call failed).
It does not depend on the amount of memory allocated, I tried to allocate much more - still crashes. Also does not depend on width and height passed to TakeScreenShot - crashes with values much smaller than actual display dimentions.

Does some one have an idea what is going on?

While googling, I noticed people faced same situation before, but found no sane answer what to do.

IDisplay::TakeScreetShotToArray works fine, but it is sooooooooo slow....

Re: IDisplay::TakeScreenshot crashes the VM

Posted: 21. Mar 2011, 20:00
by MrTrigger
I got the same problem, was this ever resolved or is there a workaround except using the sluggish TakeScreenShotToArray?

Re: IDisplay::TakeScreenshot crashes the VM

Posted: 22. Mar 2011, 00:58
by Technologov
Better to ask such questions on vbox-dev mailing list, or in "VirtualBox OSE" topic in this forum.