IDisplay::TakeScreenshot crashes the VM

This is for discussing general topics about how to use VirtualBox.
Post Reply
concretemixer
Posts: 1
Joined: 25. Jan 2011, 07:44
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp

IDisplay::TakeScreenshot crashes the VM

Post 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....
MrTrigger
Posts: 1
Joined: 21. Mar 2011, 19:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows7

Re: IDisplay::TakeScreenshot crashes the VM

Post by MrTrigger »

I got the same problem, was this ever resolved or is there a workaround except using the sluggish TakeScreenShotToArray?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: IDisplay::TakeScreenshot crashes the VM

Post by Technologov »

Better to ask such questions on vbox-dev mailing list, or in "VirtualBox OSE" topic in this forum.
Post Reply