views:

54

answers:

1

I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.

# WindowsIdentity = WindowsIdentity.GetCurrent()

which returns the identity of the security context of the currently executing Win32 thread.

# Thread = Thread.CurrentPrincipal 

which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.

+2  A: 

There isn't guaranteed to be a one-to-one mapping between operating system threads and .NET threads. Usually you only need to care about the .NET thread. Which OS thread your .NET Thread happens to be running on right now is an implementation detail which you shouldn't rely on.

Mark Byers
So the Win32 thread is the operating system thread?
Ybbest