//-----------------------------------------------------------------------
// 
//     Copyright (c) Microsoft Corporation.
// 
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Windows7
{
    /// 
    /// ESENT APIs that were first supported in Windows 7 (Windows Server 2008 R2).
    /// 
    public static class Windows7Api
    {
#if !MANAGEDESENT_ON_WSA // Not exposed in MSDK
        /// 
        /// Crash dump options for Watson.
        /// 
        /// Crash dump options.
        public static void JetConfigureProcessForCrashDump(CrashDumpGrbit grbit)
        {
            Api.Check(Api.Impl.JetConfigureProcessForCrashDump(grbit));
        }
#endif // !MANAGEDESENT_ON_WSA
        /// 
        /// If the records with the specified keys are not in the buffer cache
        /// then start asynchronous reads to bring the records into the database
        /// buffer cache.
        /// 
        /// The session to use.
        /// The table to issue the prereads against.
        /// 
        /// The keys to preread. The keys must be sorted.
        /// 
        /// The lengths of the keys to preread.
        /// 
        /// The index of the first key in the keys array to read.
        /// 
        /// 
        /// The maximum number of keys to preread.
        /// 
        /// 
        /// Returns the number of keys to actually preread.
        /// 
        /// 
        /// Preread options. Used to specify the direction of the preread.
        /// 
        public static void JetPrereadKeys(
            JET_SESID sesid,
            JET_TABLEID tableid,
            byte[][] keys,
            int[] keyLengths,
            int keyIndex,
            int keyCount,
            out int keysPreread,
            PrereadKeysGrbit grbit)
        {
            Api.Check(Api.Impl.JetPrereadKeys(sesid, tableid, keys, keyLengths, keyIndex, keyCount, out keysPreread, grbit));
        }
        /// 
        /// If the records with the specified keys are not in the buffer cache
        /// then start asynchronous reads to bring the records into the database
        /// buffer cache.
        /// 
        /// The session to use.
        /// The table to issue the prereads against.
        /// 
        /// The keys to preread. The keys must be sorted.
        /// 
        /// The lengths of the keys to preread.
        /// 
        /// The maximum number of keys to preread.
        /// 
        /// 
        /// Returns the number of keys to actually preread.
        /// 
        /// 
        /// Preread options. Used to specify the direction of the preread.
        /// 
        public static void JetPrereadKeys(
            JET_SESID sesid,
            JET_TABLEID tableid,
            byte[][] keys,
            int[] keyLengths,
            int keyCount,
            out int keysPreread,
            PrereadKeysGrbit grbit)
        {
            JetPrereadKeys(sesid, tableid, keys, keyLengths, 0, keyCount, out keysPreread, grbit);
        }
    }
}