System.Data.SQLite
Check-in [5759e099be]
Not logged in

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

Overview
Comment:Allow opened connections to skip adding the extension functions included in the interop assembly. Support loading of SQLite extensions. Add more notifications that use the new static Changed event. Miscellaneous comment cleanup. Cleanup usage of compile-time options for the .NET Framework version. Fix argument checking for the batch file tools.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5759e099bedb9eae940972d97ecc79d91b328d7d
User & Date: mistachkin 2012-09-20 11:53:22
References
2012-09-20
11:56 Closed ticket [17045010df]: Add SpatialLite extension support. plus 4 other changes artifact: 096add573c user: mistachkin
Context
2012-09-20
12:04
Explicitly add support for the .NET Framework 4.5 to the managed compile-time defines. check-in: c008d0ccd6 user: mistachkin tags: trunk
11:53
Allow opened connections to skip adding the extension functions included in the interop assembly. Support loading of SQLite extensions. Add more notifications that use the new static Changed event. Miscellaneous comment cleanup. Cleanup usage of compile-time options for the .NET Framework version. Fix argument checking for the batch file tools. check-in: 5759e099be user: mistachkin tags: trunk
02:39
Fire notification events before a connection is opened or closed. Enhance documentation comments to that include references. Workaround issue in NDoc3 to allow project reference links to be resolved correctly. check-in: 69f6030c7f user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/version.html.

    44     44       <div id="mainBody">
    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b></p>
    47     47       <ul>
    48     48         <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.7.15</a>.</li>
    49     49         <li>Add Visual Studio 2012 support to all the applicable solution/project files, their associated supporting files, and the test suite.</li>
    50     50         <li>Add Visual Studio 2012 support to the redesigned designer support installer.</li>
           51  +      <li>Allow opened connections to skip adding the extension functions included in the interop assembly via the new NoExtensionFunctions connection flag.</li>
           52  +      <li>Support loading of SQLite extensions via the new EnableExtensions and LoadExtension methods of the SQLiteConnection class.</li>
           53  +      <li>Add notifications before and after any connection is opened and closed, as well as other related notifications, via the new static Changed event.</li>
    51     54         <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li>
    52     55         <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li>
    53     56         <li>Make sure the error code of the SQLiteException class gets serialized.</li>
    54     57         <li>Make the test project for the .NET Compact Framework more flexible.</li>
    55     58         <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li>
    56     59         <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    57     60         <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>

Changes to Membership/SQLiteProvider.2008.csproj.

    16     16       <ProjectGuid>{1B7C6ACE-35AA-481C-9CF6-56B702E3E043}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>SQLiteProvider</RootNamespace>
    20     20       <AssemblyName>SQLiteProvider</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    23         -    <NetFx20>true</NetFx20>
           23  +    <NetFx35>true</NetFx35>
    24     24       <ConfigurationYear>2008</ConfigurationYear>
    25     25     </PropertyGroup>
    26     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     28       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     29     </PropertyGroup>
    30     30     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to Membership/SQLiteProvider.2010.csproj.

    16     16       <ProjectGuid>{1B7C6ACE-35AA-481C-9CF6-56B702E3E043}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>SQLiteProvider</RootNamespace>
    20     20       <AssemblyName>SQLiteProvider</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           23  +    <NetFx40>true</NetFx40>
    23     24       <ConfigurationYear>2010</ConfigurationYear>
    24     25     </PropertyGroup>
    25     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    26     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    27     28       <OutputPath>$(BinaryOutputPath)</OutputPath>
    28     29     </PropertyGroup>
    29     30     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to Membership/SQLiteProvider.2012.csproj.

    14     14       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    15     15       <ProjectGuid>{1B7C6ACE-35AA-481C-9CF6-56B702E3E043}</ProjectGuid>
    16     16       <OutputType>Library</OutputType>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <RootNamespace>SQLiteProvider</RootNamespace>
    19     19       <AssemblyName>SQLiteProvider</AssemblyName>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    26     27       <OutputPath>$(BinaryOutputPath)</OutputPath>
    27     28     </PropertyGroup>

Changes to SQLite.Designer/SQLite.Designer.2008.csproj.

    16     16       <ProjectGuid>{9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>SQLite.Designer</RootNamespace>
    20     20       <AssemblyName>SQLite.Designer</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    23         -    <NetFx20>true</NetFx20>
           23  +    <NetFx35>true</NetFx35>
    24     24       <ConfigurationYear>2008</ConfigurationYear>
    25     25     </PropertyGroup>
    26     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    28     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    29     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    30     30       <DocumentationFile>$(BinaryOutputPath)SQLite.Designer.xml</DocumentationFile>

Changes to SQLite.Designer/SQLite.Designer.2010.csproj.

    16     16       <ProjectGuid>{9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>SQLite.Designer</RootNamespace>
    20     20       <AssemblyName>SQLite.Designer</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           23  +    <NetFx40>true</NetFx40>
    23     24       <ConfigurationYear>2010</ConfigurationYear>
    24     25     </PropertyGroup>
    25     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    26     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    27     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     30       <DocumentationFile>$(BinaryOutputPath)SQLite.Designer.xml</DocumentationFile>

Changes to SQLite.Designer/SQLite.Designer.2012.csproj.

    14     14       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    15     15       <ProjectGuid>{9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}</ProjectGuid>
    16     16       <OutputType>Library</OutputType>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <RootNamespace>SQLite.Designer</RootNamespace>
    19     19       <AssemblyName>SQLite.Designer</AssemblyName>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    26     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    27     28       <OutputPath>$(BinaryOutputPath)</OutputPath>

Changes to SQLite.Interop/SQLite.Interop.2005.vcproj.

    49     49   			/>
    50     50   			<Tool
    51     51   				Name="VCMIDLTool"
    52     52   			/>
    53     53   			<Tool
    54     54   				Name="VCCLCompilerTool"
    55     55   				Optimization="0"
    56         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           56  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    57     57   				MinimalRebuild="false"
    58     58   				ExceptionHandling="0"
    59     59   				BasicRuntimeChecks="0"
    60     60   				RuntimeLibrary="3"
    61     61   				UsePrecompiledHeader="0"
    62     62   				WarningLevel="4"
    63     63   				DebugInformationFormat="3"
................................................................................
   146    146   			<Tool
   147    147   				Name="VCMIDLTool"
   148    148   				TargetEnvironment="3"
   149    149   			/>
   150    150   			<Tool
   151    151   				Name="VCCLCompilerTool"
   152    152   				Optimization="0"
   153         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          153  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   154    154   				MinimalRebuild="false"
   155    155   				ExceptionHandling="0"
   156    156   				BasicRuntimeChecks="0"
   157    157   				RuntimeLibrary="3"
   158    158   				UsePrecompiledHeader="0"
   159    159   				WarningLevel="4"
   160    160   				DebugInformationFormat="3"
................................................................................
   242    242   			/>
   243    243   			<Tool
   244    244   				Name="VCMIDLTool"
   245    245   			/>
   246    246   			<Tool
   247    247   				Name="VCCLCompilerTool"
   248    248   				Optimization="0"
   249         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          249  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   250    250   				MinimalRebuild="false"
   251    251   				ExceptionHandling="0"
   252    252   				BasicRuntimeChecks="0"
   253    253   				RuntimeLibrary="3"
   254    254   				UsePrecompiledHeader="0"
   255    255   				WarningLevel="4"
   256    256   				DebugInformationFormat="3"
................................................................................
   333    333   			<Tool
   334    334   				Name="VCMIDLTool"
   335    335   				TargetEnvironment="3"
   336    336   			/>
   337    337   			<Tool
   338    338   				Name="VCCLCompilerTool"
   339    339   				Optimization="0"
   340         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          340  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   341    341   				MinimalRebuild="false"
   342    342   				ExceptionHandling="0"
   343    343   				BasicRuntimeChecks="0"
   344    344   				RuntimeLibrary="3"
   345    345   				UsePrecompiledHeader="0"
   346    346   				WarningLevel="4"
   347    347   				DebugInformationFormat="3"

Changes to SQLite.Interop/SQLite.Interop.2008.vcproj.

    49     49   			/>
    50     50   			<Tool
    51     51   				Name="VCMIDLTool"
    52     52   			/>
    53     53   			<Tool
    54     54   				Name="VCCLCompilerTool"
    55     55   				Optimization="0"
    56         -				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           56  +				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    57     57   				MinimalRebuild="false"
    58     58   				ExceptionHandling="0"
    59     59   				BasicRuntimeChecks="0"
    60     60   				RuntimeLibrary="3"
    61     61   				UsePrecompiledHeader="0"
    62     62   				WarningLevel="4"
    63     63   				DebugInformationFormat="3"
................................................................................
   146    146   			<Tool
   147    147   				Name="VCMIDLTool"
   148    148   				TargetEnvironment="3"
   149    149   			/>
   150    150   			<Tool
   151    151   				Name="VCCLCompilerTool"
   152    152   				Optimization="0"
   153         -				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          153  +				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   154    154   				MinimalRebuild="false"
   155    155   				ExceptionHandling="0"
   156    156   				BasicRuntimeChecks="0"
   157    157   				RuntimeLibrary="3"
   158    158   				UsePrecompiledHeader="0"
   159    159   				WarningLevel="4"
   160    160   				DebugInformationFormat="3"
................................................................................
   242    242   			/>
   243    243   			<Tool
   244    244   				Name="VCMIDLTool"
   245    245   			/>
   246    246   			<Tool
   247    247   				Name="VCCLCompilerTool"
   248    248   				Optimization="0"
   249         -				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          249  +				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   250    250   				MinimalRebuild="false"
   251    251   				ExceptionHandling="0"
   252    252   				BasicRuntimeChecks="0"
   253    253   				RuntimeLibrary="3"
   254    254   				UsePrecompiledHeader="0"
   255    255   				WarningLevel="4"
   256    256   				DebugInformationFormat="3"
................................................................................
   333    333   			<Tool
   334    334   				Name="VCMIDLTool"
   335    335   				TargetEnvironment="3"
   336    336   			/>
   337    337   			<Tool
   338    338   				Name="VCCLCompilerTool"
   339    339   				Optimization="0"
   340         -				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          340  +				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   341    341   				MinimalRebuild="false"
   342    342   				ExceptionHandling="0"
   343    343   				BasicRuntimeChecks="0"
   344    344   				RuntimeLibrary="3"
   345    345   				UsePrecompiledHeader="0"
   346    346   				WarningLevel="4"
   347    347   				DebugInformationFormat="3"

Changes to SQLite.Interop/SQLite.Interop.2010.vcxproj.

   121    121       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign>
   122    122       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign>
   123    123       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign>
   124    124     </PropertyGroup>
   125    125     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   126    126       <ClCompile>
   127    127         <Optimization>Disabled</Optimization>
   128         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          128  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   129    129         <MinimalRebuild>false</MinimalRebuild>
   130    130         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   131    131         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   132    132         <WarningLevel>Level4</WarningLevel>
   133    133         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   134    134         <CompileAs>Default</CompileAs>
   135    135         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   163    163         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   164    164         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   165    165       </PostBuildEvent>
   166    166     </ItemDefinitionGroup>
   167    167     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   168    168       <ClCompile>
   169    169         <Optimization>Disabled</Optimization>
   170         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          170  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   171    171         <MinimalRebuild>false</MinimalRebuild>
   172    172         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   173    173         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   174    174         <WarningLevel>Level4</WarningLevel>
   175    175         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   176    176         <CompileAs>Default</CompileAs>
   177    177         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   205    205         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   206    206         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   207    207       </PostBuildEvent>
   208    208     </ItemDefinitionGroup>
   209    209     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'">
   210    210       <ClCompile>
   211    211         <Optimization>Disabled</Optimization>
   212         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          212  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   213    213         <MinimalRebuild>false</MinimalRebuild>
   214    214         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   215    215         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   216    216         <WarningLevel>Level4</WarningLevel>
   217    217         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   218    218         <CompileAs>Default</CompileAs>
   219    219         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   240    240         <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y
   241    241   XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command>
   242    242       </PostBuildEvent>
   243    243     </ItemDefinitionGroup>
   244    244     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'">
   245    245       <ClCompile>
   246    246         <Optimization>Disabled</Optimization>
   247         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          247  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   248    248         <MinimalRebuild>false</MinimalRebuild>
   249    249         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   250    250         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   251    251         <WarningLevel>Level4</WarningLevel>
   252    252         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   253    253         <CompileAs>Default</CompileAs>
   254    254         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>

Changes to SQLite.Interop/SQLite.Interop.2012.vcxproj.

   128    128       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign>
   129    129       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign>
   130    130       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign>
   131    131     </PropertyGroup>
   132    132     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   133    133       <ClCompile>
   134    134         <Optimization>Disabled</Optimization>
   135         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          135  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   136    136         <MinimalRebuild>false</MinimalRebuild>
   137    137         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   138    138         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   139    139         <WarningLevel>Level4</WarningLevel>
   140    140         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   141    141         <CompileAs>Default</CompileAs>
   142    142         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   170    170         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   171    171         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   172    172       </PostBuildEvent>
   173    173     </ItemDefinitionGroup>
   174    174     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   175    175       <ClCompile>
   176    176         <Optimization>Disabled</Optimization>
   177         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          177  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   178    178         <MinimalRebuild>false</MinimalRebuild>
   179    179         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   180    180         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   181    181         <WarningLevel>Level4</WarningLevel>
   182    182         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   183    183         <CompileAs>Default</CompileAs>
   184    184         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   212    212         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   213    213         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   214    214       </PostBuildEvent>
   215    215     </ItemDefinitionGroup>
   216    216     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'">
   217    217       <ClCompile>
   218    218         <Optimization>Disabled</Optimization>
   219         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          219  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   220    220         <MinimalRebuild>false</MinimalRebuild>
   221    221         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   222    222         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   223    223         <WarningLevel>Level4</WarningLevel>
   224    224         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   225    225         <CompileAs>Default</CompileAs>
   226    226         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   247    247         <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y
   248    248   XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command>
   249    249       </PostBuildEvent>
   250    250     </ItemDefinitionGroup>
   251    251     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'">
   252    252       <ClCompile>
   253    253         <Optimization>Disabled</Optimization>
   254         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          254  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   255    255         <MinimalRebuild>false</MinimalRebuild>
   256    256         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   257    257         <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
   258    258         <WarningLevel>Level4</WarningLevel>
   259    259         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   260    260         <CompileAs>Default</CompileAs>
   261    261         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>

Changes to SQLite.Interop/SQLite.Interop.CE.2005.vcproj.

    53     53   				Name="VCMIDLTool"
    54     54   				TargetEnvironment="1"
    55     55   			/>
    56     56   			<Tool
    57     57   				Name="VCCLCompilerTool"
    58     58   				ExecutionBucket="7"
    59     59   				Optimization="0"
    60         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           60  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    61     61   				MinimalRebuild="true"
    62     62   				RuntimeLibrary="1"
    63     63   				FloatingPointModel="0"
    64     64   				UsePrecompiledHeader="0"
    65     65   				WarningLevel="3"
    66     66   				DebugInformationFormat="3"
    67     67   				CompileAs="1"
................................................................................
   248    248   			<Tool
   249    249   				Name="VCMIDLTool"
   250    250   			/>
   251    251   			<Tool
   252    252   				Name="VCCLCompilerTool"
   253    253   				ExecutionBucket="7"
   254    254   				Optimization="0"
   255         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          255  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   256    256   				MinimalRebuild="true"
   257    257   				RuntimeLibrary="1"
   258    258   				FloatingPointModel="0"
   259    259   				UsePrecompiledHeader="0"
   260    260   				WarningLevel="3"
   261    261   				DebugInformationFormat="3"
   262    262   				CompileAs="1"
................................................................................
   342    342   			<Tool
   343    343   				Name="VCMIDLTool"
   344    344   			/>
   345    345   			<Tool
   346    346   				Name="VCCLCompilerTool"
   347    347   				ExecutionBucket="7"
   348    348   				Optimization="0"
   349         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          349  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   350    350   				MinimalRebuild="true"
   351    351   				RuntimeLibrary="1"
   352    352   				FloatingPointModel="0"
   353    353   				UsePrecompiledHeader="0"
   354    354   				WarningLevel="3"
   355    355   				DebugInformationFormat="3"
   356    356   				CompileAs="1"

Changes to SQLite.Interop/SQLite.Interop.CE.2008.vcproj.

    53     53   				Name="VCMIDLTool"
    54     54   				TargetEnvironment="1"
    55     55   			/>
    56     56   			<Tool
    57     57   				Name="VCCLCompilerTool"
    58     58   				ExecutionBucket="7"
    59     59   				Optimization="0"
    60         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           60  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    61     61   				MinimalRebuild="true"
    62     62   				RuntimeLibrary="1"
    63     63   				FloatingPointModel="0"
    64     64   				UsePrecompiledHeader="0"
    65     65   				WarningLevel="3"
    66     66   				DebugInformationFormat="3"
    67     67   				CompileAs="1"
................................................................................
   248    248   			<Tool
   249    249   				Name="VCMIDLTool"
   250    250   			/>
   251    251   			<Tool
   252    252   				Name="VCCLCompilerTool"
   253    253   				ExecutionBucket="7"
   254    254   				Optimization="0"
   255         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          255  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   256    256   				MinimalRebuild="true"
   257    257   				RuntimeLibrary="1"
   258    258   				FloatingPointModel="0"
   259    259   				UsePrecompiledHeader="0"
   260    260   				WarningLevel="3"
   261    261   				DebugInformationFormat="3"
   262    262   				CompileAs="1"
................................................................................
   342    342   			<Tool
   343    343   				Name="VCMIDLTool"
   344    344   			/>
   345    345   			<Tool
   346    346   				Name="VCCLCompilerTool"
   347    347   				ExecutionBucket="7"
   348    348   				Optimization="0"
   349         -				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          349  +				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;$(SQLITE_WINCE_DEFINES);$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   350    350   				MinimalRebuild="true"
   351    351   				RuntimeLibrary="1"
   352    352   				FloatingPointModel="0"
   353    353   				UsePrecompiledHeader="0"
   354    354   				WarningLevel="3"
   355    355   				DebugInformationFormat="3"
   356    356   				CompileAs="1"

Changes to SQLite.Interop/SQLite.Interop.Static.2005.vcproj.

    49     49   			/>
    50     50   			<Tool
    51     51   				Name="VCMIDLTool"
    52     52   			/>
    53     53   			<Tool
    54     54   				Name="VCCLCompilerTool"
    55     55   				Optimization="0"
    56         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           56  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    57     57   				MinimalRebuild="false"
    58     58   				ExceptionHandling="0"
    59     59   				BasicRuntimeChecks="0"
    60     60   				RuntimeLibrary="1"
    61     61   				UsePrecompiledHeader="0"
    62     62   				WarningLevel="4"
    63     63   				DebugInformationFormat="3"
................................................................................
   146    146   			<Tool
   147    147   				Name="VCMIDLTool"
   148    148   				TargetEnvironment="3"
   149    149   			/>
   150    150   			<Tool
   151    151   				Name="VCCLCompilerTool"
   152    152   				Optimization="0"
   153         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          153  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   154    154   				MinimalRebuild="false"
   155    155   				ExceptionHandling="0"
   156    156   				BasicRuntimeChecks="0"
   157    157   				RuntimeLibrary="1"
   158    158   				UsePrecompiledHeader="0"
   159    159   				WarningLevel="4"
   160    160   				DebugInformationFormat="3"
................................................................................
   242    242   			/>
   243    243   			<Tool
   244    244   				Name="VCMIDLTool"
   245    245   			/>
   246    246   			<Tool
   247    247   				Name="VCCLCompilerTool"
   248    248   				Optimization="0"
   249         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          249  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   250    250   				MinimalRebuild="false"
   251    251   				ExceptionHandling="0"
   252    252   				BasicRuntimeChecks="0"
   253    253   				RuntimeLibrary="1"
   254    254   				UsePrecompiledHeader="0"
   255    255   				WarningLevel="4"
   256    256   				DebugInformationFormat="3"
................................................................................
   333    333   			<Tool
   334    334   				Name="VCMIDLTool"
   335    335   				TargetEnvironment="3"
   336    336   			/>
   337    337   			<Tool
   338    338   				Name="VCCLCompilerTool"
   339    339   				Optimization="0"
   340         -				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          340  +				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0400;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   341    341   				MinimalRebuild="false"
   342    342   				ExceptionHandling="0"
   343    343   				BasicRuntimeChecks="0"
   344    344   				RuntimeLibrary="1"
   345    345   				UsePrecompiledHeader="0"
   346    346   				WarningLevel="4"
   347    347   				DebugInformationFormat="3"

Changes to SQLite.Interop/SQLite.Interop.Static.2008.vcproj.

    49     49   			/>
    50     50   			<Tool
    51     51   				Name="VCMIDLTool"
    52     52   			/>
    53     53   			<Tool
    54     54   				Name="VCCLCompilerTool"
    55     55   				Optimization="0"
    56         -				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
           56  +				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
    57     57   				MinimalRebuild="false"
    58     58   				ExceptionHandling="0"
    59     59   				BasicRuntimeChecks="0"
    60     60   				RuntimeLibrary="1"
    61     61   				UsePrecompiledHeader="0"
    62     62   				WarningLevel="4"
    63     63   				DebugInformationFormat="3"
................................................................................
   146    146   			<Tool
   147    147   				Name="VCMIDLTool"
   148    148   				TargetEnvironment="3"
   149    149   			/>
   150    150   			<Tool
   151    151   				Name="VCCLCompilerTool"
   152    152   				Optimization="0"
   153         -				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          153  +				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   154    154   				MinimalRebuild="false"
   155    155   				ExceptionHandling="0"
   156    156   				BasicRuntimeChecks="0"
   157    157   				RuntimeLibrary="1"
   158    158   				UsePrecompiledHeader="0"
   159    159   				WarningLevel="4"
   160    160   				DebugInformationFormat="3"
................................................................................
   242    242   			/>
   243    243   			<Tool
   244    244   				Name="VCMIDLTool"
   245    245   			/>
   246    246   			<Tool
   247    247   				Name="VCCLCompilerTool"
   248    248   				Optimization="0"
   249         -				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          249  +				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   250    250   				MinimalRebuild="false"
   251    251   				ExceptionHandling="0"
   252    252   				BasicRuntimeChecks="0"
   253    253   				RuntimeLibrary="1"
   254    254   				UsePrecompiledHeader="0"
   255    255   				WarningLevel="4"
   256    256   				DebugInformationFormat="3"
................................................................................
   333    333   			<Tool
   334    334   				Name="VCMIDLTool"
   335    335   				TargetEnvironment="3"
   336    336   			/>
   337    337   			<Tool
   338    338   				Name="VCCLCompilerTool"
   339    339   				Optimization="0"
   340         -				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES)"
          340  +				PreprocessorDefinitions="WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES)"
   341    341   				MinimalRebuild="false"
   342    342   				ExceptionHandling="0"
   343    343   				BasicRuntimeChecks="0"
   344    344   				RuntimeLibrary="1"
   345    345   				UsePrecompiledHeader="0"
   346    346   				WarningLevel="4"
   347    347   				DebugInformationFormat="3"

Changes to SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.

   121    121       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign>
   122    122       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign>
   123    123       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign>
   124    124     </PropertyGroup>
   125    125     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   126    126       <ClCompile>
   127    127         <Optimization>Disabled</Optimization>
   128         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          128  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   129    129         <MinimalRebuild>false</MinimalRebuild>
   130    130         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   131    131         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   132    132         <WarningLevel>Level4</WarningLevel>
   133    133         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   134    134         <CompileAs>Default</CompileAs>
   135    135         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   163    163         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   164    164         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   165    165       </PostBuildEvent>
   166    166     </ItemDefinitionGroup>
   167    167     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   168    168       <ClCompile>
   169    169         <Optimization>Disabled</Optimization>
   170         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          170  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   171    171         <MinimalRebuild>false</MinimalRebuild>
   172    172         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   173    173         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   174    174         <WarningLevel>Level4</WarningLevel>
   175    175         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   176    176         <CompileAs>Default</CompileAs>
   177    177         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   205    205         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   206    206         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   207    207       </PostBuildEvent>
   208    208     </ItemDefinitionGroup>
   209    209     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'">
   210    210       <ClCompile>
   211    211         <Optimization>Disabled</Optimization>
   212         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          212  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   213    213         <MinimalRebuild>false</MinimalRebuild>
   214    214         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   215    215         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   216    216         <WarningLevel>Level4</WarningLevel>
   217    217         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   218    218         <CompileAs>Default</CompileAs>
   219    219         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   240    240         <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y
   241    241   XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command>
   242    242       </PostBuildEvent>
   243    243     </ItemDefinitionGroup>
   244    244     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'">
   245    245       <ClCompile>
   246    246         <Optimization>Disabled</Optimization>
   247         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          247  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   248    248         <MinimalRebuild>false</MinimalRebuild>
   249    249         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   250    250         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   251    251         <WarningLevel>Level4</WarningLevel>
   252    252         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   253    253         <CompileAs>Default</CompileAs>
   254    254         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>

Changes to SQLite.Interop/SQLite.Interop.Static.2012.vcxproj.

   128    128       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkDelaySign>
   129    129       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkDelaySign>
   130    130       <LinkDelaySign Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</LinkDelaySign>
   131    131     </PropertyGroup>
   132    132     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   133    133       <ClCompile>
   134    134         <Optimization>Disabled</Optimization>
   135         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          135  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   136    136         <MinimalRebuild>false</MinimalRebuild>
   137    137         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   138    138         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   139    139         <WarningLevel>Level4</WarningLevel>
   140    140         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   141    141         <CompileAs>Default</CompileAs>
   142    142         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   170    170         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   171    171         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   172    172       </PostBuildEvent>
   173    173     </ItemDefinitionGroup>
   174    174     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   175    175       <ClCompile>
   176    176         <Optimization>Disabled</Optimization>
   177         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          177  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   178    178         <MinimalRebuild>false</MinimalRebuild>
   179    179         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   180    180         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   181    181         <WarningLevel>Level4</WarningLevel>
   182    182         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   183    183         <CompileAs>Default</CompileAs>
   184    184         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   212    212         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'==''">"$(FrameworkSDKDir)Bin\sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   213    213         <Command Condition="'$(TargetFrameworkSDKToolsDirectory)'!=''">"$(TargetFrameworkSDKToolsDirectory)sn.exe" -Ra "$(TargetPath)" "$(INTEROP_KEY_FILE)"</Command>
   214    214       </PostBuildEvent>
   215    215     </ItemDefinitionGroup>
   216    216     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|Win32'">
   217    217       <ClCompile>
   218    218         <Optimization>Disabled</Optimization>
   219         -      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          219  +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   220    220         <MinimalRebuild>false</MinimalRebuild>
   221    221         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   222    222         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   223    223         <WarningLevel>Level4</WarningLevel>
   224    224         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   225    225         <CompileAs>Default</CompileAs>
   226    226         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>
................................................................................
   247    247         <Command>XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y
   248    248   XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y</Command>
   249    249       </PostBuildEvent>
   250    250     </ItemDefinitionGroup>
   251    251     <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugNativeOnly|x64'">
   252    252       <ClCompile>
   253    253         <Optimization>Disabled</Optimization>
   254         -      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
          254  +      <PreprocessorDefinitions>WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);$(INTEROP_DEBUG_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
   255    255         <MinimalRebuild>false</MinimalRebuild>
   256    256         <BasicRuntimeChecks>Default</BasicRuntimeChecks>
   257    257         <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
   258    258         <WarningLevel>Level4</WarningLevel>
   259    259         <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   260    260         <CompileAs>Default</CompileAs>
   261    261         <DisableSpecificWarnings>$(SQLITE_DISABLE_WARNINGS);$(SQLITE_DISABLE_X64_WARNINGS);%(DisableSpecificWarnings)</DisableSpecificWarnings>

Changes to SQLite.Interop/props/SQLite.Interop.2005.vsprops.

    33     33   		PerformEnvironmentSet="true"
    34     34   	/>
    35     35   	<UserMacro
    36     36   		Name="INTEROP_RC_VERSION"
    37     37   		Value="1,0,83,0"
    38     38   		PerformEnvironmentSet="true"
    39     39   	/>
           40  +	<UserMacro
           41  +		Name="INTEROP_DEBUG_DEFINES"
           42  +		Value="INTEROP_TEST_EXTENSION=1"
           43  +		PerformEnvironmentSet="true"
           44  +	/>
    40     45   	<UserMacro
    41     46   		Name="INTEROP_EXTRA_DEFINES"
    42     47   		Value="INTEROP_EXTENSION_FUNCTIONS=1;INTEROP_CODEC=1"
    43     48   		PerformEnvironmentSet="true"
    44     49   	/>
    45     50   	<UserMacro
    46     51   		Name="INTEROP_ASSEMBLY_RESOURCES"

Changes to SQLite.Interop/props/SQLite.Interop.2008.vsprops.

    33     33   		PerformEnvironmentSet="true"
    34     34   	/>
    35     35   	<UserMacro
    36     36   		Name="INTEROP_RC_VERSION"
    37     37   		Value="1,0,83,0"
    38     38   		PerformEnvironmentSet="true"
    39     39   	/>
           40  +	<UserMacro
           41  +		Name="INTEROP_DEBUG_DEFINES"
           42  +		Value="INTEROP_TEST_EXTENSION=1"
           43  +		PerformEnvironmentSet="true"
           44  +	/>
    40     45   	<UserMacro
    41     46   		Name="INTEROP_EXTRA_DEFINES"
    42     47   		Value="INTEROP_EXTENSION_FUNCTIONS=1;INTEROP_CODEC=1"
    43     48   		PerformEnvironmentSet="true"
    44     49   	/>
    45     50   	<UserMacro
    46     51   		Name="INTEROP_ASSEMBLY_RESOURCES"

Changes to SQLite.Interop/props/SQLite.Interop.2010.props.

    10     10   <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    11     11     <PropertyGroup Label="UserMacros">
    12     12       <ConfigurationYear>2010</ConfigurationYear>
    13     13       <INTEROP_BUILD_NUMBER>083</INTEROP_BUILD_NUMBER>
    14     14       <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION>
    15     15       <INTEROP_MANIFEST_VERSION>1.0.83.0</INTEROP_MANIFEST_VERSION>
    16     16       <INTEROP_RC_VERSION>1,0,83,0</INTEROP_RC_VERSION>
           17  +    <INTEROP_DEBUG_DEFINES>INTEROP_TEST_EXTENSION=1</INTEROP_DEBUG_DEFINES>
    17     18       <INTEROP_EXTRA_DEFINES>INTEROP_EXTENSION_FUNCTIONS=1;INTEROP_CODEC=1</INTEROP_EXTRA_DEFINES>
    18     19       <INTEROP_ASSEMBLY_RESOURCES>/ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp</INTEROP_ASSEMBLY_RESOURCES>
    19     20       <INTEROP_KEY_FILE>$(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk</INTEROP_KEY_FILE>
    20     21       <INTEROP_NATIVE_NAME>SQLite.Interop</INTEROP_NATIVE_NAME>
    21     22       <INTEROP_MIXED_NAME>System.Data.SQLite</INTEROP_MIXED_NAME>
    22     23     </PropertyGroup>
    23     24     <ItemGroup>
................................................................................
    37     38         <Value>$(INTEROP_MANIFEST_VERSION)</Value>
    38     39         <EnvironmentVariable>true</EnvironmentVariable>
    39     40       </BuildMacro>
    40     41       <BuildMacro Include="INTEROP_RC_VERSION">
    41     42         <Value>$(INTEROP_RC_VERSION)</Value>
    42     43         <EnvironmentVariable>true</EnvironmentVariable>
    43     44       </BuildMacro>
           45  +    <BuildMacro Include="INTEROP_DEBUG_DEFINES">
           46  +      <Value>$(INTEROP_DEBUG_DEFINES)</Value>
           47  +      <EnvironmentVariable>true</EnvironmentVariable>
           48  +    </BuildMacro>
    44     49       <BuildMacro Include="INTEROP_EXTRA_DEFINES">
    45     50         <Value>$(INTEROP_EXTRA_DEFINES)</Value>
    46     51         <EnvironmentVariable>true</EnvironmentVariable>
    47     52       </BuildMacro>
    48     53       <BuildMacro Include="INTEROP_ASSEMBLY_RESOURCES">
    49     54         <Value>$(INTEROP_ASSEMBLY_RESOURCES)</Value>
    50     55         <EnvironmentVariable>true</EnvironmentVariable>

Changes to SQLite.Interop/props/SQLite.Interop.2012.props.

    10     10   <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    11     11     <PropertyGroup Label="UserMacros">
    12     12       <ConfigurationYear>2012</ConfigurationYear>
    13     13       <INTEROP_BUILD_NUMBER>083</INTEROP_BUILD_NUMBER>
    14     14       <INTEROP_LINKER_VERSION>1.0</INTEROP_LINKER_VERSION>
    15     15       <INTEROP_MANIFEST_VERSION>1.0.83.0</INTEROP_MANIFEST_VERSION>
    16     16       <INTEROP_RC_VERSION>1,0,83,0</INTEROP_RC_VERSION>
           17  +    <INTEROP_DEBUG_DEFINES>INTEROP_TEST_EXTENSION=1</INTEROP_DEBUG_DEFINES>
    17     18       <INTEROP_EXTRA_DEFINES>INTEROP_EXTENSION_FUNCTIONS=1;INTEROP_CODEC=1</INTEROP_EXTRA_DEFINES>
    18     19       <INTEROP_ASSEMBLY_RESOURCES>/ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp</INTEROP_ASSEMBLY_RESOURCES>
    19     20       <INTEROP_KEY_FILE>$(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk</INTEROP_KEY_FILE>
    20     21       <INTEROP_NATIVE_NAME>SQLite.Interop</INTEROP_NATIVE_NAME>
    21     22       <INTEROP_MIXED_NAME>System.Data.SQLite</INTEROP_MIXED_NAME>
    22     23     </PropertyGroup>
    23     24     <ItemGroup>
................................................................................
    37     38         <Value>$(INTEROP_MANIFEST_VERSION)</Value>
    38     39         <EnvironmentVariable>true</EnvironmentVariable>
    39     40       </BuildMacro>
    40     41       <BuildMacro Include="INTEROP_RC_VERSION">
    41     42         <Value>$(INTEROP_RC_VERSION)</Value>
    42     43         <EnvironmentVariable>true</EnvironmentVariable>
    43     44       </BuildMacro>
           45  +    <BuildMacro Include="INTEROP_DEBUG_DEFINES">
           46  +      <Value>$(INTEROP_DEBUG_DEFINES)</Value>
           47  +      <EnvironmentVariable>true</EnvironmentVariable>
           48  +    </BuildMacro>
    44     49       <BuildMacro Include="INTEROP_EXTRA_DEFINES">
    45     50         <Value>$(INTEROP_EXTRA_DEFINES)</Value>
    46     51         <EnvironmentVariable>true</EnvironmentVariable>
    47     52       </BuildMacro>
    48     53       <BuildMacro Include="INTEROP_ASSEMBLY_RESOURCES">
    49     54         <Value>$(INTEROP_ASSEMBLY_RESOURCES)</Value>
    50     55         <EnvironmentVariable>true</EnvironmentVariable>

Changes to SQLite.Interop/props/sqlite3.props.

    12     12       <SQLITE_MANIFEST_VERSION>3.7.15</SQLITE_MANIFEST_VERSION>
    13     13       <SQLITE_RC_VERSION>3,7,15</SQLITE_RC_VERSION>
    14     14       <SQLITE_COMMON_DEFINES>_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT3=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1</SQLITE_COMMON_DEFINES>
    15     15       <SQLITE_EXTRA_DEFINES>SQLITE_HAS_CODEC=1</SQLITE_EXTRA_DEFINES>
    16     16       <SQLITE_WINCE_DEFINES>SQLITE_OMIT_WAL=1</SQLITE_WINCE_DEFINES>
    17     17       <SQLITE_DEBUG_DEFINES>SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1</SQLITE_DEBUG_DEFINES>
    18     18       <SQLITE_RELEASE_DEFINES>SQLITE_WIN32_MALLOC=1</SQLITE_RELEASE_DEFINES>
    19         -    <SQLITE_DISABLE_WARNINGS>4100;4127;4210;4232;4244;4267;4306;4389;4701;4703;4706</SQLITE_DISABLE_WARNINGS>
           19  +    <SQLITE_DISABLE_WARNINGS>4100;4127;4146;4210;4232;4244;4245;4267;4306;4389;4701;4703;4706</SQLITE_DISABLE_WARNINGS>
    20     20       <SQLITE_DISABLE_X64_WARNINGS></SQLITE_DISABLE_X64_WARNINGS>
    21     21     </PropertyGroup>
    22     22     <ItemGroup>
    23     23       <BuildMacro Include="SQLITE_MANIFEST_VERSION">
    24     24         <Value>$(SQLITE_MANIFEST_VERSION)</Value>
    25     25         <EnvironmentVariable>true</EnvironmentVariable>
    26     26       </BuildMacro>

Changes to SQLite.Interop/props/sqlite3.vsprops.

    45     45   	<UserMacro
    46     46   		Name="SQLITE_RELEASE_DEFINES"
    47     47   		Value="SQLITE_WIN32_MALLOC=1"
    48     48   		PerformEnvironmentSet="true"
    49     49   	/>
    50     50   	<UserMacro
    51     51   		Name="SQLITE_DISABLE_WARNINGS"
    52         -		Value="4100;4127;4210;4232;4244;4267;4306;4389;4701;4703;4706"
           52  +		Value="4100;4127;4146;4210;4232;4244;4245;4267;4306;4389;4701;4703;4706"
    53     53   		PerformEnvironmentSet="true"
    54     54   	/>
    55     55   	<UserMacro
    56     56   		Name="SQLITE_DISABLE_X64_WARNINGS"
    57     57   		Value=""
    58     58   		PerformEnvironmentSet="true"
    59     59   	/>
    60     60   </VisualStudioPropertySheet>

Changes to SQLite.Interop/src/contrib/extension-functions.c.

    34     34   3) Use, for example:
    35     35      SELECT cos(radians(inclination)) FROM satsum WHERE satnum = 25544;
    36     36   
    37     37   Note: Loading extensions is by default prohibited as a
    38     38   security measure; see "Security Considerations" in
    39     39   http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions.
    40     40   If the sqlite3 program and library are built this
    41         -way, you cannot use these functions from the program, you 
           41  +way, you cannot use these functions from the program, you
    42     42   must write your own program using the sqlite3 API, and call
    43     43   sqlite3_enable_load_extension as described above.
    44     44   
    45     45   If the program is built so that loading extensions is permitted,
    46     46   the following will work:
    47     47   sqlite> SELECT load_extension('./libsqlitefunctions.so');
    48     48   sqlite> select cos(radians(45));
................................................................................
    85     85   would cause an error if any non-positive number was raised to any
    86     86   power.
    87     87   2007-02-07 posted by Mikey C to sqlite mailing list.
    88     88   Original code 2006 June 05 by relicoder.
    89     89   
    90     90   */
    91     91   
    92         -//#include "config.h"
           92  +/* #include "config.h" */
    93     93   #include <windows.h>
    94     94   
    95         -// #define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
    96         -//#define HAVE_ACOSH 1
    97         -//#define HAVE_ASINH 1
    98         -//#define HAVE_ATANH 1
           95  +/* #define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE */
           96  +/* #define HAVE_ACOSH 1 */
           97  +/* #define HAVE_ASINH 1 */
           98  +/* #define HAVE_ATANH 1 */
    99     99   #define HAVE_SINH 1
   100    100   #define HAVE_COSH 1
   101    101   #define HAVE_TANH 1
   102    102   #define HAVE_LOG10 1
   103         -//#define HAVE_ISBLANK 1
          103  +/* #define HAVE_ISBLANK 1 */
   104    104   #define SQLITE_SOUNDEX 1
   105    105   #define HAVE_TRIM 1		/* LMH 2007-03-25 if sqlite has trim functions */
   106    106   
   107    107   #ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
   108    108   #include "../core/sqlite3ext.h"
   109    109   SQLITE_EXTENSION_INIT1
   110    110   #else
................................................................................
   126    126   
   127    127   #include <stdlib.h>
   128    128   #include <assert.h>
   129    129   
   130    130   #ifndef _MAP_H_
   131    131   #define _MAP_H_
   132    132   
   133         -//#include <stdint.h>
          133  +/* #include <stdint.h> */
   134    134   
   135    135   typedef signed char int8_t;
   136    136   typedef unsigned char uint8_t;
   137    137   typedef signed int int16_t;
   138    138   typedef unsigned int uint16_t;
   139    139   typedef signed long int int32_t;
   140    140   typedef unsigned long int uint32_t;
................................................................................
   193    193   ** to use with map_make
   194    194   */
   195    195   int double_cmp(const void *a, const void *b);
   196    196   
   197    197   #endif /* _MAP_H_ */
   198    198   
   199    199   typedef uint8_t         u8;
   200         -//typedef uint16_t        u16;
          200  +/* typedef uint16_t        u16; */
   201    201   typedef int64_t         i64;
   202    202   
   203    203   static char *sqlite3StrDup( const char *z ) {
   204    204       char *res = sqlite3_malloc( strlen(z)+1 );
   205    205       return strcpy( res, z );
   206    206   }
   207    207   
................................................................................
   308    308   /*
   309    309   ** This is a macro that facilitates writting wrappers for math.h functions
   310    310   ** it creates code for a function to use in SQlite that gets one numeric input
   311    311   ** and returns a floating point value.
   312    312   **
   313    313   ** Could have been implemented using pointers to functions but this way it's inline
   314    314   ** and thus more efficient. Lower * ranking though...
   315         -** 
          315  +**
   316    316   ** Parameters:
   317    317   ** name:      function name to de defined (eg: sinFunc)
   318    318   ** function:  function defined in math.h to wrap (eg: sin)
   319    319   ** domain:    boolean condition that CAN'T happen in terms of the input parameter rVal
   320    320   **            (eg: rval<0 for sqrt)
   321    321   */
   322    322   /* LMH 2007-03-25 Changed to use errno and remove domain; no pre-checking for errors. */
................................................................................
   353    353   /* trignometric functions */
   354    354   GEN_MATH_WRAP_DOUBLE_1(acosFunc, acos)
   355    355   GEN_MATH_WRAP_DOUBLE_1(asinFunc, asin)
   356    356   GEN_MATH_WRAP_DOUBLE_1(atanFunc, atan)
   357    357   
   358    358   /*
   359    359   ** Many of systems don't have inverse hyperbolic trig functions so this will emulate
   360         -** them on those systems in terms of log and sqrt (formulas are too trivial to demand 
          360  +** them on those systems in terms of log and sqrt (formulas are too trivial to demand
   361    361   ** written proof here)
   362    362   */
   363    363   
   364    364   #ifndef HAVE_ACOSH
   365    365   static double acosh(double x){
   366    366     return log(x + sqrt(x*x - 1.0));
   367    367   }
................................................................................
   508    508   
   509    509   /*
   510    510   ** Wraps the pow math.h function
   511    511   ** When both the base and the exponent are integers the result should be integer
   512    512   ** (see sqrt just before this). Here the result is always double
   513    513   */
   514    514   /* LMH 2007-03-25 Changed to use errno; no pre-checking for errors.  Also removes
   515         -  but that was present in the pre-checking that called sqlite3_result_error on 
          515  +  but that was present in the pre-checking that called sqlite3_result_error on
   516    516     a non-positive first argument, which is not always an error. */
   517    517   static void powerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
   518    518     double r1 = 0.0;
   519    519     double r2 = 0.0;
   520    520     double val;
   521    521   
   522    522     assert( argc==2 );
   523         -  
          523  +
   524    524     if( sqlite3_value_type(argv[0]) == SQLITE_NULL || sqlite3_value_type(argv[1]) == SQLITE_NULL ){
   525         -    sqlite3_result_null(context); 
          525  +    sqlite3_result_null(context);
   526    526     }else{
   527    527       r1 = sqlite3_value_double(argv[0]);
   528    528       r2 = sqlite3_value_double(argv[1]);
   529    529       errno = 0;
   530    530       val = pow(r1,r2);
   531    531       if (errno == 0) {
   532    532         sqlite3_result_double(context, val);
   533         -    } else {  
          533  +    } else {
   534    534         sqlite3_result_error(context, strerror(errno), errno);
   535         -    }  
          535  +    }
   536    536     }
   537    537   }
   538    538   
   539    539   /*
   540    540   ** atan2 wrapper
   541    541   */
   542    542   static void atn2Func(sqlite3_context *context, int argc, sqlite3_value **argv){
   543    543     double r1 = 0.0;
   544    544     double r2 = 0.0;
   545    545   
   546    546     assert( argc==2 );
   547         -  
          547  +
   548    548     if( sqlite3_value_type(argv[0]) == SQLITE_NULL || sqlite3_value_type(argv[1]) == SQLITE_NULL ){
   549         -    sqlite3_result_null(context); 
          549  +    sqlite3_result_null(context);
   550    550     }else{
   551    551       r1 = sqlite3_value_double(argv[0]);
   552    552       r2 = sqlite3_value_double(argv[1]);
   553    553       sqlite3_result_double(context, atan2(r1,r2));
   554    554     }
   555    555   }
   556    556   
................................................................................
   632    632         sqlite3_result_int64(context, (i64) floor(rVal));
   633    633         break;
   634    634       }
   635    635     }
   636    636   }
   637    637   
   638    638   /*
   639         -** Given a string (s) in the first argument and an integer (n) in the second returns the 
          639  +** Given a string (s) in the first argument and an integer (n) in the second returns the
   640    640   ** string that constains s contatenated n times
   641    641   */
   642    642   static void replicateFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
   643    643     unsigned char *z;        /* input string */
   644    644     unsigned char *zo;       /* result string */
   645    645     i64 iCount;              /* times to repeat */
   646         -  i64 nLen;                /* length of the input string (no multibyte considerations) */ 
          646  +  i64 nLen;                /* length of the input string (no multibyte considerations) */
   647    647     i64 nTLen;               /* length of the result string (no multibyte considerations) */
   648    648     i64 i=0;
   649    649   
   650    650     if( argc!=2 || SQLITE_NULL==sqlite3_value_type(argv[0]) )
   651    651       return;
   652    652   
   653    653     iCount = sqlite3_value_int64(argv[1]);
................................................................................
   674    674   
   675    675       sqlite3_result_text(context, (char*)z, -1, SQLITE_TRANSIENT);
   676    676       sqlite3_free(z);
   677    677       sqlite3_free(zo);
   678    678     }
   679    679   }
   680    680   
   681         -/* 
          681  +/*
   682    682   ** Some systems (win32 among others) don't have an isblank function, this will emulate it.
   683    683   ** This function is not UFT-8 safe since it only analyses a byte character.
   684    684   */
   685    685   #ifndef HAVE_ISBLANK
   686    686   int isblank(char c){
   687    687     return( ' '==c || '\t'==c );
   688    688   }
................................................................................
   739    739     i64 zl;            /* length of the input string (UTF-8 chars) */
   740    740     int i = 0;
   741    741     const char *zi;    /* input string */
   742    742     char *zo;          /* output string */
   743    743     char *zt;
   744    744   
   745    745     assert( argc==2 );
   746         -  
          746  +
   747    747     if( sqlite3_value_type(argv[0]) == SQLITE_NULL ){
   748         -    sqlite3_result_null(context); 
          748  +    sqlite3_result_null(context);
   749    749     }else{
   750    750       zi = (char *)sqlite3_value_text(argv[0]);
   751    751       ilen = sqlite3_value_int64(argv[1]);
   752    752       /* check domain */
   753    753       if(ilen<0){
   754    754         sqlite3_result_error(context, "domain error", -1);
   755    755         return;
................................................................................
   793    793     i64 zll;           /* length of the input string (bytes) */
   794    794     int i = 0;
   795    795     const char *zi;    /* input string */
   796    796     char *zo;          /* output string */
   797    797     char *zt;
   798    798   
   799    799     assert( argc==2 );
   800         -  
          800  +
   801    801     if( sqlite3_value_type(argv[0]) == SQLITE_NULL ){
   802         -    sqlite3_result_null(context); 
          802  +    sqlite3_result_null(context);
   803    803     }else{
   804    804       zi = (char *)sqlite3_value_text(argv[0]);
   805    805       ilen = sqlite3_value_int64(argv[1]);
   806    806       /* check domain */
   807    807       if(ilen<0){
   808    808         sqlite3_result_error(context, "domain error", -1);
   809    809         return;
................................................................................
   848    848     i64 zll;            /* length of the input string (bytes) */
   849    849     int i = 0;
   850    850     const char *zi;     /* input string */
   851    851     char *zo;           /* output string */
   852    852     char *zt;
   853    853   
   854    854     assert( argc==2 );
   855         -  
          855  +
   856    856     if( sqlite3_value_type(argv[0]) == SQLITE_NULL ){
   857         -    sqlite3_result_null(context); 
          857  +    sqlite3_result_null(context);
   858    858     }else{
   859    859       zi = (char *)sqlite3_value_text(argv[0]);
   860    860       ilen = sqlite3_value_int64(argv[1]);
   861    861       /* check domain */
   862    862       if(ilen<0){
   863    863         sqlite3_result_error(context, "domain error", -1);
   864    864         return;
................................................................................
   907    907     const char *z22;
   908    908     char *zo;               /* output string */
   909    909     char *zot;
   910    910     int c1 = 0;
   911    911     int c2 = 0;
   912    912   
   913    913     assert( argc==2 );
   914         -  
          914  +
   915    915     if( sqlite3_value_type(argv[0]) == SQLITE_NULL || sqlite3_value_type(argv[1]) == SQLITE_NULL ){
   916         -    sqlite3_result_null(context); 
          916  +    sqlite3_result_null(context);
   917    917     }else{
   918    918       zi1 = (char *)sqlite3_value_text(argv[0]);
   919    919       zi2 = (char *)sqlite3_value_text(argv[1]);
   920         -    /* 
   921         -    ** maybe I could allocate less, but that would imply 2 passes, rather waste 
          920  +    /*
          921  +    ** maybe I could allocate less, but that would imply 2 passes, rather waste
   922    922       ** (possibly) some memory
   923    923       */
   924         -    zo = sqlite3_malloc(strlen(zi1)+1); 
          924  +    zo = sqlite3_malloc(strlen(zi1)+1);
   925    925       if (!zo){
   926    926         sqlite3_result_error_nomem(context);
   927    927         return;
   928    928       }
   929    929       zot = zo;
   930    930       z1 = zi1;
   931    931       while( (c1=sqliteCharVal((unsigned char *)z1))!=0 ){
................................................................................
   961    961     const char* zt1;
   962    962     const char* zt2;
   963    963     int c1,c2;
   964    964   
   965    965     if( '\0'==*z1 ){
   966    966       return -1;
   967    967     }
   968         -  
          968  +
   969    969     while( (sqliteCharVal((unsigned char *)z2) != 0) && (c++)<s){
   970    970       sqliteNextChar(z2);
   971    971     }
   972         -  
          972  +
   973    973     c = 0;
   974    974     while( (sqliteCharVal((unsigned char *)z2)) != 0 ){
   975    975       zt1 = z1;
   976    976       zt2 = z2;
   977    977   
   978    978       do{
   979    979         c1 = sqliteCharVal((unsigned char *)zt1);
................................................................................
   983    983             c1 = c2;
   984    984           }
   985    985           else {
   986    986             c1 = (c1) ? 1 : 0;
   987    987             c2 = (c2) ? 2 : 0;
   988    988           }
   989    989         }
   990         -      // TODO:  Maybe try and convert the chars to UTF16 and run them thru the collating sequence?
          990  +      /* TODO:  Maybe try and convert the chars to UTF16 and run them thru the collating sequence? */
   991    991         sqliteNextChar(zt1);
   992    992         sqliteNextChar(zt2);
   993    993       }while( c1 == c2 && c1 != 0 && c2 != 0 );
   994    994   
   995    995       if( c1 == 0 ){
   996    996         rVal = c;
   997         -      break; 
          997  +      break;
   998    998       }
   999         -    
          999  +
  1000   1000       sqliteNextChar(z2);
  1001   1001       ++c;
  1002   1002     }
  1003   1003     if(p){
  1004   1004       *p=z2;
  1005   1005     }
  1006   1006     return rVal >=0 ? rVal+s : rVal;
................................................................................
  1074   1074     rz = sqlite3_malloc(zt-z+1);
  1075   1075     if (!rz){
  1076   1076       sqlite3_result_error_nomem(context);
  1077   1077       return;
  1078   1078     }
  1079   1079     strncpy((char*) rz, (char*) z, zt-z);
  1080   1080     *(rz+cc) = '\0';
  1081         -  sqlite3_result_text(context, (char*)rz, -1, SQLITE_TRANSIENT); 
         1081  +  sqlite3_result_text(context, (char*)rz, -1, SQLITE_TRANSIENT);
  1082   1082     sqlite3_free(rz);
  1083   1083   }
  1084   1084   
  1085   1085   /*
  1086   1086   ** given a string (s) and an integer (n) returns the n rightmost (UTF-8) characters
  1087   1087   ** if the string has a length<=n or is NULL this function is NOP
  1088   1088   */
................................................................................
  1113   1113   
  1114   1114     ze = zt;
  1115   1115     zt = z;
  1116   1116   
  1117   1117     cc=c-l;
  1118   1118     if(cc<0)
  1119   1119       cc=0;
  1120         -  
         1120  +
  1121   1121     while( cc-- > 0 ){
  1122   1122       sqliteNextChar(zt);
  1123   1123     }
  1124   1124   
  1125   1125     rz = sqlite3_malloc(ze-zt+1);
  1126   1126     if (!rz){
  1127   1127       sqlite3_result_error_nomem(context);
  1128   1128       return;
  1129   1129     }
  1130   1130     strcpy((char*) rz, (char*) (zt));
  1131         -  sqlite3_result_text(context, (char*)rz, -1, SQLITE_TRANSIENT); 
         1131  +  sqlite3_result_text(context, (char*)rz, -1, SQLITE_TRANSIENT);
  1132   1132     sqlite3_free(rz);
  1133   1133   }
  1134   1134   
  1135   1135   #ifndef HAVE_TRIM
  1136   1136   /*
  1137   1137   ** removes the whitespaces at the begining of a string.
  1138   1138   */
................................................................................
  1162   1162     assert( argc==1);
  1163   1163   
  1164   1164     if( SQLITE_NULL==sqlite3_value_type(argv[0]) ){
  1165   1165       sqlite3_result_null(context);
  1166   1166       return;
  1167   1167     }
  1168   1168     z = sqlite3_value_text(argv[0]);
  1169         -  sqlite3_result_text(context, ltrim(z), -1, SQLITE_TRANSIENT); 
         1169  +  sqlite3_result_text(context, ltrim(z), -1, SQLITE_TRANSIENT);
  1170   1170   }
  1171   1171   
  1172   1172   /*
  1173   1173   **  Removes the whitespace at the end of a string
  1174   1174   */
  1175   1175   static void rtrimFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
  1176   1176     const char *z;
................................................................................
  1214   1214   
  1215   1215   /*
  1216   1216   ** given a pointer to a string s1, the length of that string (l1), a new string (s2)
  1217   1217   ** and it's length (l2) appends s2 to s1.
  1218   1218   ** All lengths in bytes.
  1219   1219   ** This is just an auxiliary function
  1220   1220   */
  1221         -// static void _append(char **s1, int l1, const char *s2, int l2){
  1222         -//   *s1 = realloc(*s1, (l1+l2+1)*sizeof(char));
  1223         -//   strncpy((*s1)+l1, s2, l2);
  1224         -//   *(*(s1)+l1+l2) = '\0';
  1225         -// }
         1221  +/*
         1222  +   static void _append(char **s1, int l1, const char *s2, int l2){
         1223  +     *s1 = realloc(*s1, (l1+l2+1)*sizeof(char));
         1224  +     strncpy((*s1)+l1, s2, l2);
         1225  +     *(*(s1)+l1+l2) = '\0';
         1226  +   }
         1227  +*/
  1226   1228   
  1227   1229   #ifndef HAVE_TRIM
  1228   1230   
  1229   1231   /*
  1230   1232   ** given strings s, s1 and s2 replaces occurrences of s1 in s by s2
  1231   1233   */
  1232   1234   static void replaceFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
................................................................................
  1401   1403     int type;
  1402   1404   
  1403   1405     assert( argc==1 );
  1404   1406     type = sqlite3_value_numeric_type(argv[0]);
  1405   1407   
  1406   1408     if( type == SQLITE_NULL)
  1407   1409       return;
  1408         -  
         1410  +
  1409   1411     p = sqlite3_aggregate_context(context, sizeof(*p));
  1410   1412   
  1411   1413     if( 0==(p->m) ){
  1412   1414       p->m = calloc(1, sizeof(map));
  1413   1415       if( type==SQLITE_INTEGER ){
  1414   1416         /* map will be used for integers */
  1415   1417         *(p->m) = map_make(int_cmp);
................................................................................
  1440   1442   **  Auxiliary function that iterates all elements in a map and finds the mode
  1441   1443   **  (most frequent value)
  1442   1444   */
  1443   1445   static void modeIterate(void* e, i64 c, void* pp){
  1444   1446     i64 ei;
  1445   1447     double ed;
  1446   1448     ModeCtx *p = (ModeCtx*)pp;
  1447         -  
         1449  +
  1448   1450     if( 0==p->is_double ){
  1449   1451       ei = *(int*)(e);
  1450   1452   
  1451   1453   	if( p->mcnt==c ){
  1452   1454         ++p->mn;
  1453   1455       }else if( p->mcnt<c ){
  1454   1456         p->riM = ei;
................................................................................
  1466   1468   	  p->mn=1;
  1467   1469       }
  1468   1470     }
  1469   1471   }
  1470   1472   
  1471   1473   /*
  1472   1474   **  Auxiliary function that iterates all elements in a map and finds the median
  1473         -**  (the value such that the number of elements smaller is equal the the number of 
         1475  +**  (the value such that the number of elements smaller is equal the the number of
  1474   1476   **  elements larger)
  1475   1477   */
  1476   1478   static void medianIterate(void* e, i64 c, void* pp){
  1477   1479     i64 ei;
  1478   1480     double ed;
  1479   1481     double iL;
  1480   1482     double iR;
................................................................................
  1659   1661     char *zR2 = zResult2;
  1660   1662     int rVal = 0;
  1661   1663     int i = 0;
  1662   1664     const u8 *zIn1;
  1663   1665     const u8 *zIn2;
  1664   1666   
  1665   1667     assert( argc==2 );
  1666         -  
         1668  +
  1667   1669     if( sqlite3_value_type(argv[0])==SQLITE_NULL || sqlite3_value_type(argv[1])==SQLITE_NULL ){
  1668   1670       sqlite3_result_null(context);
  1669   1671       return;
  1670   1672     }
  1671         -  
         1673  +
  1672   1674     zIn1 = (u8*)sqlite3_value_text(argv[0]);
  1673   1675     zIn2 = (u8*)sqlite3_value_text(argv[1]);
  1674   1676   
  1675   1677     soundex(zIn1, zR1);
  1676   1678     soundex(zIn2, zR2);
  1677   1679   
  1678   1680     for(i=0; i<4; ++i){
................................................................................
  1783   1785   
  1784   1786     for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
  1785   1787       void *pArg = 0;
  1786   1788       switch( aFuncs[i].argType ){
  1787   1789         case 1: pArg = db; break;
  1788   1790         case 2: pArg = (void *)(-1); break;
  1789   1791       }
  1790         -    //sqlite3CreateFunc
         1792  +    /* sqlite3CreateFunc */
  1791   1793       /* LMH no error checking */
  1792   1794       sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
  1793   1795           aFuncs[i].eTextRep, pArg, aFuncs[i].xFunc, 0, 0);
  1794   1796   #if 1
  1795   1797       if( aFuncs[i].needCollSeq ){
  1796         -      struct FuncDef *pFunc = sqlite3FindFunction(db, aFuncs[i].zName, 
         1798  +      struct FuncDef *pFunc = sqlite3FindFunction(db, aFuncs[i].zName,
  1797   1799             strlen(aFuncs[i].zName), aFuncs[i].nArg, aFuncs[i].eTextRep, 0);
  1798   1800         if( pFunc && aFuncs[i].needCollSeq ){
  1799   1801           pFunc->flags |= SQLITE_FUNC_NEEDCOLL;
  1800   1802         }
  1801   1803       }
  1802   1804   #endif
  1803   1805     }
................................................................................
  1804   1806   
  1805   1807     for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){
  1806   1808       void *pArg = 0;
  1807   1809       switch( aAggs[i].argType ){
  1808   1810         case 1: pArg = db; break;
  1809   1811         case 2: pArg = (void *)(-1); break;
  1810   1812       }
  1811         -    //sqlite3CreateFunc
         1813  +    /* sqlite3CreateFunc */
  1812   1814       /* LMH no error checking */
  1813         -    sqlite3_create_function(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8, 
         1815  +    sqlite3_create_function(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8,
  1814   1816           pArg, 0, aAggs[i].xStep, aAggs[i].xFinalize);
  1815   1817   #if 0
  1816   1818       if( aAggs[i].needCollSeq ){
  1817   1819         struct FuncDefAgg *pFunc = sqlite3FindFunction( db, aAggs[i].zName,
  1818   1820             strlen(aAggs[i].zName), aAggs[i].nArg, SQLITE_UTF8, 0);
  1819   1821         if( pFunc && aAggs[i].needCollSeq ){
  1820   1822           pFunc->needCollSeq = 1;

Changes to SQLite.Interop/src/win/SQLite.Interop.rc.

    10     10   #else
    11     11   #include "windows.h"
    12     12   #endif
    13     13   
    14     14   #include "..\core\sqlite3.h"
    15     15   #include "interop.h"
    16     16   
    17         -/////////////////////////////////////////////////////////////////////////////
    18         -// English (U.S.) resources
           17  +/*
           18  +** English (U.S.) resources
           19  +*/
    19     20   
    20     21   #ifdef _WIN32
    21     22   LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    22     23   #pragma code_page(1252)
    23     24   #endif //_WIN32
    24     25   
    25         -/////////////////////////////////////////////////////////////////////////////
    26         -//
    27         -// Version
    28         -//
           26  +/*
           27  +** Version
           28  +*/
    29     29   
    30     30   VS_VERSION_INFO VERSIONINFO
    31     31    FILEVERSION INTEROP_RC_VERSION
    32     32    PRODUCTVERSION INTEROP_RC_VERSION
    33     33    FILEFLAGSMASK 0x17L
    34     34   #ifdef _DEBUG
    35     35    FILEFLAGS 0x1L

Changes to SQLite.Interop/src/win/crypt.c.

     4      4    * 
     5      5    * Released to the public domain, use at your own risk!
     6      6    ********************************************************/
     7      7   
     8      8   #ifndef SQLITE_OMIT_DISKIO
     9      9   #ifdef SQLITE_HAS_CODEC
    10     10   
    11         -//#ifdef SQLITE_DEBUG
    12         -//#include "splitsource\pager.c"
    13         -//#endif
    14         -
    15     11   #include <windows.h>
    16     12   #include <wincrypt.h>
    17     13   
    18         -// Extra padding before and after the cryptographic buffer
           14  +/* Extra padding before and after the cryptographic buffer */
    19     15   #define CRYPT_OFFSET 8
    20     16   
    21     17   typedef struct _CRYPTBLOCK
    22     18   {
    23         -  Pager    *pPager;       // Pager this cryptblock belongs to
    24         -  HCRYPTKEY hReadKey;     // Key used to read from the database and write to the journal
    25         -  HCRYPTKEY hWriteKey;    // Key used to write to the database
    26         -  DWORD     dwPageSize;   // Size of pages
    27         -  LPVOID    pvCrypt;      // A buffer for encrypting/decrypting (if necessary)
    28         -  DWORD     dwCryptSize;  // Equal to or greater than dwPageSize.  If larger, pvCrypt is valid and this is its size
           19  +  Pager    *pPager;       /* Pager this cryptblock belongs to */
           20  +  HCRYPTKEY hReadKey;     /* Key used to read from the database and write to the journal */
           21  +  HCRYPTKEY hWriteKey;    /* Key used to write to the database */
           22  +  DWORD     dwPageSize;   /* Size of pages */
           23  +  LPVOID    pvCrypt;      /* A buffer for encrypting/decrypting (if necessary) */
           24  +  DWORD     dwCryptSize;  /* Equal to or greater than dwPageSize.  If larger, pvCrypt is valid and this is its size */
    29     25   } CRYPTBLOCK, *LPCRYPTBLOCK;
    30     26   
    31         -HCRYPTPROV g_hProvider = 0; // Global instance of the cryptographic provider
           27  +HCRYPTPROV g_hProvider = 0; /* Global instance of the cryptographic provider */
    32     28   
    33     29   #define SQLITECRYPTERROR_PROVIDER "Cryptographic provider not available"
    34     30   
    35         -// Needed for re-keying
           31  +/* Needed for re-keying */
    36     32   static void * sqlite3pager_get_codecarg(Pager *pPager)
    37     33   {
    38     34     return (pPager->xCodec) ? pPager->pCodec: NULL;
    39     35   }
    40     36   
    41     37   void sqlite3_activate_see(const char *info)
    42     38   {
    43     39   }
    44     40   
    45         -// Create a cryptographic context.  Use the enhanced provider because it is available on
    46         -// most platforms
           41  +/* Create a cryptographic context.  Use the enhanced provider because it is available on
           42  +** most platforms
           43  +*/
    47     44   static BOOL InitializeProvider()
    48     45   {
    49     46     if (g_hProvider) return TRUE;
    50     47   
    51     48     if (!CryptAcquireContext(&g_hProvider, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
    52     49     {
    53     50       return FALSE;
    54     51     }
    55     52     return TRUE;
    56     53   }
    57     54   
    58         -// Create or update a cryptographic context for a pager.
    59         -// This function will automatically determine if the encryption algorithm requires
    60         -// extra padding, and if it does, will create a temp buffer big enough to provide
    61         -// space to hold it.
           55  +/* Create or update a cryptographic context for a pager.
           56  +** This function will automatically determine if the encryption algorithm requires
           57  +** extra padding, and if it does, will create a temp buffer big enough to provide
           58  +** space to hold it.
           59  +*/
    62     60   static LPCRYPTBLOCK CreateCryptBlock(HCRYPTKEY hKey, Pager *pager, int pageSize, LPCRYPTBLOCK pExisting)
    63     61   {
    64     62     LPCRYPTBLOCK pBlock;
    65     63   
    66         -  if (!pExisting) // Creating a new cryptblock
           64  +  if (!pExisting) /* Creating a new cryptblock */
    67     65     {
    68     66       pBlock = sqlite3_malloc(sizeof(CRYPTBLOCK));
    69     67       if (!pBlock) return NULL;
    70     68   
    71     69       ZeroMemory(pBlock, sizeof(CRYPTBLOCK));
    72     70       pBlock->hReadKey = hKey;
    73     71       pBlock->hWriteKey = hKey;
    74     72     }
    75         -  else // Updating an existing cryptblock
           73  +  else /* Updating an existing cryptblock */
    76     74     {
    77     75       pBlock = pExisting;
    78     76     }
    79     77   
    80     78     if (pageSize == -1)
    81     79       pageSize = pager->pageSize;
    82     80   
    83     81     pBlock->pPager = pager;
    84     82     pBlock->dwPageSize = (DWORD)pageSize;
    85     83     pBlock->dwCryptSize = pBlock->dwPageSize;
    86     84   
    87         -  // Existing cryptblocks may have a buffer, if so, delete it
           85  +  /* Existing cryptblocks may have a buffer, if so, delete it */
    88     86     if (pBlock->pvCrypt)
    89     87     {
    90     88       sqlite3_free(pBlock->pvCrypt);
    91     89       pBlock->pvCrypt = NULL;
    92     90     }
    93     91   
    94         -  // Figure out how big to make our spare crypt block
           92  +  /* Figure out how big to make our spare crypt block */
    95     93     CryptEncrypt(hKey, 0, TRUE, 0, NULL, &pBlock->dwCryptSize, pBlock->dwCryptSize * 2);
    96     94     pBlock->pvCrypt = sqlite3_malloc(pBlock->dwCryptSize + (CRYPT_OFFSET * 2));
    97     95     if (!pBlock->pvCrypt)
    98     96     {
    99         -    // We created a new block in here, so free it.  Otherwise leave the original intact
   100         -    if (pBlock != pExisting) 
           97  +    /* We created a new block in here, so free it.  Otherwise leave the original intact */
           98  +    if (pBlock != pExisting)
   101     99         sqlite3_free(pBlock);
   102    100   
   103    101       return NULL;
   104    102     }
   105    103   
   106    104     return pBlock;
   107    105   }
   108    106   
   109         -// Destroy a cryptographic context and any buffers and keys allocated therein
          107  +/* Destroy a cryptographic context and any buffers and keys allocated therein */
   110    108   static void sqlite3CodecFree(LPVOID pv)
   111    109   {
   112    110     LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)pv;
   113         -  // Destroy the read key if there is one
          111  +  /* Destroy the read key if there is one */
   114    112     if (pBlock->hReadKey)
   115    113     {
   116    114       CryptDestroyKey(pBlock->hReadKey);
   117    115     }
   118    116   
   119         -  // If there's a writekey and its not equal to the readkey, destroy it
          117  +  /* If there's a writekey and its not equal to the readkey, destroy it */
   120    118     if (pBlock->hWriteKey && pBlock->hWriteKey != pBlock->hReadKey)
   121    119     {
   122    120       CryptDestroyKey(pBlock->hWriteKey);
   123    121     }
   124    122   
   125         -  // If there's extra buffer space allocated, free it as well
          123  +  /* If there's extra buffer space allocated, free it as well */
   126    124     if (pBlock->pvCrypt)
   127    125     {
   128    126       sqlite3_free(pBlock->pvCrypt);
   129    127     }
   130    128   
   131         -  // All done with this cryptblock
          129  +  /* All done with this cryptblock */
   132    130     sqlite3_free(pBlock);
   133    131   }
   134    132   
   135    133   void sqlite3CodecSizeChange(void *pArg, int pageSize, int reservedSize)
   136    134   {
   137    135     LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)pArg;
   138    136   
   139    137     if (pBlock->dwPageSize != pageSize)
   140    138     {
   141    139       CreateCryptBlock(pBlock->hReadKey, pBlock->pPager, pageSize, pBlock);
   142         -    // If this fails, pvCrypt will be NULL, and the next time sqlite3Codec() is called, it will result in an error
          140  +    /* If this fails, pvCrypt will be NULL, and the next time sqlite3Codec() is called, it will result in an error */
   143    141     }
   144    142   }
   145    143   
   146         -// Encrypt/Decrypt functionality, called by pager.c
          144  +/* Encrypt/Decrypt functionality, called by pager.c */
   147    145   void * sqlite3Codec(void *pArg, void *data, Pgno nPageNum, int nMode)
   148    146   {
   149    147     LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)pArg;
   150    148     DWORD dwPageSize;
   151    149     LPVOID pvTemp = NULL;
   152    150   
   153    151     if (!pBlock) return data;
   154         -  if (pBlock->pvCrypt == NULL) return NULL; // This only happens if CreateCryptBlock() failed to make scratch space
          152  +  if (pBlock->pvCrypt == NULL) return NULL; /* This only happens if CreateCryptBlock() failed to make scratch space */
   155    153   
   156    154     switch(nMode)
   157    155     {
   158         -  case 0: // Undo a "case 7" journal file encryption
   159         -  case 2: // Reload a page
   160         -  case 3: // Load a page
          156  +  case 0: /* Undo a "case 7" journal file encryption */
          157  +  case 2: /* Reload a page */
          158  +  case 3: /* Load a page */
   161    159       if (!pBlock->hReadKey) break;
   162    160   
   163         -    /* Block ciphers often need to write extra padding beyond the 
          161  +    /* Block ciphers often need to write extra padding beyond the
   164    162       data block.  We don't have that luxury for a given page of data so
   165    163       we must copy the page data to a buffer that IS large enough to hold
   166    164       the padding.  We then encrypt the block and write the buffer back to
   167    165       the page without the unnecessary padding.
   168    166       We only use the special block of memory if its absolutely necessary. */
   169    167       if (pBlock->dwCryptSize != pBlock->dwPageSize)
   170    168       {
................................................................................
   172    170         pvTemp = data;
   173    171         data = ((LPBYTE)pBlock->pvCrypt) + CRYPT_OFFSET;
   174    172       }
   175    173   
   176    174       dwPageSize = pBlock->dwCryptSize;
   177    175       CryptDecrypt(pBlock->hReadKey, 0, TRUE, 0, (LPBYTE)data, &dwPageSize);
   178    176   
   179         -    // If the encryption algorithm required extra padding and we were forced to encrypt or
   180         -    // decrypt a copy of the page data to a temp buffer, then write the contents of the temp
   181         -    // buffer back to the page data minus any padding applied.
          177  +    /* If the encryption algorithm required extra padding and we were forced to encrypt or
          178  +    ** decrypt a copy of the page data to a temp buffer, then write the contents of the temp
          179  +    ** buffer back to the page data minus any padding applied.
          180  +    */
   182    181       if (pBlock->dwCryptSize != pBlock->dwPageSize)
   183    182       {
   184    183         CopyMemory(pvTemp, data, pBlock->dwPageSize);
   185    184         data = pvTemp;
   186    185       }
   187    186       break;
   188         -  case 6: // Encrypt a page for the main database file
          187  +  case 6: /* Encrypt a page for the main database file */
   189    188       if (!pBlock->hWriteKey) break;
   190    189   
   191    190       CopyMemory(((LPBYTE)pBlock->pvCrypt) + CRYPT_OFFSET, data, pBlock->dwPageSize);
   192    191       data = ((LPBYTE)pBlock->pvCrypt) + CRYPT_OFFSET;
   193    192   
   194    193       dwPageSize = pBlock->dwPageSize;
   195    194       CryptEncrypt(pBlock->hWriteKey, 0, TRUE, 0, ((LPBYTE)pBlock->pvCrypt) + CRYPT_OFFSET, &dwPageSize, pBlock->dwCryptSize);
   196    195       break;
   197         -  case 7: // Encrypt a page for the journal file
          196  +  case 7: /* Encrypt a page for the journal file */
   198    197       /* Under normal circumstances, the readkey is the same as the writekey.  However,
   199    198       when the database is being rekeyed, the readkey is not the same as the writekey.
   200    199       The rollback journal must be written using the original key for the
   201    200       database file because it is, by nature, a rollback journal.
   202    201       Therefore, for case 7, when the rollback is being written, always encrypt using
   203    202       the database's readkey, which is guaranteed to be the same key that was used to
   204    203       read the original data.
................................................................................
   212    211       CryptEncrypt(pBlock->hReadKey, 0, TRUE, 0, ((LPBYTE)pBlock->pvCrypt) + CRYPT_OFFSET, &dwPageSize, pBlock->dwCryptSize);
   213    212       break;
   214    213     }
   215    214   
   216    215     return data;
   217    216   }
   218    217   
   219         -// Derive an encryption key from a user-supplied buffer
          218  +/* Derive an encryption key from a user-supplied buffer */
   220    219   static HCRYPTKEY DeriveKey(const void *pKey, int nKeyLen)
   221    220   {
   222    221     HCRYPTHASH hHash = 0;
   223    222     HCRYPTKEY  hKey;
   224    223   
   225    224     if (!pKey || !nKeyLen) return 0;
   226    225   
................................................................................
   232    231     if (CryptCreateHash(g_hProvider, CALG_SHA1, 0, 0, &hHash))
   233    232     {
   234    233       if (CryptHashData(hHash, (LPBYTE)pKey, nKeyLen, 0))
   235    234       {
   236    235         CryptDeriveKey(g_hProvider, CALG_RC4, hHash, 0, &hKey);
   237    236       }
   238    237       CryptDestroyHash(hHash);
   239         -  }  
          238  +  }
   240    239     return hKey;
   241    240   }
   242    241   
   243         -// Called by sqlite and sqlite3_key_interop to attach a key to a database.
          242  +/* Called by sqlite and sqlite3_key_interop to attach a key to a database. */
   244    243   int sqlite3CodecAttach(sqlite3 *db, int nDb, const void *pKey, int nKeyLen)
   245    244   {
   246    245     int rc = SQLITE_ERROR;
   247    246     HCRYPTKEY hKey = 0;
   248    247   
   249         -  // No key specified, could mean either use the main db's encryption or no encryption
          248  +  /* No key specified, could mean either use the main db's encryption or no encryption */
   250    249     if (!pKey || !nKeyLen)
   251    250     {
   252    251       if (!nDb)
   253    252       {
   254         -      return SQLITE_OK; // Main database, no key specified so not encrypted
          253  +      return SQLITE_OK; /* Main database, no key specified so not encrypted */
   255    254       }
   256         -    else // Attached database, use the main database's key
          255  +    else /* Attached database, use the main database's key */
   257    256       {
   258         -      // Get the encryption block for the main database and attempt to duplicate the key
   259         -      // for use by the attached database
          257  +      /* Get the encryption block for the main database and attempt to duplicate the key
          258  +      ** for use by the attached database
          259  +      */
   260    260         Pager *p = sqlite3BtreePager(db->aDb[0].pBt);
   261    261         LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)sqlite3pager_get_codecarg(p);
   262    262   
   263         -      if (!pBlock) return SQLITE_OK; // Main database is not encrypted so neither will be any attached database
   264         -      if (!pBlock->hReadKey) return SQLITE_OK; // Not encrypted
          263  +      if (!pBlock) return SQLITE_OK; /* Main database is not encrypted so neither will be any attached database */
          264  +      if (!pBlock->hReadKey) return SQLITE_OK; /* Not encrypted */
   265    265   
   266    266         if (!CryptDuplicateKey(pBlock->hReadKey, NULL, 0, &hKey))
   267         -        return rc; // Unable to duplicate the key
          267  +        return rc; /* Unable to duplicate the key */
   268    268       }
   269    269     }
   270         -  else // User-supplied passphrase, so create a cryptographic key out of it
          270  +  else /* User-supplied passphrase, so create a cryptographic key out of it */
   271    271     {
   272    272       hKey = DeriveKey(pKey, nKeyLen);
   273    273       if (hKey == MAXDWORD)
   274    274       {
   275    275         sqlite3Error(db, rc, SQLITECRYPTERROR_PROVIDER);
   276    276         return rc;
   277    277       }
   278    278     }
   279    279   
   280         -  // Create a new encryption block and assign the codec to the new attached database
          280  +  /* Create a new encryption block and assign the codec to the new attached database */
   281    281     if (hKey)
   282    282     {
   283    283       Pager *p = sqlite3BtreePager(db->aDb[nDb].pBt);
   284    284       LPCRYPTBLOCK pBlock = CreateCryptBlock(hKey, p, -1, NULL);
   285    285       if (!pBlock) return SQLITE_NOMEM;
   286    286   
   287    287       sqlite3PagerSetCodec(p, sqlite3Codec, sqlite3CodecSizeChange, sqlite3CodecFree, pBlock);
   288         -    //db->aDb[nDb].pAux = pBlock;
   289         -    //db->aDb[nDb].xFreeAux = DestroyCryptBlock;
   290    288   
   291    289       rc = SQLITE_OK;
   292    290     }
   293    291     return rc;
   294    292   }
   295    293   
   296         -// Once a password has been supplied and a key created, we don't keep the 
   297         -// original password for security purposes.  Therefore return NULL.
          294  +/* Once a password has been supplied and a key created, we don't keep the
          295  +** original password for security purposes.  Therefore return NULL.
          296  +*/
   298    297   void sqlite3CodecGetKey(sqlite3 *db, int nDb, void **ppKey, int *pnKeyLen)
   299    298   {
   300    299     Btree *pbt = db->aDb[0].pBt;
   301    300     Pager *p = sqlite3BtreePager(pbt);
   302    301     LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)sqlite3pager_get_codecarg(p);
   303    302   
   304    303     if (ppKey) *ppKey = 0;
   305    304     if (pnKeyLen && pBlock) *pnKeyLen = 1;
   306    305   }
   307    306   
   308         -// We do not attach this key to the temp store, only the main database.
          307  +/* We do not attach this key to the temp store, only the main database. */
   309    308   SQLITE_API int sqlite3_key(sqlite3 *db, const unsigned char *pKey, int nKeySize)
   310    309   {
   311    310     return sqlite3CodecAttach(db, 0, pKey, nKeySize);
   312    311   }
   313    312   
   314         -// Changes the encryption key for an existing database.
          313  +/* Changes the encryption key for an existing database. */
   315    314   SQLITE_API int sqlite3_rekey(sqlite3 *db, const unsigned char *pKey, int nKeySize)
   316    315   {
   317    316     Btree *pbt = db->aDb[0].pBt;
   318    317     Pager *p = sqlite3BtreePager(pbt);
   319    318     LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)sqlite3pager_get_codecarg(p);
   320    319     HCRYPTKEY hKey = DeriveKey(pKey, nKeySize);
   321    320     int rc = SQLITE_ERROR;
................................................................................
   322    321   
   323    322     if (hKey == MAXDWORD)
   324    323     {
   325    324       sqlite3Error(db, rc, SQLITECRYPTERROR_PROVIDER);
   326    325       return rc;
   327    326     }
   328    327   
   329         -  if (!pBlock && !hKey) return SQLITE_OK; // Wasn't encrypted to begin with
          328  +  if (!pBlock && !hKey) return SQLITE_OK; /* Wasn't encrypted to begin with */
   330    329   
   331         -  // To rekey a database, we change the writekey for the pager.  The readkey remains
   332         -  // the same
   333         -  if (!pBlock) // Encrypt an unencrypted database
          330  +  /* To rekey a database, we change the writekey for the pager.  The readkey remains
          331  +  ** the same
          332  +  */
          333  +  if (!pBlock) /* Encrypt an unencrypted database */
   334    334     {
   335    335       pBlock = CreateCryptBlock(hKey, p, -1, NULL);
   336    336       if (!pBlock)
   337    337         return SQLITE_NOMEM;
   338    338   
   339         -    pBlock->hReadKey = 0; // Original database is not encrypted
          339  +    pBlock->hReadKey = 0; /* Original database is not encrypted */
   340    340       sqlite3PagerSetCodec(sqlite3BtreePager(pbt), sqlite3Codec, sqlite3CodecSizeChange, sqlite3CodecFree, pBlock);
   341         -    //db->aDb[0].pAux = pBlock;
   342         -    //db->aDb[0].xFreeAux = DestroyCryptBlock;
   343    341     }
   344         -  else // Change the writekey for an already-encrypted database
          342  +  else /* Change the writekey for an already-encrypted database */
   345    343     {
   346    344       pBlock->hWriteKey = hKey;
   347    345     }
   348    346   
   349    347     sqlite3_mutex_enter(db->mutex);
   350    348   
   351         -  // Start a transaction
          349  +  /* Start a transaction */
   352    350     rc = sqlite3BtreeBeginTrans(pbt, 1);
   353    351   
   354    352     if (!rc)
   355    353     {
   356         -    // Rewrite all the pages in the database using the new encryption key
          354  +    /* Rewrite all the pages in the database using the new encryption key */
   357    355       Pgno nPage;
   358    356       Pgno nSkip = PAGER_MJ_PGNO(p);
   359    357       DbPage *pPage;
   360    358       Pgno n;
   361    359       int count;
   362    360   
   363    361       sqlite3PagerPagecount(p, &count);
................................................................................
   371    369         {
   372    370           rc = sqlite3PagerWrite(pPage);
   373    371           sqlite3PagerUnref(pPage);
   374    372         }
   375    373       }
   376    374     }
   377    375   
   378         -  // If we succeeded, try and commit the transaction
          376  +  /* If we succeeded, try and commit the transaction */
   379    377     if (!rc)
   380    378     {
   381    379       rc = sqlite3BtreeCommit(pbt);
   382    380     }
   383    381   
   384         -  // If we failed, rollback
          382  +  // If we failed, rollback */
   385    383     if (rc)
   386    384     {
   387    385       sqlite3BtreeRollback(pbt, SQLITE_OK);
   388    386     }
   389    387   
   390         -  // If we succeeded, destroy any previous read key this database used
   391         -  // and make the readkey equal to the writekey
          388  +  /* If we succeeded, destroy any previous read key this database used
          389  +  ** and make the readkey equal to the writekey
          390  +  */
   392    391     if (!rc)
   393    392     {
   394    393       if (pBlock->hReadKey)
   395    394       {
   396    395         CryptDestroyKey(pBlock->hReadKey);
   397    396       }
   398    397       pBlock->hReadKey = pBlock->hWriteKey;
   399    398     }
   400         -  // We failed.  Destroy the new writekey (if there was one) and revert it back to
   401         -  // the original readkey
          399  +  /* We failed.  Destroy the new writekey (if there was one) and revert it back to
          400  +  ** the original readkey
          401  +  */
   402    402     else
   403    403     {
   404    404       if (pBlock->hWriteKey)
   405    405       {
   406    406         CryptDestroyKey(pBlock->hWriteKey);
   407    407       }
   408    408       pBlock->hWriteKey = pBlock->hReadKey;
   409    409     }
   410    410   
   411         -  // If the readkey and writekey are both empty, there's no need for a codec on this
   412         -  // pager anymore.  Destroy the crypt block and remove the codec from the pager.
          411  +  /* If the readkey and writekey are both empty, there's no need for a codec on this
          412  +  ** pager anymore.  Destroy the crypt block and remove the codec from the pager.
          413  +  */
   413    414     if (!pBlock->hReadKey && !pBlock->hWriteKey)
   414    415     {
   415    416       sqlite3PagerSetCodec(p, NULL, NULL, NULL, NULL);
   416    417     }
   417    418   
   418    419     sqlite3_mutex_leave(db->mutex);
   419    420   
   420    421     return rc;
   421    422   }
   422    423   
   423         -#endif // SQLITE_HAS_CODEC
   424         -
   425         -#endif // SQLITE_OMIT_DISKIO
          424  +#endif /* SQLITE_HAS_CODEC */
          425  +#endif /* SQLITE_OMIT_DISKIO */

Changes to SQLite.Interop/src/win/interop.c.

    10     10   #include "../core/sqlite3.c"
    11     11   
    12     12   #if defined(INTEROP_EXTENSION_FUNCTIONS)
    13     13   #include "../contrib/extension-functions.c"
    14     14   extern int RegisterExtensionFunctions(sqlite3 *db);
    15     15   #endif
    16     16   
           17  +#ifdef SQLITE_OS_WIN
    17     18   #if defined(INTEROP_CODEC)
    18     19   #include "crypt.c"
    19     20   #endif
    20     21   
    21         -#ifdef SQLITE_OS_WIN
    22         -
    23         -// Additional open flags, we use this one privately
    24         -//#define SQLITE_OPEN_SHAREDCACHE      0x01000000
    25         -
    26     22   typedef void (*SQLITEUSERFUNC)(sqlite3_context *, int, sqlite3_value **);
    27     23   typedef void (*SQLITEFUNCFINAL)(sqlite3_context *);
    28     24   
    29     25   #if SQLITE_VERSION_NUMBER < 3007014
    30     26   SQLITE_PRIVATE void * sqlite3DbMallocZero_interop(sqlite3 *db, int n)
    31     27   {
    32     28     void *p;
................................................................................
    83     79       {
    84     80         sqlite3_mutex_leave(db->mutex);
    85     81         return ret;
    86     82       }
    87     83   
    88     84       while (db->pVdbe)
    89     85       {
    90         -      // Make a copy of the first prepared statement
           86  +      /* Make a copy of the first prepared statement */
    91     87         Vdbe *p = (Vdbe *)sqlite3DbMallocZero_interop(db, sizeof(Vdbe));
    92     88         Vdbe *po = db->pVdbe;
    93     89   
    94     90         if (!p) 
    95     91         {
    96     92           ret = SQLITE_NOMEM;
    97     93           break;
    98     94         }
    99     95   
   100     96         CopyMemory(p, po, sizeof(Vdbe));
   101     97   
   102         -      // Put it on the chain so we can free it
           98  +      /* Put it on the chain so we can free it */
   103     99         db->pVdbe = p;
   104         -      ret = sqlite3_finalize((sqlite3_stmt *)p); // This will also free the copy's memory
          100  +      ret = sqlite3_finalize((sqlite3_stmt *)p); /* This will also free the copy's memory */
   105    101         if (ret)
   106    102         {
   107         -        // finalize failed -- so we must put back anything we munged
          103  +        /* finalize failed -- so we must put back anything we munged */
   108    104           CopyMemory(po, p, sizeof(Vdbe));
   109    105           db->pVdbe = po;
   110    106   
   111         -        //
   112         -        // NOTE: Ok, we must free this block that *we* allocated (above) since
   113         -        //       finalize did not do so.
   114         -        //
          107  +        /*
          108  +        ** NOTE: Ok, we must free this block that *we* allocated (above) since
          109  +        **       finalize did not do so.
          110  +        */
   115    111           sqlite3DbFree_interop(db, p);
   116    112           break;
   117    113         }
   118    114         else
   119    115         {
   120    116           ZeroMemory(po, sizeof(Vdbe));
   121    117           po->magic = VDBE_MAGIC_DEAD;
................................................................................
   127    123     return ret;
   128    124   #endif
   129    125   }
   130    126   
   131    127   SQLITE_API int WINAPI sqlite3_open_interop(const char*filename, int flags, sqlite3 **ppdb)
   132    128   {
   133    129     int ret;
   134         -  //int sharedcache = ((flags & SQLITE_OPEN_SHAREDCACHE) != 0);
   135         -  //flags &= ~SQLITE_OPEN_SHAREDCACHE;
   136    130   
   137         -  //sqlite3_enable_shared_cache(sharedcache);
   138    131     ret = sqlite3_open_v2(filename, ppdb, flags, NULL);
   139         -  //sqlite3_enable_shared_cache(0);
   140    132   
   141    133   #if defined(INTEROP_EXTENSION_FUNCTIONS)
   142    134     if (ret == 0)
   143    135       RegisterExtensionFunctions(*ppdb);
   144    136   #endif
   145    137   
   146    138     return ret;
................................................................................
   546    538       }
   547    539       break;
   548    540     }
   549    541     sqlite3_mutex_leave(db->mutex);
   550    542   
   551    543     return ret;
   552    544   }
          545  +#endif /* SQLITE_OS_WIN */
          546  +
          547  +/*****************************************************************************/
          548  +
          549  +/*
          550  +** The INTEROP_TEST_EXTENSION block must be at the end of this source file
          551  +** because it includes the "sqlite3ext.h" file, which defines the sqlite3
          552  +** public API function names to be macros and that would cause the code
          553  +** above this point to malfunction.
          554  +*/
          555  +#if defined(INTEROP_TEST_EXTENSION)
          556  +#include "../core/sqlite3ext.h"
          557  +SQLITE_EXTENSION_INIT1
          558  +
          559  +/*
          560  +** The interopTest() SQL function returns its first argument or raises an
          561  +** error if there are not enough arguments.
          562  +*/
          563  +static void interopTestFunc(
          564  +  sqlite3_context *context,
          565  +  int argc,
          566  +  sqlite3_value **argv
          567  +){
          568  +  const unsigned char *z;
          569  +  if( argc!=1 ){
          570  +    sqlite3_result_error(context, "need exactly one argument", -1);
          571  +    return;
          572  +  }
          573  +  z = sqlite3_value_text(argv[0]);
          574  +  if( z ){
          575  +    sqlite3_result_text(context, (char*)z, -1, SQLITE_STATIC);
          576  +  }else{
          577  +    sqlite3_result_null(context);
          578  +  }
          579  +}
   553    580   
   554         -#endif // SQLITE_OS_WIN
          581  +/* SQLite invokes this routine once when it loads the extension.
          582  +** Create new functions, collating sequences, and virtual table
          583  +** modules here.  This is usually the only exported symbol in
          584  +** the shared library.
          585  +*/
          586  +SQLITE_API int interop_test_extension_init(
          587  +  sqlite3 *db,
          588  +  char **pzErrMsg,
          589  +  const sqlite3_api_routines *pApi
          590  +){
          591  +  SQLITE_EXTENSION_INIT2(pApi)
          592  +  sqlite3_create_function(db, "interopTest", -1, SQLITE_ANY, 0,
          593  +      interopTestFunc, 0, 0);
          594  +  return 0;
          595  +}
          596  +#endif

Changes to SQLite.NET.Settings.targets.

   143    143   
   144    144                     "SQLite.Interop\props\SQLite.Interop.20XX.[vs]props"
   145    145   
   146    146                 for the corresponding version(s) of Visual Studio.
   147    147       -->
   148    148       <InteropExtensionFunctions Condition="'$(InteropExtensionFunctions)' == ''">true</InteropExtensionFunctions>
   149    149   
          150  +    <!--
          151  +        NOTE: Enable the test extension from the custom built interop DLL (i.e.
          152  +              "SQLite.Interop.dll")?  By default, this is enabled only in the
          153  +              Debug build configuration.  If this is disabled, the test
          154  +              extension will be unavailable.  If this is enabled, it must also
          155  +              be enabled via the "INTEROP_TEST_EXTENSION=1" preprocessor define
          156  +              being present in the "INTEROP_DEBUG_DEFINES" macro in the build
          157  +              properties file:
          158  +
          159  +                  "SQLite.Interop\props\SQLite.Interop.20XX.[vs]props"
          160  +
          161  +              for the corresponding version(s) of Visual Studio.
          162  +    -->
          163  +    <InteropTestExtension Condition="'$(InteropTestExtension)' == '' And '$(Configuration)' == 'Debug'">true</InteropTestExtension>
          164  +    <InteropTestExtension Condition="'$(InteropTestExtension)' == '' And '$(Configuration)' != 'Debug'">false</InteropTestExtension>
          165  +
   150    166       <!--
   151    167           NOTE: Enable exposing the CryptoAPI based codec from the custom built
   152    168                 interop DLL (i.e. "SQLite.Interop.dll")?  By default, this is
   153    169                 enabled.  If this is disabled, support for encrypted databases
   154    170                 will be unavailable.  If this is enabled, it must also be enabled
   155    171                 via the "SQLITE_HAS_CODEC=1" preprocessor define being present in
   156    172                 the "SQLITE_EXTRA_DEFINES" macro in the build properties file:

Changes to Setup/archive.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO2=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET ROOT=%~dp0\..
    23     29   SET ROOT=%ROOT:\\=\%
    24     30   
    25     31   SET TOOLS=%~dp0
    26     32   SET TOOLS=%TOOLS:~0,-1%
    27     33   

Changes to Setup/bake.bat.

    13     13   
    14     14   REM SET __ECHO=ECHO
    15     15   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    16     16   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    17     17   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    18     18   
    19     19   %_AECHO% Running %0 %*
           20  +
           21  +SET DUMMY2=%1
           22  +
           23  +IF DEFINED DUMMY2 (
           24  +  GOTO usage
           25  +)
    20     26   
    21     27   SET TOOLS=%~dp0
    22     28   SET TOOLS=%TOOLS:~0,-1%
    23     29   
    24     30   %_VECHO% Tools = '%TOOLS%'
    25     31   
    26     32   IF NOT DEFINED FRAMEWORK (
................................................................................
    66     72     VERIFY > NUL
    67     73     GOTO :EOF
    68     74   
    69     75   :fn_SetErrorLevel
    70     76     VERIFY MAYBE 2> NUL
    71     77     GOTO :EOF
    72     78   
           79  +:usage
           80  +  ECHO.
           81  +  ECHO Usage: %~nx0
           82  +  ECHO.
           83  +  GOTO errors
           84  +
    73     85   :errors
    74     86     CALL :fn_SetErrorLevel
    75     87     ENDLOCAL
    76     88     ECHO.
    77     89     ECHO Bake failure, errors were encountered.
    78     90     GOTO end_of_file
    79     91   

Changes to Setup/bake_all.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   CALL :fn_ResetErrorLevel
................................................................................
    84     90     VERIFY > NUL
    85     91     GOTO :EOF
    86     92   
    87     93   :fn_SetErrorLevel
    88     94     VERIFY MAYBE 2> NUL
    89     95     GOTO :EOF
    90     96   
           97  +:usage
           98  +  ECHO.
           99  +  ECHO Usage: %~nx0
          100  +  ECHO.
          101  +  GOTO errors
          102  +
    91    103   :errors
    92    104     CALL :fn_SetErrorLevel
    93    105     ENDLOCAL
    94    106     ECHO.
    95    107     ECHO Failure, errors were encountered.
    96    108     GOTO end_of_file
    97    109   

Changes to Setup/build.bat.

    15     15   REM SET __ECHO2=ECHO
    16     16   REM SET __ECHO3=ECHO
    17     17   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    18     18   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    19     19   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    20     20   
    21     21   %_AECHO% Running %0 %*
           22  +
           23  +SET DUMMY2=%3
           24  +
           25  +IF DEFINED DUMMY2 (
           26  +  GOTO usage
           27  +)
    22     28   
    23     29   SET ROOT=%~dp0\..
    24     30   SET ROOT=%ROOT:\\=\%
    25     31   
    26     32   %_VECHO% Root = '%ROOT%'
    27     33   
    28     34   SET CONFIGURATION=%1
................................................................................
   286    292   
   287    293   :fn_SetErrorLevel
   288    294     VERIFY MAYBE 2> NUL
   289    295     GOTO :EOF
   290    296   
   291    297   :usage
   292    298     ECHO.
   293         -  ECHO Usage: %~nx0 [configuration] [platform] [...]
          299  +  ECHO Usage: %~nx0 [configuration] [platform]
   294    300     ECHO.
   295    301     GOTO errors
   296    302   
   297    303   :errors
   298    304     CALL :fn_SetErrorLevel
   299    305     ENDLOCAL
   300    306     ECHO.

Changes to Setup/build_all.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   CALL :fn_ResetErrorLevel
................................................................................
    84     90     VERIFY > NUL
    85     91     GOTO :EOF
    86     92   
    87     93   :fn_SetErrorLevel
    88     94     VERIFY MAYBE 2> NUL
    89     95     GOTO :EOF
    90     96   
           97  +:usage
           98  +  ECHO.
           99  +  ECHO Usage: %~nx0
          100  +  ECHO.
          101  +  GOTO errors
          102  +
    91    103   :errors
    92    104     CALL :fn_SetErrorLevel
    93    105     ENDLOCAL
    94    106     ECHO.
    95    107     ECHO Failure, errors were encountered.
    96    108     GOTO end_of_file
    97    109   

Changes to Setup/build_ce.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   SET BUILD_CONFIGURATIONS=Release

Changes to Setup/release.bat.

    15     15   REM SET __ECHO2=ECHO
    16     16   REM SET __ECHO3=ECHO
    17     17   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    18     18   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    19     19   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    20     20   
    21     21   %_AECHO% Running %0 %*
           22  +
           23  +SET DUMMY2=%4
           24  +
           25  +IF DEFINED DUMMY2 (
           26  +  GOTO usage
           27  +)
    22     28   
    23     29   SET TOOLS=%~dp0
    24     30   SET TOOLS=%TOOLS:~0,-1%
    25     31   
    26     32   %_VECHO% Tools = '%TOOLS%'
    27     33   
    28     34   SET CONFIGURATION=%1

Changes to Setup/release_all.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   CALL :fn_ResetErrorLevel
................................................................................
    77     83     VERIFY > NUL
    78     84     GOTO :EOF
    79     85   
    80     86   :fn_SetErrorLevel
    81     87     VERIFY MAYBE 2> NUL
    82     88     GOTO :EOF
    83     89   
           90  +:usage
           91  +  ECHO.
           92  +  ECHO Usage: %~nx0
           93  +  ECHO.
           94  +  GOTO errors
           95  +
    84     96   :errors
    85     97     CALL :fn_SetErrorLevel
    86     98     ENDLOCAL
    87     99     ECHO.
    88    100     ECHO Failure, errors were encountered.
    89    101     GOTO end_of_file
    90    102   

Changes to Setup/release_ce.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   SET RELEASE_CONFIGURATIONS=Release

Changes to Setup/release_static.bat.

    14     14   REM SET __ECHO=ECHO
    15     15   REM SET __ECHO3=ECHO
    16     16   IF NOT DEFINED _AECHO (SET _AECHO=REM)
    17     17   IF NOT DEFINED _CECHO (SET _CECHO=REM)
    18     18   IF NOT DEFINED _VECHO (SET _VECHO=REM)
    19     19   
    20     20   %_AECHO% Running %0 %*
           21  +
           22  +SET DUMMY2=%1
           23  +
           24  +IF DEFINED DUMMY2 (
           25  +  GOTO usage
           26  +)
    21     27   
    22     28   SET TOOLS=%~dp0
    23     29   SET TOOLS=%TOOLS:~0,-1%
    24     30   
    25     31   %_VECHO% Tools = '%TOOLS%'
    26     32   
    27     33   SET CONFIGURATIONSUFFIX=Static

Changes to System.Data.SQLite.Linq/SQL Generation/InternalBase.cs.

     3      3    * Written by Robert Simpson (robert@blackcastlesoft.com)
     4      4    * 
     5      5    * Released to the public domain, use at your own risk!
     6      6    ********************************************************/
     7      7   
     8      8   using System.Text;
     9      9   
    10         -#if !NET_20
           10  +#if NET_40
    11     11   using System.Runtime;
    12     12   #endif
    13     13   
    14     14   namespace System.Data.SQLite
    15     15   {
    16     16   	internal abstract class InternalBase
    17     17   	{
    18     18   		// Methods
    19         -#if !NET_20
           19  +#if NET_40
    20     20   		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    21     21   #endif
    22     22   		protected InternalBase()
    23     23   		{
    24     24   		}
    25     25   
    26     26   		internal abstract void ToCompactString(StringBuilder builder);
................................................................................
    27     27   		internal virtual string ToFullString()
    28     28   		{
    29     29   			StringBuilder builder = new StringBuilder();
    30     30   			this.ToFullString(builder);
    31     31   			return builder.ToString();
    32     32   		}
    33     33   
    34         -#if !NET_20
           34  +#if NET_40
    35     35   		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    36     36   #endif
    37     37   		internal virtual void ToFullString(StringBuilder builder)
    38     38   		{
    39     39   			this.ToCompactString(builder);
    40     40   		}
    41     41   

Changes to System.Data.SQLite.Linq/SQL Generation/KeyToListMap.cs.

     6      6    ********************************************************/
     7      7   
     8      8   using System.Collections.Generic;
     9      9   using System.Text;
    10     10   using System.Collections.ObjectModel;
    11     11   using System.Collections;
    12     12   
    13         -#if !NET_20
           13  +#if NET_40
    14     14   using System.Runtime;
    15     15   #endif
    16     16   
    17     17   namespace System.Data.SQLite
    18     18   {
    19     19   	internal class KeyToListMap<TKey, TValue> : InternalBase
    20     20   	{
................................................................................
   115    115   			{
   116    116   				return this.m_map.Keys;
   117    117   			}
   118    118   		}
   119    119   
   120    120   		internal IEnumerable<KeyValuePair<TKey, List<TValue>>> KeyValuePairs
   121    121   		{
   122         -#if !NET_20
          122  +#if NET_40
   123    123   			[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
   124    124   #endif
   125    125   			get
   126    126   			{
   127    127   				return this.m_map;
   128    128   			}
   129    129   		}
   130    130   	}
   131    131   }

Changes to System.Data.SQLite.Linq/SQL Generation/SqlChecker.cs.

    15     15     {
    16     16   #if false
    17     17       private static Type sql8rewriter;
    18     18   
    19     19       static SqlChecker()
    20     20       {
    21     21           string version =
    22         -#if NET_20
    23         -            "3.5.0.0";
           22  +#if NET_40
           23  +            "4.0.0.0";
    24     24   #else
    25         -            "4.0.0.0";
           25  +            "3.5.0.0";
    26     26   #endif
    27     27   
    28     28           sql8rewriter = Type.GetType(String.Format("System.Data.SqlClient.SqlGen.Sql8ExpressionRewriter, System.Data.Entity, Version={0}, Culture=neutral, PublicKeyToken=b77a5c561934e089", version), false);
    29     29       }
    30     30   #endif
    31     31   
    32     32       private SqlChecker()

Changes to System.Data.SQLite.Linq/SQL Generation/StringUtil.cs.

     6      6    ********************************************************/
     7      7   
     8      8   using System.Collections.Generic;
     9      9   using System.Text;
    10     10   using System.Globalization;
    11     11   using System.Collections;
    12     12   
    13         -#if !NET_20
           13  +#if NET_40
    14     14   using System.Runtime;
    15     15   #endif
    16     16   
    17     17   namespace System.Data.SQLite
    18     18   {
    19     19   	internal static class StringUtil
    20     20   	{
................................................................................
    81     81   		}
    82     82   
    83     83   		private static string InvariantConvertToString<T>(T value)
    84     84   		{
    85     85   			return string.Format(CultureInfo.InvariantCulture, "{0}", new object[] { value });
    86     86   		}
    87     87   
    88         -#if !NET_20
           88  +#if NET_40
    89     89   		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    90     90   #endif
    91     91   		internal static bool IsNullOrEmptyOrWhiteSpace(string value)
    92     92   		{
    93     93   			return IsNullOrEmptyOrWhiteSpace(value, 0);
    94     94   		}
    95     95   
................................................................................
   161    161   		}
   162    162   
   163    163   		internal static void ToSeparatedString(StringBuilder builder, IEnumerable list, string separator)
   164    164   		{
   165    165   			ToSeparatedStringPrivate(builder, list, separator, string.Empty, false);
   166    166   		}
   167    167   
   168         -#if !NET_20
          168  +#if NET_40
   169    169   		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
   170    170   #endif
   171    171   		internal static void ToSeparatedString(StringBuilder stringBuilder, IEnumerable list, string separator, string nullValue)
   172    172   		{
   173    173   			ToSeparatedStringPrivate(stringBuilder, list, separator, nullValue, false);
   174    174   		}
   175    175   

Changes to System.Data.SQLite.Linq/System.Data.SQLite.Linq.2008.csproj.

    16     16       <ProjectGuid>{E6BF9F74-58E2-413B-A7CE-EA653ECB728D}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite.Linq</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite.Linq</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    23         -    <NetFx20>true</NetFx20>
           23  +    <NetFx35>true</NetFx35>
    24     24       <ConfigurationYear>2008</ConfigurationYear>
    25     25     </PropertyGroup>
    26     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     28       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     29       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.Linq.xml</DocumentationFile>
    30     30     </PropertyGroup>

Changes to System.Data.SQLite.Linq/System.Data.SQLite.Linq.2010.csproj.

    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite.Linq</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite.Linq</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           24  +    <NetFx40>true</NetFx40>
    24     25       <ConfigurationYear>2010</ConfigurationYear>
    25     26     </PropertyGroup>
    26     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     30       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.Linq.xml</DocumentationFile>
    30     31     </PropertyGroup>

Changes to System.Data.SQLite.Linq/System.Data.SQLite.Linq.2012.csproj.

    14     14       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    15     15       <ProjectGuid>{E6BF9F74-58E2-413B-A7CE-EA653ECB728D}</ProjectGuid>
    16     16       <OutputType>Library</OutputType>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <RootNamespace>System.Data.SQLite.Linq</RootNamespace>
    19     19       <AssemblyName>System.Data.SQLite.Linq</AssemblyName>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    26     27       <OutputPath>$(BinaryOutputPath)</OutputPath>
    27     28       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.Linq.xml</DocumentationFile>

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

    43     43   [assembly: InternalsVisibleTo("System.Data.SQLite.Linq, PublicKey=" + System.Data.SQLite.SQLite3.PublicKey)]
    44     44   [assembly: NeutralResourcesLanguage("en")]
    45     45   
    46     46   #if !PLATFORM_COMPACTFRAMEWORK
    47     47   [assembly: AllowPartiallyTrustedCallers]
    48     48   [assembly: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    49     49   
    50         -#if !NET_20
           50  +#if NET_40
    51     51   //
    52     52   // NOTE: This attribute is only available in .NET Framework 4.0 or higher.
    53     53   //
    54     54   [assembly: SecurityRules(System.Security.SecurityRuleSet.Level1)]
    55     55   #endif
    56     56   #endif
    57     57   

Changes to System.Data.SQLite/LINQ/SQLiteConnection_Linq.cs.

     8      8   namespace System.Data.SQLite
     9      9   {
    10     10     using System.Data.Common;
    11     11   
    12     12     public sealed partial class SQLiteConnection
    13     13     {
    14     14       /// <summary>
    15         -    /// Returns a SQLiteProviderFactory object.
           15  +    /// Returns the <see cref="SQLiteFactory" /> instance.
    16     16       /// </summary>
    17     17       protected override DbProviderFactory DbProviderFactory
    18     18       {
    19     19         get { return SQLiteFactory.Instance; }
    20     20       }
    21     21     }
    22     22   }
    23     23   

Changes to System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs.

     9      9   {
    10     10     using System;
    11     11     using System.Globalization;
    12     12     using System.Reflection;
    13     13     using System.Security.Permissions;
    14     14   
    15     15     /// <summary>
    16         -  /// SQLite implementation of DbProviderFactory.
           16  +  /// SQLite implementation of <see cref="IServiceProvider" />.
    17     17     /// </summary>
    18     18     public sealed partial class SQLiteFactory : IServiceProvider
    19     19     {
    20     20       private static Type _dbProviderServicesType;
    21     21       private static object _sqliteServices;
    22     22   
    23     23       static SQLiteFactory()
................................................................................
    27     27   #endif
    28     28   
    29     29   #if !PLATFORM_COMPACTFRAMEWORK
    30     30           SQLiteLog.Initialize();
    31     31   #endif
    32     32   
    33     33           string version =
    34         -#if NET_20
    35         -            "3.5.0.0";
           34  +#if NET_40
           35  +            "4.0.0.0";
    36     36   #else
    37         -            "4.0.0.0";
           37  +            "3.5.0.0";
    38     38   #endif
    39     39   
    40     40           _dbProviderServicesType = Type.GetType(String.Format(CultureInfo.InvariantCulture, "System.Data.Common.DbProviderServices, System.Data.Entity, Version={0}, Culture=neutral, PublicKeyToken=b77a5c561934e089", version), false);
    41     41       }
    42     42   
    43     43       /// <summary>
    44         -    /// Will provide a DbProviderServices object in .NET 3.5
           44  +    /// Will provide a <see cref="IServiceProvider" /> object in .NET 3.5.
    45     45       /// </summary>
    46         -    /// <param name="serviceType">The class or interface type to query for</param>
           46  +    /// <param name="serviceType">The class or interface type to query for.</param>
    47     47       /// <returns></returns>
    48     48       object IServiceProvider.GetService(Type serviceType)
    49     49       {
    50     50         if (serviceType == typeof(ISQLiteSchemaExtensions) ||
    51     51           (_dbProviderServicesType != null && serviceType == _dbProviderServicesType))
    52     52         {
    53     53           return GetSQLiteProviderServicesInstance();

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

    64     64       /// The opaque pointer returned to us by the sqlite provider
    65     65       /// </summary>
    66     66       protected internal SQLiteConnectionHandle _sql;
    67     67       protected string _fileName;
    68     68       protected bool _usePool;
    69     69       protected int _poolVersion;
    70     70   
    71         -#if !PLATFORM_COMPACTFRAMEWORK
           71  +#if (NET_35 || NET_40) && !PLATFORM_COMPACTFRAMEWORK
    72     72       private bool _buildingSchema;
    73     73   #endif
           74  +
    74     75       /// <summary>
    75     76       /// The user-defined functions registered on this connection
    76     77       /// </summary>
    77     78       protected SQLiteFunction[] _functionsArray;
    78     79   
    79     80       internal SQLite3(SQLiteDateFormats fmt, DateTimeKind kind)
    80     81         : base(fmt, kind)
................................................................................
   291    292           Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "<null>"));
   292    293   #endif
   293    294         }
   294    295   
   295    296         if (_sql == null)
   296    297         {
   297    298           IntPtr db;
          299  +        SQLiteErrorCode n;
   298    300   
   299    301   #if !SQLITE_STANDARD
   300         -        SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_open_interop(ToUTF8(strFilename), (int)openFlags, out db);
   301         -#else
   302         -        SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_open_v2(ToUTF8(strFilename), out db, (int)openFlags, IntPtr.Zero);
          302  +        if ((connectionFlags & SQLiteConnectionFlags.NoExtensionFunctions) != SQLiteConnectionFlags.NoExtensionFunctions)
          303  +        {
          304  +          n = UnsafeNativeMethods.sqlite3_open_interop(ToUTF8(strFilename), openFlags, out db);
          305  +        }
          306  +        else
   303    307   #endif
          308  +        {
          309  +          n = UnsafeNativeMethods.sqlite3_open_v2(ToUTF8(strFilename), out db, openFlags, IntPtr.Zero);
          310  +        }
   304    311   
   305    312   #if !NET_COMPACT_20 && TRACE_CONNECTION
   306    313           Trace.WriteLine(String.Format("Open: {0}", db));
   307    314   #endif
   308    315   
   309    316           if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, null);
   310    317   
................................................................................
   519    526                 }
   520    527   
   521    528                 if (cmd != null)
   522    529                   cmd.SetTypes(typedefs);
   523    530   
   524    531                 return cmd;
   525    532               }
   526         -#if !PLATFORM_COMPACTFRAMEWORK
          533  +#if (NET_35 || NET_40) && !PLATFORM_COMPACTFRAMEWORK
   527    534               else if (_buildingSchema == false && String.Compare(GetLastError(), 0, "no such table: TEMP.SCHEMA", 0, 26, StringComparison.OrdinalIgnoreCase) == 0)
   528    535               {
   529    536                 strRemain = "";
   530    537                 _buildingSchema = true;
   531    538                 try
   532    539                 {
   533    540                   ISQLiteSchemaExtensions ext = ((IServiceProvider)SQLiteFactory.Instance).GetService(typeof(ISQLiteSchemaExtensions)) as ISQLiteSchemaExtensions;
................................................................................
  1382   1389         UnsafeNativeMethods.sqlite3_result_text(context, ToUTF8(value), b.Length - 1, (IntPtr)(-1));
  1383   1390       }
  1384   1391   
  1385   1392       internal override IntPtr AggregateContext(IntPtr context)
  1386   1393       {
  1387   1394         return UnsafeNativeMethods.sqlite3_aggregate_context(context, 1);
  1388   1395       }
         1396  +
         1397  +    /// <summary>
         1398  +    /// Enables or disabled extension loading by SQLite.
         1399  +    /// </summary>
         1400  +    /// <param name="bOnOff">
         1401  +    /// True to enable loading of extensions, false to disable.
         1402  +    /// </param>
         1403  +    internal override void SetLoadExtension(bool bOnOff)
         1404  +    {
         1405  +        SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_enable_load_extension(
         1406  +            _sql, (bOnOff ? -1 : 0));
         1407  +
         1408  +        if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
         1409  +    }
         1410  +
         1411  +    /// <summary>
         1412  +    /// Loads a SQLite extension library from the named file.
         1413  +    /// </summary>
         1414  +    /// <param name="fileName">
         1415  +    /// The name of the dynamic link library file containing the extension.
         1416  +    /// </param>
         1417  +    /// <param name="procName">
         1418  +    /// The name of the exported function used to initialize the extension.
         1419  +    /// If null, the default "sqlite3_extension_init" will be used.
         1420  +    /// </param>
         1421  +    internal override void LoadExtension(string fileName, string procName)
         1422  +    {
         1423  +        if (fileName == null)
         1424  +            throw new ArgumentNullException("fileName");
         1425  +
         1426  +        IntPtr pError = IntPtr.Zero;
         1427  +
         1428  +        try
         1429  +        {
         1430  +            byte[] utf8FileName = UTF8Encoding.UTF8.GetBytes(fileName + '\0');
         1431  +            byte[] utf8ProcName = null;
         1432  +
         1433  +            if (procName != null)
         1434  +                utf8ProcName = UTF8Encoding.UTF8.GetBytes(procName + '\0');
         1435  +
         1436  +            SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_load_extension(
         1437  +                _sql, utf8FileName, utf8ProcName, ref pError);
         1438  +
         1439  +            if (n != SQLiteErrorCode.Ok)
         1440  +                throw new SQLiteException(n, UTF8ToString(pError, -1));
         1441  +        }
         1442  +        finally
         1443  +        {
         1444  +            if (pError != IntPtr.Zero)
         1445  +            {
         1446  +                UnsafeNativeMethods.sqlite3_free(pError);
         1447  +                pError = IntPtr.Zero;
         1448  +            }
         1449  +        }
         1450  +    }
  1389   1451   
  1390   1452       /// Enables or disabled extended result codes returned by SQLite
  1391   1453       internal override void SetExtendedResultCodes(bool bOnOff)
  1392   1454       {
  1393         -      UnsafeNativeMethods.sqlite3_extended_result_codes(_sql, (bOnOff ? -1 : 0));
         1455  +      SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_extended_result_codes(
         1456  +          _sql, (bOnOff ? -1 : 0));
         1457  +
         1458  +      if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1394   1459       }
  1395   1460       /// Gets the last SQLite error code
  1396   1461       internal override SQLiteErrorCode ResultCode()
  1397   1462       {
  1398   1463         return UnsafeNativeMethods.sqlite3_errcode(_sql);
  1399   1464       }
  1400   1465       /// Gets the last SQLite extended error code

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

     9      9   {
    10     10     using System;
    11     11   
    12     12   #if !NET_COMPACT_20 && TRACE_CONNECTION
    13     13     using System.Diagnostics;
    14     14   #endif
    15     15   
           16  +  using System.IO;
    16     17     using System.Runtime.InteropServices;
    17     18   
    18     19     /// <summary>
    19     20     /// Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode)
    20     21     /// </summary>
    21     22     internal class SQLite3_UTF16 : SQLite3
    22     23     {
................................................................................
   105    106           Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "<null>"));
   106    107   #endif
   107    108         }
   108    109   
   109    110         if (_sql == null)
   110    111         {
   111    112           IntPtr db;
          113  +        SQLiteErrorCode n;
   112    114   
   113    115   #if !SQLITE_STANDARD
   114         -        SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_open16_interop(ToUTF8(strFilename), (int)openFlags, out db);
   115         -#else
   116         -        if ((openFlags & SQLiteOpenFlagsEnum.Create) == 0 && System.IO.File.Exists(strFilename) == false)
   117         -          throw new SQLiteException((int)SQLiteErrorCode.CantOpen, strFilename);
   118         -
   119         -        SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_open16(strFilename, out db);
          116  +        if ((connectionFlags & SQLiteConnectionFlags.NoExtensionFunctions) != SQLiteConnectionFlags.NoExtensionFunctions)
          117  +        {
          118  +          n = UnsafeNativeMethods.sqlite3_open16_interop(ToUTF8(strFilename), openFlags, out db);
          119  +        }
          120  +        else
   120    121   #endif
          122  +        {
          123  +          //
          124  +          // NOTE: This flag check is designed to enforce the constraint that opening
          125  +          //       a database file that does not already exist requires specifying the
          126  +          //       "Create" flag, even when a native API is used that does not accept
          127  +          //       a flags parameter.
          128  +          //
          129  +          if (((openFlags & SQLiteOpenFlagsEnum.Create) != SQLiteOpenFlagsEnum.Create) && !File.Exists(strFilename))
          130  +            throw new SQLiteException(SQLiteErrorCode.CantOpen, strFilename);
          131  +
          132  +          n = UnsafeNativeMethods.sqlite3_open16(strFilename, out db);
          133  +        }
   121    134   
   122    135   #if !NET_COMPACT_20 && TRACE_CONNECTION
   123    136           Trace.WriteLine(String.Format("Open: {0}", db));
   124    137   #endif
   125    138   
   126    139           if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, null);
   127    140   

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

   187    187       internal abstract void ReturnError(IntPtr context, string value);
   188    188       internal abstract void ReturnInt32(IntPtr context, Int32 value);
   189    189       internal abstract void ReturnInt64(IntPtr context, Int64 value);
   190    190       internal abstract void ReturnNull(IntPtr context);
   191    191       internal abstract void ReturnText(IntPtr context, string value);
   192    192   
   193    193       /// <summary>
          194  +    /// Enables or disabled extension loading by SQLite.
          195  +    /// </summary>
          196  +    /// <param name="bOnOff">
          197  +    /// True to enable loading of extensions, false to disable.
          198  +    /// </param>
          199  +    internal abstract void SetLoadExtension(bool bOnOff);
          200  +    /// <summary>
          201  +    /// Loads a SQLite extension library from the named file.
          202  +    /// </summary>
          203  +    /// <param name="fileName">
          204  +    /// The name of the dynamic link library file containing the extension.
          205  +    /// </param>
          206  +    /// <param name="procName">
          207  +    /// The name of the exported function used to initialize the extension.
          208  +    /// If null, the default "sqlite3_extension_init" will be used.
          209  +    /// </param>
          210  +    internal abstract void LoadExtension(string fileName, string procName);
          211  +    /// <summary>
   194    212       /// Enables or disabled extened result codes returned by SQLite
   195    213       /// </summary>
   196    214       /// <param name="bOnOff">true to enable extended result codes, false to disable.</param>
   197    215       /// <returns></returns>
   198    216       internal abstract void SetExtendedResultCodes(bool bOnOff);
   199    217       /// <summary>
   200    218       /// Returns the numeric result code for the most recent failed SQLite API call 
................................................................................
   615    633         LogCallbackException = 0x8,
   616    634   
   617    635         /// <summary>
   618    636         /// Enable logging of backup API errors.
   619    637         /// </summary>
   620    638         LogBackup = 0x10,
   621    639   
          640  +      /// <summary>
          641  +      /// Skip adding the extension functions provided by the native
          642  +      /// interop assembly.
          643  +      /// </summary>
          644  +      NoExtensionFunctions = 0x20,
          645  +
   622    646         /// <summary>
   623    647         /// Enable all logging.
   624    648         /// </summary>
   625    649         LogAll = LogPrepare | LogPreBind | LogBind |
   626    650                  LogCallbackException | LogBackup,
   627    651   
   628    652         /// <summary>

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

   138    138         {
   139    139           DbConnection = connection;
   140    140           _commandTimeout = connection.DefaultTimeout;
   141    141         }
   142    142   
   143    143         if (transaction != null)
   144    144           Transaction = transaction;
          145  +
          146  +      SQLiteConnection.OnChanged(connection, new ConnectionEventArgs(
          147  +          SQLiteConnectionEventType.NewCommand, null, transaction, this, null, null));
   145    148       }
   146    149   
   147    150       ///////////////////////////////////////////////////////////////////////////////////////////////
   148    151   
   149    152       [Conditional("CHECK_STATE")]
   150    153       internal static void Check(SQLiteCommand command)
   151    154       {

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

    30     30         public readonly SQLiteConnectionEventType EventType;
    31     31   
    32     32         /// <summary>
    33     33         /// The <see cref="StateChangeEventArgs" /> associated with this event, if any.
    34     34         /// </summary>
    35     35         public readonly StateChangeEventArgs EventArgs;
    36     36   
           37  +      /// <summary>
           38  +      /// The transaction associated with this event, if any.
           39  +      /// </summary>
           40  +      public readonly IDbTransaction Transaction;
           41  +
           42  +      /// <summary>
           43  +      /// The command associated with this event, if any.
           44  +      /// </summary>
           45  +      public readonly IDbCommand Command;
           46  +
    37     47         /// <summary>
    38     48         /// Command or message text associated with this event, if any.
    39     49         /// </summary>
    40     50         public readonly string Text;
    41     51   
    42     52         /// <summary>
    43     53         /// Extra data associated with this event, if any.
................................................................................
    46     56   
    47     57         /// <summary>
    48     58         /// Constructs the object.
    49     59         /// </summary>
    50     60         /// <param name="eventType">The type of event being raised.</param>
    51     61         /// <param name="eventArgs">The base <see cref="EventArgs" /> associated
    52     62         /// with this event, if any.</param>
           63  +      /// <param name="transaction">The transaction associated with this event, if any.</param>
           64  +      /// <param name="command">The command associated with this event, if any.</param>
    53     65         /// <param name="text">The command or message text, if any.</param>
    54     66         /// <param name="data">The extra data, if any.</param>
    55     67         internal ConnectionEventArgs(
    56     68             SQLiteConnectionEventType eventType,
    57     69             StateChangeEventArgs eventArgs,
           70  +          IDbTransaction transaction,
           71  +          IDbCommand command,
    58     72             string text,
    59     73             object data
    60     74             )
    61     75         {
    62     76             EventType = eventType;
    63     77             EventArgs = eventArgs;
           78  +          Transaction = transaction;
           79  +          Command = command;
    64     80             Text = text;
    65     81             Data = data;
    66     82         }
    67     83     }
    68     84   
    69     85     /////////////////////////////////////////////////////////////////////////////////////////////////
    70     86   
................................................................................
   481    497       /// </summary>
   482    498       /// <param name="connection">
   483    499       /// The connection associated with this event.
   484    500       /// </param>
   485    501       /// <param name="e">
   486    502       /// A <see cref="ConnectionEventArgs" /> that contains the event data.
   487    503       /// </param>
   488         -    public static void OnChanged(
          504  +    internal static void OnChanged(
   489    505           SQLiteConnection connection,
   490    506           ConnectionEventArgs e
   491    507           )
   492    508       {
   493    509           if (connection == null)
   494    510               return;
   495    511   
................................................................................
   498    514               return;
   499    515   #endif
   500    516   
   501    517           SQLiteConnectionEventHandler handlers;
   502    518   
   503    519           lock (_syncRoot)
   504    520           {
   505         -            handlers = _handlers;
          521  +            if (_handlers != null)
          522  +                handlers = _handlers.Clone() as SQLiteConnectionEventHandler;
          523  +            else
          524  +                handlers = null;
   506    525           }
   507    526   
   508    527           if (handlers != null) handlers(connection, e);
   509    528       }
   510    529   
   511    530       ///////////////////////////////////////////////////////////////////////////////////////////////
   512    531   
................................................................................
   821    840       public SQLiteTransaction BeginTransaction(bool deferredLock)
   822    841       {
   823    842         CheckDisposed();
   824    843         return (SQLiteTransaction)BeginDbTransaction(deferredLock == false ? IsolationLevel.Serializable : IsolationLevel.ReadCommitted);
   825    844       }
   826    845   
   827    846       /// <summary>
   828         -    /// Creates a new SQLiteTransaction if one isn't already active on the connection.
          847  +    /// Creates a new <see cref="SQLiteTransaction" /> if one isn't already active on the connection.
   829    848       /// </summary>
   830    849       /// <param name="isolationLevel">Supported isolation levels are Serializable, ReadCommitted and Unspecified.</param>
   831    850       /// <remarks>
   832    851       /// Unspecified will use the default isolation level specified in the connection string.  If no isolation level is specified in the
   833    852       /// connection string, Serializable is used.
   834    853       /// Serializable transactions are the default.  In this mode, the engine gets an immediate lock on the database, and no other threads
   835    854       /// may begin a transaction.  Other threads may read from the database, but not write.
................................................................................
   841    860       public new SQLiteTransaction BeginTransaction(IsolationLevel isolationLevel)
   842    861       {
   843    862         CheckDisposed();
   844    863         return (SQLiteTransaction)BeginDbTransaction(isolationLevel);
   845    864       }
   846    865   
   847    866       /// <summary>
   848         -    /// Creates a new SQLiteTransaction if one isn't already active on the connection.
          867  +    /// Creates a new <see cref="SQLiteTransaction" /> if one isn't already
          868  +    /// active on the connection.
   849    869       /// </summary>
   850         -    /// <returns>Returns a SQLiteTransaction object.</returns>
          870  +    /// <returns>Returns the new transaction object.</returns>
   851    871       public new SQLiteTransaction BeginTransaction()
   852    872       {
   853    873         CheckDisposed();
   854    874         return (SQLiteTransaction)BeginDbTransaction(_defaultIsolation);
   855    875       }
   856    876   
   857    877       /// <summary>
   858         -    /// Forwards to the local BeginTransaction() function
          878  +    /// Forwards to the local <see cref="BeginTransaction(IsolationLevel)" /> function
   859    879       /// </summary>
   860    880       /// <param name="isolationLevel">Supported isolation levels are Unspecified, Serializable, and ReadCommitted</param>
   861    881       /// <returns></returns>
   862    882       protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
   863    883       {
   864    884         if (_connectionState != ConnectionState.Open)
   865    885           throw new InvalidOperationException();
   866    886   
   867    887         if (isolationLevel == IsolationLevel.Unspecified) isolationLevel = _defaultIsolation;
   868    888   
   869    889         if (isolationLevel != IsolationLevel.Serializable && isolationLevel != IsolationLevel.ReadCommitted)
   870    890           throw new ArgumentException("isolationLevel");
   871    891   
   872         -      return new SQLiteTransaction(this, isolationLevel != IsolationLevel.Serializable);
          892  +      SQLiteTransaction transaction =
          893  +          new SQLiteTransaction(this, isolationLevel != IsolationLevel.Serializable);
          894  +
          895  +      OnChanged(this, new ConnectionEventArgs(
          896  +          SQLiteConnectionEventType.NewTransaction, null, transaction, null, null, null));
          897  +
          898  +      return transaction;
   873    899       }
   874    900   
   875    901       /// <summary>
   876         -    /// Not implemented
          902  +    /// This method is not implemented; however, the <see cref="Changed" />
          903  +    /// event will still be raised.
   877    904       /// </summary>
   878    905       /// <param name="databaseName"></param>
   879    906       public override void ChangeDatabase(string databaseName)
   880    907       {
   881    908         CheckDisposed();
   882         -      throw new NotImplementedException();
          909  +
          910  +      OnChanged(this, new ConnectionEventArgs(
          911  +          SQLiteConnectionEventType.ChangeDatabase, null, null, null, databaseName, null));
          912  +
          913  +      throw new NotImplementedException(); // NOTE: For legacy compatibility.
   883    914       }
   884    915   
   885    916       /// <summary>
   886    917       /// When the database connection is closed, all commands linked to this connection are automatically reset.
   887    918       /// </summary>
   888    919       public override void Close()
   889    920       {
   890    921         CheckDisposed();
   891    922   
   892    923         OnChanged(this, new ConnectionEventArgs(
   893         -          SQLiteConnectionEventType.Closing, null, null, null));
          924  +          SQLiteConnectionEventType.Closing, null, null, null, null, null));
   894    925   
   895    926         if (_sql != null)
   896    927         {
   897    928   #if !PLATFORM_COMPACTFRAMEWORK
   898    929           if (_enlistment != null)
   899    930           {
   900    931             // If the connection is enlisted in a transaction scope and the scope is still active,
................................................................................
   922    953           _transactionLevel = 0;
   923    954         }
   924    955   
   925    956         StateChangeEventArgs eventArgs = null;
   926    957         OnStateChange(ConnectionState.Closed, ref eventArgs);
   927    958   
   928    959         OnChanged(this, new ConnectionEventArgs(
   929         -          SQLiteConnectionEventType.Closed, eventArgs, null, null));
          960  +          SQLiteConnectionEventType.Closed, eventArgs, null, null, null, null));
   930    961       }
   931    962   
   932    963       /// <summary>
   933    964       /// Returns the number of pool entries for the file name associated with this connection.
   934    965       /// </summary>
   935    966       public int PoolCount
   936    967       {
................................................................................
  1161   1192             throw new InvalidOperationException();
  1162   1193   
  1163   1194           _connectionString = value;
  1164   1195         }
  1165   1196       }
  1166   1197   
  1167   1198       /// <summary>
  1168         -    /// Create a new SQLiteCommand and associate it with this connection.
         1199  +    /// Create a new <see cref="SQLiteCommand" /> and associate it with this connection.
  1169   1200       /// </summary>
  1170         -    /// <returns>Returns an instantiated SQLiteCommand object already assigned to this connection.</returns>
         1201  +    /// <returns>Returns a new command object already assigned to this connection.</returns>
  1171   1202       public new SQLiteCommand CreateCommand()
  1172   1203       {
  1173   1204         CheckDisposed();
  1174   1205         return new SQLiteCommand(this);
  1175   1206       }
  1176   1207   
  1177   1208       /// <summary>
  1178         -    /// Forwards to the local CreateCommand() function
         1209  +    /// Forwards to the local <see cref="CreateCommand" /> function.
  1179   1210       /// </summary>
  1180   1211       /// <returns></returns>
  1181   1212       protected override DbCommand CreateDbCommand()
  1182   1213       {
  1183   1214         return CreateCommand();
  1184   1215       }
  1185   1216   
  1186   1217       /// <summary>
  1187         -    /// Returns the filename without extension or path
         1218  +    /// Returns the data source file name without extension or path.
  1188   1219       /// </summary>
  1189   1220   #if !PLATFORM_COMPACTFRAMEWORK
  1190   1221       [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  1191   1222   #endif
  1192   1223       public override string DataSource
  1193   1224       {
  1194   1225         get
................................................................................
  1270   1301   
  1271   1302         if (_transactionLevel > 0 && transaction != null)
  1272   1303           throw new ArgumentException("Unable to enlist in transaction, a local transaction already exists");
  1273   1304         else if (transaction == null)
  1274   1305           throw new ArgumentNullException("Unable to enlist in transaction, it is null");
  1275   1306   
  1276   1307         _enlistment = new SQLiteEnlistment(this, transaction);
         1308  +
         1309  +      OnChanged(this, new ConnectionEventArgs(
         1310  +          SQLiteConnectionEventType.EnlistTransaction, null, null, null, null, _enlistment));
  1277   1311       }
  1278   1312   #endif
  1279   1313   
  1280   1314       /// <summary>
  1281   1315       /// Looks for a key in the array of key/values of the parameter string.  If not found, return the specified default value
  1282   1316       /// </summary>
  1283   1317       /// <param name="items">The list to look in</param>
................................................................................
  1313   1347           catch
  1314   1348           {
  1315   1349               // do nothing.
  1316   1350           }
  1317   1351   
  1318   1352           return null;
  1319   1353       }
         1354  +
         1355  +    /// <summary>
         1356  +    /// Enables or disabled extension loading.
         1357  +    /// </summary>
         1358  +    /// <param name="enable">
         1359  +    /// True to enable loading of extensions, false to disable.
         1360  +    /// </param>
         1361  +    public void EnableExtensions(
         1362  +        bool enable
         1363  +        )
         1364  +    {
         1365  +        CheckDisposed();
         1366  +
         1367  +        if (_sql == null)
         1368  +            throw new InvalidOperationException(String.Format(
         1369  +                "Database connection not valid for {0} extensions.",
         1370  +                enable ? "enabling" : "disabling"));
         1371  +
         1372  +        _sql.SetLoadExtension(enable);
         1373  +    }
         1374  +
         1375  +    /// <summary>
         1376  +    /// Loads a SQLite extension library from the named dynamic link library file.
         1377  +    /// </summary>
         1378  +    /// <param name="fileName">
         1379  +    /// The name of the dynamic link library file containing the extension.
         1380  +    /// </param>
         1381  +    public void LoadExtension(
         1382  +        string fileName
         1383  +        )
         1384  +    {
         1385  +        CheckDisposed();
         1386  +
         1387  +        LoadExtension(fileName, null);
         1388  +    }
         1389  +
         1390  +    /// <summary>
         1391  +    /// Loads a SQLite extension library from the named dynamic link library file.
         1392  +    /// </summary>
         1393  +    /// <param name="fileName">
         1394  +    /// The name of the dynamic link library file containing the extension.
         1395  +    /// </param>
         1396  +    /// <param name="procName">
         1397  +    /// The name of the exported function used to initialize the extension.
         1398  +    /// If null, the default "sqlite3_extension_init" will be used.
         1399  +    /// </param>
         1400  +    public void LoadExtension(
         1401  +        string fileName,
         1402  +        string procName
         1403  +        )
         1404  +    {
         1405  +        CheckDisposed();
         1406  +
         1407  +        if (_sql == null)
         1408  +            throw new InvalidOperationException(
         1409  +                "Database connection not valid for loading extensions.");
         1410  +
         1411  +        _sql.LoadExtension(fileName, procName);
         1412  +    }
  1320   1413   
  1321   1414       /// <summary>
  1322   1415       /// Opens the connection using the parameters found in the <see cref="ConnectionString" />.
  1323   1416       /// </summary>
  1324   1417       public override void Open()
  1325   1418       {
  1326   1419         CheckDisposed();
  1327   1420   
  1328   1421         OnChanged(this, new ConnectionEventArgs(
  1329         -          SQLiteConnectionEventType.Opening, null, null, null));
         1422  +          SQLiteConnectionEventType.Opening, null, null, null, null, null));
  1330   1423   
  1331   1424         if (_connectionState != ConnectionState.Closed)
  1332   1425           throw new InvalidOperationException();
  1333   1426   
  1334   1427         Close();
  1335   1428   
  1336   1429         SortedList<string, string> opts = ParseConnectionString(_connectionString);
................................................................................
  1565   1658   
  1566   1659             _connectionState = oldstate;
  1567   1660   
  1568   1661             StateChangeEventArgs eventArgs = null;
  1569   1662             OnStateChange(ConnectionState.Open, ref eventArgs);
  1570   1663   
  1571   1664             OnChanged(this, new ConnectionEventArgs(
  1572         -              SQLiteConnectionEventType.Opened, eventArgs, null, null));
         1665  +              SQLiteConnectionEventType.Opened, eventArgs, null, null, null, null));
  1573   1666           }
  1574   1667           catch
  1575   1668           {
  1576   1669             _connectionState = oldstate;
  1577   1670             throw;
  1578   1671           }
  1579   1672         }
................................................................................
  3168   3261           SQLiteBase.UTF8ToString(table, -1),
  3169   3262           (UpdateEventType)type,
  3170   3263           rowid));
  3171   3264       }
  3172   3265   
  3173   3266       /// <summary>
  3174   3267       /// This event is raised whenever SQLite is committing a transaction.
  3175         -    /// Return non-zero to trigger a rollback
         3268  +    /// Return non-zero to trigger a rollback.
  3176   3269       /// </summary>
  3177   3270       public event SQLiteCommitHandler Commit
  3178   3271       {
  3179   3272         add
  3180   3273         {
  3181   3274           CheckDisposed();
  3182   3275   
................................................................................
  3233   3326       private void TraceCallback(IntPtr puser, IntPtr statement)
  3234   3327       {
  3235   3328         _traceHandler(this, new TraceEventArgs(
  3236   3329           SQLiteBase.UTF8ToString(statement, -1)));
  3237   3330       }
  3238   3331   
  3239   3332       /// <summary>
  3240         -    /// This event is raised whenever SQLite is committing a transaction.
  3241         -    /// Return non-zero to trigger a rollback
         3333  +    /// This event is raised whenever SQLite is rolling back a transaction.
  3242   3334       /// </summary>
  3243   3335       public event EventHandler RollBack
  3244   3336       {
  3245   3337         add
  3246   3338         {
  3247   3339           CheckDisposed();
  3248   3340   

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

  1010   1010         Opening = 1,
  1011   1011   
  1012   1012         /// <summary>
  1013   1013         /// The connection was opened.
  1014   1014         /// </summary>
  1015   1015         Opened = 2,
  1016   1016   
         1017  +      /// <summary>
         1018  +      /// The <see cref="ChangeDatabase" /> method was called on the
         1019  +      /// connection.
         1020  +      /// </summary>
         1021  +      ChangeDatabase = 3,
         1022  +
         1023  +      /// <summary>
         1024  +      /// A transaction was created using the connection.
         1025  +      /// </summary>
         1026  +      NewTransaction = 4,
         1027  +
         1028  +      /// <summary>
         1029  +      /// The connection was enlisted into a transaction.
         1030  +      /// </summary>
         1031  +      EnlistTransaction = 5,
         1032  +
         1033  +      /// <summary>
         1034  +      /// A command was created using the connection.
         1035  +      /// </summary>
         1036  +      NewCommand = 6,
         1037  +
  1017   1038         /// <summary>
  1018   1039         /// The connection is being closed.
  1019   1040         /// </summary>
  1020         -      Closing = 3,
         1041  +      Closing = 7,
  1021   1042   
  1022   1043         /// <summary>
  1023   1044         /// The connection was closed.
  1024   1045         /// </summary>
  1025         -      Closed = 4
         1046  +      Closed = 8
  1026   1047     }
  1027   1048   
  1028   1049     /// <summary>
  1029   1050     /// This implementation of SQLite for ADO.NET can process date/time fields in databases in only one of three formats.  Ticks, ISO8601
  1030   1051     /// and JulianDay.
  1031   1052     /// </summary>
  1032   1053     /// <remarks>

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

    23     23   #if INTEROP_CODEC
    24     24               "INTEROP_CODEC",
    25     25   #endif
    26     26   
    27     27   #if INTEROP_EXTENSION_FUNCTIONS
    28     28               "INTEROP_EXTENSION_FUNCTIONS",
    29     29   #endif
           30  +
           31  +#if INTEROP_TEST_EXTENSION
           32  +            "INTEROP_TEST_EXTENSION",
           33  +#endif
    30     34   
    31     35   #if NET_20
    32     36               "NET_20",
    33     37   #endif
           38  +
           39  +#if NET_35
           40  +            "NET_35",
           41  +#endif
           42  +
           43  +#if NET_40
           44  +            "NET_40",
           45  +#endif
    34     46   
    35     47   #if NET_COMPACT_20
    36     48               "NET_COMPACT_20",
    37     49   #endif
    38     50   
    39     51   #if PLATFORM_COMPACTFRAMEWORK
    40     52               "PLATFORM_COMPACTFRAMEWORK",

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

     8      8   namespace System.Data.SQLite
     9      9   {
    10     10     using System;
    11     11     using System.Data.Common;
    12     12   
    13     13   #if !PLATFORM_COMPACTFRAMEWORK
    14     14     /// <summary>
    15         -  /// SQLite implementation of DbProviderFactory.
           15  +  /// SQLite implementation of <see cref="DbProviderFactory" />.
    16     16     /// </summary>
    17     17     public sealed partial class SQLiteFactory : DbProviderFactory, IDisposable
    18     18     {
    19         -    /// <overloads>
    20         -    /// Constructs a new SQLiteFactory object
    21         -    /// </overloads>
    22     19       /// <summary>
    23         -    /// Default constructor
           20  +    /// Constructs a new instance.
    24     21       /// </summary>
    25     22       public SQLiteFactory()
    26     23       {
    27     24           //
    28     25           // NOTE: Do nothing here now.  All the logging setup related code has
    29     26           //       been moved to the new SQLiteLog static class.
    30     27           //
................................................................................
    85     82   
    86     83       ///////////////////////////////////////////////////////////////////////////////////////////////
    87     84   
    88     85       /// <summary>
    89     86       /// This event is raised whenever SQLite raises a logging event.
    90     87       /// Note that this should be set as one of the first things in the
    91     88       /// application.  This event is provided for backward compatibility only.
    92         -    /// New code should use the SQLiteLog class instead.
           89  +    /// New code should use the <see cref="SQLiteLog" /> class instead.
    93     90       /// </summary>
    94     91       public event SQLiteLogEventHandler Log
    95     92       {
    96     93         add { CheckDisposed(); SQLiteLog.Log += value; }
    97     94         remove { CheckDisposed(); SQLiteLog.Log -= value; }
    98     95       }
    99     96   
   100     97       /// <summary>
   101         -    /// Static instance member which returns an instanced SQLiteFactory class.
           98  +    /// Static instance member which returns an instanced <see cref="SQLiteFactory" /> class.
   102     99       /// </summary>
   103    100       public static readonly SQLiteFactory Instance = new SQLiteFactory();
   104    101   
   105    102       /// <summary>
   106         -    /// Returns a new SQLiteCommand object.
          103  +    /// Creates and returns a new <see cref="SQLiteCommand" /> object.
   107    104       /// </summary>
   108         -    /// <returns>A SQLiteCommand object.</returns>
          105  +    /// <returns>The new object.</returns>
   109    106       public override DbCommand CreateCommand()
   110    107       {
   111    108         CheckDisposed();
   112    109         return new SQLiteCommand();
   113    110       }
   114    111   
   115    112       /// <summary>
   116         -    /// Returns a new SQLiteCommandBuilder object.
          113  +    /// Creates and returns a new <see cref="SQLiteCommandBuilder" /> object.
   117    114       /// </summary>
   118         -    /// <returns>A SQLiteCommandBuilder object.</returns>
          115  +    /// <returns>The new object.</returns>
   119    116       public override DbCommandBuilder CreateCommandBuilder()
   120    117       {
   121    118         CheckDisposed();
   122    119         return new SQLiteCommandBuilder();
   123    120       }
   124    121   
   125    122       /// <summary>
   126         -    /// Creates a new SQLiteConnection.
          123  +    /// Creates and returns a new <see cref="SQLiteConnection" /> object.
   127    124       /// </summary>
   128         -    /// <returns>A SQLiteConnection object.</returns>
          125  +    /// <returns>The new object.</returns>
   129    126       public override DbConnection CreateConnection()
   130    127       {
   131    128         CheckDisposed();
   132    129         return new SQLiteConnection();
   133    130       }
   134    131   
   135    132       /// <summary>
   136         -    /// Creates a new SQLiteConnectionStringBuilder.
          133  +    /// Creates and returns a new <see cref="SQLiteConnectionStringBuilder" /> object.
   137    134       /// </summary>
   138         -    /// <returns>A SQLiteConnectionStringBuilder object.</returns>
          135  +    /// <returns>The new object.</returns>
   139    136       public override DbConnectionStringBuilder CreateConnectionStringBuilder()
   140    137       {
   141    138         CheckDisposed();
   142    139         return new SQLiteConnectionStringBuilder();
   143    140       }
   144    141   
   145    142       /// <summary>
   146         -    /// Creates a new SQLiteDataAdapter.
          143  +    /// Creates and returns a new <see cref="SQLiteDataAdapter" /> object.
   147    144       /// </summary>
   148         -    /// <returns>A SQLiteDataAdapter object.</returns>
          145  +    /// <returns>The new object.</returns>
   149    146       public override DbDataAdapter CreateDataAdapter()
   150    147       {
   151    148         CheckDisposed();
   152    149         return new SQLiteDataAdapter();
   153    150       }
   154    151   
   155    152       /// <summary>
   156         -    /// Creates a new SQLiteParameter.
          153  +    /// Creates and returns a new <see cref="SQLiteParameter" /> object.
   157    154       /// </summary>
   158         -    /// <returns>A SQLiteParameter object.</returns>
          155  +    /// <returns>The new object.</returns>
   159    156       public override DbParameter CreateParameter()
   160    157       {
   161    158         CheckDisposed();
   162    159         return new SQLiteParameter();
   163    160       }
   164    161     }
   165    162   #endif
   166    163   }

Changes to System.Data.SQLite/System.Data.SQLite.2008.csproj.

    16     16       <ProjectGuid>{AC139952-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    23         -    <NetFx20>true</NetFx20>
           23  +    <NetFx35>true</NetFx35>
    24     24       <ConfigurationYear>2008</ConfigurationYear>
    25     25     </PropertyGroup>
    26     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     28       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     29       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.xml</DocumentationFile>
    30     30     </PropertyGroup>

Changes to System.Data.SQLite/System.Data.SQLite.2010.csproj.

    17     17       <OutputType>Library</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           24  +    <NetFx40>true</NetFx40>
    24     25       <ConfigurationYear>2010</ConfigurationYear>
    25     26     </PropertyGroup>
    26     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     30       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.xml</DocumentationFile>
    30     31     </PropertyGroup>

Changes to System.Data.SQLite/System.Data.SQLite.2012.csproj.

    14     14       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    15     15       <ProjectGuid>{AC139952-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    16     16       <OutputType>Library</OutputType>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <RootNamespace>System.Data.SQLite</RootNamespace>
    19     19       <AssemblyName>System.Data.SQLite</AssemblyName>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    26     27       <OutputPath>$(BinaryOutputPath)</OutputPath>
    27     28       <DocumentationFile>$(BinaryOutputPath)System.Data.SQLite.xml</DocumentationFile>

Changes to System.Data.SQLite/System.Data.SQLite.Compact.2008.csproj.

    23     23       <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
    24     24       <OSVersion>5.0</OSVersion>
    25     25       <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    26     26       <OldToolsVersion>2.0</OldToolsVersion>
    27     27       <NativePlatformName>Windows CE</NativePlatformName>
    28     28       <FormFactorID></FormFactorID>
    29     29       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    30         -    <NetFx20>true</NetFx20>
           30  +    <NetFx35>true</NetFx35>
    31     31       <UseInteropDll>false</UseInteropDll>
    32     32       <UseSqliteStandard>false</UseSqliteStandard>
    33     33       <IsCompactFramework>true</IsCompactFramework>
    34     34       <ConfigurationYear>2008</ConfigurationYear>
    35     35       <ConfigurationSuffix>Compact</ConfigurationSuffix>
    36     36     </PropertyGroup>
    37     37     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />

Changes to System.Data.SQLite/System.Data.SQLite.Files.targets.

    64     64     ******************************************************************************
    65     65     **                        Core Files (Full Framework)                       **
    66     66     ******************************************************************************
    67     67     -->
    68     68   
    69     69     <ItemGroup Condition="'$(IsCompactFramework)' == 'false'">
    70     70       <Compile Include="SQLiteEnlistment.cs" />
    71         -    <Compile Include="LINQ\SQLiteConnection_Linq.cs">
           71  +    <Compile Condition="'$(NetFx35)' != 'false' Or '$(NetFx40)' != 'false'"
           72  +             Include="LINQ\SQLiteConnection_Linq.cs">
    72     73         <SubType>Component</SubType>
    73     74       </Compile>
    74         -    <Compile Include="LINQ\SQLiteFactory_Linq.cs">
           75  +    <Compile Condition="'$(NetFx35)' != 'false' Or '$(NetFx40)' != 'false'"
           76  +             Include="LINQ\SQLiteFactory_Linq.cs">
    75     77         <SubType>Code</SubType>
    76     78       </Compile>
    77     79       <EmbeddedResource Include="SQLiteCommand.bmp" />
    78     80       <EmbeddedResource Include="SQLiteConnection.bmp" />
    79     81       <EmbeddedResource Include="SQLiteDataAdapter.bmp" />
    80     82     </ItemGroup>
    81     83   </Project>

Changes to System.Data.SQLite/System.Data.SQLite.Module.2008.csproj.

    17     17       <OutputType>Module</OutputType>
    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SignAssembly>false</SignAssembly>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    24         -    <NetFx20>true</NetFx20>
           24  +    <NetFx35>true</NetFx35>
    25     25       <ConfigurationYear>2008</ConfigurationYear>
    26     26       <ConfigurationSuffix>Module</ConfigurationSuffix>
    27     27       <UseInteropDll>false</UseInteropDll>
    28     28       <UseSqliteStandard>false</UseSqliteStandard>
    29     29     </PropertyGroup>
    30     30     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    31     31     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">

Changes to System.Data.SQLite/System.Data.SQLite.Module.2010.csproj.

    18     18       <AppDesignerFolder>Properties</AppDesignerFolder>
    19     19       <RootNamespace>System.Data.SQLite</RootNamespace>
    20     20       <AssemblyName>System.Data.SQLite</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    23     23       <SignAssembly>false</SignAssembly>
    24     24       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           25  +    <NetFx40>true</NetFx40>
    25     26       <ConfigurationYear>2010</ConfigurationYear>
    26     27       <ConfigurationSuffix>Module</ConfigurationSuffix>
    27     28       <UseInteropDll>false</UseInteropDll>
    28     29       <UseSqliteStandard>false</UseSqliteStandard>
    29     30     </PropertyGroup>
    30     31     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    31     32     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">

Changes to System.Data.SQLite/System.Data.SQLite.Module.2012.csproj.

    15     15       <ProjectGuid>{AC139952-261A-4463-B6FA-AEBC25284A66}</ProjectGuid>
    16     16       <OutputType>Module</OutputType>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <RootNamespace>System.Data.SQLite</RootNamespace>
    19     19       <AssemblyName>System.Data.SQLite</AssemblyName>
    20     20       <SignAssembly>false</SignAssembly>
    21     21       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           22  +    <NetFx40>true</NetFx40>
    22     23       <ConfigurationYear>2012</ConfigurationYear>
    23     24       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    24     25       <ConfigurationSuffix>Module</ConfigurationSuffix>
    25     26       <UseInteropDll>false</UseInteropDll>
    26     27       <UseSqliteStandard>false</UseSqliteStandard>
    27     28     </PropertyGroup>
    28     29     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />

Changes to System.Data.SQLite/System.Data.SQLite.Properties.targets.

     6      6    * Released to the public domain, use at your own risk!
     7      7    *
     8      8   -->
     9      9   <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    10     10     <!--
    11     11         NOTE: Only use functionality available in the .NET Framework 2.0?  By
    12     12               default, this is disabled.  This must be enabled to successfully
    13         -            build the project using Visual Studio 2008 and/or the .NET
           13  +            build the project using Visual Studio 2005 and/or the .NET
    14     14               Framework 2.0 (if necessary, it will typically be enabled from
    15     15               within the project file itself).
    16     16     -->
    17         -  <PropertyGroup Condition="'$(NetFx20)' != 'false' Or
    18         -                            '$(TargetFrameworkVersion)' == 'v2.0' Or
    19         -                            '$(TargetFrameworkVersion)' == 'v3.5'">
           17  +  <PropertyGroup Condition="'$(NetFx20)' != 'false'">
    20     18       <DefineConstants>$(DefineConstants);NET_20</DefineConstants>
    21     19     </PropertyGroup>
    22     20   
           21  +  <!--
           22  +      NOTE: Only use functionality available in the .NET Framework 3.5?  By
           23  +            default, this is disabled.  This must be enabled to successfully
           24  +            build the project using Visual Studio 2008 and/or the .NET
           25  +            Framework 3.5 (if necessary, it will typically be enabled from
           26  +            within the project file itself).
           27  +  -->
           28  +  <PropertyGroup Condition="'$(NetFx35)' != 'false'">
           29  +    <DefineConstants>$(DefineConstants);NET_35</DefineConstants>
           30  +  </PropertyGroup>
           31  +
           32  +  <!--
           33  +      NOTE: Only use functionality available in the .NET Framework 4.0?  By
           34  +            default, this is disabled.  This must be enabled to successfully
           35  +            build the project using Visual Studio 2010 and/or the .NET
           36  +            Framework 4.0 (if necessary, it will typically be enabled from
           37  +            within the project file itself).
           38  +  -->
           39  +  <PropertyGroup Condition="'$(NetFx40)' != 'false'">
           40  +    <DefineConstants>$(DefineConstants);NET_40</DefineConstants>
           41  +  </PropertyGroup>
           42  +
    23     43     <!--
    24     44         NOTE: Only use functionality available in the .NET Compact Framework 2.0?
    25     45               By default, this is disabled.  This must be enabled to successfully
    26     46               build the project using Visual Studio 2005 and/or the .NET Compact
    27     47               Framework 2.0 (if necessary, it will typically be enabled from
    28     48               within the project file itself).
    29     49     -->
................................................................................
    88    108         NOTE: Enable support (in the managed assemblies) for the custom extension
    89    109               functions?
    90    110     -->
    91    111     <PropertyGroup Condition="'$(InteropExtensionFunctions)' != 'false'">
    92    112       <DefineConstants>$(DefineConstants);INTEROP_EXTENSION_FUNCTIONS</DefineConstants>
    93    113     </PropertyGroup>
    94    114   
          115  +  <!--
          116  +      NOTE: Enable support (in the managed assemblies) for the test extension?
          117  +  -->
          118  +  <PropertyGroup Condition="'$(InteropTestExtension)' != 'false'">
          119  +    <DefineConstants>$(DefineConstants);INTEROP_TEST_EXTENSION</DefineConstants>
          120  +  </PropertyGroup>
          121  +
    95    122     <!--
    96    123         NOTE: Enable support (in the managed assemblies) for encrypted databases
    97    124               using the CryptoAPI based codec?
    98    125     -->
    99    126     <PropertyGroup Condition="'$(InteropCodec)' != 'false'">
   100    127       <DefineConstants>$(DefineConstants);INTEROP_CODEC</DefineConstants>
   101    128     </PropertyGroup>

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

   577    577       [DllImport(SQLITE_DLL)]
   578    578       internal static extern SQLiteErrorCode sqlite3_create_function_interop(IntPtr db, byte[] strName, int nArgs, int nType, IntPtr pvUser, SQLiteCallback func, SQLiteCallback fstep, SQLiteFinalCallback ffinal, int needCollSeq);
   579    579   
   580    580       [DllImport(SQLITE_DLL)]
   581    581       internal static extern SQLiteErrorCode sqlite3_finalize_interop(IntPtr stmt);
   582    582   
   583    583       [DllImport(SQLITE_DLL)]
   584         -    internal static extern SQLiteErrorCode sqlite3_open_interop(byte[] utf8Filename, int flags, out IntPtr db);
          584  +    internal static extern SQLiteErrorCode sqlite3_open_interop(byte[] utf8Filename, SQLiteOpenFlagsEnum flags, out IntPtr db);
   585    585   
   586    586       [DllImport(SQLITE_DLL)]
   587         -    internal static extern SQLiteErrorCode sqlite3_open16_interop(byte[] utf8Filename, int flags, out IntPtr db);
          587  +    internal static extern SQLiteErrorCode sqlite3_open16_interop(byte[] utf8Filename, SQLiteOpenFlagsEnum flags, out IntPtr db);
   588    588   
   589    589       [DllImport(SQLITE_DLL)]
   590    590       internal static extern SQLiteErrorCode sqlite3_reset_interop(IntPtr stmt);
   591    591   
   592    592   #endif
   593    593   // !SQLITE_STANDARD
   594    594   
................................................................................
   623    623   #if !PLATFORM_COMPACTFRAMEWORK
   624    624       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
   625    625   #else
   626    626       [DllImport(SQLITE_DLL)]
   627    627   #endif
   628    628       internal static extern SQLiteErrorCode sqlite3_finalize(IntPtr stmt);
   629    629   
   630         -#if !PLATFORM_COMPACTFRAMEWORK
   631         -    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
   632         -#else
   633         -    [DllImport(SQLITE_DLL)]
   634         -#endif
   635         -    internal static extern SQLiteErrorCode sqlite3_open_v2(byte[] utf8Filename, out IntPtr db, int flags, IntPtr vfs);
   636         -
   637         -#if !PLATFORM_COMPACTFRAMEWORK
   638         -    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
   639         -#else
   640         -    [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
   641         -#endif
   642         -    internal static extern SQLiteErrorCode sqlite3_open16(string fileName, out IntPtr db);
   643         -
   644    630   #if !PLATFORM_COMPACTFRAMEWORK
   645    631       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
   646    632   #else
   647    633       [DllImport(SQLITE_DLL)]
   648    634   #endif
   649    635       internal static extern SQLiteErrorCode sqlite3_reset(IntPtr stmt);
   650    636   
................................................................................
   807    793   // !SQLITE_STANDARD
   808    794   
   809    795       #endregion
   810    796   
   811    797       // Standard API calls global across versions.  There are a few instances of interop calls
   812    798       // scattered in here, but they are only active when PLATFORM_COMPACTFRAMEWORK is declared.
   813    799       #region standard sqlite api calls
          800  +#if !PLATFORM_COMPACTFRAMEWORK
          801  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
          802  +#else
          803  +    [DllImport(SQLITE_DLL)]
          804  +#endif
          805  +    internal static extern SQLiteErrorCode sqlite3_enable_load_extension(
          806  +        IntPtr db, int enable);
          807  +
          808  +#if !PLATFORM_COMPACTFRAMEWORK
          809  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
          810  +#else
          811  +    [DllImport(SQLITE_DLL)]
          812  +#endif
          813  +    internal static extern SQLiteErrorCode sqlite3_load_extension(
          814  +        IntPtr db, byte[] fileName, byte[] procName, ref IntPtr pError);
          815  +
   814    816   #if !PLATFORM_COMPACTFRAMEWORK
   815    817       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
   816    818   #else
   817    819       [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
   818    820   #endif
   819    821       internal static extern SQLiteErrorCode sqlite3_win32_set_directory(uint type, string value);
   820    822   
................................................................................
   849    851   #if !PLATFORM_COMPACTFRAMEWORK
   850    852       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
   851    853   #else
   852    854       [DllImport(SQLITE_DLL)]
   853    855   #endif
   854    856       internal static extern void sqlite3_free(IntPtr p);
   855    857   
          858  +#if !PLATFORM_COMPACTFRAMEWORK
          859  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
          860  +#else
          861  +    [DllImport(SQLITE_DLL)]
          862  +#endif
          863  +    internal static extern SQLiteErrorCode sqlite3_open_v2(byte[] utf8Filename, out IntPtr db, SQLiteOpenFlagsEnum flags, IntPtr vfs);
          864  +
          865  +#if !PLATFORM_COMPACTFRAMEWORK
          866  +    [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
          867  +#else
          868  +    [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
          869  +#endif
          870  +    internal static extern SQLiteErrorCode sqlite3_open16(string fileName, out IntPtr db);
          871  +
   856    872   #if !PLATFORM_COMPACTFRAMEWORK
   857    873       [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
   858    874   #else
   859    875       [DllImport(SQLITE_DLL)]
   860    876   #endif
   861    877       internal static extern void sqlite3_interrupt(IntPtr db);
   862    878   

Changes to Tests/basic.eagle.

  1024   1024   \{file:test.db, FullUri=file:test\.db\} 0 \{60, Default Timeout=60\} 0 \{False,\
  1025   1025   Enlist=False\} 0 \{True, FailIfMissing=True\} 0 \{False, Legacy Format=False\}\
  1026   1026   0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0 \{4096, Page\
  1027   1027   Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache Size=8192\} 0\
  1028   1028   \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc, DateTimeKind=Utc\} 0\
  1029   1029   \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0 \{Memory, Journal\
  1030   1030   Mode=Memory\} 0 \{Serializable, Default IsolationLevel=Serializable\} 0\
  1031         -\{False, Foreign Keys=False\} 0 \{LogCallbackException,\
         1031  +\{False, Foreign Keys=False\} 0 \{(?:Default|LogCallbackException),\
  1032   1032   Flags=(?:Default|LogCallbackException)\} 0 \{False, SetDefaults=False\} 0\
  1033   1033   \{False, ToFullPath=False\}$}}
  1034   1034   
  1035   1035   ###############################################################################
  1036   1036   
  1037   1037   runTest {test data-1.17 {SQLiteConvert ToDateTime (Julian Day)} -body {
  1038   1038     set dateTime [object invoke System.Data.SQLite.SQLiteConvert ToDateTime \
................................................................................
  1888   1888   } -cleanup {
  1889   1889     cleanupDb $fileName
  1890   1890   
  1891   1891     unset -nocomplain result db fileName
  1892   1892   } -constraints \
  1893   1893   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
  1894   1894   {1 2 1}}
         1895  +
         1896  +###############################################################################
         1897  +
         1898  +runTest {test data-1.38 {NoExtensionFunctions connection flag} -setup {
         1899  +  setupDb [set fileName data-1.38.db]
         1900  +} -body {
         1901  +  set result [list]
         1902  +
         1903  +  lappend result [catch {sql execute -execute scalar $db \
         1904  +      "SELECT replicate('1234', 2);"} output] $output
         1905  +
         1906  +  cleanupDb $fileName
         1907  +  setupDb $fileName "" "" "" NoExtensionFunctions
         1908  +
         1909  +  lappend result [catch {sql execute -execute scalar $db \
         1910  +      "SELECT replicate('1234', 3);"} output] $output
         1911  +
         1912  +  cleanupDb $fileName
         1913  +  setupDb $fileName
         1914  +
         1915  +  lappend result [catch {sql execute -execute scalar $db \
         1916  +      "SELECT replicate('1234', 4);"} output] $output
         1917  +
         1918  +  set result
         1919  +} -cleanup {
         1920  +  cleanupDb $fileName
         1921  +
         1922  +  unset -nocomplain result db fileName
         1923  +} -constraints \
         1924  +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \
         1925  +regexp -result {^0 12341234 1 \{System\.Data\.SQLite\.SQLiteException\
         1926  +\(0x80004005\): SQL logic error or missing database.*?\} 0 1234123412341234$}}
  1895   1927   
  1896   1928   ###############################################################################
  1897   1929   
  1898   1930   unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \
  1899   1931       testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile
  1900   1932   
  1901   1933   ###############################################################################
  1902   1934   
  1903   1935   runSQLiteTestEpilogue
  1904   1936   runTestEpilogue

Changes to Tests/common.eagle.

   493    493           if {[string length $item] > 0} then {
   494    494             lappend result [$item ToString]
   495    495           }
   496    496         }
   497    497   
   498    498         return $result
   499    499       }
          500  +
          501  +    proc catchAndReturn { script {stackTrace false} {strict true} } {
          502  +      #
          503  +      # NOTE: Evaluate the script provided by the caller in their context,
          504  +      #       capturing both the result and the return code.
          505  +      #
          506  +      set code [catch {uplevel 1 $script} result]
          507  +
          508  +      #
          509  +      # NOTE: Did the script provided by the caller NOT raise an error?
          510  +      #
          511  +      if {$strict && $code == 0 || !$strict && $code != 1} then {
          512  +        #
          513  +        # NOTE: Success.  Return a list with the return code and the result.
          514  +        #
          515  +        return [list $code $result]
          516  +      } elseif {$stackTrace} then {
          517  +        #
          518  +        # NOTE: Failure.  The caller wants a full stack trace (if applicable),
          519  +        #       return a list with the return code and the result verbatim.
          520  +        #
          521  +        return [list $code $result]
          522  +      } else {
          523  +        #
          524  +        # NOTE: Failure.  The caller does not want a full stack trace (if
          525  +        #       applicable), return a list with the return code, the error
          526  +        #       code for the interpreter, and the error message up to the
          527  +        #       point where the stack trace should start.
          528  +        #
          529  +        set index [string first "   at " $result]; # HACK: Reliable?
          530  +
          531  +        return [list $code $::errorCode [expr {$index != -1 ? \
          532  +            [string trim [string range $result 0 $index]] : $result}]]
          533  +      }
          534  +    }
   500    535   
   501    536       proc compileCSharpWith {
   502    537               text memory symbols strict resultsVarName errorsVarName fileNames
   503    538               args } {
   504    539         #
   505    540         # NOTE: Since we are going to use this method name a lot, assign it to a
   506    541         #       variable first.
................................................................................
  1029   1064               CHECK_STATE
  1030   1065   
  1031   1066           checkForSQLiteDefineConstant $::test_channel \
  1032   1067               USE_INTEROP_DLL
  1033   1068   
  1034   1069           checkForSQLiteDefineConstant $::test_channel \
  1035   1070               INTEROP_EXTENSION_FUNCTIONS
         1071  +
         1072  +        checkForSQLiteDefineConstant $::test_channel \
         1073  +            INTEROP_TEST_EXTENSION
  1036   1074   
  1037   1075           #
  1038   1076           # NOTE: Report the resource usage prior to running any tests.
  1039   1077           #
  1040   1078           reportSQLiteResources $::test_channel
  1041   1079   
  1042   1080           #

Added Tests/tkt-17045010df.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-17045010df.eagle --
            4  +#
            5  +# Written by Joe Mistachkin.
            6  +# Released to the public domain, use at your own risk!
            7  +#
            8  +###############################################################################
            9  +
           10  +package require Eagle
           11  +package require Eagle.Library
           12  +package require Eagle.Test
           13  +
           14  +runTestPrologue
           15  +
           16  +###############################################################################
           17  +
           18  +package require System.Data.SQLite.Test
           19  +runSQLiteTestPrologue
           20  +
           21  +###############################################################################
           22  +
           23  +runTest {test tkt-17045010df-1.1 {EnableExtensions & LoadExtension} -setup {
           24  +  setupDb [set fileName tkt-17045010df-1.1.db]
           25  +} -body {
           26  +  set connection [object invoke -flags +NonPublic -objectflags +NoDispose \
           27  +      -alias Interpreter.GetActive.connections get_Item $db]
           28  +
           29  +  lappend result [catchAndReturn {$connection EnableExtensions false}]
           30  +  lappend result [catchAndReturn {$connection LoadExtension [file join \
           31  +      [getBinaryDirectory] SQLite.Interop.dll] interop_test_extension_init}]
           32  +
           33  +  lappend result [catchAndReturn {sql execute -execute scalar $db \
           34  +      "SELECT interopTest('test1');"}]
           35  +  lappend result [catchAndReturn {sql execute -execute scalar $db \
           36  +      "SELECT interopTest('test1', '1234');"}]
           37  +
           38  +  lappend result [catchAndReturn {$connection EnableExtensions true}]
           39  +  lappend result [catchAndReturn {$connection LoadExtension [file join \
           40  +      [getBinaryDirectory] SQLite.Interop.dll] interop_test_extension_init}]
           41  +
           42  +  lappend result [catchAndReturn {sql execute -execute scalar $db \
           43  +      "SELECT interopTest('test2');"}]
           44  +  lappend result [catchAndReturn {sql execute -execute scalar $db \
           45  +      "SELECT interopTest('test2', '5678');"}]
           46  +
           47  +  string map [list \r\n ", "] $result
           48  +} -cleanup {
           49  +  unset -nocomplain result connection
           50  +
           51  +  cleanupDb $fileName
           52  +
           53  +  unset -nocomplain db fileName
           54  +} -constraints \
           55  +{eagle monoBug28 defineConstant.System.Data.SQLite.INTEROP_TEST_EXTENSION\
           56  +command.sql compile.DATA SQLite System.Data.SQLite} -result {{0 {}} {1\
           57  +{EXCEPTION System.Data.SQLite.SQLiteException}\
           58  +{System.Reflection.TargetInvocationException: Exception has been thrown by the\
           59  +target of an invocation. ---> System.Data.SQLite.SQLiteException: SQL logic\
           60  +error or missing database, not authorized}} {1 {EXCEPTION\
           61  +System.Data.SQLite.SQLiteException} {System.Data.SQLite.SQLiteException\
           62  +(0x80004005): SQL logic error or missing database, no such function:\
           63  +interopTest}} {1 {EXCEPTION System.Data.SQLite.SQLiteException}\
           64  +{System.Data.SQLite.SQLiteException (0x80004005): SQL logic error or missing\
           65  +database, no such function: interopTest}} {0 {}} {0 {}} {0 test2} {1 {EXCEPTION\
           66  +System.Data.SQLite.SQLiteException} {System.Data.SQLite.SQLiteException\
           67  +(0x80004005): SQL logic error or missing database, need exactly one argument}}}}
           68  +
           69  +###############################################################################
           70  +
           71  +runSQLiteTestEpilogue
           72  +runTestEpilogue

Changes to readme.htm.

   189    189   <p>
   190    190       <b>1.0.83.0 - November XX, 2012</b>
   191    191   </p>
   192    192   <ul>
   193    193       <li>Updated to <a href="http://www.sqlite.org/src/info/trunk">SQLite 3.7.15</a>.</li>
   194    194       <li>Add Visual Studio 2012 support to all the applicable solution/project files, their associated supporting files, and the test suite.</li>
   195    195       <li>Add Visual Studio 2012 support to the redesigned designer support installer.</li>
          196  +    <li>Allow opened connections to skip adding the extension functions included in the interop assembly via the new NoExtensionFunctions connection flag.</li>
          197  +    <li>Support loading of SQLite extensions via the new EnableExtensions and LoadExtension methods of the SQLiteConnection class.</li>
          198  +    <li>Add notifications before and after any connection is opened and closed, as well as other related notifications, via the new static Changed event.</li>
   196    199       <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li>
   197    200       <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li>
   198    201       <li>Make sure the error code of the SQLiteException class gets serialized.</li>
   199    202       <li>Make the test project for the .NET Compact Framework more flexible.</li>
   200    203       <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li>
   201    204       <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   202    205       <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>

Changes to test/test.2008.csproj.

    16     16       <ProjectGuid>{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}</ProjectGuid>
    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>test</RootNamespace>
    20     20       <AssemblyName>test</AssemblyName>
    21     21       <OldToolsVersion>2.0</OldToolsVersion>
    22     22       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    23         -    <NetFx20>true</NetFx20>
           23  +    <NetFx35>true</NetFx35>
    24     24       <ConfigurationYear>2008</ConfigurationYear>
    25     25     </PropertyGroup>
    26     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     28       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     29     </PropertyGroup>
    30     30     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to test/test.2010.csproj.

    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>test</RootNamespace>
    20     20       <AssemblyName>test</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           24  +    <NetFx40>true</NetFx40>
    24     25       <ConfigurationYear>2010</ConfigurationYear>
    25     26     </PropertyGroup>
    26     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     30     </PropertyGroup>
    30     31     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to test/test.2012.csproj.

    14     14       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    15     15       <ProjectGuid>{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}</ProjectGuid>
    16     16       <AppDesignerFolder>Properties</AppDesignerFolder>
    17     17       <OutputType>Exe</OutputType>
    18     18       <RootNamespace>test</RootNamespace>
    19     19       <AssemblyName>test</AssemblyName>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    26     27       <OutputPath>$(BinaryOutputPath)</OutputPath>
    27     28     </PropertyGroup>

Changes to testce/testce.2008.csproj.

    23     23       <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
    24     24       <OSVersion>5.0</OSVersion>
    25     25       <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    26     26       <OldToolsVersion>2.0</OldToolsVersion>
    27     27       <NativePlatformName>Windows CE</NativePlatformName>
    28     28       <FormFactorID></FormFactorID>
    29     29       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    30         -    <NetFx20>true</NetFx20>
           30  +    <NetFx35>true</NetFx35>
    31     31       <ConfigurationYear>2008</ConfigurationYear>
    32     32       <ConfigurationSuffix>Compact</ConfigurationSuffix>
    33     33       <DeployDirSuffix>testce</DeployDirSuffix>
    34     34       <DeployDirPrefix>%25CSIDL_PROGRAM_FILES%25</DeployDirPrefix>
    35     35     </PropertyGroup>
    36     36     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    37     37     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">

Changes to testlinq/Program.cs.

   251    251                             territories.Regions = db.Regions.First();
   252    252   
   253    253                             db.AddObject("Territories", territories);
   254    254                         }
   255    255   
   256    256                         try
   257    257                         {
   258         -#if NET_20
   259         -                          db.SaveChanges(false);
          258  +#if NET_40
          259  +                          db.SaveChanges(SaveOptions.None);
   260    260   #else
   261         -                          db.SaveChanges(SaveOptions.None);
          261  +                          db.SaveChanges(false);
   262    262   #endif
   263    263                         }
   264    264                         catch (Exception e)
   265    265                         {
   266    266                             Console.WriteLine(e);
   267    267                         }
   268    268                         finally
................................................................................
   274    274                 }
   275    275             }
   276    276             else
   277    277             {
   278    278                 using (northwindEFEntities db = new northwindEFEntities())
   279    279                 {
   280    280                     bool once = false;
   281         -#if NET_20
          281  +#if NET_40
          282  +                  var query = from t in db.Territories
          283  +                    where territoryIds.AsQueryable<long>().Contains<long>(t.TerritoryID)
          284  +                    orderby t.TerritoryID
          285  +                    select t;
          286  +
          287  +                  foreach (Territories territories in query)
          288  +                  {
          289  +                      if (once)
          290  +                          Console.Write(' ');
          291  +
          292  +                      Console.Write(territories.TerritoryID);
          293  +
          294  +                      once = true;
          295  +                  }
          296  +#else
   282    297                     //
   283    298                     // HACK: We cannot use the Contains extension method within a
   284    299                     //       LINQ query with the .NET Framework 3.5.
   285    300                     //
   286    301                     var query = from t in db.Territories
   287    302                       orderby t.TerritoryID
   288    303                       select t;
   289    304   
   290    305                     foreach (Territories territories in query)
   291    306                     {
   292    307                         if (Array.IndexOf(territoryIds, territories.TerritoryID) == -1)
   293    308                             continue;
   294    309   
   295         -                      if (once)
   296         -                          Console.Write(' ');
   297         -
   298         -                      Console.Write(territories.TerritoryID);
   299         -
   300         -                      once = true;
   301         -                  }
   302         -#else
   303         -                  var query = from t in db.Territories
   304         -                    where territoryIds.AsQueryable<long>().Contains<long>(t.TerritoryID)
   305         -                    orderby t.TerritoryID
   306         -                    select t;
   307         -
   308         -                  foreach (Territories territories in query)
   309         -                  {
   310    310                         if (once)
   311    311                             Console.Write(' ');
   312    312   
   313    313                         Console.Write(territories.TerritoryID);
   314    314   
   315    315                         once = true;
   316    316                     }

Changes to testlinq/testlinq.2008.csproj.

    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>testlinq</RootNamespace>
    20     20       <AssemblyName>testlinq</AssemblyName>
    21     21       <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    22     22       <OldToolsVersion>2.0</OldToolsVersion>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
    24         -    <NetFx20>true</NetFx20>
           24  +    <NetFx35>true</NetFx35>
    25     25       <ConfigurationYear>2008</ConfigurationYear>
    26     26     </PropertyGroup>
    27     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    28     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    29     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    30     30     </PropertyGroup>
    31     31     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to testlinq/testlinq.2010.csproj.

    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>testlinq</RootNamespace>
    20     20       <AssemblyName>testlinq</AssemblyName>
    21     21       <OldToolsVersion>3.5</OldToolsVersion>
    22     22       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           24  +    <NetFx40>true</NetFx40>
    24     25       <ConfigurationYear>2010</ConfigurationYear>
    25     26     </PropertyGroup>
    26     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    27     28     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    28     29       <OutputPath>$(BinaryOutputPath)</OutputPath>
    29     30     </PropertyGroup>
    30     31     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Changes to testlinq/testlinq.2012.csproj.

    13     13       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    14     14       <ProjectGuid>{9D3CF7A6-092A-4B05-B0E4-BEF6944525B3}</ProjectGuid>
    15     15       <AppDesignerFolder>Properties</AppDesignerFolder>
    16     16       <OutputType>Exe</OutputType>
    17     17       <RootNamespace>testlinq</RootNamespace>
    18     18       <AssemblyName>testlinq</AssemblyName>
    19     19       <SQLiteNetDir>$(MSBuildProjectDirectory)\..</SQLiteNetDir>
           20  +    <NetFx40>true</NetFx40>
    20     21       <ConfigurationYear>2012</ConfigurationYear>
    21     22       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    22     23     </PropertyGroup>
    23     24     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    24     25     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    25     26       <OutputPath>$(BinaryOutputPath)</OutputPath>
    26     27     </PropertyGroup>

Changes to tools/install/Installer.2008.csproj.

    17     17       <AppDesignerFolder>Properties</AppDesignerFolder>
    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>Installer</RootNamespace>
    20     20       <AssemblyName>Installer</AssemblyName>
    21     21       <DelaySign>true</DelaySign>
    22     22       <OldToolsVersion>2.0</OldToolsVersion>
    23     23       <SQLiteNetDir>$(MSBuildProjectDirectory)\..\..</SQLiteNetDir>
    24         -    <NetFx20>true</NetFx20>
           24  +    <NetFx35>true</NetFx35>
    25     25       <ConfigurationYear>2008</ConfigurationYear>
    26     26     </PropertyGroup>
    27     27     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    28     28     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    29     29     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    30     30       <OutputPath>$(BinaryOutputPath)</OutputPath>
    31     31     </PropertyGroup>

Changes to tools/install/Installer.2010.csproj.

    18     18       <OutputType>Exe</OutputType>
    19     19       <RootNamespace>Installer</RootNamespace>
    20     20       <AssemblyName>Installer</AssemblyName>
    21     21       <DelaySign>true</DelaySign>
    22     22       <OldToolsVersion>3.5</OldToolsVersion>
    23     23       <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    24     24       <SQLiteNetDir>$(MSBuildProjectDirectory)\..\..</SQLiteNetDir>
           25  +    <NetFx40>true</NetFx40>
    25     26       <ConfigurationYear>2010</ConfigurationYear>
    26     27     </PropertyGroup>
    27     28     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    28     29     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    29     30     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    30     31       <OutputPath>$(BinaryOutputPath)</OutputPath>
    31     32     </PropertyGroup>

Changes to tools/install/Installer.2012.csproj.

    14     14       <ProjectGuid>{A41FE2A5-07AD-4CE7-B836-1544634816F5}</ProjectGuid>
    15     15       <AppDesignerFolder>Properties</AppDesignerFolder>
    16     16       <OutputType>Exe</OutputType>
    17     17       <RootNamespace>Installer</RootNamespace>
    18     18       <AssemblyName>Installer</AssemblyName>
    19     19       <DelaySign>true</DelaySign>
    20     20       <SQLiteNetDir>$(MSBuildProjectDirectory)\..\..</SQLiteNetDir>
           21  +    <NetFx40>true</NetFx40>
    21     22       <ConfigurationYear>2012</ConfigurationYear>
    22     23       <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    23     24     </PropertyGroup>
    24     25     <Import Project="$(SQLiteNetDir)\SQLite.NET.Settings.targets" />
    25     26     <Import Project="$(SQLiteNetDir)\SQLite.NET.targets" />
    26     27     <PropertyGroup Condition="'$(BinaryOutputPath)' != ''">
    27     28       <OutputPath>$(BinaryOutputPath)</OutputPath>

Changes to tools/install/Installer.cs.

    15     15   
    16     16   #if WINDOWS
    17     17   using System.Runtime.InteropServices;
    18     18   #endif
    19     19   
    20     20   using System.Security;
    21     21   
    22         -#if NET_20
           22  +#if NET_20 || NET_35
    23     23   using System.Security.Permissions;
    24     24   #endif
    25     25   
    26     26   using System.Threading;
    27     27   using System.Windows.Forms;
    28     28   using System.Xml;
    29     29   using Microsoft.Win32;
................................................................................
   146    146           Default = Medium
   147    147       }
   148    148       #endregion
   149    149   
   150    150       ///////////////////////////////////////////////////////////////////////////
   151    151   
   152    152       #region Installer Class
   153         -#if !NET_20
          153  +#if NET_40
   154    154       [SecurityCritical()]
   155    155   #else
   156    156       [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
   157    157   #endif
   158    158       internal static class Installer
   159    159       {
   160    160           #region Unsafe Native Methods Class

Changes to www/news.wiki.

     5      5   <p>
     6      6       <b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b>
     7      7   </p>
     8      8   <ul>
     9      9       <li>Updated to [http://www.sqlite.org/src/info/trunk|SQLite 3.7.15].</li>
    10     10       <li>Add Visual Studio 2012 support to all the applicable solution/project files, their associated supporting files, and the test suite.</li>
    11     11       <li>Add Visual Studio 2012 support to the redesigned designer support installer.</li>
           12  +    <li>Allow opened connections to skip adding the extension functions included in the interop assembly via the new NoExtensionFunctions connection flag.</li>
           13  +    <li>Support loading of SQLite extensions via the new EnableExtensions and LoadExtension methods of the SQLiteConnection class.</li>
           14  +    <li>Add notifications before and after any connection is opened and closed, as well as other related notifications, via the new static Changed event.</li>
    12     15       <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li>
    13     16       <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li>
    14     17       <li>Make sure the error code of the SQLiteException class gets serialized.</li>
    15     18       <li>Make the test project for the .NET Compact Framework more flexible.</li>
    16     19       <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li>
    17     20       <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    18     21       <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>