I have a workaround that may resolve the issue in XP but the Vista thing I am a bit stumped on. I think it has to do with specific access in the process but that shouldn't matter as the process isn't being written to from another it is all internal. So we will see.
For all the coders who understand about memory
The memory size that the game is stored in is 0x5000. It increases by 0x1000 each time. Therefore:
js code:
if(MEMORY_BASIC_INFORMATION.ReadDWORD(16) === MEM_COMMIT && (MEMORY_BASIC_INFORMATION.ReadDWORD(12) % 0x1000 === 0) ) {
....
}
Should serve its purpose accordingly. It just may be slow I will have to test and see.