本文整理汇总了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);
示例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;
}
示例3: PlaySound
static bool PlaySound (
byte [] ptrToSound,
UIntPtr hmod,
SoundFlags flags)
{
throw new System.NotImplementedException();
}
示例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);
}
示例5: RegNotifyChangeKeyValue
public static extern int RegNotifyChangeKeyValue(
UIntPtr hKey,
bool bWatchSubtree,
uint dwNotifyFilter,
SafeWaitHandle hEvent,
bool fAsynchronous
);
示例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);
}
示例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);
}
示例8: Log4JEventProperty
public Log4JEventProperty(IntPtr name, UIntPtr nameSize, IntPtr value, UIntPtr valueSize)
{
Name = name;
NameSize = nameSize;
Value = value;
ValueSize = valueSize;
}
示例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);
}
示例10: RegQueryValueEx
public static extern int RegQueryValueEx(
UIntPtr hKey,
string lpValueName,
int lpReserved,
out uint lpType,
StringBuilder lpData,
ref uint lpcbData);
示例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);
}
示例12: SendMessageTimeout
private static extern IntPtr SendMessageTimeout(IntPtr hWnd,
uint Msg,
UIntPtr wParam,
UIntPtr lParam,
SendMessageTimeoutFlags fuFlags,
uint uTimeout,
out UIntPtr lpdwResult);
示例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
}
示例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();
}
示例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;
}