Greetings!
When I try to use GetThreadContext() on a thread that I've started with CreateProcess(), I receive an error of 998: ERROR_NOACCESS
You can find a contrived but functional code example of this problem here: http://pastebin.com/tamDhYza
Based on the MSDN article regarding "Thread Security and Access Rights", my assumption is that I need to first pass the THREAD_GET_CONTEXT property into the lpThreadAttributes
parameter of CreateProcess(). The type required by this argument is LPSECURITY_ATTRIBUTES
, which appears to be a long pointer to the struct SECURITY_ATTRIBUTES. Unfortunately, I've not had much luck in figuring out how to add rights to this structure.
Could anyone help point me in the right direction?