mov eax, OldThreadHandle
mov edi, CurThreadHandle
call [ThreadSwitchCallback]
Performs programmer-defined processing whenever the system switches to a different thread. ThreadSwitchCallback is a programmer-defined callback function installed by the Call_When_Thread_Switched service. Uses Flags.
The callback function can carry out any operation and can modify the EAX, EBX, ECX, EDX, ESI, EDI, and Flags registers.
Call_When_Thread_Switched