This is dangerous. The pointer you are given here is only guaranteed by the framework to be valid during the execution of the callback. I don't think you will get an access violation either, just undefined behavior.