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


C# System.UIntPtr类代码示例

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


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

示例1: RealTimeMultiplayerManager_SendUnreliableMessage

 internal static extern void RealTimeMultiplayerManager_SendUnreliableMessage(
     HandleRef self,
  /* from(RealTimeRoom_t) */IntPtr room,
  /* from(MultiplayerParticipant_t const *) */IntPtr[] participants,
  /* from(size_t) */UIntPtr participants_size,
  /* from(uint8_t const *) */byte[] data,
  /* from(size_t) */UIntPtr data_size);
开发者ID:CodingDuff,项目名称:play-games-plugin-for-unity,代码行数:7,代码来源:RealTimeMultiplayerManager.cs

示例2: HunkCallback

        private int HunkCallback(GitDiffDelta delta, GitDiffRange range, IntPtr header, UIntPtr headerlen, IntPtr payload)
        {
            string decodedContent = Utf8Marshaler.FromNative(header, (int)headerlen);

            AppendToPatch(decodedContent);
            return 0;
        }
开发者ID:kckrinke,项目名称:libgit2sharp,代码行数:7,代码来源:ContentChanges.cs

示例3: PlaySound

		static bool PlaySound (
		byte [] ptrToSound,
		UIntPtr hmod,
		SoundFlags flags)
		{
			throw new System.NotImplementedException();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:Win32SoundPlayer.Mosa.cs

示例4: KeyboardHook

 public static UIntPtr KeyboardHook(int nCode, UIntPtr wParam, IntPtr lParam)
 {
     try
     {
         if (nCode == 0)
         {
             var wm = (WinAPI.WM)wParam.ToUInt32();
             Mubox.WinAPI.WindowHook.KBDLLHOOKSTRUCT keyboardHookStruct = (Mubox.WinAPI.WindowHook.KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(Mubox.WinAPI.WindowHook.KBDLLHOOKSTRUCT));
             if (OnKeyboardInputReceived(wm, keyboardHookStruct))
             {
                 return new UIntPtr(1);
             }
         }
     }
     catch (Exception ex)
     {
         ex.Log();
     }
     try
     {
         return Mubox.WinAPI.WindowHook.CallNextHookEx(hHook, nCode, wParam, lParam);
     }
     catch (Exception ex)
     {
         ex.Log();
     }
     return new UIntPtr(1);
 }
开发者ID:wilson0x4d,项目名称:Mubox,代码行数:28,代码来源:KeyboardInputHook.cs

示例5: RegNotifyChangeKeyValue

 public static extern int RegNotifyChangeKeyValue(
     UIntPtr hKey,
     bool bWatchSubtree,
     uint dwNotifyFilter,
     SafeWaitHandle hEvent,
     bool fAsynchronous
     );
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:Advapi32.cs

示例6: SetDateTime

		public void SetDateTime (OciHandle handle, OciErrorHandle errorHandle,
					short year, byte month, byte day,
					byte hour, byte min, byte sec, uint fsec, string timezone)
		{
			// Get size of buffer
			ulong rsize = 0;
			UIntPtr rsizep = new UIntPtr (rsize);
			int status = OciCalls.OCIUnicodeToCharSet (handle, null, timezone, ref rsizep);

			// Fill buffer
			rsize = rsizep.ToUInt64 ();
			byte[] bytes = new byte[rsize];
			if (status == 0 && rsize > 0)
				OciCalls.OCIUnicodeToCharSet (handle, bytes, timezone, ref rsizep);

			if (fsec > 0)
				fsec = fsec * 1000000;

			uint timezoneSize = (uint) bytes.Length;
			OciCalls.OCIDateTimeConstruct (handle,
				errorHandle, this.Handle,
				year, month, day,
				hour, min, sec, fsec,
				bytes, timezoneSize);

			//uint valid = 0;
			//int result = OciCalls.OCIDateTimeCheck (handle,
			//	errorHandle, this.Handle, out valid);
		}
开发者ID:wamiq,项目名称:debian-mono,代码行数:29,代码来源:OciDateTimeDescriptor.cs

示例7: OnKeyHooked

        /// <summary>
        /// Override F1 to prevent it from getting to MSHTML. Will fire the HelpRequested
        /// event when the F1 key is pressed
        /// </summary>
        protected override IntPtr OnKeyHooked(int nCode, UIntPtr wParam, IntPtr lParam)
        {
            // only process HC_ACTION
            if (nCode == HC.ACTION)
            {
                // We want one key event per key key-press. To do this we need to
                // mask out key-down repeats and key-ups by making sure that bits 30
                // and 31 of the lParam are NOT set. Bit 30 specifies the previous
                // key state. The value is 1 if the key is down before the message is
                // sent; it is 0 if the key is up. Bit 31 specifies the transition
                // state. The value is 0 if the key is being pressed and 1 if it is
                // being released. Therefore, we are only interested in key events
                // where both bits are set to 0. To test for both of these bits being
                // set to 0 we use the constant REDUNDANT_KEY_EVENT_MASK.
                const uint REDUNDANT_KEY_EVENT_MASK = 0xC0000000;
                if (((uint)lParam & REDUNDANT_KEY_EVENT_MASK) == 0)
                {
                    // extract the keyCode and combine with modifier keys
                    Keys keyCombo =
                        ((Keys)(int)wParam & Keys.KeyCode) | KeyboardHelper.GetModifierKeys();

                    if (_tabs.CheckForTabSwitch(keyCombo))
                        return new IntPtr(1);
                }
            }

            // key not handled by our hook, continue processing
            return CallNextHook(nCode, wParam, lParam);
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:33,代码来源:TabbingHookProc.cs

示例8: Log4JEventProperty

 public Log4JEventProperty(IntPtr name, UIntPtr nameSize, IntPtr value, UIntPtr valueSize)
 {
     Name = name;
     NameSize = nameSize;
     Value = value;
     ValueSize = valueSize;
 }
开发者ID:MaxKot,项目名称:Log4JDash,代码行数:7,代码来源:Log4JEventProperty.cs

示例9: OnGitCheckoutProgress

        /// <summary>
        ///   The delegate with a signature that matches the native checkout progress_cb function's signature.
        /// </summary>
        /// <param name="str">The path that was updated.</param>
        /// <param name="completedSteps">The number of completed steps.</param>
        /// <param name="totalSteps">The total number of steps.</param>
        /// <param name="payload">Payload object.</param>
        private void OnGitCheckoutProgress(IntPtr str, UIntPtr completedSteps, UIntPtr totalSteps, IntPtr payload)
        {
            // Convert null strings into empty strings.
            string path = (str != IntPtr.Zero) ? Utf8Marshaler.FromNative(str) : string.Empty;

            onCheckoutProgress(path, (int)completedSteps, (int)totalSteps);
        }
开发者ID:KindDragon,项目名称:libgit2sharp,代码行数:14,代码来源:CheckoutCallbacks.cs

示例10: RegQueryValueEx

 public static extern int RegQueryValueEx(
   UIntPtr hKey,
   string lpValueName,
   int lpReserved,
   out uint lpType,
   StringBuilder lpData,
   ref uint lpcbData);
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:7,代码来源:Registry.cs

示例11: TestCtor_VoidPointer_ToPointer

        public static unsafe void TestCtor_VoidPointer_ToPointer()
        {
            void* pv = new UIntPtr(42).ToPointer();

            VerifyPointer(new UIntPtr(pv), 42);
            VerifyPointer((UIntPtr)pv, 42);
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:7,代码来源:UIntPtrTests.cs

示例12: SendMessageTimeout

 private static extern IntPtr SendMessageTimeout(IntPtr hWnd,
                                                 uint Msg,
                                                 UIntPtr wParam,
                                                 UIntPtr lParam,
                                                 SendMessageTimeoutFlags fuFlags,
                                                 uint uTimeout,
                                                 out UIntPtr lpdwResult);
开发者ID:Mexahoid,项目名称:CSF,代码行数:7,代码来源:ProxyChanger.cs

示例13: MemoryBlock

		public MemoryBlock(UIntPtr start, long size)
		{
#if !MONO
			Start = Kernel32.VirtualAlloc(start, checked((UIntPtr)size),
				Kernel32.AllocationType.RESERVE | Kernel32.AllocationType.COMMIT,
				Kernel32.MemoryProtection.NOACCESS);
			if (Start == UIntPtr.Zero)
			{
				throw new InvalidOperationException("VirtualAlloc() returned NULL");
			}
			if (start != UIntPtr.Zero)
				End = (UIntPtr)((long)start + size);
			else
				End = (UIntPtr)((long)Start + size);
			Size = (long)End - (long)Start;
#else
			Start = LibC.mmap(start, checked((UIntPtr)size), 0, LibC.MapType.MAP_ANONYMOUS, -1, IntPtr.Zero);
			if (Start == UIntPtr.Zero)
			{
				throw new InvalidOperationException("mmap() returned NULL");
			}
			End = (UIntPtr)((long)Start + size);
			Size = (long)End - (long)Start;
#endif
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:25,代码来源:MemoryBlock.cs

示例14: Hash

 public Hash(HashKind hashsum, int output_bits)
 {
     if (UnmanagedError.RegisterThread() != ErrorKind.K_ESUCCESS)
         throw new Exception("unable to register libk error handler");
     if ((context = SafeNativeMethods.k_hash_init(hashsum, (uint)output_bits)) == (UIntPtr)0)
         UnmanagedError.ThrowLastError();
 }
开发者ID:sothis,项目名称:libk,代码行数:7,代码来源:Hash.cs

示例15: OutputDevice

 /// <summary>
 /// Private Constructor, only called by the getter for the InstalledDevices property.
 /// </summary>
 /// <param name="deviceId">Position of this device in the list of all devices.</param>
 /// <param name="caps">Win32 Struct with device metadata</param>
 private OutputDevice(UIntPtr deviceId, Win32API.MIDIOUTCAPS caps)
     : base(caps.szPname)
 {
     this.deviceId = deviceId;
     this.caps = caps;
     this.isOpen = false;
 }
开发者ID:iUltimateLP,项目名称:launchpad-led-editor,代码行数:12,代码来源:OutputDevice.cs


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