public static object GetDevice(this IDXGIDeviceSubObject obj, Guid riid)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            obj.GetDevice(riid, out object parent);
            return(parent);
        }
        public static IComObject <IDXGIDevice> GetDevice(this IDXGIDeviceSubObject subObject)
        {
            if (subObject == null)
            {
                throw new ArgumentNullException(nameof(subObject));
            }

            subObject.GetDevice(typeof(IDXGIDevice).GUID, out var device).ThrowOnError();
            return(new ComObject <IDXGIDevice>((IDXGIDevice)device));
        }
 public static T GetDevice <T>(this IDXGIDeviceSubObject obj) => (T)GetDevice(obj, typeof(T).GUID);