This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace System | |
{ | |
public class LazyType<T> | |
{ | |
private static readonly Func<T> DefaultValueFactory = () => default(T); | |
private readonly object _lock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace System.Input | |
{ | |
/// <summary> | |
/// An enumeration of all VirtualKeyCodes on Windows | |
/// </summary> | |
public enum VirtualKeyCode : int | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace System.Input | |
{ | |
public class KeyboardState | |
{ | |
[DllImport("user32.dll")] | |
private static extern int GetKeyboardState(byte[] buffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using System.Runtime.Serialization; | |
namespace System.Runtime.InteropServices | |
{ | |
public static class DynamicImport | |
{ | |
[DllImport("kernel32.dll", EntryPoint = "GetProcAddress", SetLastError = true, CharSet = CharSet.Ansi)] | |
private static extern IntPtr GetProcAddress(IntPtr hModule, string procname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace System | |
{ | |
public static class IntPtrExtensions | |
{ | |
private static readonly bool _x86 = IntPtr.Size == 4; | |
public static ulong GetValue(this IntPtr ptr) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace System.Input | |
{ | |
public static class AsyncKeyState | |
{ | |
[DllImport("user32.dll")] | |
private static extern short GetAsyncKeyState(int key); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace System | |
{ | |
/// <summary> | |
/// Represents a static and thread safe pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness. | |
/// </summary> | |
public static class StaticRandom | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace System.Security.Cryptography | |
{ | |
/// <summary> | |
/// Represents a static and thread safe cryptographic Random Number Generator (RNG) using the implementation provided by the cryptographic service provider (CSP). | |
/// </summary> | |
public static class SecureStaticRandom | |
{ | |
private const long MAX_EXCLUSIVE_UINT = 1 + (long)uint.MaxValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use System.ComponentModel.Win32Exception instead | |
using System; | |
namespace Microsoft.Win32 | |
{ | |
/// <summary> | |
/// Contains all system error codes. | |
/// </summary> | |
public enum SystemError : uint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Microsoft.Win32 | |
{ | |
/// <summary> | |
/// Provides static helper methods to work with NTSTATUS values. | |
/// </summary> | |
public static class NTStatusHelper | |
{ | |
/// <summary> |
OlderNewer