public static void CloseHandle(IntPtr handle)
{
// Check if the handle is valid
HandleManipulator.ValidateAsArgument(handle, "handle");
// Close the handle
if (!NativeMethods.CloseHandle(handle))
{
throw new Win32Exception(string.Format("Couldn't close he handle 0x{0}.", handle));
}
}