//
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
//
// File generated by WinMDIDL version 8.00.0021
//

import "inspectable.idl";
import "AsyncInfo.idl";
import "EventToken.idl";
import "windowscontracts.idl";
import "Windows.Foundation.idl";
import "Windows.Storage.Streams.idl";

// Forward Declare
namespace Windows
{
    namespace Storage
    {
        namespace Streams
        {
            interface IBuffer;

            interface IInputStream;

            interface IOutputStream;
        }
    }
}
namespace Windows
{
    namespace Devices
    {
        namespace Custom
        {
            apicontract CustomDeviceContract;

            typedef enum DeviceAccessMode DeviceAccessMode;

            typedef enum DeviceSharingMode DeviceSharingMode;

            typedef enum IOControlAccessMode IOControlAccessMode;

            typedef enum IOControlBufferingMethod IOControlBufferingMethod;

            interface ICustomDevice;

            interface ICustomDeviceStatics;

            interface IIOControlCode;

            interface IIOControlCodeFactory;

            interface IKnownDeviceTypesStatics;

            runtimeclass CustomDevice;

            runtimeclass IOControlCode;

            runtimeclass KnownDeviceTypes;
        }
    }
}

// Generic instantiations
namespace Windows
{
    namespace Devices
    {
        namespace Custom
        {
            declare
            {
                interface Windows.Foundation.IAsyncOperation<Windows.Devices.Custom.CustomDevice*>;
            }
        }
    }
}

// Type definition
namespace Windows
{
    namespace Devices
    {
        namespace Custom
        {
            [contractversion(1.0)]
            apicontract CustomDeviceContract
            {
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            enum DeviceAccessMode
            {
                Read      = 0,
                Write     = 1,
                ReadWrite = 2
            };

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            enum DeviceSharingMode
            {
                Shared    = 0,
                Exclusive = 1
            };

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            enum IOControlAccessMode
            {
                Any       = 0,
                Read      = 1,
                Write     = 2,
                ReadWrite = 3
            };

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            enum IOControlBufferingMethod
            {
                Buffered     = 0,
                DirectInput  = 1,
                DirectOutput = 2,
                Neither      = 3
            };

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [exclusiveto(Windows.Devices.Custom.CustomDevice)]
            [uuid(DD30251F-C48B-43BD-BCB1-DEC88F15143E)]
            interface ICustomDevice : IInspectable
            {
                [propget] HRESULT InputStream([out] [retval] Windows.Storage.Streams.IInputStream** value);
                [propget] HRESULT OutputStream([out] [retval] Windows.Storage.Streams.IOutputStream** value);
                HRESULT SendIOControlAsync([in] Windows.Devices.Custom.IIOControlCode* ioControlCode, [in] Windows.Storage.Streams.IBuffer* inputBuffer, [in] Windows.Storage.Streams.IBuffer* outputBuffer, [out] [retval] Windows.Foundation.IAsyncOperation<UINT32>** operation);
                HRESULT TrySendIOControlAsync([in] Windows.Devices.Custom.IIOControlCode* ioControlCode, [in] Windows.Storage.Streams.IBuffer* inputBuffer, [in] Windows.Storage.Streams.IBuffer* outputBuffer, [out] [retval] Windows.Foundation.IAsyncOperation<boolean>** operation);
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [exclusiveto(Windows.Devices.Custom.CustomDevice)]
            [uuid(C8220312-EF4C-46B1-A58E-EEB308DC8917)]
            interface ICustomDeviceStatics : IInspectable
            {
                HRESULT GetDeviceSelector([in] GUID classGuid, [out] [retval] HSTRING* value);
                HRESULT FromIdAsync([in] HSTRING deviceId, [in] Windows.Devices.Custom.DeviceAccessMode desiredAccess, [in] Windows.Devices.Custom.DeviceSharingMode sharingMode, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Custom.CustomDevice*>** operation);
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [uuid(0E9559E7-60C8-4375-A761-7F8808066C60)]
            interface IIOControlCode : IInspectable
            {
                [propget] HRESULT AccessMode([out] [retval] Windows.Devices.Custom.IOControlAccessMode* value);
                [propget] HRESULT BufferingMethod([out] [retval] Windows.Devices.Custom.IOControlBufferingMethod* value);
                [propget] HRESULT Function([out] [retval] UINT16* value);
                [propget] HRESULT DeviceType([out] [retval] UINT16* value);
                [propget] HRESULT ControlCode([out] [retval] UINT32* value);
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [exclusiveto(Windows.Devices.Custom.IOControlCode)]
            [uuid(856A7CF0-4C11-44AE-AFC6-B8D4A212788F)]
            interface IIOControlCodeFactory : IInspectable
            {
                HRESULT CreateIOControlCode([in] UINT16 deviceType, [in] UINT16 function, [in] Windows.Devices.Custom.IOControlAccessMode accessMode, [in] Windows.Devices.Custom.IOControlBufferingMethod bufferingMethod, [out] [retval] Windows.Devices.Custom.IOControlCode** instance);
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [exclusiveto(Windows.Devices.Custom.KnownDeviceTypes)]
            [uuid(EE5479C2-5448-45DA-AD1B-24948C239094)]
            interface IKnownDeviceTypesStatics : IInspectable
            {
                [propget] HRESULT Unknown([out] [retval] UINT16* value);
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [marshaling_behavior(agile)]
            [static(Windows.Devices.Custom.ICustomDeviceStatics, Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [threading(both)]
            runtimeclass CustomDevice
            {
                [default] interface Windows.Devices.Custom.ICustomDevice;
            }

            [activatable(Windows.Devices.Custom.IIOControlCodeFactory, Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [marshaling_behavior(agile)]
            [threading(both)]
            runtimeclass IOControlCode
            {
                [default] interface Windows.Devices.Custom.IIOControlCode;
            }

            [contract(Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            [marshaling_behavior(agile)]
            [static(Windows.Devices.Custom.IKnownDeviceTypesStatics, Windows.Devices.Custom.CustomDeviceContract, 1.0)]
            runtimeclass KnownDeviceTypes
            {
            }
        }
    }
}
