Einzelnen Beitrag anzeigen

Win32.API

Registriert seit: 23. Mai 2005
312 Beiträge
 
#12

Re: Code läuft in VCL aber nicht in Console (GetThreadContex

  Alt 29. Mai 2010, 15:45
Zitat von himitsu:
Aber vielleicht sollte man nicht nur den Zugriffsfehler beim Speicher, sondern beim Kontext suchen?

http://msdn.microsoft.com/en-us/library/ms679362.aspx
Zitat:
hThread [in]

A handle to the thread whose context is to be retrieved. The handle must have THREAD_GET_CONTEXT access to the thread. For more information, see Thread Security and Access Rights.

WOW64: The handle must also have THREAD_QUERY_INFORMATION access.
Und der Beispielcode dort unten könnte ebenfalls helfen.
Ich verwende GetCurrentThread(), welches mir ein pseudo Handle mit THREAD_ALL_ACCESS zurueck gibt.

Edith meinte noch, dass es nicht am Alignment liegt, da in der Subfunktion der Speicher auch passend Aligned ist.
  Mit Zitat antworten Zitat