Intel® Software Network Knowledge Base Wiki


Constructing Nav Tree
One Moment...

(refresh menu)



 
Welcome, Guest | Quick Login | Register

Develop for Core processor


Support the CONTEXT Structure in Windows 2000 (64-bit)

Version 1, Changed by KYLEX.S.LEWIS@INTEL.COM on 7/11/2007
Created by: KYLEX.S.LEWIS@INTEL.COM

Challenge

Provide support for the CONTEXT structure on both 32-bit Windows and 64-bit Windows operating systems. Windows 2000 (64-bit) uses CONTEXT structures to perform various internal operations.

Solution

Change the access to the Windows 2000 (64-bit) CONTEXT. The <winnt.h> header file provides definitions of these structures. The following example shows how you might combine Win32* and Windows 2000 (64-bit) code to maintain a single-code base that will compile for both architectures:

<br />
CONTEXT ThreadContext;<br /><br />
HANDLE hThread;<br /><br />
hThread = CreateThread(...);<br /><br />
SuspendThread(hThread);<br /><br />
ThreadContext.ContextFlags=CONTEXT_INTEGER;<br /><br />
GetThreadContext(hThread, &amp;ThreadContext);<br /><br />
printf("Dump of Integer Contextn");<br /><br />
#if defined(_M_IA64)<br /><br />
printf("r2:0%.16I64x, r3:%0.16I64xn", ThreadContext.IntT0,<br /><br />
ThreadContext.IntT1);<br /><br />
#elif defined(_M_IX86)<br /><br />
printf("Edi:%08x, Esi: %08xn", ThreadContext.Edi, ThreadContext.Esi);<br /><br />
#endif<br /> 
 

Source 

Preparing Code for the IA-64 Architecture (Code Clean)

 



Served
23 Knowledge Bases
605 Pages
Search
Powering Up Search...


Vote on this Page

Tags For This Page
Loading Tags..

Tag This



Additional legal information