Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /System.Data.SQLite/UnsafeNativeMethods.cs [d2857c] .. [9dba08] Maximize Restore

  Switch to side-by-side view

--- a/System.Data.SQLite/UnsafeNativeMethods.cs
+++ b/System.Data.SQLite/UnsafeNativeMethods.cs
@@ -1,8 +1,8 @@
-/********************************************************
- * ADO.NET 2.0 Data Provider for SQLite Version 3.X
- * Written by Robert Simpson (robert@blackcastlesoft.com)
- * 
- * Released to the public domain, use at your own risk!
+/********************************************************
+ * ADO.NET 2.0 Data Provider for SQLite Version 3.X
+ * Written by Robert Simpson (robert@blackcastlesoft.com)
+ * 
+ * Released to the public domain, use at your own risk!
  ********************************************************/
 
 using System.Runtime.InteropServices;
@@ -21,17 +21,17 @@
 
 #if !PLATFORM_COMPACTFRAMEWORK
         private const string SQLITE_DLL = "System.Data.SQLite.DLL";
-#else
+#else
     internal const string SQLITE_DLL = "SQLite.Interop.067.DLL";
 #endif
         // PLATFORM_COMPACTFRAMEWORK
 
-#else
+#else
     private const string SQLITE_DLL = "SQLite.Interop.DLL";
 #endif
         // USE_INTEROP_DLL
 
-#else
+#else
     private const string SQLITE_DLL = "sqlite3";
 #endif
 
@@ -138,173 +138,173 @@
 
         #region standard versions of interop functions
 
-#if SQLITE_STANDARD
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_close(IntPtr db);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_create_function(IntPtr db, byte[] strName, int nArgs, int nType, IntPtr pvUser, SQLiteCallback func, SQLiteCallback fstep, SQLiteFinalCallback ffinal);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_finalize(IntPtr stmt);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_open_v2(byte[] utf8Filename, out IntPtr db, int flags, IntPtr vfs);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
-#else
-    [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
-#endif
-    internal static extern int sqlite3_open16(string fileName, out IntPtr db);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_reset(IntPtr stmt);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_bind_parameter_name(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_database_name(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_database_name16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_decltype(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_decltype16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_name(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_name16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_origin_name(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_origin_name16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_table_name(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_table_name16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_text(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_column_text16(IntPtr stmt, int index);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_errmsg(IntPtr db);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_prepare(IntPtr db, IntPtr pSql, int nBytes, out IntPtr stmt, out IntPtr ptrRemain);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern int sqlite3_table_column_metadata(IntPtr db, byte[] dbName, byte[] tblName, byte[] colName, out IntPtr ptrDataType, out IntPtr ptrCollSeq, out int notNull, out int primaryKey, out int autoInc);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
-    internal static extern IntPtr sqlite3_value_text(IntPtr p);
-
-#if !PLATFORM_COMPACTFRAMEWORK
-    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
-    [DllImport(SQLITE_DLL)]
-#endif
+#if SQLITE_STANDARD
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_close(IntPtr db);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_create_function(IntPtr db, byte[] strName, int nArgs, int nType, IntPtr pvUser, SQLiteCallback func, SQLiteCallback fstep, SQLiteFinalCallback ffinal);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_finalize(IntPtr stmt);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_open_v2(byte[] utf8Filename, out IntPtr db, int flags, IntPtr vfs);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
+#else
+    [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
+#endif
+    internal static extern int sqlite3_open16(string fileName, out IntPtr db);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_reset(IntPtr stmt);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_bind_parameter_name(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_database_name(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_database_name16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_decltype(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_decltype16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_name(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_name16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_origin_name(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_origin_name16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_table_name(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_table_name16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_text(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_column_text16(IntPtr stmt, int index);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_errmsg(IntPtr db);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_prepare(IntPtr db, IntPtr pSql, int nBytes, out IntPtr stmt, out IntPtr ptrRemain);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern int sqlite3_table_column_metadata(IntPtr db, byte[] dbName, byte[] tblName, byte[] colName, out IntPtr ptrDataType, out IntPtr ptrCollSeq, out int notNull, out int primaryKey, out int autoInc);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
+    internal static extern IntPtr sqlite3_value_text(IntPtr p);
+
+#if !PLATFORM_COMPACTFRAMEWORK
+    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
+#else
+    [DllImport(SQLITE_DLL)]
+#endif
     internal static extern IntPtr sqlite3_value_text16(IntPtr p);
 #endif
 
@@ -348,35 +348,35 @@
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_libversion();
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_interrupt(IntPtr db);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_changes(IntPtr db);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_busy_timeout(IntPtr db, int ms);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_blob(IntPtr stmt, int index, Byte[] value, int nSize, IntPtr nTransient);
@@ -384,14 +384,14 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern int sqlite3_bind_double(IntPtr stmt, int index, double value);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern int sqlite3_bind_double_interop(IntPtr stmt, int index, ref double value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_int(IntPtr stmt, int index, int value);
@@ -399,49 +399,49 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern int sqlite3_bind_int64(IntPtr stmt, int index, long value);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern int sqlite3_bind_int64_interop(IntPtr stmt, int index, ref long value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_null(IntPtr stmt, int index);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_text(IntPtr stmt, int index, byte[] value, int nlen, IntPtr pvReserved);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_parameter_count(IntPtr stmt);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_bind_parameter_index(IntPtr stmt, byte[] strName);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_column_count(IntPtr stmt);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_step(IntPtr stmt);
@@ -449,14 +449,14 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern double sqlite3_column_double(IntPtr stmt, int index);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_column_double_interop(IntPtr stmt, int index, out double value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_column_int(IntPtr stmt, int index);
@@ -464,35 +464,35 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern long sqlite3_column_int64(IntPtr stmt, int index);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_column_int64_interop(IntPtr stmt, int index, out long value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_column_blob(IntPtr stmt, int index);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_column_bytes(IntPtr stmt, int index);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern TypeAffinity sqlite3_column_type(IntPtr stmt, int index);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_create_collation(IntPtr db, byte[] strName, int nType, IntPtr pvUser,
@@ -500,21 +500,21 @@
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_aggregate_count(IntPtr context);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_value_blob(IntPtr p);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_value_bytes(IntPtr p);
@@ -522,14 +522,14 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern double sqlite3_value_double(IntPtr p);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_value_double_interop(IntPtr p, out double value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_value_int(IntPtr p);
@@ -537,21 +537,21 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern long sqlite3_value_int64(IntPtr p);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_value_int64_interop(IntPtr p, out Int64 value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern TypeAffinity sqlite3_value_type(IntPtr p);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_result_blob(IntPtr context, byte[] value, int nSize, IntPtr pvReserved);
@@ -559,21 +559,21 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern void sqlite3_result_double(IntPtr context, double value);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_result_double_interop(IntPtr context, ref double value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_result_error(IntPtr context, byte[] strErr, int nLen);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_result_int(IntPtr context, int value);
@@ -581,105 +581,105 @@
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
         internal static extern void sqlite3_result_int64(IntPtr context, long value);
-#else
-    [DllImport(SQLITE_DLL)]
+#else
+    [DllImport(SQLITE_DLL)]
     internal static extern void sqlite3_result_int64_interop(IntPtr context, ref Int64 value);
 #endif
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_result_null(IntPtr context);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern void sqlite3_result_text(IntPtr context, byte[] value, int nLen, IntPtr pvReserved);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_aggregate_context(IntPtr context, int nBytes);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
-#else
+#else
     [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
 #endif
         internal static extern int sqlite3_bind_text16(IntPtr stmt, int index, string value, int nlen, IntPtr pvReserved);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
-#else
+#else
     [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
 #endif
         internal static extern void sqlite3_result_error16(IntPtr context, string strName, int nLen);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
-#else
+#else
     [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
 #endif
         internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_key(IntPtr db, byte[] key, int keylen);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_rekey(IntPtr db, byte[] key, int keylen);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_update_hook(IntPtr db, SQLiteUpdateCallback func, IntPtr pvUser);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_commit_hook(IntPtr db, SQLiteCommitCallback func, IntPtr pvUser);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_rollback_hook(IntPtr db, SQLiteRollbackCallback func, IntPtr pvUser);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_db_handle(IntPtr stmt);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern IntPtr sqlite3_next_stmt(IntPtr db, IntPtr stmt);
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_exec(IntPtr db, byte[] strSql, IntPtr pvCallback, IntPtr pvParam,
@@ -687,7 +687,7 @@
 
 #if !PLATFORM_COMPACTFRAMEWORK
         [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
-#else
+#else
     [DllImport(SQLITE_DLL)]
 #endif
         internal static extern int sqlite3_get_autocommit(IntPtr db);
@@ -695,159 +695,75 @@
         #endregion
     }
 
-#if PLATFORM_COMPACTFRAMEWORK
-  internal abstract class CriticalHandle : IDisposable
-  {
-    private bool _isClosed;
-    protected IntPtr handle;
-    
-    protected CriticalHandle(IntPtr invalidHandleValue)
-    {
-      handle = invalidHandleValue;
-      _isClosed = false;
-    }
-
-    ~CriticalHandle()
-    {
-      Dispose(false);
-    }
-
-    private void Cleanup()
-    {
-      if (!IsClosed)
-      {
-        this._isClosed = true;
-        if (!IsInvalid)
-        {
-          ReleaseHandle();
-          GC.SuppressFinalize(this);
-        }
-      }
-    }
-
-    public void Close()
-    {
-      Dispose(true);
-    }
-
-    public void Dispose()
-    {
-      Dispose(true);
-    }
-
-    protected virtual void Dispose(bool disposing)
-    {
-      Cleanup();
-    }
-
-    protected abstract bool ReleaseHandle();
-
-    protected void SetHandle(IntPtr value)
-    {
-      handle = value;
-    }
-
-    public void SetHandleAsInvalid()
-    {
-      _isClosed = true;
-      GC.SuppressFinalize(this);
-    }
-
-    public bool IsClosed
-    {
-      get { return _isClosed; }
-    }
-
-    public abstract bool IsInvalid
-    {
-      get;
-    }
-
+#if PLATFORM_COMPACTFRAMEWORK
+  internal abstract class CriticalHandle : IDisposable
+  {
+    private bool _isClosed;
+    protected IntPtr handle;
+    
+    protected CriticalHandle(IntPtr invalidHandleValue)
+    {
+      handle = invalidHandleValue;
+      _isClosed = false;
+    }
+
+    ~CriticalHandle()
+    {
+      Dispose(false);
+    }
+
+    private void Cleanup()
+    {
+      if (!IsClosed)
+      {
+        this._isClosed = true;
+        if (!IsInvalid)
+        {
+          ReleaseHandle();
+          GC.SuppressFinalize(this);
+        }
+      }
+    }
+
+    public void Close()
+    {
+      Dispose(true);
+    }
+
+    public void Dispose()
+    {
+      Dispose(true);
+    }
+
+    protected virtual void Dispose(bool disposing)
+    {
+      Cleanup();
+    }
+
+    protected abstract bool ReleaseHandle();
+
+    protected void SetHandle(IntPtr value)
+    {
+      handle = value;
+    }
+
+    public void SetHandleAsInvalid()
+    {
+      _isClosed = true;
+      GC.SuppressFinalize(this);
+    }
+
+    public bool IsClosed
+    {
+      get { return _isClosed; }
+    }
+
+    public abstract bool IsInvalid
+    {
+      get;
+    }
+
   }
 
 #endif
-
-    // Handles the unmanaged database pointer, and provides finalization support for it.
-    internal class SQLiteConnectionHandle : CriticalHandle
-    {
-        private SQLiteConnectionHandle(IntPtr db)
-            : this()
-        {
-            SetHandle(db);
-        }
-
-        internal SQLiteConnectionHandle()
-            : base(IntPtr.Zero)
-        {
-        }
-
-        public override bool IsInvalid
-        {
-            get { return (handle == IntPtr.Zero); }
-        }
-
-        public static implicit operator IntPtr(SQLiteConnectionHandle db)
-        {
-            return db.handle;
-        }
-
-        public static implicit operator SQLiteConnectionHandle(IntPtr db)
-        {
-            return new SQLiteConnectionHandle(db);
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            try
-            {
-                SQLiteBase.CloseConnection(this);
-            }
-            catch (SQLiteException)
-            {
-            }
-            return true;
-        }
-    }
-
-    // Provides finalization support for unmanaged SQLite statements.
-    internal class SQLiteStatementHandle : CriticalHandle
-    {
-        private SQLiteStatementHandle(IntPtr stmt)
-            : this()
-        {
-            SetHandle(stmt);
-        }
-
-        internal SQLiteStatementHandle()
-            : base(IntPtr.Zero)
-        {
-        }
-
-        public override bool IsInvalid
-        {
-            get { return (handle == IntPtr.Zero); }
-        }
-
-        public static implicit operator IntPtr(SQLiteStatementHandle stmt)
-        {
-            return stmt.handle;
-        }
-
-        public static implicit operator SQLiteStatementHandle(IntPtr stmt)
-        {
-            return new SQLiteStatementHandle(stmt);
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            try
-            {
-                SQLiteBase.FinalizeStatement(this);
-            }
-            catch (SQLiteException)
-            {
-            }
-            return true;
-        }
-    }
 }