System.Data.SQLite

Check-in [73b6826ea6]
Login

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

Overview
Comment:Change the default behavior for the native library pre-loader so that it first searches the executing (i.e. System.Data.SQLite) assembly directory and then the application domain directory. Pursuant to [f0246d1817].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 73b6826ea6f90ee03300437e592632a6e958cf2d
User & Date: mistachkin 2013-12-31 07:44:00.420
Original Comment: Change the default behavior for the native library pre-loader so that it first searches the executing (i.e. System.Data.SQLite) assembly directory and then the application domain directory.
Context
2013-12-31
07:50
Update version history docs. check-in: 65cfd24266 user: mistachkin tags: trunk
07:44
Change the default behavior for the native library pre-loader so that it first searches the executing (i.e. System.Data.SQLite) assembly directory and then the application domain directory. Pursuant to [f0246d1817]. check-in: 73b6826ea6 user: mistachkin tags: trunk
07:40
Update test suite infrastructure to make it possible to easily test the native library pre-loading code. check-in: 1a3f35c77a user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Doc/Extra/environment.html.
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
          <td>PreLoadSQLite_ProcessorArchitecture</td>
          <td>If this environment variable is set [to anything], it will be
          used instead of the processor architecture value contained in the
          PROCESSOR_ARCHITECTURE environment variable to help build the path
          of the native library to pre-load.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_SearchForDirectory</td>
          <td>If this environment variable is set [to anything], the native
          library pre-loading code will conduct a search for the native library
          to pre-load, starting in the location of the currently executing
          assembly (i.e. the one containing all the managed components for
          System.Data.SQLite) and then falling back to the application domain
          base directory.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_UseAssemblyDirectory</td>
          <td>If this environment variable is set [to anything], the location
          of the currently executing assembly (i.e. the one containing all the
          managed components for System.Data.SQLite) will be used as the basis
          for locating the the native library to pre-load (i.e. instead of







|

|
|
|
|
|







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
          <td>PreLoadSQLite_ProcessorArchitecture</td>
          <td>If this environment variable is set [to anything], it will be
          used instead of the processor architecture value contained in the
          PROCESSOR_ARCHITECTURE environment variable to help build the path
          of the native library to pre-load.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_NoSearchForDirectory</td>
          <td>If this environment variable is set [to anything], the native
          library pre-loading code will skip conducting a search for the native
          library to pre-load.  By default, the search starts in the location
          of the currently executing assembly (i.e. the assembly containing all
          the managed components for System.Data.SQLite) and then falls back to
          the application domain base directory.</td>
        </tr>
        <tr valign="top">
          <td>PreLoadSQLite_UseAssemblyDirectory</td>
          <td>If this environment variable is set [to anything], the location
          of the currently executing assembly (i.e. the one containing all the
          managed components for System.Data.SQLite) will be used as the basis
          for locating the the native library to pre-load (i.e. instead of
Changes to System.Data.SQLite/System.Data.SQLite.dll.config.
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    -->
    <!--
    <add key="PreLoadSQLite_ProcessorArchitecture" value="x86" />
    -->

    <!--
        NOTE: If this environment variable is set [to anything], the native
              library pre-loading code will conduct a search for the native
              library to pre-load, starting in the location of the currently
              executing assembly (i.e. the one containing all the managed
              components for System.Data.SQLite) and then falling back to the
              application domain base directory.
    -->
    <!--
    <add key="PreLoadSQLite_SearchForDirectory" value="1" />
    -->

    <!--
        NOTE: If this configuration variable is set [to anything], the location
              of the currently executing assembly (i.e. the one containing all
              the managed components for System.Data.SQLite) will be used as
              the basis for locating the the native library to pre-load (i.e.







|
|
|
|
|


|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    -->
    <!--
    <add key="PreLoadSQLite_ProcessorArchitecture" value="x86" />
    -->

    <!--
        NOTE: If this environment variable is set [to anything], the native
              library pre-loading code will skip conducting a search for the
              native library to pre-load.  By default, the search starts in the
              location of the currently executing assembly (i.e. the assembly
              containing all the managed components for System.Data.SQLite) and
              then falls back to the application domain base directory.
    -->
    <!--
    <add key="PreLoadSQLite_NoSearchForDirectory" value="1" />
    -->

    <!--
        NOTE: If this configuration variable is set [to anything], the location
              of the currently executing assembly (i.e. the one containing all
              the managed components for System.Data.SQLite) will be used as
              the basis for locating the the native library to pre-load (i.e.
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
      /// </returns>
      private static bool SearchForDirectory(
          ref string baseDirectory,        /* out */
          ref string processorArchitecture /* out */
          )
      {
          if (GetSettingValue(
                "PreLoadSQLite_SearchForDirectory", null) == null)
          {
              return false; /* DISABLED */
          }

          //
          // NOTE: Build the list of base directories and processor/platform
          //       names.  These lists will be used to help locate the native







|







505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
      /// </returns>
      private static bool SearchForDirectory(
          ref string baseDirectory,        /* out */
          ref string processorArchitecture /* out */
          )
      {
          if (GetSettingValue(
                "PreLoadSQLite_NoSearchForDirectory", null) != null)
          {
              return false; /* DISABLED */
          }

          //
          // NOTE: Build the list of base directories and processor/platform
          //       names.  These lists will be used to help locate the native