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));
        }