Torna al Thread
if (LogonUser(UserLogon, Domain, UserPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, ref ptrToken) != 0)
{
[.........CODICE PER LA COPIA..........]
if (DuplicateToken(ptrToken, 2, ref ptrTokenDuplicate) != 0)
{
WindowsIdentity UserIdentity = new WindowsIdentity(ptrTokenDuplicate);
_CtxImpersonation = UserIdentity.Impersonate();
if (null != UserIdentity) return true;
}
}