示例#1
0
        private void TestAllocator()
        {
            int hr;
            AllocatorProperties pProps       = new AllocatorProperties();
            AllocatorProperties pActualProps = new AllocatorProperties();

            pProps.cbAlign  = 1;
            pProps.cbBuffer = 512 * 2;
            pProps.cbPrefix = 0;
            pProps.cBuffers = 5;

            hr = m_iar.RequestAllocator(null, pProps, out m_pActual);
            DsError.ThrowExceptionForHR(hr);

            hr = m_pActual.SetProperties(pProps, pActualProps);
            DsError.ThrowExceptionForHR(hr);

            hr = m_pActual.Commit();
            DsError.ThrowExceptionForHR(hr);
        }
示例#2
0
        private void TestProp()
        {
            int hr;
            AllocatorProperties pProps  = new AllocatorProperties();
            AllocatorProperties pProps2 = new AllocatorProperties();
            AllocatorProperties pActual = new AllocatorProperties();

            hr = m_ma.GetProperties(pProps);
            DsError.ThrowExceptionForHR(hr);

            pProps.cbAlign  = 1;
            pProps.cbBuffer = 1024;
            pProps.cbPrefix = 0;
            pProps.cBuffers = 24;

            hr = m_ma.SetProperties(pProps, pActual);
            DsError.ThrowExceptionForHR(hr);

            hr = m_ma.GetProperties(pProps2);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(pProps.cbBuffer == pProps2.cbBuffer, "Check Size");
            Debug.Assert(pProps.cbBuffer == pActual.cbBuffer, "Check Size");
        }