當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。