int _tmain(int argc, _TCHAR* argv[])
{
char idtr[6]={0};
char gdtr[6]={0};
SetThreadAffinityMask(GetCurrentThread(),1);
__asm
{
sidt idtr
sgdt gdtr
}
printf("idt limit is %.4x,base is %.8x\n",*(unsigned short *)idtr,*(unsigned int *)(idtr+2));
printf("gdt limit is %.4x,base is %.8x\n",*(unsigned short *)gdtr,*(unsigned int *)(gdtr+2));
SetThreadAffinityMask(GetCurrentThread(),2);
__asm
{
sidt idtr
sgdt gdtr
}
printf("idt limit is %.4x,base is %.8x\n",*(unsigned short *)idtr,*(unsigned int *)(idtr+2));
printf("gdt limit is %.4x,base is %.8x\n",*(unsigned short *)gdtr,*(unsigned int *)(gdtr+2));
return 0;
}