Added a lifetime check in the ServerContext.ImpersonateClient method.

This commit is contained in:
antiduh
2014-07-11 22:16:12 +00:00
parent 8c19366314
commit 4bfe7d8bc9

View File

@@ -183,6 +183,12 @@ namespace NSspi.Contexts
{
throw new ObjectDisposedException( "ServerContext" );
}
else if( this.Initialized == false )
{
throw new InvalidOperationException(
"The server context has not been completely initialized."
);
}
else if( impersonating )
{
throw new InvalidOperationException( "Cannot impersonate again while already impersonating." );