첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System;
using System.Runtime.InteropServices;

#region 토큰 정보 설정하기 - SetTokenInformation(tokenHandle, tokenInformationClass, tokenInformation, tokenInformationLenth)

/// <summary>
/// 토큰 정보 설정하기
/// </summary>
/// <param name="tokenHandle">토큰 핸들</param>
/// <param name="tokenInformationClass">토큰 정보 클래스</param>
/// <param name="tokenInformation">토큰 정보</param>
/// <param name="tokenInformationLenth">토큰 정보 길이</param>
/// <returns>처리 결과</returns>
[DllImport("advapi32", SetLastError = true)]
private static extern bool SetTokenInformation(IntPtr tokenHandle, TOKEN_INFORMATION_CLASS tokenInformationClass, ref uint tokenInformation, uint tokenInformationLenth);

#endregion

#region 토큰 정보 클래스 - TOKEN_INFORMATION_CLASS

/// <summary>
/// 토큰 정보 클래스
/// </summary>
public enum TOKEN_INFORMATION_CLASS
{
    /// <summary>
    /// TokenUser
    /// </summary>
    TokenUser = 1,

    /// <summary>
    /// TokenGroups
    /// </summary>
    TokenGroups,

    /// <summary>
    /// TokenPrivileges
    /// </summary>
    TokenPrivileges,

    /// <summary>
    /// TokenOwner
    /// </summary>
    TokenOwner,

    /// <summary>
    /// TokenPrimaryGroup
    /// </summary>
    TokenPrimaryGroup,

    /// <summary>
    /// TokenDefaultDACL
    /// </summary>
    TokenDefaultDACL,

    /// <summary>
    /// TokenSource
    /// </summary>
    TokenSource,

    /// <summary>
    /// TokenType
    /// </summary>
    TokenType,

    /// <summary>
    /// TokenImpersonationLevel
    /// </summary>
    TokenImpersonationLevel,

    /// <summary>
    /// TokenStatistics
    /// </summary>
    TokenStatistics,

    /// <summary>
    /// TokenRestrictedSIDs
    /// </summary>
    TokenRestrictedSIDs,

    /// <summary>
    /// TokenSessionID
    /// </summary>
    TokenSessionID,

    /// <summary>
    /// TokenGroupsAndPrivileges
    /// </summary>
    TokenGroupsAndPrivileges,

    /// <summary>
    /// TokenSessionReference
    /// </summary>
    TokenSessionReference,

    /// <summary>
    /// TokenSandBoxInert
    /// </summary>
    TokenSandBoxInert,

    /// <summary>
    /// TokenAuditPolicy
    /// </summary>
    TokenAuditPolicy,

    /// <summary>
    /// TokenOrigin
    /// </summary>
    TokenOrigin,

    /// <summary>
    /// TokenElevationType
    /// </summary>
    TokenElevationType,

    /// <summary>
    /// TokenLinkedToken
    /// </summary>
    TokenLinkedToken,

    /// <summary>
    /// TokenElevation
    /// </summary>
    TokenElevation,

    /// <summary>
    /// TokenHasRestrictions
    /// </summary>
    TokenHasRestrictions,

    /// <summary>
    /// TokenAccessInformation
    /// </summary>
    TokenAccessInformation,

    /// <summary>
    /// TokenVirtualizationAllowed
    /// </summary>
    TokenVirtualizationAllowed,

    /// <summary>
    /// TokenVirtualizationEnabled
    /// </summary>
    TokenVirtualizationEnabled,

    /// <summary>
    /// TokenIntegrityLevel
    /// </summary>
    TokenIntegrityLevel,

    /// <summary>
    /// TokenUIAccess
    /// </summary>
    TokenUIAccess,

    /// <summary>
    /// TokenMandatoryPolicy
    /// </summary>
    TokenMandatoryPolicy,

    /// <summary>
    /// TokenLogonSid
    /// </summary>
    TokenLogonSID,

    /// <summary>
    /// MaxTokenInfoClass
    /// </summary>
    MaxTokenInfoClass
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요