bbqchickenrobot / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

Use of DllImport for LockFile, & UnlockFile prevents running under Silverlight #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Use of DllImport for LockFile, LockFileEx & UnlockFile prevents running
under Silverlight

    [DllImport( "kernel32", SetLastError = true )]
    static extern int LockFile(int hFile, int dwFileOffsetLow, int
dwFileOffsetHigh, int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh);

    [DllImport( "kernel32", SetLastError = true )]
    static extern int LockFileEx(int hFile, int dwFlags, int dwReserved,
int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh, ref OVERLAPPED
lpOverlapped);
    const int LOCKFILE_EXCLUSIVE_LOCK = 0x00000002;

    [DllImport( "kernel32", SetLastError = true )]
    static extern int UnlockFile( IntPtr hFile, int dwFileOffsetLow, int
dwFileOffsetHigh, int nNumberOfBytesToUnlockLow, int
nNumberOfBytesToUnlockHigh );

in referenced in os_win_c.cs and used by the locking routines

This prevents fulling running under Silverlight

Original issue reported on code.google.com by noah.hart@gmail.com on 7 Aug 2009 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by noah.hart@gmail.com on 24 Aug 2009 at 10:29

GoogleCodeExporter commented 9 years ago
Changed usage to FileStream.Lock/Unlock; Moved LockFileEx into its own issue

Original comment by noah.hart@gmail.com on 24 Aug 2009 at 11:59