/// <summary> /// Gets extended information about an error. /// </summary> /// <param name="error">The error code about which to retrieve information.</param> /// <param name="errinfo">Information about the specified error code.</param> /// <returns>An error code.</returns> public int JetGetErrorInfo( JET_err error, out JET_ERRINFOBASIC errinfo) { TraceFunctionCall(); this.CheckSupportsWindows8Features("JetGetErrorInfo"); NATIVE_ERRINFOBASIC nativeErrinfobasic = new NATIVE_ERRINFOBASIC(); errinfo = new JET_ERRINFOBASIC(); nativeErrinfobasic.cbStruct = checked ((uint)Marshal.SizeOf(typeof(NATIVE_ERRINFOBASIC))); int nativeErr = (int)error; int err = Implementation.NativeMethods.JetGetErrorInfoW( ref nativeErr, ref nativeErrinfobasic, nativeErrinfobasic.cbStruct, (uint)JET_ErrorInfo.SpecificErr, (uint)ErrorInfoGrbit.None); errinfo.SetFromNative(ref nativeErrinfobasic); return(err); }
public void Setup() { this.managedOriginal = new JET_ERRINFOBASIC() { errValue = JET_err.ReadVerifyFailure, errcat = JET_ERRCAT.Corruption, rgCategoricalHierarchy = new JET_ERRCAT[] { JET_ERRCAT.Error, JET_ERRCAT.Data, JET_ERRCAT.Fragmentation, 0, 0, 0, 0, 0 }, lSourceLine = 42, rgszSourceFile = "sourcefile.cxx", }; this.native = this.managedOriginal.GetNativeErrInfo(); this.managed = new JET_ERRINFOBASIC(); this.managed.SetFromNative(ref this.native); }
/// <summary> /// Gets extended information about an error. /// </summary> /// <param name="error">The error code about which to retrieve information.</param> /// <param name="errinfo">Information about the specified error code.</param> /// <returns>An error code.</returns> public int JetGetErrorInfo( JET_err error, out JET_ERRINFOBASIC errinfo) { TraceFunctionCall("JetGetErrorInfo"); this.CheckSupportsWindows8Features("JetGetErrorInfo"); NATIVE_ERRINFOBASIC nativeErrinfobasic = new NATIVE_ERRINFOBASIC(); errinfo = new JET_ERRINFOBASIC(); nativeErrinfobasic.cbStruct = checked((uint)Marshal.SizeOf(typeof(NATIVE_ERRINFOBASIC))); int nativeErr = (int)error; int err = Implementation.NativeMethods.JetGetErrorInfoW( ref nativeErr, ref nativeErrinfobasic, nativeErrinfobasic.cbStruct, (uint)JET_ErrorInfo.SpecificErr, (uint)ErrorInfoGrbit.None); errinfo.SetFromNative(ref nativeErrinfobasic); return err; }