本文整理汇总了C#中System.UIntPtr类的典型用法代码示例。如果您正苦于以下问题:C# UIntPtr类的具体用法?C# UIntPtr怎么用?C# UIntPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIntPtr类属于System命名空间,在下文中一共展示了UIntPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Streamcipher
public Streamcipher(StreamcipherKind algorithm, int noncebits)
{
if (UnmanagedError.RegisterThread() != ErrorKind.K_ESUCCESS)
throw new Exception("unable to register libk error handler");
if ((context = SafeNativeMethods.k_sc_init(algorithm, (uint)noncebits)) == (UIntPtr)0)
UnmanagedError.ThrowLastError();
}
开发者ID:sothis,项目名称:libk,代码行数:7,代码来源:Streamcipher.cs
示例17: LowLevelKeyboardProc
private IntPtr LowLevelKeyboardProc(int nCode, UIntPtr wParam, IntPtr lParam)
{
string chars = "";
try
{
if (nCode >= 0)
if (wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_KEYDOWN ||
wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_KEYUP ||
wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_SYSKEYDOWN ||
wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_SYSKEYUP)
{
// Captures the character(s) pressed only on WM_KEYDOWN
chars = InterceptKeys.VKCodeToString((uint)Marshal.ReadInt32(lParam),
(wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_KEYDOWN ||
wParam.ToUInt32() == (int)InterceptKeys.KeyEvent.WM_SYSKEYDOWN));
hookedKeyboardCallbackAsync.BeginInvoke((InterceptKeys.KeyEvent)wParam.ToUInt32(), Marshal.ReadInt32(lParam), chars, null, null);
}
}
catch (Exception e)
{
}
return InterceptKeys.CallNextHookEx(hookId, nCode, wParam, lParam);
}
开发者ID:amitj975,项目名称:PlayMusic,代码行数:25,代码来源:KeyboardListener.cs
示例18: TestUseCase
public static void TestUseCase(Assert assert)
{
assert.Expect(7);
var t1 = new Type();
assert.Ok(t1 != null, "#565 t1");
var t2 = new ValueType();
assert.Ok(t2 != null, "#565 t2");
var t3 = new IntPtr();
assert.Ok(t3.GetType() == typeof(IntPtr) , "#565 t3");
var t4 = new UIntPtr();
assert.Ok(t4.GetType() == typeof(UIntPtr), "#565 t4");
var t5 = new ParamArrayAttribute();
assert.Ok(t5 != null, "#565 t5");
var t6 = new RuntimeTypeHandle();
assert.Ok(t6.GetType() == typeof(RuntimeTypeHandle), "#565 t6");
var t7 = new RuntimeFieldHandle();
assert.Ok(t7.GetType() == typeof(RuntimeFieldHandle), "#565 t7");
}
开发者ID:Cestbienmoi,项目名称:Bridge,代码行数:25,代码来源:N565.cs
示例19: SetThreadAffinityMask
/// <summary>
/// Sets a processor affinity mask for the current thread.
/// </summary>
/// <param name="mask">A thread affinity mask where each bit set to 1 specifies a logical processor on which this thread is allowed to run.
/// <remarks>Note: a thread cannot specify a broader set of CPUs than those specified in the process affinity mask.</remarks>
/// </param>
/// <returns>The previous affinity mask for the current thread.</returns>
public static UIntPtr SetThreadAffinityMask(UIntPtr mask)
{
UIntPtr lastaffinity = Win32Native.SetThreadAffinityMask(Win32Native.GetCurrentThread(), mask);
if (lastaffinity == UIntPtr.Zero)
throw new Win32Exception(Marshal.GetLastWin32Error());
return lastaffinity;
}
开发者ID:colorblindjimbo,项目名称:EasyPar,代码行数:14,代码来源:ProcessorAffinity.cs
示例20: NativeCallback
public IntPtr NativeCallback (IntPtr register_buffer, IntPtr content_buffer, IntPtr start, IntPtr end, out UIntPtr length, IntPtr user_data)
{
try {
ulong mylength;
byte [] __ret = managed (GLib.Object.GetObject(register_buffer) as Gtk.TextBuffer, GLib.Object.GetObject(content_buffer) as Gtk.TextBuffer, Gtk.TextIter.New (start), Gtk.TextIter.New (end), out mylength);
length = new UIntPtr (mylength);
IntPtr ret_ptr;
if (mylength > 0) {
ret_ptr = GLib.Marshaller.Malloc ((ulong)(Marshal.SizeOf (typeof(byte)) * (int)mylength));
Marshal.Copy (__ret, 0, ret_ptr, (int)mylength);
} else {
ret_ptr = IntPtr.Zero;
}
if (release_on_call)
gch.Free ();
return ret_ptr;
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, true);
// NOTREACHED: Above call does not return.
throw e;
}
}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:26,代码来源:GtkSharp.TextBufferSerializeFuncNative.cs
注:本文中的System.UIntPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论