GetThreadContext() returns error 18 - There are no more files. I've searched all over the place and cannot find explanation to the error. Could someone clarify this for me?
Big thanks开发者_JAVA技巧.
Rob Kennedyand Hans Passant answered my question below. I wanted to just quote Rob and Hans here as an answer:
Hans Passant First verify that it [GetThreadContext()] returned FALSE, you won't get a valid error code from GetLastError() if it [GetThreadContext()] returned TRUE.
Rob Kennedy The return value from GetLastError is only valid if the documentation says it's valid; it doesn't say it's valid if the API function succeeded. The OS is allowed to set the error code speculatively, so make sure you check the API return value before paying attention to the error code
Simple if handle == False print error fixed it for me.
Thank you all for your input.
精彩评论