이 ILSpy 사용을 해부 너무 게으른 오전, 당신은 GetCurrent
및 GetCurrentInternal
의 디 컴파일 된 버전, GetCurrent
통화를 볼 수 있습니다 . 결과는 다음과 같습니다
에 getCurrent :
public static WindowsIdentity GetCurrent()
{
return WindowsIdentity.GetCurrentInternal(TokenAccessLevels.MaximumAllowed, false);
}
GetCurrentInternal : GetCurrent
에서 전화 및 currentToken
다른 유효해야하는 경우 threadOnly
이후
internal static WindowsIdentity GetCurrentInternal(TokenAccessLevels desiredAccess, bool threadOnly)
{
int errorCode = 0;
bool flag;
SafeTokenHandle currentToken = WindowsIdentity.GetCurrentToken(desiredAccess, threadOnly, out flag, out errorCode);
if (currentToken != null && !currentToken.IsInvalid)
{
WindowsIdentity windowsIdentity = new WindowsIdentity();
windowsIdentity.m_safeTokenHandle.Dispose();
windowsIdentity.m_safeTokenHandle = currentToken;
return windowsIdentity;
}
if (threadOnly && !flag)
{
return null;
}
throw new SecurityException(Win32Native.GetMessage(errorCode));
}
은 항상 false입니다 return 문, 나는 당신이 null을 얻을 위험에 있다고 생각하지 않는다 WindowsIdentity
.
글쎄, 난 당신을 위해 그것을 봤 :) 이것은 우리의 작은 친구 것 같다 : http://youtrack.jetbrains.com/issue/RSRP-328266 – Noich
정확히.위의 주석은 328266 (XML 스 니펫의 첫 번째 줄에 대한 주석)을 수정하기로되어 있지만, 어떤 이유로 든 수정 프로그램이 작동하지 않는 것 같습니다. R # 설정 또는 구성에 문제가 있음을 나타내려면 정교하게 작성하십시오. –
나는 정말로 모른다 : 당신은 그들의 품질 보증으로 그것을 가져 가야 할 것이다. – Noich