コード例 #1
0
        public void TestClone()
        {
            int hr;

            StreamBufferAttribute[] pAttribs = new StreamBufferAttribute[1];

            IEnumStreamBufferRecordingAttrib cloneEnum;

            hr = m_sbra.Clone(out cloneEnum);
            DsError.ThrowExceptionForHR(hr);

            hr = cloneEnum.Next(1, pAttribs, IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);

            Marshal.ReleaseComObject(cloneEnum);
            Marshal.FreeCoTaskMem(pAttribs[0].pbAttribute);
        }
コード例 #2
0
        public void TestNext()
        {
            int    lFetched;
            IntPtr ip = Marshal.AllocCoTaskMem(4);
            int    hr;

            StreamBufferAttribute[] pAttribs = new StreamBufferAttribute[2];

            hr       = m_sbra.Next(2, pAttribs, ip);
            lFetched = Marshal.ReadInt32(ip);
            Marshal.FreeCoTaskMem(ip);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(lFetched == 2, "Next");

            Marshal.FreeCoTaskMem(pAttribs[0].pbAttribute);
            Marshal.FreeCoTaskMem(pAttribs[1].pbAttribute);
        }
コード例 #3
0
        public void TestSkip()
        {
            int hr;

            StreamBufferAttribute[] pAttribs = new StreamBufferAttribute[1];

            hr = m_sbra.Next(1, pAttribs, IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);

            Marshal.FreeCoTaskMem(pAttribs[0].pbAttribute);

            hr = m_sbra.Skip(1);
            DsError.ThrowExceptionForHR(hr);

            hr = m_sbra.Next(1, pAttribs, IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);

            Marshal.FreeCoTaskMem(pAttribs[0].pbAttribute);
        }