SecureDelete.WipeContext.GetFailedObject C# (CSharp) Method

GetFailedObject() public method

Get an failed object, and optionally, its associated error
public GetFailedObject ( int index, NativeMethods &item, bool getAssociatedError, NativeMethods &error ) : bool
index int
item NativeMethods
getAssociatedError bool
error NativeMethods
return bool
        public bool GetFailedObject(int index, out NativeMethods.WSmallObject item, 
            bool getAssociatedError, out NativeMethods.WError error)
        {
            CheckContextInitialized();

            // object can be inserted only when the context is stopped
            if(_status != ContextStatus.Stopped) {
                throw new Exception("Object can be inserted only when the context is stopped");
            }

            int result = NativeMethods.GetFailedObject(_contextId, index, out item);

            if(result == NativeMethods.ERRORCODE_SUCCESS && getAssociatedError) {
                // get the associated error
                result = NativeMethods.GetError(_contextId, item.log, out error);
            }
            else {
                error = new NativeMethods.WError();
            }

            return ValidResult(result);
        }