Strange null pointer exception

You are checking if it is NULL, that is 0x00000000. The variable is instead 0xFFFFFFFF. Thus it passes your test and it does not crash.

It is not a nullpointer exception, it is an access violation error because you try to access RAM outside of what you have. Something before it failed and windows returned 0xFFFFFFFFFF which is the invalid handle error.

HTH

1 Like