internal static string GetLastError(SQLiteConnectionHandle hdl, IntPtr db) { if (hdl == null || db == IntPtr.Zero) { return("null connection or database handle"); } string str = null; try { } finally { lock (hdl) { if (hdl.IsInvalid || hdl.IsClosed) { str = "closed or invalid connection handle"; } else { int num = 0; str = SQLiteConvert.UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg_interop(db, ref num), num); } } } GC.KeepAlive(hdl); return(str); }
public virtual string ToString(IntPtr nativestring, int nativestringlen) { return(SQLiteConvert.UTF8ToString(nativestring, nativestringlen)); }
private static void LogCallback(IntPtr pUserData, int errorCode, IntPtr pMessage) { bool flag; SQLiteLogEventHandler sQLiteLogEventHandler; lock (SQLiteLog.syncRoot) { flag = SQLiteLog._enabled; if (SQLiteLog._handlers == null) { sQLiteLogEventHandler = null; } else { sQLiteLogEventHandler = SQLiteLog._handlers.Clone() as SQLiteLogEventHandler; } } if (flag && sQLiteLogEventHandler != null) { sQLiteLogEventHandler(null, new LogEventArgs(pUserData, (object)errorCode, SQLiteConvert.UTF8ToString(pMessage, -1), null)); } }