System.Data.SQLite
Check-in [70d83a095a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid calling Win32 specific SQLite APIs on non-Windows platforms.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 70d83a095aa501f0f650b5d3090d7cff7d15c4f0
User & Date: mistachkin 2016-03-24 20:42:56
Context
2016-03-24
20:43
Fix a couple build configuration test constraints. check-in: 81ccaf438c user: mistachkin tags: trunk
20:42
Avoid calling Win32 specific SQLite APIs on non-Windows platforms. check-in: 70d83a095a user: mistachkin tags: trunk
20:42
Pickup Eagle script library fixes from upstream. check-in: 9e66a41b59 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLite3.cs.

791
792
793
794
795
796
797


798
799
800
801
802
803
804
805
806
807

808

809

810
811

812
813
814
815
816
817
818
...
842
843
844
845
846
847
848


849
850
851
852
853

854


855
856
857
858
859

860
861
862
863
864
865
866
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        int nFreeLocal = UnsafeNativeMethods.sqlite3_release_memory(nBytes);
        uint nLargestLocal = 0;
        bool resetOkLocal = false;

#if !DEBUG && WINDOWS // NOTE: Should be "WIN32HEAP && !MEMDEBUG && WINDOWS"


        if ((rc == SQLiteErrorCode.Ok) && reset)
        {
            rc = UnsafeNativeMethods.sqlite3_win32_reset_heap();

            if (rc == SQLiteErrorCode.Ok)
                resetOkLocal = true;
        }

        if ((rc == SQLiteErrorCode.Ok) && compact)
            rc = UnsafeNativeMethods.sqlite3_win32_compact_heap(ref nLargestLocal);

#else

        if (reset || compact)

            rc = SQLiteErrorCode.NotFound;
#endif


        nFree = nFreeLocal;
        nLargest = nLargestLocal;
        resetOk = resetOkLocal;

        return rc;
    }
................................................................................
        )
    {
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        if (directories)
        {
#if WINDOWS


            if (rc == SQLiteErrorCode.Ok)
                rc = UnsafeNativeMethods.sqlite3_win32_set_directory(1, null);

            if (rc == SQLiteErrorCode.Ok)
                rc = UnsafeNativeMethods.sqlite3_win32_set_directory(2, null);

#else


#if !NET_COMPACT_20 && TRACE_CONNECTION
            Trace.WriteLine(
                "Shutdown: Cannot reset directories on this platform.");
#endif
#endif

        }

        if (rc == SQLiteErrorCode.Ok)
            rc = UnsafeNativeMethods.sqlite3_shutdown();

        return rc;
    }







>
>
|
|
|

|
|
|

|
|
>
|
>

>

<
>







 







>
>
|
|

|
|
>
|
>
>

|
|

<
>







791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815

816
817
818
819
820
821
822
823
...
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868

869
870
871
872
873
874
875
876
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        int nFreeLocal = UnsafeNativeMethods.sqlite3_release_memory(nBytes);
        uint nLargestLocal = 0;
        bool resetOkLocal = false;

#if !DEBUG && WINDOWS // NOTE: Should be "WIN32HEAP && !MEMDEBUG && WINDOWS"
        if (HelperMethods.IsWindows())
        {
            if ((rc == SQLiteErrorCode.Ok) && reset)
            {
                rc = UnsafeNativeMethods.sqlite3_win32_reset_heap();

                if (rc == SQLiteErrorCode.Ok)
                    resetOkLocal = true;
            }

            if ((rc == SQLiteErrorCode.Ok) && compact)
                rc = UnsafeNativeMethods.sqlite3_win32_compact_heap(ref nLargestLocal);
        }
        else
#endif
        if (reset || compact)
        {
            rc = SQLiteErrorCode.NotFound;

        }

        nFree = nFreeLocal;
        nLargest = nLargestLocal;
        resetOk = resetOkLocal;

        return rc;
    }
................................................................................
        )
    {
        SQLiteErrorCode rc = SQLiteErrorCode.Ok;

        if (directories)
        {
#if WINDOWS
            if (HelperMethods.IsWindows())
            {
                if (rc == SQLiteErrorCode.Ok)
                    rc = UnsafeNativeMethods.sqlite3_win32_set_directory(1, null);

                if (rc == SQLiteErrorCode.Ok)
                    rc = UnsafeNativeMethods.sqlite3_win32_set_directory(2, null);
            }
            else
#endif
            {
#if !NET_COMPACT_20 && TRACE_CONNECTION
                Trace.WriteLine(
                    "Shutdown: Cannot reset directories on this platform.");
#endif

            }
        }

        if (rc == SQLiteErrorCode.Ok)
            rc = UnsafeNativeMethods.sqlite3_shutdown();

        return rc;
    }