SecureDelete.WipeContext.ValidResult C# (CSharp) Method

ValidResult() private method

Check the result received from the native methods
private ValidResult ( int result ) : bool
result int
return bool
        private bool ValidResult(int result)
        {
            switch(result) {
                case NativeMethods.ERRORCODE_INITIALIZATION: {
                    Debug.ReportWarning("Context not initialized");
                    break;
                }
                case NativeMethods.ERRORCODE_INVALID_CONTEXT: {
                    Debug.ReportWarning("Invalid context Id");
                    break;
                }
                case NativeMethods.ERRORCODE_INVALID_REQUEST: {
                    Debug.ReportWarning("Invalid request");
                    break;
                }
                case NativeMethods.ERRORCODE_NO_MORE_CONTEXTS: {
                    Debug.ReportWarning("No more context slots available");
                    break;
                }
            }

            return (result == NativeMethods.ERRORCODE_SUCCESS);
        }