tags:

views:

5

answers:

0

I have a source code (which is not written by myself) that assumes an address of a D3D9 surface, which is created in system memory, will never change.

In short, the code is like this;

// the following code runs only once in initialization phase system_surface->LockRect(&lockinfo, blah blah..); void *pSurface = lockinfo.pBits; UnlockRect();

// use pSurface in other modules... e.g memcpy(pSurface, pSource, ...)

In my knowledge, this assumption is not true and some of my customers complains about runtime error and the error log says that memcpy to pSurface causes an acess violation.

The original author of this code do not agree with me, so I need to prove it and I tried to googling.. but failed. So, I post this question here;

Is an address of D3D9 system memory surface changeable?

(in DDraw the answer is obiously YES - I've tested it and I found a book chapter about it. But I don't know about D3D9 and the address do not seems to change in simple example code)