public static ValidateAsArgument ( |
||
handle | A handle to validate. | |
argumentName | string | The name of the argument that represents the handle in its original function. |
return | void |
public static void ValidateAsArgument(IntPtr handle, string argumentName)
{
// Check if the handle is not null
if(handle == null)
throw new ArgumentNullException(argumentName);
// Check if the handle is valid
if(handle == IntPtr.Zero)
throw new ArgumentException("The handle is not valid.", argumentName);
}
HandleManipulator::ValidateAsArgument ( |