• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# HANDLE类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AdjustTokenPrivileges

 public static extern int AdjustTokenPrivileges(
     HANDLE TokenHandle,
     int DisableAllPrivileges,
     PTOKEN_PRIVILEGES NewState,
     uint BufferLength,
     PTOKEN_PRIVILEGES PreviousState,
     out uint ReturnLength);
开发者ID:farshad-sadri,项目名称:Windows-10-Login-Background-Changer,代码行数:7,代码来源:Win32.cs


示例2: GraphicsPlus

        public GraphicsPlus(HDC hdc,
                 HANDLE hdevice)
        {
            GpGraphics Graphics = new GpGraphics();

            lastResult = NativeMethods.GdipCreateFromHDC2(hdc, hdevice, out Graphics);

            SetNativeGraphics(Graphics);
        }
开发者ID:intille,项目名称:mitessoftware,代码行数:9,代码来源:GraphicsPlus.cs


示例3: GetSecurityInfo

		public static void GetSecurityInfo(
			HANDLE handle,
			SE_OBJECT_TYPE objectType,
			SECURITY_INFORMATION securityInfo,
			out Sid sidOwner,
			out Sid sidGroup,
			out Dacl dacl,
			out Sacl sacl,
			out SecurityDescriptor secDesc)
		{
			sidOwner = null;
			sidGroup = null;
			dacl = null;
			sacl = null;
			secDesc = null;

			IntPtr ptrOwnerSid = IntPtr.Zero;
			IntPtr ptrGroupSid = IntPtr.Zero;
			IntPtr ptrDacl = IntPtr.Zero;
			IntPtr ptrSacl = IntPtr.Zero;
			IntPtr ptrSecDesc = IntPtr.Zero;

			DWORD rc = Win32.GetSecurityInfo(handle, objectType, securityInfo,
				ref ptrOwnerSid, ref ptrGroupSid, ref ptrDacl, ref ptrSacl, ref ptrSecDesc);

			if (rc != Win32.ERROR_SUCCESS)
			{
				Win32.SetLastError(rc);
				Win32.ThrowLastError();
			}

			try
			{
				if (ptrOwnerSid != IntPtr.Zero)
					sidOwner = new Sid(ptrOwnerSid);

				if (ptrGroupSid != IntPtr.Zero)
					sidGroup = new Sid(ptrGroupSid);

				if (ptrDacl != IntPtr.Zero)
					dacl = new Dacl(ptrDacl);

				if (ptrSacl != IntPtr.Zero)
					sacl = new Sacl(ptrSacl);

				if (ptrSecDesc != IntPtr.Zero)
					secDesc = new SecurityDescriptor(ptrSecDesc, true);
			}
			catch
			{
				if (ptrSecDesc != IntPtr.Zero)
					Win32.LocalFree(ptrSecDesc);
				throw;
			}
		}
开发者ID:jmbolivar,项目名称:BetterExplorer,代码行数:55,代码来源:Win32Helpers.cs


示例4: GetSecurityInfo

		public static SecurityDescriptor GetSecurityInfo(
			HANDLE handle,
			SE_OBJECT_TYPE objectType,
			SECURITY_INFORMATION securityInfo)
		{
			Sid sidOwner;
			Sid sidGroup;
			Dacl dacl;
			Sacl sacl;
			SecurityDescriptor secDesc;
			Win32Helpers.GetSecurityInfo(handle, objectType, securityInfo,
				out sidOwner, out sidGroup, out dacl, out sacl,	out secDesc);

			return secDesc;
		}
开发者ID:jmbolivar,项目名称:BetterExplorer,代码行数:15,代码来源:SecurityDescriptor.cs


示例5: EndDeferWindowPos

 public static extern bool EndDeferWindowPos(HANDLE hWndPosInfo);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例6: DeferWindowPos

 public static extern bool DeferWindowPos(HANDLE hWndPosInfo, HWND hWnd, HWND hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例7: TerminateProcess

		public static extern BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode);
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:1,代码来源:NativeMethods.cs


示例8: GetRawInputDeviceInfo

 internal static extern INT GetRawInputDeviceInfo(
     HANDLE Device,
     [MarshalAs(UnmanagedType.U4)] RawInputDeviceInfoEnum Command,
     [In, Out] RawInputDeviceInfo Data,
     [In, Out] ref INT Size
 );
开发者ID:jpbruyere,项目名称:opentk,代码行数:6,代码来源:API.cs


示例9: SetProcessWorkingSetSize

 public static extern bool SetProcessWorkingSetSize(HANDLE hProcess, IntPtr min, IntPtr max);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例10: ReleaseMutex

 public static extern bool ReleaseMutex(HANDLE hMutex);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例11: LoadLibraryEx

 public static extern HINSTANCE LoadLibraryEx(string stModuleName, HANDLE hFile, uint dwFlags);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例12: OpenProcessToken

		public static extern BOOL OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, [Out] out HANDLE TokenHandle);
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:1,代码来源:NativeMethods.cs


示例13: AdjustTokenPrivileges

		public static extern BOOL AdjustTokenPrivileges(HANDLE TokenHandle,
			[MarshalAs(UnmanagedType.Bool)] BOOL DisableAllPrivileges, ref TOKEN_PRIVILEGES NewState, DWORD BufferLength,
			IntPtr PreviousState = default(IntPtr), IntPtr ReturnLength = default(IntPtr));
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:3,代码来源:NativeMethods.cs


示例14: GetFinalPathNameByHandle

		public static string GetFinalPathNameByHandle(HANDLE handle, DWORD dwFlags)
		{
			var pathLength = GetFinalPathNameByHandle(handle, null, 0, dwFlags);
			NativeMethods.CheckWin32(pathLength > 0);
			var pathBuilder = new StringBuilder((int)pathLength);
			pathBuilder.Length = (int)pathLength;
			NativeMethods.CheckWin32(GetFinalPathNameByHandle(handle, pathBuilder, pathLength, dwFlags) > 0);
			return pathBuilder.ToString();
		}
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:9,代码来源:NativeMethods.cs


示例15: WriteProcessMemory

		public static extern BOOL WriteProcessMemory(HANDLE hProcess, LPVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, out SIZE_T lpNumberOfBytesWritten);
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:1,代码来源:NativeMethods.cs


示例16: TerminateThread

		public static extern BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode);
开发者ID:MrTrillian,项目名称:Asmuth,代码行数:1,代码来源:NativeMethods.cs


示例17: FindClose

 public static extern bool FindClose(HANDLE hFindFile);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例18: FindNextFile

 public static extern bool FindNextFile(HANDLE hndFindFile, [In, Out, MarshalAs(UnmanagedType.LPStruct)] WIN32_FIND_DATA lpFindFileData);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs


示例19: GetFileInformationByHandleEx

/*
 *	TYPELIB
 *
 *	Copyright 1997	Marcus Meissner
 *		      1999  Rein Klazes
 *		      2000  Francois Jacques
 *		      2001  Huw D M Davies for CodeWeavers
 *		      2004  Alastair Bridgewater
 *		      2005  Robert Shearman, for CodeWeavers
 *		      2013  Andrew Eikum for CodeWeavers
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 *
 * --------------------------------------------------------------------------------------
 * Known problems (2000, Francois Jacques)
 *
 * - Tested using OLEVIEW (Platform SDK tool) only.
 *
 * - dual interface dispinterfaces. vtable-interface ITypeInfo instances are
 *   creating by doing a straight copy of the dispinterface instance and just changing
 *   its typekind. Pointed structures aren't copied - only the address of the pointers.
 *
 * - locale stuff is partially implemented but hasn't been tested.
 *
 * - typelib file is still read in its entirety, but it is released now.
 *
 * --------------------------------------------------------------------------------------
 *  Known problems left from previous implementation (1999, Rein Klazes) :
 *
 * -. Data structures are straightforward, but slow for look-ups.
 * -. (related) nothing is hashed
 * -. Most error return values are just guessed not checked with windows
 *      behaviour.
 * -. lousy fatal error handling
 *
 */

//#include "precomp.h"

//#include <winternl.h>
//#include <lzexpand.h>

//#include "typelib.h"

//WINE_DEFAULT_DEBUG_CHANNEL(ole);
//WINE_DECLARE_DEBUG_CHANNEL(typelib);

#if __REACTOS__
/* FIXME: Vista+ */
//#define STATUS_SUCCESS ((NTSTATUS)0x00000000)
static BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLASS class,
开发者ID:gitter-badger,项目名称:reko,代码行数:63,代码来源:TypeLib.cs


示例20: RegNotifyChangeKeyValue

 public static extern int RegNotifyChangeKeyValue(HKEY hkey, bool bWatchSubtree, int dwNotifyFilter, HANDLE hEvent, bool fAsynchronous);
开发者ID:peeboo,项目名称:open-media-library,代码行数:1,代码来源:ThemeManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# HAPI_Session类代码示例发布时间:2022-05-24
下一篇:
C# Gun类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap