public static D3DXCONSTANTTABLE_DESC?GetDesc(
            this ID3DXConstantTable contantTable)
        {
            VerifyNonNullArgument(
                contantTable,
                "contantTable");

            var desc = default(D3DXCONSTANTTABLE_DESC);

            return(Succeeded(contantTable.GetDesc(out desc))
                   ? (D3DXCONSTANTTABLE_DESC?)desc
                   : null);
        }
        public static IEnumerable <IntPtr> GetTopLevelConstantHandles(
            this ID3DXConstantTable contantTable)
        {
            VerifyNonNullArgument(
                contantTable,
                "contantTable");

            var desc_ = contantTable.GetDesc();

            if (!desc_.HasValue)
            {
                return(Enumerable.Empty <IntPtr>());
            }
            var desc = desc_.Value;

            return(Enumerable.Range(
                       0,
                       (int)desc.Constants)
                   .Select(
                       index => contantTable.GetConstant(
                           IntPtr.Zero,
                           (uint)index)));
        }