IDisplay::TakeScreenshot crashes the VM
Posted: 25. Jan 2011, 07:56
Hello
I'm trying to take screen shot of the virtual machine using c++. The code is like this.
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....
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);
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....