当前位置: 首页>>代码示例>>C#>>正文


C# TOKEN_INFORMATION_CLASS类代码示例

本文整理汇总了C#中TOKEN_INFORMATION_CLASS的典型用法代码示例。如果您正苦于以下问题:C# TOKEN_INFORMATION_CLASS类的具体用法?C# TOKEN_INFORMATION_CLASS怎么用?C# TOKEN_INFORMATION_CLASS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TOKEN_INFORMATION_CLASS类属于命名空间,在下文中一共展示了TOKEN_INFORMATION_CLASS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTokenInformation

 public static SafeHandle GetTokenInformation(SafeCloseHandle token, TOKEN_INFORMATION_CLASS infoClass)
 {
     uint length;
     if (!SafeNativeMethods.GetTokenInformation(token, infoClass, SafeHGlobalHandle.InvalidHandle, 0, out length))
     {
         int error = Marshal.GetLastWin32Error();
         if (error != (int)Win32Error.ERROR_INSUFFICIENT_BUFFER)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error, SR.GetString(SR.GetTokenInfoFailed, error)));
         }
     }
     SafeHandle buffer = SafeHGlobalHandle.AllocHGlobal(length);
     try
     {
         if (!SafeNativeMethods.GetTokenInformation(token, infoClass, buffer, length, out length))
         {
             int error = Marshal.GetLastWin32Error();
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error, SR.GetString(SR.GetTokenInfoFailed, error)));
         }
     }
     catch
     {
         buffer.Dispose();
         throw;
     }
     return buffer;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:27,代码来源:ComPlusAuthorization.cs

示例2: GetTokenInformation

 static extern bool GetTokenInformation(
     IntPtr TokenHandle,
     TOKEN_INFORMATION_CLASS TokenInformationClass,
     IntPtr TokenInformation,
     uint TokenInformationLength,
     out uint ReturnLength
     );
开发者ID:windrobin,项目名称:kumpro,代码行数:7,代码来源:UtVistaToken.cs

示例3: GetTokenInformation

		static extern bool GetTokenInformation(
			HANDLE hToken,
			TOKEN_INFORMATION_CLASS tokenInfoClass,
			IntPtr TokenInformation,
			int tokeInfoLength,
			ref int reqLength
		);
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:ProcessHelper.cs

示例4: GetTokenInformation

 public static extern bool GetTokenInformation(
     IntPtr TokenHandle,
     TOKEN_INFORMATION_CLASS TokenInformationClass,
     IntPtr TokenInformation,
     UInt32 TokenInformationLength,
     out UInt32 ReturnLength
     );
开发者ID:cagrawal21,项目名称:x360ce,代码行数:7,代码来源:NativeMethods.cs

示例5: GetTokenInformation

 internal static extern bool GetTokenInformation(SafeCloseHandle tokenHandle, TOKEN_INFORMATION_CLASS tokenInformationClass, [Out] byte[] pTokenInformation, int tokenInformationLength, out int returnLength);
开发者ID:uQr,项目名称:referencesource,代码行数:1,代码来源:ListenerUnsafeNativeMethods.cs

示例6: GetTokenInformation

 public static extern bool GetTokenInformation(int TokenHandle,
     TOKEN_INFORMATION_CLASS TokenInformationClass, ref TOKEN_SOURCE TokenInformation,
     int TokenInformationLength, out int ReturnLength);
开发者ID:andyvand,项目名称:ProcessHacker,代码行数:3,代码来源:Functions.cs

示例7: GetTokenInformation

            public static bool GetTokenInformation([NotNull] SafeTokenHandle hToken, TOKEN_INFORMATION_CLASS tokenInfoClass, [NotNull] SafeNativeMemory pTokenInfo)
            {
                Contract.Requires(hToken != null);
                Contract.Requires(pTokenInfo != null);

                int cbReturned;
                return GetTokenInformation(hToken, tokenInfoClass, pTokenInfo.DangerousGetHandle(), pTokenInfo.Size, out cbReturned);
            }
开发者ID:tom-englert,项目名称:TomsToolbox,代码行数:8,代码来源:UserAccountControl.cs

示例8: SetTokenInformation

 public static extern bool SetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass,
                                                ref int TokenInformation, int TokenInformationLength);
开发者ID:rcanright,项目名称:pgina,代码行数:2,代码来源:pInvokes.cs

示例9: GetTokenInformation

 public unsafe static extern bool GetTokenInformation(
          SafeTokenHandle TokenHandle,
          TOKEN_INFORMATION_CLASS TokenInfoClass,
    [Out] void* TokenInformation,
          int TokenInfoLength,
    [Out] out int ccbReturn);
开发者ID:nickchal,项目名称:pash,代码行数:6,代码来源:UnsafeNativeMethods.cs

示例10: GetTokenInformation

	private static extern int GetTokenInformation(
		IntPtr TokenHandle,
		TOKEN_INFORMATION_CLASS TokenInformationClass,
		out int TokenInformation,
		int TokenInformationLength,
		out int ReturnLength);
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:6,代码来源:java.util.prefs.cs

示例11: GetTokenInformation

 public static SafeHandle GetTokenInformation(SafeCloseHandle token, TOKEN_INFORMATION_CLASS infoClass)
 {
     uint num;
     if (!SafeNativeMethods.GetTokenInformation(token, infoClass, SafeHGlobalHandle.InvalidHandle, 0, out num))
     {
         int error = Marshal.GetLastWin32Error();
         if (error != 0x7a)
         {
             throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error, System.ServiceModel.SR.GetString("GetTokenInfoFailed", new object[] { error })));
         }
     }
     SafeHandle tokenInformation = SafeHGlobalHandle.AllocHGlobal(num);
     try
     {
         if (!SafeNativeMethods.GetTokenInformation(token, infoClass, tokenInformation, num, out num))
         {
             int num3 = Marshal.GetLastWin32Error();
             throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(num3, System.ServiceModel.SR.GetString("GetTokenInfoFailed", new object[] { num3 })));
         }
     }
     catch
     {
         tokenInformation.Dispose();
         throw;
     }
     return tokenInformation;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:SecurityUtils.cs

示例12: SetTokenInformation

 static extern Boolean SetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, ref UInt32 TokenInformation, UInt32 TokenInformationLength);
开发者ID:hoeness2,项目名称:mcebuddy2,代码行数:1,代码来源:AppProcess.cs

示例13: SetTokenInformation

 public static extern bool SetTokenInformation(
     SafeTokenHandle hToken,
     TOKEN_INFORMATION_CLASS tokenInfoClass,
     IntPtr pTokenInfo,
     Int32 tokenInfoLength);
开发者ID:bazile,项目名称:Training,代码行数:5,代码来源:NativeMethods.cs

示例14: GetTokenInformation

 public static extern bool GetTokenInformation(SafeTokenHandle TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, ref TOKEN_ELEVATION_TYPE TokenInformation, int TokenInformationLength, out uint ReturnLength);
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:1,代码来源:Security.cs

示例15: SetTokenInformation

 internal static extern bool SetTokenInformation(SafeTokenHandle hToken, TOKEN_INFORMATION_CLASS informationClass,
                                                 TOKEN_MANDATORY_LABEL tokenInformation,
                                                 int tokenInformationLength);
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:3,代码来源:Win32Native.cs


注:本文中的TOKEN_INFORMATION_CLASS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。