System.Data.SQLite
Check-in [dc86717583]
Not logged in

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

Overview
Comment:Implement a workaround for the issue described in ticket [9ac9862611].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-9ac9862611
Files: files | file ages | folders
SHA1: dc8671758339f015b58388e627dea48217a7f897
User & Date: mistachkin 2013-07-15 18:21:46
Context
2013-07-15
18:46
Implement a workaround for the issue described in ticket [9ac9862611]. check-in: f54929f54e user: mistachkin tags: trunk
18:21
Implement a workaround for the issue described in ticket [9ac9862611]. Closed-Leaf check-in: dc86717583 user: mistachkin tags: tkt-9ac9862611
07:08
Fix several issues with the managed virtual table support. Use the correct methods overloads for Marshal.PtrToStructure. Correct handling of native structure padding when running on 64-bit operating systems. Make sure connections released to the pool do not hold onto modules. Call sqlite3_dispose_module with the correct native module pointer. Modify all classes implementing the IDisposable pattern to set the disposed flag after their base classes have been disposed. Add LogExceptionsNoThrow and LogErrorsNoThrow to avoid throwing ObjectDisposedException when logging during derived class disposal. check-in: d60eb09374 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

383
384
385
386
387
388
389
390














































391
392
393
394
395
396
397

          if (processorArchitecture != null)
              return processorArchitecture;

          //
          // BUGBUG: Will this always be reliable?
          //
          return Environment.GetEnvironmentVariable(PROCESSOR_ARCHITECTURE);














































#else
          //
          // NOTE: On the .NET Compact Framework, attempt to use the native
          //       Win32 API function (via P/Invoke) that can provide us with
          //       the processor architecture.
          //
          try







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443

          if (processorArchitecture != null)
              return processorArchitecture;

          //
          // BUGBUG: Will this always be reliable?
          //
          processorArchitecture = Environment.GetEnvironmentVariable(
              PROCESSOR_ARCHITECTURE);

          //
          // HACK: Check for an "impossible" situation.  If the pointer size
          //       is 32-bits, the processor architecture cannot be "AMD64".
          //       In that case, we are almost certainly hitting a bug in the
          //       operating system and/or Visual Studio that causes the
          //       PROCESSOR_ARCHITECTURE environment variable to contain the
          //       wrong value in some circumstances.  Please refer to ticket
          //       [9ac9862611] for further information.
          //
          if ((IntPtr.Size == sizeof(int)) &&
              String.Equals(processorArchitecture, "AMD64",
                  StringComparison.OrdinalIgnoreCase))
          {
#if !NET_COMPACT_20 && TRACE_PRELOAD
              //
              // NOTE: When tracing is enabled, save the originally detected
              //       processor architecture before changing it.
              //
              string savedProcessorArchitecture = processorArchitecture;
#endif

              //
              // NOTE: We know that operating systems that return "AMD64" as
              //       the processor architecture are actually a superset of
              //       the "x86" processor architecture; therefore, return
              //       "x86" when the pointer size is 32-bits.
              //
              processorArchitecture = "x86";

              //
              // NOTE: Show that we hit a fairly unusual situation (i.e. the
              //       "wrong" processor architecture was detected).
              //
#if !NET_COMPACT_20 && TRACE_PRELOAD
              Trace.WriteLine(String.Format(
                  CultureInfo.CurrentCulture,
                  "Detected {0}-bit pointer size with processor architecture " +
                  "\"{1}\", using processor architecture \"{2}\" instead...",
                  IntPtr.Size * 8 /* bits */, savedProcessorArchitecture,
                  processorArchitecture));
#endif
          }

          return processorArchitecture;
#else
          //
          // NOTE: On the .NET Compact Framework, attempt to use the native
          //       Win32 API function (via P/Invoke) that can provide us with
          //       the processor architecture.
          //
          try