Esempio n. 1
0
 public static extern int JetGetObjectInfo(
     IntPtr sesid,
     uint dbid,
     uint objtyp,
     string szContainerName,
     string szObjectName,
     [In][Out] ref NATIVE_OBJECTLIST objectlist,
     uint cbMax,
     uint InfoLevel);
Esempio n. 2
0
        public void ConvertObjectlistFromNative()
        {
            var tableid = new JET_TABLEID {
                Value = (IntPtr)0x1000
            };
            var col1 = new JET_COLUMNID {
                Value = 1
            };
            var col2 = new JET_COLUMNID {
                Value = 2
            };
            var col3 = new JET_COLUMNID {
                Value = 3
            };
            var col4 = new JET_COLUMNID {
                Value = 4
            };
            var col5 = new JET_COLUMNID {
                Value = 5
            };
            var col6 = new JET_COLUMNID {
                Value = 6
            };

            var native = new NATIVE_OBJECTLIST()
            {
                tableid            = tableid.Value,
                cRecord            = 100,
                columnidobjectname = col1.Value,
                columnidobjtyp     = col2.Value,
                columnidgrbit      = col3.Value,
                columnidflags      = col4.Value,
                columnidcRecord    = col5.Value,
                columnidcPage      = col6.Value,
            };

            var objectlist = new JET_OBJECTLIST();

            objectlist.SetFromNativeObjectlist(native);

            Assert.AreEqual(tableid, objectlist.tableid);
            Assert.AreEqual(100, objectlist.cRecord);
            Assert.AreEqual(col1, objectlist.columnidobjectname);
            Assert.AreEqual(col2, objectlist.columnidobjtyp);
            Assert.AreEqual(col3, objectlist.columnidgrbit);
            Assert.AreEqual(col4, objectlist.columnidflags);
            Assert.AreEqual(col5, objectlist.columnidcRecord);
            Assert.AreEqual(col6, objectlist.columnidcPage);
        }
        public void Setup()
        {
            this.native = new NATIVE_OBJECTLIST()
            {
                tableid            = new IntPtr(0x100),
                cRecord            = 100,
                columnidobjectname = 1,
                columnidobjtyp     = 2,
                columnidgrbit      = 3,
                columnidflags      = 4,
                columnidcRecord    = 5,
                columnidcPage      = 6,
            };

            this.managed = new JET_OBJECTLIST();
            this.managed.SetFromNativeObjectlist(this.native);
        }