public static WaitValues WaitForSingleObject(SafeMemoryHandle handle)
{
// Check if the handle is valid
HandleManipulator.ValidateAsArgument(handle, "handle");
// Wait for single object
var ret = NativeMethods.WaitForSingleObject(handle, 0xFFFFFFFF);
// If the function failed
if (ret == WaitValues.Failed)
throw new Win32Exception("The WaitForSingleObject function call failed.");
return ret;
}