/*++

© 1998 Seagate Software, Inc.  All rights reserved

Module Name:

    rmsint.idl

Abstract:

    IDL source for RMS

    This file will be processed by the MIDL tool to produce the
    RMS Proxy/Stub marshaling code (RmsPs.dll).

Author:

    Brian Dodd          [brian]     29-Oct-1996

Revision History:

--*/

interface IRmsLibrary;
interface IRmsDrive;
interface IRmsCartridge;
interface IRmsChangerElement;
interface IRmsNTMS;
interface IDataMover;

import "oaidl.idl";
import "WsbInt.idl";
import "MvrInt.idl";
import "winioctl.h";

#define   RMS_INFO_SIZE     128


typedef struct _RMS_CHANGER_PARAMETERS {

    USHORT  x;

    BOOL    HasScanner                : 1; // The medium-changer has a bar code scanner installed.
    BOOL    CanInitWithRange          : 1; // The medium-changer has the ability to initialize elements within a specified range.
    BOOL    CanCloseIEPort            : 1; // The medium-changer has the ability to close the i/e port door.
    BOOL    CanOpenIEPort             : 1; // The medium-changer can open the i/e port door.
    BOOL    HasNVROM                  : 1; // The medium-changer uses non-volatile memory for element status information.
    BOOL    CanExchange               : 1; // The medium-changer supports exchange operations.
    BOOL    HasCleanerSlot            : 1; // The medium-changer has a fixed slot.
    BOOL    CanLockUnlock             : 1; // The medium-changer can be (un)secured to (allow)prevent media removal.
    BOOL    HasMagazine               : 1; // The medium-changer uses cartridge magazines for some storage slots.
    BOOL    CanFlip                   : 1; // The medium-changer can flip medium.
    BOOL    CanPositionToElement      : 1; // The medium-changer can position the transport to a particular element.
    BOOL    DriveIsStorage            : 1; // The medium-changer can use a drive as an independent storage element.
    BOOL    IEPortIsStorage           : 1; // The medium-changer can use a i/e port as an independent storage element.
    BOOL    SlotIsStorage             : 1; // The medium-changer can use a slot as an independent storage element.
    BOOL    TransportIsStorage        : 1; // The medium-changer can use a transport as an independent storage element.
    BOOL    RequiresHomeUnit          : 1; // The medium-changer must be issued a ChangerHomeUnit for certain User operations.
    BOOL    RequiresCleaning          : 1; // The drives controlled by the medium changer require periodic cleaning initiated by an application.
    BOOL    RequiresCartridgeEject    : 1; // The medium-changer requires a drive eject command to be issued, before a changer move / exchange command can be issued to a cleaner cartridge.
    BOOL    RequiresCleanerEject      : 1; // The medium-changer requires a drive eject command to be issued, before a changer move / exchange command can be issued to a cleaner cartridge.
    BOOL    SupportsVolumeId          : 1; // The medium-changer supports volume identification.
    BOOL    SupportsVolumeSequence    : 1; // The medium-changer supports volume sequencing.
    BOOL    SupportsVolumeSearch      : 1; // The medium-changer can search for volume information.
    BOOL    SupportsVolumeAssert      : 1; // The medium-changer can verify volume information.
    BOOL    SupportsVolumeReplace     : 1; // The medium-changer can replace volume information.
    BOOL    SupportsVolumeUndefine    : 1; // The medium-changer can undefine volume information.
    BOOL    CanEnableDisableKeypad    : 1; // Indicates that the keypad can be enabled/disabled.

} RmsChangerParameters;



/*++

Interface Name:

    IRmsServer

Interface Description:

    Server Interface

--*/

[
    object,
	uuid(52487E77-286D-4F42-BF58-3254708FA510),
    //dual,
    helpstring("IRmsServer Interface"),
    pointer_default(unique)
]

interface IRmsServer : IDispatch
{
    HRESULT IsReady(void);
/*++

Method Name:

    IsReady

Method Description:

    Returns S_OK if the server is ready for normal processing.

Arguments:

    None.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RPC_S_SERVER_UNAVAILABLE - The RPC server is unavailable.
    RPC_S_CALL_FAILED   - The remote procedure call failed.

--*/

    HRESULT ChangeState(
        [in] LONG newState);
/*++

Method Name:

    ChangeState

Method Description:

    Changes the state of the server.

Arguments:

    None.

Return Values:

    S_OK    - Success.

--*/

    HRESULT IsNTMSInstalled(void);

    HRESULT GetNTMS(
        [out] IRmsNTMS **ptr);

    HRESULT InitializeInAnotherThread(void);
    HRESULT Initialize(void);
    HRESULT SaveAll(void);

    HRESULT GetServerName(
        [in, out, string] BSTR *pName);

/*++

Method Name:

    GetServerName

Method Description:

    Returns the name of the computer running the RMS service.

Arguments:

    pName               - Receives the name of the computer.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsServer::GetLogicalName

--*/

    HRESULT GetCartridges( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetCartridges

Method Description:

    Returns the collection of RMS Cartridges.

    This collection represents physical units of media.  A particular cartridge
    could represent a fixed disk, removable disk, optical media, or tape media.

    There is only one collection of cartridges per RMS Server.  From this collection all
    known cartridges can be enumerated using the IWsbIndexedCollection interface.
    Information about a particular cartridge can be retrieved through the
    IRmsCartridge interface.

Arguments:

    ptr                 - Receives the cartridge collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsCartridge
    IWsbIndexedCollection

--*/

    HRESULT GetActiveCartridges( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetActiveCartridges

Method Description:

    Returns the collection of Cartridges that are actively in use and
    mounted in a drive.

Arguments:

    ptr                 - Receives the cartridge collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsCartridge
    IWsbIndexedCollection

--*/

    HRESULT GetDataMovers( [out] IWsbIndexedCollection **ptr );
/*++

Method Name:

    GetDataMovers

Method Description:

    Returns the collection of DataMovers in use by the subsystem.

Arguments:

    ptr                 - Receives the DataMover collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IDataMover
    IWsbIndexedCollection

--*/

    HRESULT SetActiveCartridge( [in] IRmsCartridge *ptr );

/*++

Method Name:

    SetActiveCartridge

Method Description:

    Saves the active cartridge.

Arguments:

    ptr         - The active cartridge.

Return Value:

    S_OK        - Success.

See Also:

    IRmsCartridge

--*/

    HRESULT GetLibraries( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetLibraries

Method Description:

    Returns the collection of RMS Libraries.

    This collection represents both physical Jukebox / Autoloader devices, and
    logical groupings of standalone drives which are called human Jukeboxes, or
    manual libraries since they require human intervention when accessing media.

    There is only one collection of libraries per RMS Server.  From this collection all
    known libraries can be enumerated using the IWsbIndexedCollection interface.
    Information about a particular library can be retrieved through the
    IRmsLibrary interface.

Arguments:

    ptr             - Receives the library collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsLibrary
    IWsbIndexedCollection

--*/

    HRESULT GetMediaSets( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetMediaSets

Method Description:

    Returns the collection of RMS Media Sets.

    This collection represents both application specific media sets as well as
    the default media sets created for each library mananged by RMS.  Application
    specific media sets are created by an application or via the user interface.

    A media set in this collection is usually also in the collection of media sets
    of one or more libraries.  The media set objects within a library are specific
    to the library, but have identical names and IDs as the media set within this
    server level collection.  Properties of a media set at the server level are
    scoped to include the properties for the same media sets contained within one
    or more libraries.

    This collection is used in conjuntion with a mount-scratch request.  The
    application specifies the media set to use for the mount-scratch request.  RMS
    selects a unit of media from any library that supports the specified media set.

    From this collection all known media sets can be enumerated using the
    IWsbIndexedCollection interface.  Information about a particular media set
    can be retrieved through the IRmsMediaSet interface.

Arguments:

    ptr             - Receives the media set collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsMediaSet
    IRmsLibrary
    IWsbIndexedCollection

--*/

    HRESULT GetRequests( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetRequests

Method Description:

    Returns the collection of RMS Requests.

    This collection represents all the active and inactive media movement
    or devices configuration operations processed by RMS.  Media movement
    requests that are automatically handled by robotic devices have a transient
    state, and are deleted from the list when operation completes successfully.
    Request requiring human intervention remain in the collection until they
    are acted upon or deleted by an operator.

    There is only one collection of requests per RMS Server.  From this collection all
    known requests can be enumerated using the IWsbIndexedCollection interface
    Information about a particular request can be retrieved through the
    IRmsRequest interface.

Arguments:

    ptr             - Receives the request collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsRequest
    IWsbIndexedCollection

--*/

    HRESULT GetClients( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetClients

Method Description:

    Returns the collection of RMS Clients.

    This collection represents all the information known about client applications
    that have registered with RMS.

    There is only one collection of clients per RMS Server.  From this collection all
    known clients can be enumerated using the IWsbIndexedCollection interface.
    Information about a particular client can be retrieved through the
    IRmsClient interface.

Arguments:

    ptr             - Receives the client collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsClient
    IWsbIndexedCollection

--*/

    HRESULT GetUnconfiguredDevices( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetUnconfiguredDevices

Method Description:

    Returns the collection of devices detected, but presently unconfigured.

    This collection represents both Medium Changer and Drive type devices and
    is built whenever the ScanForDevices method is executed.  Devices
    not configured remain in this collection until added to an RMS library
    object through the administrative interface.

Arguments:

    ptr             - Receives the request collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsRequest
    IWsbIndexedCollection
    ScanForDevices

--*/

    HRESULT ScanForDevices( void );

/*++

Method Name:

    ScanForDevices

Method Description:

    Scans all the I/O ports on a server for storage devices.

    A RMS device object is created for each RMS compatible device.  A compatible
    device includes hard disks, removable disks, optical media, and tape media.

    The current configuration of devices is compared with what is actually found
    connected to the server.  Devices objects are updated accordingly, and a request
    is generated do deal with inconsistencies, such as the detection of unexpected
    devices, or devices not found that where expected to be connected to the server.

Arguments:

    None.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

--*/


    HRESULT ScanForDrives( void );

/*++

Method Name:

    ScanForDrives

Method Description:

    Scans for local drives compatible with RemoteStorage.  These are devices accessed
    using a drive letter.

    A RMS device object is created for each RMS compatible drive.

    The current configuration of devices is compared with what is actually found
    connected to the server.  Device objects are updated accordingly, and a request
    is generated do deal with inconsistencies, such as the detection of unexpected
    devices, or devices not found that where expected to be connected to the server.

Arguments:

    None.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

--*/

    HRESULT MountScratchCartridge( [out] GUID *pCartId,
                                   [in] REFGUID fromMediaSet,
							       [in] REFGUID prevSideId,
                                   [in, out] LONGLONG *pFreeSpace,
                                   [in] LONG blockingFactor,
                                   [in, string] BSTR displayName,
                                   [in, out] IRmsDrive **ppDrive,
                                   [out] IRmsCartridge **ppCartridge,
                                   [out] IDataMover **ppDataMover,
								   [in, defaultvalue(0)] DWORD options );

/*++

Method Name:

    MountScratchCartridge

Method Description:

    Mounts a scratch cartridge into a drive.

    The scratch cartridge is selected from the media set specified.  Any drive compatible
    with the media type may be used to satisfy the mount.

    The IDataMover interface returned is used for all I/O operations on cartridge.

Arguments:

    pCartId         - Receives the cartridge Id of the scratch media that was mounted.

    fromMediaSet    - Identifies from which media set the scratch media is to be taken.

	prevSideId	    - An id of an allocated media - should be given for allocating the second side
					  (Should be set to null value for allocating a new piece of media)

    pFreeSpace      - Required free space for the scratch media.  Zero specifies any capacity.

    blockingFactor  - The blocking factor to use for media.  Zero specifies default block size.

    displayName     - The name used to identify the unit of media to the user.

    ppDrive         - Specifies or receives the drive in which the media is mounted (optional).

    ppCartridge     - Receives cartridge interface.

    ppDataMover     - Receives the data mover interface for the cartridge.

	options			- RMS flags. Currently use flag for mounting in blocking/non-blocking


Return Value:

    S_OK                        - Success.
    RMS_E_ACCESS_DENIED         - Access to the object denied.
    RMS_E_CANCELED              - The operation was canceled by an operator.
    RMS_E_INVALIDARG            - One or more parameters are incorrect.
    RMS_E_MEDIASET_NOT_FOUND    - The specified media set was not found.
    RMS_E_RESOURCE_BUSY         - The resource required to complete the operation is busy.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.
    RMS_E_SCRATCH_NOT_FOUND     - A unit of scratch media was not found.
    RMS_E_TIMEOUT               - The operation timed out before completing.

See Also:

    IRmsServer::MountCartridge
    IRmsCartridge::SetStatus

--*/

/*++

    HRESULT MountCartridges( [in] ULONG count,
                             [in, out, size_is(count), length_is(*pNumMounted)] GUID *partitionIDs
                             [in] LONG priority,
                             [in] LONG desiredAccess,
                             [in] BOOL bVerify,
                             [in] BOOL bAll,
                             [in] BOOL bMountWait,
                             [in] ULONG freeSpace,
                             [in, out, size_is(count), length_is(*pNumMounted)] IRmsDrive* pDrives,
                             [out] ULONG *pNumMounted,
                             [out] IRmsRequest *pRequest );

    HRESULT SwapCartridges( [in] ULONG count,
                            [in, size_is(count)] GUID *pPartitionIDs,
                            [out, size_is(count)] GUID *pNewPartitionIDs,
                            [in] LONG priority,
                            [in] LONG desiredAccess,
                            [in] BOOL bVerify,
                            [in] BOOL bMountWait,
                            [in] ULONG freeSpace,
                            [in, out, size_is(count)] IRmsDrive* pDrives,
                            [out] IRmsRequest *pRequest );

    HRESULT MountScratchCartridges( [in] ULONG count,
                                    [out, size_is(count), length_is(*pNumMounted)] GUID *pPartitionIDs,
                                    [in] GUID poolId,
                                    [in] LONG priority,
                                    [in] BOOL bMountWait,
                                    [in] ULONG freeSpace,
                                    [in, out, size_is(count), length_is(*pNumMounted)] IRmsDrive* pDrives,
                                    [out] ULONG *pNumMounted,
                                    [out] IRmsRequest *pRequest );
*/

    HRESULT MountCartridge( [in] REFGUID cartId, [in, out] IRmsDrive **ppDrive, [out] IRmsCartridge **ppCartridge, [out] IDataMover **ppDataMover, [in, defaultvalue(0)] DWORD options, [in, defaultvalue(0)] DWORD threadId );

/*++

Method Name:

    MountCartridge

Method Description:

    Mounts the specified cartridge.

    The is probably the most common method used by external applications.  The
    cartridge Id is returned when a unit of media is first mounted for scratch use.

    In general, the cartridge Id must then be stored with the applications
    metadata and used whenever referring to a particular cartridge managed by RMS.

    There are a few exceptions, to this guideline.  In particular, the IRmsServer
    interface supports three alternate methods for mounting media, see below.

    The IDataMover interface returned is used for all I/O operations on cartridge.

Arguments:

    cartId          - The cartridge Id of the cartridge that is to be mounted into a drive.

    ppDrive         - Specifies or receives the drive in which the media is mounted (optional).

    ppCartridge     - Receives cartridge interface.

    ppDataMover     - Receives the IDataMover interface for the cartridge.

	options			- RMS flags. Currently use flag for mounting in blocking/non-blocking


Return Value:

    S_OK                        - Success.
    RMS_E_ACCESS_DENIED         - Access to the object denied.
    RMS_E_CANCELED              - The operation was canceled by an operator.
    RMS_E_INVALIDARG            - One or more parameters are incorrect.
    RMS_E_MEDIASET_NOT_FOUND    - The specified media set was not found.
    RMS_E_RESOURCE_BUSY         - The resource required to complete the operation is busy.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.
    RMS_E_SCRATCH_NOT_FOUND     - A unit of scratch media was not found.
    RMS_E_TIMEOUT               - The operation timed out before completing.

See Also:

    IRmsServer::MountScratchCartridge
    IRmsServer::MountByName
    IRmsServer::MountByBarCode
    IRmsServer::MountByMediaLabel

--*/

    HRESULT DismountCartridge( [in] REFGUID cartId, [in, defaultvalue(0)] DWORD options  );

/*++

Method Name:

    DismountCartridge

Method Description:

    Dismounts a Cartridge.

    The method decrements the usage counter for the drive resource in which
    the specified cartridge is mounted.  When the usage counter decrements to
    zero the cartridge may be physically removed from the drive to free up
    the resource, as determined by the drive class parameters associated with
    the drive.

Arguments:

    cartId          - The cartridge to dismount.

	options			- RMS flags. Currently use flag for dismounting immediately or not

Return Value:

    S_OK            - Success.

See Also:

    IRmsDriveClass

--*/

    HRESULT DuplicateCartridge(
        [in] REFGUID cartId,
	    [in] REFGUID firstSideId,
        [in, out] GUID *pCopyCartId,
        [in] REFGUID copySet,
        [in, string] BSTR copyName,
        [out] LONGLONG *pFreeSpace,
        [out] LONGLONG *pCapacity,
        [in] DWORD options);

/*++

Method Name:

    DuplicateCartridge

Method Description:

    Makes a copy or updates the copy of a Cartridge.

    The method performs media duplication.  The media types of
    both the original and copy are identical.  Except for the
    on-media label information the copy is identical to the original.

Arguments:

    cartId          - The original cartridge to duplicate.
	firstSideId		- The id of a first side of a media whoes second side is to be allocated
					  for the Copy. Valid only when pCopyCartId is GUID_NULL.
    pCopyCartId     - The cartridge used for the copy.  If GUID_NULL, a scratch cartridge is
                      used, and on return this parameter receives the copy cartridge.
    copySet         - The media set used from which scratch media is taken.  Used only when
                      pCopyCartId is GUID_NULL.  If GUID_NULL, then scratch media is taken from
                      the same pool as the original.
    copyName        - The displayable name for the duplicate cartridge.  If NULL, the name
                      duplicate is given the same name as the original cartridge.  The parameter
                      is ignored if pCopyCartId refers to non-scratch media.
    options         - Reserved for future use.

Return Value:

    S_OK            - Success.

--*/

    HRESULT RecycleCartridge(
        [in] REFGUID cartId,
        [in] DWORD options);

/*++

Method Name:

    RecycleCartridge

Method Description:

    Recycles the Cartridge, to prepare for reuse.

    After the operation completes the physical cartridge can be used to satisfy
    a MountScratchCartridge request.

Arguments:

    cartId          - The cartridge to scrap.
    options         - Reserved for future use.

Return Value:

    S_OK            - Success.

See Also:

    IRmsServer::MountScratchCartridge

--*/

    HRESULT FindLibraryById( [in] REFGUID libId, [out] IRmsLibrary **ptr );

/*++

Method Name:

    FindLibraryById

Method Description:

    Retrieves the library object with the give library Id.

Arguments:

    libId           - The library Id of the library to find.

    ptr             - Receives the library found.

Return Value:

    S_OK                    - Success.
    RMS_E_ACCESS_DENIED     - Access to the object denied.
    RMS_E_LIBRARY_NOT_FOUND - The specified library was not found.

--*/

    HRESULT FindCartridgeById( [in] REFGUID cartId, [out] IRmsCartridge **ptr );

/*++

Method Name:

    FindCartridgeById

Method Description:

    Retrieves the cartridge object with the give cartridge Id.

Arguments:

    cartId          - The cartridge Id of the cartridge to find.

    ptr             - Receives the cartridge found

Return Value:

    S_OK                        - Success.
    RMS_E_ACCESS_DENIED         - Access to the object denied.
    RMS_E_CARTRIDGE_NOT_FOUND   - The specified unit of media was not found.

--*/
    HRESULT CreateObject( [in] REFGUID objectId, [in] REFCLSID rclsid, [in] REFIID riid, [in] DWORD dwCreate, [out, iid_is(riid)] void ** ppvObj );

/*++

Method Name:

    CreateObject

Method Description:

    Creates an Rms object, and adds the object to the appropriate server collection.

    The method is used to create Cartridges, Libraries, MediaSets, Requests, and Clients.

Arguments:

    objectId        - The object Id of the cartridge to create.  If GUID_NULL, then a new object is created.
    rclsid          - The class id of the object to create.
    riid            - The interface to return.
    dwCreate        - Create dispostion.  See RmsCreate.
    ppvObj          - Receives the created object.

Return Value:

    S_OK                        - Success.
    RMS_E_ACCESS_DENIED         - Access to the object denied.
    RMS_E_NOT_FOUND             - General not found error.
    RMS_E_ALREADY_EXISTS        - Attempt to create an object failed because the
                                  object already exists, and the create disposition was new.

See Also:

    RmsCreate

--*/

    HRESULT GetNofAvailableDrives( [in] REFGUID fromMediaSet, [out] DWORD *pdwNofDrives );

/*++

Method Name:

    GetNofAvailableDrives

Method Description:

    Retrieves the current number of available drives

Arguments:

    fromMediaSet      - Identifies the media set for specifying which drives are relevant

    pdwNofDrives      - The output - current number of available drives

Return Value:

    S_OK                        - Success.
    Other				        - Unexpected error
								(we ignore errors of retrieving a specific drive details)

--*/
    HRESULT FindCartridgeStatusById( [in] REFGUID cartId, [out] DWORD *pdwStatus );

/*++

Method Name:

    FindCartridgeStatusById

Method Description:

    Retrieves the current cartridge status according to the give cartridge Id.

Arguments:

    cartId          - The cartridge Id of the cartridge to find.

    pdwStatus       - A flags vector - each bit represents a different type of status-data

Return Value:

    S_OK                        - Success.
    RMS_E_CARTRIDGE_NOT_FOUND   - The specified unit of media was not found.
	Other						- Unexpected error

--*/

    HRESULT IsMultipleSidedMedia( [in] REFGUID mediaSetId );

/*++

Method Name:

    IsMultipleSidedMedia

Method Description:

    Checks whether a specific media-set or any known media-set has multiples sided medias

Arguments:

    mediaSetId      - The media set to check
					  A null value indicates checking for all sets

Return Value:

    S_OK                        - A media set contains mutiple sided medias
    S_FALSE						- The specified media set (or no media set) has such medias
	Other						- Unexpected error

--*/

    HRESULT CheckSecondSide( [in] REFGUID firstSideId, [out] BOOL *pbValid, [out] GUID *pSecondSideId );
/*++

Method Name:

    CheckSecondSide

Method Description:

    Checks whether a specific media has a valid second side and provides the id of the second side (if it is already allocated)

Arguments:

    firstSideId     - The (logical) id of the first side of the media

	pbValid			- True iff there is a second valid side

	pSecondSideId	- The (logical) id of the second side if it is alreday allocated
					  A null value indicates either no second side or second side not allocated yet

Return Value:

    S_OK						- Success
    RMS_E_CARTRIDGE_NOT_FOUND	- Indicates problem with the input id
	Other						- Unexpected error

--*/
};


/*++

Interface Name:

    IRmsLibrary

Interface Description:

    Library Interface

    The IRmsLibrary interface represents a multiple-device complex that includes:

    Zero or more medium changers, drive classes, drives, storage slots, staging slots,
    I/E ports, cleaning cartridges, scratch cartridges, media sets.

    But, at least one of something.

    This is a completely arbitrary object that can be created and tuned to the
    requirements of a particular application.

    One library is created for each physical medium changer device.  In addition,
    a single library is created for all standalone drives detected.

    An application could create a library to represent shelf storage, or vaulted
    storage.  These application specific libraries would not have physical devices
    associated with them, but rather represent the physical storage slot contained
    on a shelf on within a vaulted area.

--*/

[
    object,
    uuid(FE37FB02-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsLibrary Interface"),
    pointer_default(unique)
]

interface IRmsLibrary : IDispatch
{

    HRESULT GetLibraryId( [out] GUID *pLibId );

/*++

Method Name:

    GetLibraryId

Method Description:

    Returns the library Id.

    The library Id is a system generated GUID that uniquely identifies a library.  The
    Id may be stored by an external application for future reference.

Arguments:

    pLibId          - Receives the library Id.

Return Value:

    S_OK            - Success.

See Also:

    IRmsServer::FindLibraryById

--*/

    HRESULT SetLibraryId( [in] GUID libId );

/*++

Method Name:

    SetLibraryId

Method Description:

    Assigns the library Id to the specified GUID.

    This method is used internally by RMS.  The library Id is a system generated
    GUID that uniquely identifies a library.  The Id may be stored by an external
    application for future reference.

Arguments:

    libId           - Sets the library Id.

Return Value:

    S_OK            - Success.

--*/

    HRESULT GetName ( [in, out, string] BSTR *pName );

/*++

Method Name:

    GetName

Method Description:

    Returns the displayable name of the library.

    The library name is a descriptive name assigned by the administrator, and
    used to identify a library device.  RMS requests that require human intervention
    will use this name when referring to a library.

Arguments:

    pName           - Receives the name of library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetName

--*/

    HRESULT SetName ( [in, string] BSTR name );

/*++

Method Name:

    SetName

Method Description:

    Assigns a name to the library.

    This method is typically called by the RMS administrative interface to add
    a descriptive name to a library.

    << ADMIN >>

Arguments:

    name            - The new name of the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsLibrary::GetName

--*/

    HRESULT GetMediaSupported( [out] LONG *pType );

/*++

Method Name:

    GetMediaSupported

Method Description:

    Returns the type of media supported by the library.

    The type of media supported by a library is usually of one kind, but
    be a combination of media types is allowed for multiple function devices.  For
    example some devices support read-write optical, WORM, and CD media.

Arguments:

    pType           - Receives the type of media supported by the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMediaSupported
    RmsMedia

--*/

    HRESULT SetMediaSupported( [in] LONG type );

/*++

Method Name:

    SetMediaSupported

Method Description:

    Defines the type of media supported by the library.

    For most libraries the supported media type supported is automatically
    set by RMS.  The value can be overridden to restrict the type of media
    supported by a library.  The value supplied must be a valid media type
    for the library.

    << ADMIN >>

    TODO: Add enumeration method to IRmsLibrary.

Arguments:

    type            - The new value for type of media supported.  If adding an
                      additional media type the GetMediaSupported method should
                      be used to first obtain the current value for the kinds of
                      media supported by the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_INVALIDARG    - One or more parmeters are incorrect.

See Also:

    IRmsLibrary::GetMediaSupported.

--*/

    HRESULT GetMaxChangers( [out] LONG *pNum );

/*++

Method Name:

    GetMaxChangers

Method Description:

    Returns the number of medium changers supported by the library.

    Most automated libraries have only one medium changer, often called an arm;
    however, the RMS model supports more than one changer arm per library.

Arguments:

    pNum            - Receives number of changers supported by the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMaxChangers

--*/

    HRESULT SetMaxChangers( [in] LONG num );

/*++

Method Name:

    SetMaxChangers

Method Description:

    Defines the number of changers supported by the library.

    The maximum number of changers is set internally by RMS by querying the
    device.  This method can be called to override the default value; however
    the value supplied cannot exceed the actual number of changer arms
    physically addressable by the device.

Arguments:

    num             - The new value for the number of changers supported by the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_INVALIDARG    - One or more parmeters are incorrect.

See Also:

    IRmsLibrary::GetMaxChangers

--*/

    HRESULT GetMaxDrives( [out] LONG *pNum );

/*++

Method Name:

    GetMaxDrives

Method Description:

    Returns the number of drives supported by the library.

    The value returned is the total number of drives currently supported by the library;
    not the total number of drivers that the library can physically house.

Arguments:

    pNum            - Receives the number of drives supported by the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMaxDrives

--*/

    HRESULT SetMaxDrives( [in] LONG num );

/*++

Method Name:

    SetMaxDrives

Method Description:

    Defines the number of drives supported by the library.

    The maximum number of drives is set internally by RMS by querying the
    library device or other means of detection.  This method may be
    called to override the default value devices.  The value supplied 
    cannot exceed the physical number of drives addressable by the library.

Arguments:

    num             - The new value for the number of drives supported by the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_INVALIDARG    - One or more parmeters are incorrect.

See Also:

    IRmsLibrary::GetMaxDrives

--*/

    HRESULT GetMaxPorts( [out] LONG *pNum );

/*++

Method Name:

    GetMaxPorts

Method Description:

    Returns the number of import and export ports supported by the library.

    A port is the mechanism through which a unit of media is imported to or exported
    from a library.  The value returned is to the total number of ports supported
    by the library.

Arguments:

    pNum            - Receives the number of ports supported by the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMaxPorts

--*/

    HRESULT SetMaxPorts( [in] LONG num );

/*++

Method Name:

    SetMaxPorts

Method Description:

    Defines the number of ports supported by the library.

    The maximum number of ports is set internally by RMS by querying the
    library device or other means of detection.  This method may be
    called to override the default value; however, the value supplied
    cannot exceed the physical number of ports addressable by the device.

Arguments:

    num             - The new value for number of ports supported by the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_INVALIDARG    - One or more parmeters are incorrect.

See Also:

    IRmsLibrary::GetMaxPorts

--*/

    HRESULT GetMaxSlots( [out] LONG *pNum );

/*++

Method Name:

    GetMaxSlots

Method Description:

    Returns the total number of storage slots contained within the library.

Arguments:

    pNum            - Receives the total number of storage slots in the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMaxSlots

--*/

    HRESULT SetMaxSlots( [in] LONG num );

/*++

Method Name:

    SetMaxSlots

Method Description:

    Defines the number of storage slots supported by the library.

    The maximum number of storage slots is set internally by RMS by querying the
    library device or other means of detection.  This method may be
    called to override the default value; however, the value supplied cannot
    exceed the physical number of slot addressable by the device.

Arguments:

    num             - The new value for number of storage slots supported by the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_INVALIDARG    - One or more parmeters are incorrect.

--*/

    HRESULT GetNumUsedSlots( [out] LONG *pNum );

/*++

Method Name:

    GetNumUsedSlots

Method Description:

    Returns the number of occupied storage slots.

    Any storage slot that contains a unit of media, either scratch or private to
    an application, is considered in use.  The value of the parameter is determined
    by RMS.

Arguments:

    pNum            - Receives the current number of used storage slots in the library.

Return Value:

    S_OK            - Success.

--*/

    HRESULT GetNumStagingSlots( [out] LONG *pNum );

/*++

Method Name:

    GetNumStagingSlots

Method Description:

    Returns the number of storage slots that can be used for staging media
    between its storage location and a drive.

    This is a library tuning parameter that enhances performance of cartridge
    movement by minimizing distances traversed to storage slots during peak
    periods of media movement demand.

Arguments:

    pNum            - Receives the number of staging slots.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetNumStagingSlots

--*/

    HRESULT SetNumStagingSlots( [in] LONG num );

/*++

Method Name:

    SetNumStagingSlots

Method Description:

    Defines the number of slots that can be used for staging media.

    This is an administrator assigned tuning parameter for the library.

    << ADMIN >>

Arguments:

    num             - The new value for number of slots used for staging media.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsLibrary::GetNumStagingSlots

--*/

    HRESULT GetNumScratchCarts( [out] LONG *pNum );

/*++

Method Name:

    GetNumScratchCarts

Method Description:

    Returns the current number of scratch cartridges in the library.

Arguments:

    pNum            - Receives the current number of scratch cartridges in the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetNumScratchCarts

--*/

    HRESULT SetNumScratchCarts( [in] LONG num );

/*++

Method Name:

    SetNumScratchCarts

Method Description:

    Defines the number of scratch cartridges that are contained within the library.

    This method is used internally by RMS.

Arguments:

    num             - The new value for number of scratch cartridges contained within the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

--*/

    HRESULT GetNumUnknownCarts( [out] LONG *pNum );

/*++

Method Name:

    GetNumUnknownCarts

Method Description:

    Returns the number of cartridges with a status of Unknown.

    An unknown cartridge is one that is not a scratch cartridge, a cleaning,
    cartridge, or a cartridge that is private to a particular application.

Arguments:

    pNum            - Receives the number of unknown cartridges in the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetNumUnknownCarts
    RmsStatus

--*/

    HRESULT SetNumUnknownCarts( [in] LONG num );

/*++

Method Name:

    SetNumUnknownCarts

Method Description:

    Defines the number of unknown cartridges in the library.

    This method is used internally by RMS.

Arguments:

    num             - The new value for number of unknown cartridges in the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsLibrary::GetNumUnknownCarts
    RmsStatus

--*/

    HRESULT IsMagazineSupported( void );

/*++

Method Name:

    IsMagazineSupported

Method Description:

    Indicates whether magazines are supported by the library.

Arguments:

    None.

Return Value:

    S_OK        - magazines are supported by the library.

    S_FALSE     - magazines are not supported by the library.

See Also:

    IRmsLibrary::SetIsMagazineSupported

--*/

    HRESULT SetIsMagazineSupported( [in] BOOL flag );

/*++

Method Name:

    SetIsMagazineSupported

Method Description:

    Sets the magazine supported flag.

    Magazine support is detected internally by RMS by querying the
    device.  This method may be called to override the default value.
    Setting the magazine support flag to FALSE will disable certain RMS
    optimizations that depend on magazine support, such as exporting
    multiple cartridges by first placing the cartridges in a single magazine.

Arguments:

    flag            - The new value for magazine supported flag for the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_SUPPORTED - The operation attempted is not supported.

See Also:

    IRmsLibrary::IsMagazineSupported

--*/

    HRESULT GetMaxCleaningMounts( [out] LONG *pNum );

/*++

Method Name:

    GetMaxCleaningMounts

Method Description:

    Returns the maximum number of times a cleaning cartridge should be
    mounted into a drive.

Arguments:

    pNum            - Receives the maximum number of cleaning mounts.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetMaxCleaningMounts

--*/

    HRESULT SetMaxCleaningMounts( [in] LONG num );

/*++

Method Name:

    SetMaxCleaningMounts

Method Description:

    Defines the maximum number of times a cleaning cartridge can be mounted
    into a drive.

    This method can be used to override the RMS default value.

    This is an administrator assigned parameter.

    << ADMIN >>

Arguments:

    num             - The new value for maximum number of cleaning mounts for each
                      cleaning cartridge in the library.

Return Value:

    S_OK                - Success
    RMS_E_ACCESS_DENIED - Access to the object denied.

See Also:

    IRmsLibrary::GetMaxCleaningMounts

--*/

    HRESULT GetSlotSelectionPolicy( [out] LONG *pNum );

/*++

Method Name:

    GetSlotSelectionPolicy

Method Description:

    Returns the storage slot selection policy.

    The slot selection policy determines how storage slots are allocated.  Slots
    are allocated to minimize mount times, group by application, or to sort by
    cartridge name, bar code, or on-media label.

Arguments:

    pNum            - Receives the value of the slot selection policy for the library.

Return Value:

    S_OK            - Success.

See Also:

    IRmsLibrary::SetSlotSelectionPolicy
    RmsSlotSelect

--*/

    HRESULT SetSlotSelectionPolicy( [in] LONG num );

/*++

Method Name:

    SetSlotSelectionPolicy

Method Description:

    Defines the slot selection policy for the library.

    This is an administrator assigned parameter.

    << ADMIN >>

    TODO: Add enumeration method to IRmsLibrary.

Arguments:

    num             - The new slot selection policy for the library.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_SUPPORTED - One or more parameters are incorrect.

See Also:

    IRmsLibrary::GetSlotSelectionPolicy
    RmsSlotSelect

--*/

    HRESULT GetChangers( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetChangers

Method Description:

    Returns the collection of RMS Medium Changers.

    This collection represents the medium changer devices within a library.

Arguments:

    ptr             - Receives the changers collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no changers associated
                          with this library.

See Also:

    IRmsLibrary::GetMaxChangers
    IRmsMediumChanger
    IRmsMoveMedia
    IWsbIndexedCollection

--*/

    HRESULT GetDriveClasses( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetDriveClasses

Method Description:

    Returns the collection of RMS Drive Classes.

    This collection represents drive classes supported by the library.
    This collection is used in determining a suitable drive to use when
    processing a mount request.

Arguments:

    ptr             - Receives the drive class collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no drive classes associated
                          with this library.

See Also:

    IRmsDriveClass
    IWsbIndexedCollection

--*/

    HRESULT GetDrives( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetDrives

Method Description:

    Returns the collection of RMS Drives.

    This collection represents the drives within a library.

Arguments:

    ptr             - Receives the drive collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no drives associated
                          with the library.

See Also:

    IRmsDrive
    IWsbIndexedCollection

--*/

    HRESULT GetStorageSlots( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetStorageSlots

Method Description:

    Returns the collection of RMS Storage Slots.

    This collection represents the storage slots within a library.

Arguments:

    ptr             - Receives the storage slot collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no storage slots associated
                          with the library.

See Also:

    IRmsStorageSlot
    IWsbIndexedCollection

--*/

    HRESULT GetStagingSlots( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetStagingSlots

Method Description:

    Returns the collection of staging slots.

    This collection represents the storage slots within a library.
    These slots are designated for staging media between drives
    and permanent storage locations during demand periods.

Arguments:

    ptr             - Receives the staging slot collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no staging slots associated
                          with the library.

See Also:

    IRmsStorageSlot
    IWsbIndexedCollection

--*/

    HRESULT GetPorts( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetPorts

Method Description:

    Returns the collection of RMS Ports.

    This collection represents the import and export ports within a library.

Arguments:

    ptr             - Receives the port collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no ports associated
                          with the library.

See Also:

    IRmsIEPort
    IWsbIndexedCollection

--*/

    HRESULT GetCleaningCartridges( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetCleaningCartridges

Method Description:

    Returns the collection of cleaning cartridges.

    This collection represents the cleaning cartridges associated with a library.
    These cartridges are used to satisfy requests to clean drive.

Arguments:

    ptr             - Receives cleaning cartridge interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no cleaning cartridges associated
                          with the library.

See Also:

    IRmsCartridge
    IRmsDrive::Clean
    IWsbIndexedCollection

--*/

    HRESULT GetScratchCartridges( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetScratchCartridges

Method Description:

    Returns the collection of scratch cartridges.

    This collection represents all the scratch cartridges associated with
    a library.  These cartridges are used to satisfy requests to
    mount scratch media.

Arguments:

    ptr             - Receives the scratch cartridge collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no scratch cartridges associated
                          with the library.

See Also:

    IRmsCartridge
    IRmsServer::MountScratchCartridge
    IWsbIndexedCollection

--*/

    HRESULT GetMediaSets( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetMediaSets

Method Description:

    Returns the collection of RMS Media Sets.

    This collection represents the media sets associated with a library.  A media
    set is used to classify media by type or application.

Arguments:

    ptr             - Receives the media set collection interface.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.
    RMS_E_NOT_FOUND     - General not found error.  There are no media sets associated
                          with the library.

See Also:

    IRmsMediaSet
    IRmsServer::MountScratchCartridge
    IWsbIndexedCollection

--*/

// HRESULT Audit( [in] LONG start, [in] LONG count, [in] BOOL verify, [in] BOOL unknownOnly, [in] BOOL mountWait, [in] LONG *pRequest );

/*++

Method Name:

    Audit

Method Description:

    Audits the contents of the library.

    The Audit method performs a complete audit of some or all
    cartridges, depending on the bAll flag specified.  It is more than just a
    simple inventory, in that at various levels corrective action can be taken
    to update the RMS data bases so that they reflect the true state of cartridges
    within a library.

Arguments:

    start           - Specifies the starting storage slot to begin the audit.
    count           - Specifies the number of storage slots to
                      Audit.  If dwStart and dwCount are
                      both zero the audit range is the entire
                      library.
    verify          - If TRUE, verify each cartridge by reading
                      the on-media label, using one of the
                      registered COM interfaces for the verify
                      label operation. If FALSE, the library is initialized
                      and cartridge bar code information scanned, if
                      supported.
    unknownOnly     - If TRUE, all cartridges for the range
                      specified are audited.  Otherwise, only
                      cartridges with status "Unknown" are audited.
    mountWait       - Indicates whether the application is willing
                      to wait for a drive resource when bVerify
                      is TRUE.  If this parameter is FALSE and the
                      required resources are unavailable, the function
                      returns RMS_E_RESOURCE_BUSY. If TRUE, the request will
                      wait up to the MountWait time specified for the
                      given drive class required for cartridge
                      verification. If the MountWait time expires
                      the function returns RMS_E_TIMEOUT.
    pRequest        - The request number assigned to the audit operation

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_BUSY         - The resource required to complete the operation is busy.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.
    RMS_E_INVALIDARG            - One or more parameters are incorrect.
    RMS_E_CANCELED              - The operation was canceled by an operator.
    RMS_E_TIMEOUT               - The operation timed out before completing.

Comments:

    Various levels of detail can be obtained from the audit operation
    depending on the parameters supplied, and capabilities of the particular
    library device.  In all cases, inactive media residing in a drive
    is returned to its storage location, then the library is initialized
    to determine which storage slots contain cartridges.

    Setting the bVerify parameter to TRUE forces each cartridge
    in the specified range to be mounted to and on-media label read.

    When bVerify is FALSE, the cartridge inventory is performed by
    a bar code scan operation, if available.  Otherwise the libary is
    simply initialized and any cartridges in a storage slot that was previously
    empty, is marked with "Unknown" status before the function returns.

    Set bUnknownOnly equal to TRUE to limit the audit to only
    those cartridge in the specified range with an "Unkonwn" status.

    Because of the time involved with performing a complete library audit,
    set bVerify to TRUE only when the integrity of the library contents
    is in doubt.  This operation can be very time consuming, but provides the
    only means to verify the location and status of each cartridge in
    the library.

    For this asynchronous request upto three event are issued.
    The first event is signaled after the operation begins.  The last
    event is signaled after the operations completes. When bVerify is
    is TRUE, the second event is signaled after each volume is verified.
    This allows the application to monitor progress and optionally cancel
    the audit before completion.

    If dwStart and dwCount are both non-zero, and bVerify is
    FALSE for a target device that supports bar code scanning of individual
    elements, each element specified is scanned.  If individual element bar
    code scanning is not supported, the function returns
    RMS_E_INVALIDARG.

See Also:

    IRmsRequest::Cancel

--*/
};


/*++

Interface Name:

    IRmsDriveClass

Interface Description:

    Drive Class Interface

    IRmsDriveClass is the interface to administrative properties associated with a
    drive, or more typically a grouping of drives having the same capabilities or
    performance characteristics.  These properties include media types supported,
    application supported, current mount limits, and cartridge idle time
    specifications that indicate when an inactive cartridge should be returned
    to its storage location.

    By default a CRmsDriveClass object is created for each type of media supported
    by the drives in a library.  Multiple functions drives will be associated
    with multiple drive classes.

    The IRmsDriveClass interface provides access to the collection of drives
    that are associated with the DriveClass.

--*/

[
    object,
    uuid(FE37FB03-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsDriveClass Interface"),
    pointer_default(unique)
]

interface IRmsDriveClass : IDispatch
{

    HRESULT GetDriveClassId( [out] GUID *pDriveClassId );

/*++

Method Name:

    GetDriveClassId

Method Description:

    Returns the drive class Id.

    The drive class Id is a system generated GUID that uniquely identifies a drive
    class.  The Id may be stored by an external application for future reference.

Arguments:

    pDriveClassId   - Receives the drive class Id.

Return Value:

    S_OK                - Success.
    RMS_E_ACCESS_DENIED - Access to the object denied.

--*/

    HRESULT GetName( [in, out, string] BSTR *pName );

/*++

Method Name:

    GetName

Method Description:

    Returns the displayable name of the drive class.

    The drive class is a descriptive name assigned by the administrator, and
    used to identify a drive class.

Arguments:

    pName           - Receives the name of drive class.

Return Value:

    S_OK            - Success.

See Also:

    IRmsDriveClass::SetName

--*/

    HRESULT SetName( [in, string] BSTR name );

/*++

Method Name:

    SetName

Method Description:

    Set drive class name.

Arguments:

    name         - name to  set drive class to.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetType( [out] LONG *pType );

/*++

Method Name:

    GetType

Method Description:

    Get drive class type.

Arguments:

    pType        - value of drive class type.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetType( [in] LONG type );

/*++

Method Name:

    SetType

Method Description:

    Set drive class type.

Arguments:

    type         - new value of drive class type.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetCapability( [out] LONG *pCapablity );

/*++

Method Name:

    GetCapability

Method Description:

    Get drive capability.

Arguments:

    pCapablity   - current value of drive capability.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetCapability( [in] LONG capability );

/*++

Method Name:

    SetCapability

Method Description:

    Set drive class capability.

Arguments:

    capability   - new drive class capability value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetIdleTime( [out] LONG *pTime );

/*++

Method Name:

    GetIdleTime

Method Description:

    Get idle time for drive class.

Arguments:

    pTime        - current idle time value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetIdleTime( [in] LONG time );

/*++

Method Name:

    SetIdleTime

Method Description:

    Set idle time value for drive class.

Arguments:

    time         - new idle time value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetMountWaitTime( [out] LONG *pTime );

/*++

Method Name:

    GetMountWaitTime

Method Description:

    Get mount wait time value.

Arguments:

    pTime        - current mount wait time value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetMountWaitTime( [in] LONG time );

/*++

Method Name:

    SetMountWaitTime

Method Description:

    Set mount wait time value.

Arguments:

    time         - new mount wait time value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetMountLimit( [out] LONG *pLim );

/*++

Method Name:

    GetMountLimit

Method Description:

    Get mount limit value.

Arguments:

    pLim         - current mount limit value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetMountLimit( [in] LONG lim );

/*++

Method Name:

    SetMountLimit

Method Description:

    Set mount limit value.

Arguments:

    lim          - new mount limit value.

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetQueuedRequests( [out] LONG *pReqs );

/*++

Method Name:

    GetQueuedRequests

Method Description:

    Get number of queued requests.

Arguments:

    pReqs        - current number of queued requests

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetQueuedRequests( [in] LONG reqs );

/*++

Method Name:

    SetQueuedRequests

Method Description:

    Set number of queued requests.

Arguments:

    reqs         - new value for number of queued requests

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetUnloadPauseTime( [out] LONG *pTime );

/*++

Method Name:

    GetUnloadPauseTime

Method Description:

    Get unload pause time value.

Arguments:

    pTime        - current value of unload pause time

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetUnloadPauseTime( [in] LONG time );

/*++

Method Name:

    SetUnloadPauseTime

Method Description:

    Set value for unload pause time.

Arguments:

    time         - new value for unload pause time

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetDriveSelectionPolicy( [out] LONG *pPolicy );

/*++

Method Name:

    GetDriveSelectionPolicy

Method Description:

    Get drive selection policy information.

Arguments:

    pPolicy      - current drive selection policy value

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT SetDriveSelectionPolicy( [in] LONG policy );

/*++

Method Name:

    SetDriveSelectionPolicy

Method Description:

    Set drive selection policy value.

Arguments:

    policy       - new value for drive selection policy

Return Value:

    S_OK         - operation completed successfully


--*/

    HRESULT GetDrives( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetDrives

Method Description:

    Get current drives.

Arguments:

    ptr          - Value of current drives available

Return Value:

    S_OK         - operation completed successfully


--*/

};


/*++

Interface Name:

    IRmsCartridge

Interface Description:

    RMS Cartridge Interface.

        The cartridge interface provide accessors to cartridge object data members.

--*/

[
    object,
    uuid(534F26CB-4F8A-4FEE-8D7E-5C35A0A0CC38),
    //dual,
    helpstring("IRmsCartridge Interface"),
    pointer_default(unique)
]

interface IRmsCartridge : IDispatch
{
//  example defs for scripting:
//      [propput] HRESULT Location ( [in] LONG loc );               // set_Location
//      [propget] HRESULT Location ( [out, retval] LONG * loc );    // get_Location

    HRESULT GetMediaSetId( [out] GUID *pMediaSetId );
    HRESULT SetMediaSetId( [in] GUID mediaSetId );

    HRESULT SetCartridgeId( [in] GUID cartId );

    HRESULT GetCartridgeId( [out] GUID *pCartId );

/*++

Method Name:

    GetCartridgeId

Method Description:

    Returns the GUID assigned to the cartridge.

    The cartridge ID is an internally designated GUID generated by RMS when the
    cartridge object is first created.  The Id can be used to reference
    the cartridge through standard collection or database enumeration methods.

Arguments:

    pCartId     - Receives the cartridge Id.

Return Value:

    S_OK        - Success.

See Also:

    IWsbCollection::Find

--*/

    HRESULT GetName( [in, out, string] BSTR *pName );

/*++

Method Name:

    GetName

Method Description:

    Returns the user specified name for the cartridge.

    The Cartridge Name is generated by application that own the cartridge
    resource.  The name can be used by applications when referencing a Cartridge,
    instead of the cartridge Id.  Typically the name is used with in conjunction
    with a User Interface.

    The name can be any ASCII string, and usually has the format \path\name, but
    this syntax is not required.

Arguments:

    pName           - Receives the cartridge name.

Return Value:

    S_OK            - Success

See Also:

    IRmsCartridge::SetName
    IRmsCartridge::GetCartridgeId

--*/

    HRESULT SetName( [in, string] BSTR name );

/*++

Method Name:

    SetName

Method Description:

    Assigns a name to a cartridge object.

Arguments:

    name        - The name to assign the cartridge.

Return Value:

    S_OK            - Success
    E_OUTOFMEMORY   - Ran out of memory

See Also:

    IRmsCartridge::GetName

--*/
    HRESULT GetDescription( [in, out, string] BSTR *pDescription );

/*++

Method Name:

    GetDescription

Method Description:

    Returns the user specified description for the cartridge.

    The Cartridge description a scratch pad for information about the cartridge.  It
    may be specified by an application or through the user interface.

    The description can be any UNICODE string.

Arguments:

    pDescription        - Receives the cartridge description.

Return Value:

    S_OK                - Success

See Also:

    IRmsCartridge::SetDescription

--*/

    HRESULT SetDescription( [in, string] BSTR name );

/*++

Method Name:

    SetDescription

Method Description:

    Assigns a description to a cartridge object.

Arguments:

    description     - The description to assign the cartridge.

Return Value:

    S_OK            - Success
    E_OUTOFMEMORY   - Ran out of memory

See Also:

    IRmsCartridge::GetDescription

--*/

    HRESULT GetTagAndNumber( [in, out, string] BSTR *pTag, [out] LONG *pNumber );

/*++

Method Name:

    GetTagAndNumber

Method Description:

    Returns the cartridge tag (barcode) and number.

    The tag is a string representing bar code or SCSI volume-tag information
    for this Cartridge.

    The number is a value representing a bar code number or SCSI volume-tag
    sequence number.

Arguments:

    pTag        - Receives the external cartridge label.

    pNumber     - Receives the cartridge number.

Return Value:

    S_OK                - Success
    RMS_E_NOT_SUPPORTED - The operation attempted is not supported

See Also:

    IRmsCartridge::SetTagAndNumber
    IRmsCartridge::GetBarcode

--*/

    HRESULT SetTagAndNumber( [in, string] BSTR tag, [in] LONG number );

/*++

Method Name:

    SetTagAndNumber

Method Description:

    Assigns cartridge tag and number.

    These values cannot be set on systems that support external bar code scanners,
    or on systems that don't support SCSI volume-tag information, or equivalent.

    This method is used to define SCSI volume-tag information associated with
    a cartridge.  Ussually this is supported by optical libraries only.

Arguments:

    tag      - new external cartridge label.

    number   - new cartridge number.

Return Value:

    S_OK                - Success
    RMS_E_NOT_SUPPORTED - The operation attempted is not supported

See Also:

    IRmsCartridge::GetTagAndNumber
    IRmsCartridge::GetBarcode

--*/

    HRESULT GetBarcode( [in, out, string] BSTR *pBarcode );

/*++

Method Name:

    GetBarcode

Method Description:

    Returns the cartridge barcode, if supported.

Arguments:

    pBarcode            - Receives the external cartridge label.

Return Value:

    S_OK                - Success
    RMS_E_NOT_SUPPORTED - The operation attempted is not supported

See Also:

    IRmsCartridge::GetTagAndNumber

--*/
    // OnMediaIdentifier is used by DataMover
    HRESULT GetOnMediaIdentifier([in, out, size_is(*pSize)] BYTE *pIdentifier, [in, out] LONG *pSize, [out] LONG *pType);
    HRESULT SetOnMediaIdentifier([in, size_is(size)] BYTE *pIdentifier, [in] LONG size, [in] LONG type);

    // OnMediaLabel is used by DataMover
    HRESULT GetOnMediaLabel([in, out, string] BSTR *pLabel);
    HRESULT SetOnMediaLabel([in, string] BSTR label);

    HRESULT GetStatus( [out] LONG *pStatus );

/*++

Method Name:

    GetStatus

Method Description:

    Get cartridge status.

Arguments:

    pStatus  - pointer to current cartridge status.

Return Value:

    S_OK     - successful.

--*/

    HRESULT SetStatus( [in] LONG status );

/*++

Method Name:

    SetStatus

Method Description:

    Set cartridge status.

Arguments:

    status    - value for new cartridge status.

Return Value:

    S_OK     - successful.

--*/

    HRESULT GetType( [out] LONG *pType );

/*++

Method Name:

    GetType

Method Description:

    Get cartridge type.

Arguments:

    pType       - pointer to cartridge type.

Return Value:

    S_OK        - successful.

--*/

    HRESULT SetType( [in] LONG type );

/*++

Method Name:

    SetType

Method Description:

    Set cartridge type.

Arguments:

    type    - new cartridge type.

Return Value:

    S_OK    - successful.

--*/
    HRESULT GetBlockSize([out] LONG *pBlockSize);
    HRESULT SetBlockSize([in] LONG blockSize);

    HRESULT SetIsTwoSided( [in] BOOL flag );

/*++

Method Name:

    SetIsTwoSided

Method Description:

    Sets the cartridge two sided flag to the value specified.

Arguments:

    flag    - value to set two sided cartridge to.

Return Value:

    S_OK    - Success.

--*/

    HRESULT IsTwoSided( void );

/*++

Method Name:

    IsTwoSided

Method Description:

    Returns status of two sided flag.

Arguments:

    None.

Return Value:

    S_OK        - cartridge is two sided.

    S_FALSE     - cartridge is not two sided.

--*/

    HRESULT SetIsMounted( [in] BOOL flag );

/*++

Method Name:

    SetIsMounted

Method Description:

    Sets the cartridge mounted flag to the value specified.

Arguments:

    flag    - value to set mounted flag to.

Return Value:

    S_OK    - Success.

--*/

    HRESULT IsMounted( void );

/*++

Method Name:

    IsMounted

Method Description:

    Return status of two sided flag.

Arguments:

    None.

Return Value:

    S_OK        - cartridge is mounted in a drive.

    S_FALSE     - cartridge is not mounted in a drive.

--*/

    HRESULT SetIsAvailable( [in] BOOL flag );

/*++

Method Name:

    SetIsAvailable

Method Description:

    Sets the cartridge availability flag to the value specified.

Arguments:

    flag    - value to set availability flag to.

Return Value:

    S_OK    - Success.

--*/

    HRESULT IsAvailable( void );

/*++

Method Name:

    IsAvailable

Method Description:

    Return if media available

Arguments:

    None.

Return Value:

    S_OK        - cartridge is available.

    S_FALSE     - cartridge is not available.

--*/

    HRESULT GetHome( [out] LONG *pType, [out] GUID *pLibId, [out] GUID *pMediaSetId, [out] LONG *pPos, [out] LONG *pAlt1, [out] LONG *pAlt2, [out] LONG *pAlt3, [out] BOOL *pInvert );

/*++

Method Name:

    GetHome

Method Description:

    Get cartridge home address.

Arguments:

    pType           - pointer to cartridge type.
    pLibId          - pointer to library id.
    pMediaSetId     - pointer to media set id.
    pPos            - pointer to cartridge position.
    pAlt1           - application specific.
    pAlt2           - application specific.
    pAlt3           - application specific.
    pInvert         - pointer to invert flag.

Return Value:

    S_OK            - successful.

--*/

    HRESULT SetHome( [in] LONG type, [in] GUID libId, [in] GUID mediaSetId, [in] LONG pos, [in] LONG alt1, [in] LONG alt2, [in] LONG alt3, [in] BOOL invert );

/*++

Method Name:

    SetHome

Method Description:

    Set cartridge home address.

Arguments:

    Type            - new cartridge type.
    LibId           - new library id.
    MediaSetId      - new media set id.
    Pos             - new cartridge position.
    Alt1            - application specific.
    Alt2            - application specific.
    Alt3            - application specific.
    Invert          - new invert flag.

Return Value:

    S_OK            - successful.

--*/

    HRESULT GetLocation( [in, out, unique] LONG *pType, [in, out, unique] GUID *pLibId, [in, out, unique] GUID *pMediaSetId, [in, out, unique] LONG *pPos, [in, out, unique] LONG *pAlt1, [in, out, unique] LONG *pAlt2, [in, out, unique] LONG *pAlt3, [in, out, unique] BOOL *pInvert );

/*++

Method Name:

    GetLocation

Method Description:


Arguments:

    pType           - pointer to cartridge type.
    pLibId          - pointer to library id.
    pMediaSetId     - pointer to media set id.
    pPos            - pointer to cartridge position.
    pAlt1           - application specific.
    pAlt2           - application specific.
    pAlt3           - application specific.
    pInvert         - pointer to invert flag.

Return Value:

    S_OK            - Success

--*/

    HRESULT SetLocation( [in] LONG type, [in] GUID libId, [in] GUID mediaSetId, [in] LONG pos, [in] LONG alt1, [in] LONG alt2, [in] LONG alt3, [in] BOOL invert );

/*++

Method Name:

    SetLocation

Method Description:


Arguments:

    Type            - new cartridge type.
    LibId           - new library id.
    MediaSetId      - new media set id.
    Pos             - new cartridge position.
    Alt1            - application specific.
    Alt2            - application specific.
    Alt3            - application specific.
    Invert          - new invert flag.

Return Value:

    S_OK            - successful

--*/
    HRESULT GetDrive( [out] IRmsDrive **ptr );

/*++

Method Name:

    GetDrive

Method Description:

    Returns the drive in which the cartridge is mounted.

Arguments:

    ptr             - pointer to drive.

Return Value:

    S_OK            - Success.

--*/

    HRESULT SetDrive( [in] IRmsDrive *ptr );

/*++

Method Name:

    GetCartridge

Method Description:

    Get changer element cartridge

Arguments:

    ptr             - pointer to cartridge changer element

Return Value:

    S_OK            - successful

--*/

    HRESULT GetMailStop( [in, out, string] BSTR *pMailStop );

/*++

Method Name:

    GetMailStop

Method Description:

    Get mail stop.

Arguments:

    pMailStop    - pointer to mail stop.

Return Value:

    S_OK         - successful.

--*/

    HRESULT SetMailStop( [in, string] BSTR mailStop );

/*++

Method Name:

    SetMailStop

Method Description:

    Set mail stop.

Arguments:

    mailStop    - new mail stop value.

Return Value:

    S_OK    - successful

--*/

    HRESULT GetInfo( [out, size_is (RMS_INFO_SIZE)] UCHAR *pInfo, [out] SHORT *pSize );

/*++

Method Name:

    GetInfo

Method Description:

    Get cartridge information.

Arguments:

    ppInfo    - pointer to UCHAR string for cartridge information.

    pSize     - pointer to size of ppInfo.

Return Value:

    S_OK      - successful.

--*/

    HRESULT SetInfo( [in, size_is (size)] UCHAR *pInfo, [in] SHORT size );

/*++

Method Name:

    SetInfo

Method Description:

    Set cartridge information.

Arguments:

    pInfo        - new value of information.

    size         - new size of information.

Return Value:

    S_OK            - Success



--*/

    HRESULT GetOwnerClassId( [out] CLSID *pClassId );

/*++

Method Name:

    GetOwnerClassId

Method Description:

    Get cartridge owner class id.

Arguments:

    pClassId   - pointer to owner class id.

Return Value:

    S_OK       - successful.

--*/

    HRESULT SetOwnerClassId( [in] CLSID classId );

/*++

Method Name:

    SetOwnerClassId

Method Description:

    Set cartridge owner class id.

Arguments:

    classId    - new class id.

Return Value:

    S_OK       - successful.

--*/

    HRESULT GetPartitions( [out] IWsbIndexedCollection **ptr );

/*++

Method Name:

    GetPartitions

Method Description:

    Get cartridge partitions.

Arguments:

    ptr       - pointer to indexed collection of cartridges.

Return Value:

    S_OK      - successful.

--*/

    HRESULT GetVerifierClass( [out] CLSID *pClassId );

/*++

Method Name:

    GetVerifierClass

Method Description:

    Get cartridge verifier class.

Arguments:

    pClassId    - pointer to verifier class id.

Return Value:

    S_OK        - successful.

--*/

    HRESULT SetVerifierClass( [in] CLSID classId );

/*++

Method Name:

    SetVerifierClass

Method Description:

    Set cartridge verifier class.

Arguments:

    classId        - new cartridge verifier class

Return Value:

    S_OK           - successful.

--*/

    HRESULT GetPortalClass( [out] CLSID *pClassId );

/*++

Method Name:

    GetPortalClass

Method Description:

    Get portal class id.

Arguments:

    pClassId        - pointer to portal class id.

Return Value:

    S_OK            - successful.

--*/

    HRESULT SetPortalClass( [in] CLSID classId );

/*++

Method Name:

    SetPortalClass

Method Description:

    Set portal class id.

Arguments:

    classId         - new portal class id.

Return Value:

    S_OK            - successful.

--*/

    HRESULT Mount( [out]IRmsDrive **ppDrive, [in, defaultvalue(0)] DWORD options, [in, defaultvalue(0)] DWORD threadId);

/*++

Method Name:

    Mount

Method Description:

    Mount cartridge.

Arguments:

    ppDrive         - drive to mount

	options			- RMS flags. Currently use flag for mounting in blocking/non-blocking

Return Value:

    S_OK            - mount successful

    S_xxxxxxxxxxxx  - mount unsuccessful

--*/

    HRESULT Dismount( [in, defaultvalue(0)] DWORD options );

/*++

Method Name:

    Dismount

Method Description:

    Decrements the mount reference count for cartridge.

Arguments:

	options			- RMS flags. Currently use flag for dismounting immediately or not

Return Value:

    S_OK            - Success.


--*/

    HRESULT Home( [in, defaultvalue(0)] DWORD options );

/*++

Method Name:

    Home

Method Description:

    Moves the cartridge back to it's storage location.

Arguments:

	options			- RMS flags. Currently use flag for dismounting immediately or not

Return Value:

    S_OK            - Success.


--*/

    HRESULT CreateDataMover( [out] IDataMover **ptr );

/*++

Method Name:

    CreateDataMover

Method Description:

    Returns the data mover interface.
    
    This interface is used for moving data to and from the cartridge strorage medium.
    The interface is only defined when a cartridge is mounted in a drive.

Arguments:

    ptr                 - Receives the data mover interface.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT ReleaseDataMover( [in] IDataMover *ptr );

/*++

Method Name:

    ReleaseDataMover

Method Description:

    Relinquishes the data mover.
    
Arguments:

    ptr                         - DataMover interface to release.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT LoadDataCache( [out, size_is (*pSize)] BYTE *pCache, [in, out] ULONG *pSize, [out] ULONG *pUsed, [out] ULARGE_INTEGER *pStartPBA );

/*++

Method Name:

    LoadDataCache

Method Description:

    Returns the data cache that holds the data from the last non-block aligned read.

Arguments:

    pCache    - The data cache.
    pSize     - Size of the data cache.
    pUsed     - The number of valid bytes in the cache.
    pStartPBA - The corresponding start location of the cache.

Return Value:

    S_OK      - Success.
    E_FAIL    - The data cache is not valid.

--*/

    HRESULT SaveDataCache( [in, size_is (size)] BYTE *pCache, [in] ULONG size, [in] ULONG used, [in] ULARGE_INTEGER startPBA );

/*++

Method Name:

    SaveDataCache

Method Description:

    Saves away the data cache that holds the last non-block aligned read.

Arguments:

    pCache      - The data cache.
    size        - Size of the data cache.
    used        - The number of valid bytes in the cache.
    startPBA    - The corresponding start location of the cache.

Return Value:

    S_OK            - Success.
    E_OUTOFMEMORY   - Ran out of memory.

--*/

    HRESULT GetManagedBy([out] LONG *pManagedBy);

/*++

Method Name:

    GetManagedBy

Method Description:

    Returns the RmsMediaManager that controls the cartridge.

Arguments:

    pManagedBy  - Receives the RmsMediaManager that controls the cartridge.

Return Value:

    S_OK        - Success.

See Also:

    RmsMediaManager

--*/

    HRESULT SetManagedBy([in] LONG managedBy);

/*++

Method Name:

    SetManagedBy

Method Description:

    Saves the RmsMediaManager that controls the cartridge.

Arguments:

    managedBy   - The RmsMediaManager that controls the cartridge.

Return Value:

    S_OK        - Success.

See Also:

    RmsMediaManager

--*/

    HRESULT IsFixedBlockSize(void);

/*++

Method Name:

    IsFixedBlockSize

Method Description:

    Returns whether the media has a fixes or configurable block (sector) size.

Arguments:

    None

Return Value:

    S_OK        - Fixed block size
    S_FALSE     - None fixed block size


--*/

}; // IRmsCartridge


/*++

Interface Name:

    IRmsDrive

Interface Description:

    Drive Interface

--*/

[
    object,
    uuid(AA46E0CE-F1F8-11D2-A81E-00C04FB960ED),
    //dual,
    helpstring("IRmsDrive Interface"),
    pointer_default(unique)
]

interface IRmsDrive : IDispatch
{

    HRESULT GetMountReference( [out] LONG *pRefs );

/*++

Method Name:

    GetMountReference

Method Description:

    Returns the current mount reference count.  This represents
    the number of concurrent mount requests for the Cartridge mounted in
    a Drive.

Arguments:

    pRefs   - Receives the mount reference counter.

Return Value:

    S_OK            - Success.


--*/

    HRESULT ResetMountReference();

/*++

Method Name:

    ResetMountReference

Method Description:

    Resets the mount reference counter to zero.

Arguments:

    None.

Return Value:

    S_OK            - Success.

--*/

    HRESULT AddMountReference();

/*++

Method Name:

    AddMountReference

Method Description:

    Increments the mount reference counter.

Arguments:

    None.

Return Value:

    S_OK            - Success.

--*/

    HRESULT ReleaseMountReference([in, defaultvalue(0)] DWORD options);

/*++

Method Name

    ReleaseMountReference


Method Description:

    Decrements the mount reference counter.  When reference count reaches zero, the
    cartridge is unloaded.

Arguments:

	options			- RMS flags. Currently use flag for dismounting immediately or not
					(if flag is set - ismount even if there are outstanding mount references.)

Return Value:

    S_OK            - Success.

--*/

    HRESULT SelectForMount();

/*++

Method Name

    SelectForMount


Method Description:

    Selects the drive for mounting.

    If this method returns success, the drive is ready for a cartridge mount operation.

Arguments:

    None.

Return Value:

    S_OK                - Success.
    RMS_E_RESOURCE_BUSY - The resource required to complete the operation is busy.

--*/

    HRESULT CreateDataMover( [out] IDataMover **ptr );

/*++

Method Name:

    CreateDataMover

Method Description:

    Returns the data mover interface.
    
    This interface is used for moving data to and from the cartridge strorage medium.
    The interface is only defined when a cartridge is mounted in a drive.

Arguments:

    ptr                 - Receives the data mover interface.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT ReleaseDataMover( [in] IDataMover *ptr );

/*++

Method Name:

    ReleaseDataMover

Method Description:

    Relinquishes the data mover.

Arguments:

    ptr                         - DataMover interface to release.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/
    HRESULT Eject( void );

/*++

Method Name:

    Eject

Method Description:

    Ejects a unit of media from the drive.

Arguments:

    None.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT GetLargestFreeSpace( [out] LONGLONG *freeSpace, [out] LONGLONG *capacity );

/*++

Method Name:

    GetLargestFreeSpace

Method Description:

    Returns the free space and capacity of a drive, in bytes.  A unit of media must be preset.

Arguments:

    freeSpace   - Receives the freeSpace available on the drive.

    capacity    - Receives the total capacity of the drive.

Return Value:

    S_OK                        - Success.
    RMS_E_RESOURCE_UNAVAILABLE  - The resource required to complete the operation is not available.

--*/

    HRESULT UnloadNow(void);

/*++

Method Name:

    UnloadNow

Method Description:

    Signals a drive that is waiting to unload to unload immediately.

Arguments:

    None.

Return Value:

    S_OK                        - Success.

--*/

};


/*++

Interface Name:

    IRmsStorageSlot

Interface Description:

    Storage Slot Interface

--*/

[
    object,
    uuid(FE37FB06-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsStorageSlot Interface"),
    pointer_default(unique)
]

interface IRmsStorageSlot : IDispatch
{
    HRESULT SetIsInMagazine( [in] BOOL flag );

/*++

Method Name:

    SetIsInMagazine

Method Description:

    Set 'is in magazine' flag to value.

Arguments:

    flag        - value to set 'is in magazine' to

Return Value:

    S_OK        - successful

--*/

    HRESULT IsInMagazine( void );

/*++

Method Name:

    IsInMagazine

Method Description:

    Return status of in magazine flag.

Arguments:

    None.

Return Value:

    S_OK        - is in magazine flag is true

    S_FALSE     - is in magazine flag is false


--*/

    HRESULT GetMagazineAndCell( [out] LONG *pMag, [out] LONG *pCell );

/*++

Method Name:

    GetMagazineAndCell

Method Description:

    Get magazine and cell information.

Arguments:

    pMag        - pointer to magazine information

    pCell       - pointer to cell information

Return Value:

    S_OK        - successful

--*/

    HRESULT SetMagazineAndCell( [in] LONG mag, [in] LONG cell );

/*++

Method Name:

    SetMagazineAndCell

Method Description:

    Set magazine and cell information.

Arguments:

    mag         - new value for magazine information

    cell        - new value for cell information


Return Value:

    S_OK        - successful

--*/

};


/*++

Interface Name:

    IRmsMediumChanger

Interface Description:

    Medium Changer Interface

--*/

[
    object,
    uuid(FE37FB07-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsMediumChanger Interface"),
    pointer_default(unique)
]

interface IRmsMediumChanger : IDispatch
{
    HRESULT Initialize( void );
    HRESULT AcquireDevice( void );
    HRESULT ReleaseDevice( void );

    HRESULT GetHome( [out] LONG *pType, [out] LONG *pPos, [out] BOOL *pInvert );

/*++

Method Name:

    GetHome

Method Description:

    Get medium changer 'home' values.

Arguments:

    pType           - pointer to medium changer home type.

    pPos            - pointer to medium changer home position.

    pInvert         - pointer to medium changer home invert flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetHome( [in] LONG type, [in] LONG pos, [in] BOOL invert );

/*++

Method Name:

    SetHome

Method Description:

    Set medium changer 'home' values.

Arguments:

    type            - new value of medium changer home type.

    pos             - new value of medium changer home position.

    invert          - new value of medium changer home invert flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetAutomatic( [in] BOOL flag );

/*++

Method Name:

    SetAutomatic

Method Description:

    Set medium changer automatic flag.

Arguments:

    flag            - new value for automatic changer flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT IsAutomatic( void );

/*++

Method Name:

    IsAutomatic

Method Description:

    Get value of medium changer automatic flag.

Arguments:

    None.

Return Value:

    S_OK            - medium changer is automatic.

    S_FALSE         - medium changer is not automatic.

--*/

    HRESULT SetCanRotate( [in] BOOL flag );

/*++

Method Name:

    SetCanRotate

Method Description:

    Set value for medium changer can rotate flag

Arguments:

    flag            - value for can rotate flag

Return Value:

    S_OK            - successful

--*/

    HRESULT CanRotate( void );

/*++

Method Name:

    CanRotate

Method Description:

    Get value of medium changer can rotate flag.

Arguments:

    None.

Return Value:

    S_OK            - medium changer can rotate.

    S_FALSE         - medium changer cannot rotate.

--*/

    HRESULT GetOperation( [in, out, string] BSTR *pOperation );

/*++

Method Name:

    GetOperation

Method Description:

    Get current operation on medium changer.

Arguments:

    pOperation      - pointer to current operation.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetOperation( [in, string] BSTR pOperation );

/*++

Method Name:

    SetOperation

Method Description:

    Set current medium changer operation.

Arguments:

    pOperation      - new value of current operation

Return Value:

    S_OK            - successful

--*/

    HRESULT GetPercentComplete( [out] BYTE *pPercent );

/*++

Method Name:

    GetPercentComplete

Method Description:

    Get current percent complete

Arguments:

    pPercent        - pointer to percent complete.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetPercentComplete( [in] BYTE percent );

/*++

Method Name:

    SetPercentComplete

Method Description:

    Set percent complete value.

Arguments:

    percent         - new percent complete value

Return Value:

    S_OK            - successful

--*/

    HRESULT TestReady( void );

/*++

Method Name:

    TestReady

Method Description:

    Test cartridge ready.

Arguments:

    None

Return Value:

    S_OK            - cartridge is ready

    S_FALSE         - cartridge is not ready

--*/

    HRESULT ImportCartridge( [in] IRmsCartridge **pCart );

/*++

Method Name:

    ImportCartridge

Method Description:

    Import a cartridge.

Arguments:

    pCart           - pointer to cartridge data.

Return Value:

    S_OK            - successful

--*/

    HRESULT ExportCartridge( [in] IRmsCartridge **pCart );

/*++

Method Name:

    ExportCartridge

Method Description:

    Export a cartridge.

Arguments:

    pCart           - pointer to cartridge data.

Return Value:

    S_OK            - successful

--*/

    HRESULT MoveCartridge( [in] IRmsCartridge *pSrcCart, IUnknown *pDestElmt );

/*++

Method Name:

    MoveCartridge

Method Description:

    Moves a cartridge to the specified changer element.

Arguments:

    pSrcCart            - The cartridge to move.
    pDestElmt           - The changer element into which the cartridge is to be moved.  This
                          object support IRmsChangerElement.

Return Value:

    S_OK                - Success.

--*/

    HRESULT HomeCartridge( [in] IRmsCartridge *pCart );

/*++

Method Name:

    HomeCartridge

Method Description:

    Moves a cartridge to a storage location.

Arguments:

    pCart               - The cartridge to send home.

Return Value:

    S_OK                - Success.

--*/

};


/*++

Interface Name:

    IRmsMoveMedia

Interface Description:

    Robotic Mechanism interface.

--*/

[
    object,
    uuid(FE37FB18-3729-11D0-8CF4-00A0C9190459),
    helpstring("IRmsMoveMedia Interface"),
    pointer_default(unique)
]

interface IRmsMoveMedia : IUnknown
{
    HRESULT GetParameters( [in, out] DWORD *pSize, [out, size_is(*pSize)] PGET_CHANGER_PARAMETERS pParms );

/*++

Method Name:

    This method returns information about features supported by the medium changer device.

    The method calls directly through to the system driver that controls the changer device.

Arguments:

    pSize       - On input this parameter is the size, in bytes, of the buffer pointed to by pParms.
                  If the size is too small, this parameter recieves the required size.

    pParms      - Recieves the returned data.

Return Value:

    S_OK        - Success.

--*/

    HRESULT GetProductData( [in, out] DWORD *pSize, [out, size_is(*pSize)] PCHANGER_PRODUCT_DATA pData );
    HRESULT RezeroUnit( void );
    HRESULT InitializeElementStatus( [in] CHANGER_ELEMENT_LIST elementList, [in] BOOL barCodeScan );
    HRESULT Status( void );
    HRESULT SetAccess( [in] CHANGER_ELEMENT element, [in] DWORD control );
    HRESULT GetElementStatus( [in] CHANGER_ELEMENT_LIST elementList,
        [in] BOOL volumeTagInfo,
        [in, out] DWORD *pSize,
        [out, size_is(*pSize) ] PREAD_ELEMENT_ADDRESS_INFO  pElementInformation );

    HRESULT ExchangeMedium( [in] CHANGER_ELEMENT source, [in] CHANGER_ELEMENT destination1,
        [in] CHANGER_ELEMENT destination2, [in] BOOL flip1, [in] BOOL flip2 );
    HRESULT MoveMedium( [in] CHANGER_ELEMENT source, [in] CHANGER_ELEMENT destination, [in] BOOL flip );
    HRESULT Position( [in] CHANGER_ELEMENT destination, [in] BOOL flip );
//    HRESULT GetDisplay( PCHANGER_DISPLAY pDisplay );
//    HRESULT SetDisplay( PCHANGER_DISPLAY pDisplay );
    HRESULT QueryVolumeTag( [in] CHANGER_ELEMENT startingElement, [in] DWORD actionCode,
        [in] UCHAR *pVolumeIDTemplate, [in, out] DWORD *pNumberOfElementsReturned,
        [out, size_is(*pNumberOfElementsReturned)] PREAD_ELEMENT_ADDRESS_INFO  pElementInformation );
};


/*++

Interface Name:

    IRmsIEPort

Interface Description:

    IE Port Interface

--*/

[
    object,
    uuid(FE37FB08-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsIEPort Interface"),
    pointer_default(unique)
]
interface IRmsIEPort : IDispatch
{
    HRESULT GetDescription( [in, out, string] BSTR *pDesc );

/*++

Method Name:

    GetDescription

Method Description:

    Get description.

Arguments:

    pDesc           - pointer to returned description.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetDescription( [in, string] BSTR desc );

/*++

Method Name:

    SetDescription

Method Description:

    Set description.

Arguments:

    desc            -  new description value.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetIsImport( [in] BOOL flag );

/*++

Method Name:

    SetIsImport

Method Description:

    Set is import flag.

Arguments:

    flag            -  new value of is import flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT IsImport( void );

/*++

Method Name:

    IsImport

Method Description:

    Get value of is import flag.

Arguments:

    None.

Return Value:

    S_OK            - the import is true.

    S_FALSE         - the import is false.

--*/

    HRESULT SetIsExport( [in] BOOL flag );

/*++

Method Name:

    SetIsExport

Method Description:

    Set is export flag.

Arguments:

    flag            -  new value of is export flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT IsExport( void );

/*++

Method Name:

    IsExport

Method Description:

    Get value of is export flag.

Arguments:

    None.

Return Value:

    S_OK            - export is true.

    S_FALSE         - export is false.

--*/

    HRESULT GetWaitTime( [out] LONG *pTime );

/*++

Method Name:

    GetWaitTime

Method Description:

    Get wait time value.

Arguments:

    pTime           - pointer to returned wait time.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetWaitTime( [in] LONG time );

/*++

Method Name:

    SetWaitTime

Method Description:

    Set wait time value.

Arguments:

    time            - new wait time value.

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsMediaSet

Interface Description:

    Media Set Interface

--*/

[
    object,
    uuid(BC9E7125-0976-4773-9E43-72047FED478C),
    //dual,
    helpstring("IRmsMediaSet Interface"),
    pointer_default(unique)
]
interface IRmsMediaSet : IDispatch
{
    HRESULT GetMediaSetId( [out] GUID *pMediaSetId );

/*++

Method Name:

    GetMediaSetId

Method Description:

    Get media set ID.

Arguments:

    pMediaSetId         - pointer to returned media set Id.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetName( [in, out, string] BSTR *pName );

/*++

Method Name:

    GetName

Method Description:

    Get media set name.

Arguments:

    pName           - pointer to returned media set name.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetName( [in, string] BSTR name );

/*++

Method Name:

    SetName

Method Description:

    Set media set name.

Arguments:

    name            - new media set name.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetMediaSupported( [out] LONG *pType );

/*++

Method Name:

    GetMediaSupported

Method Description:

    Get supported media type.

Arguments:

    pType           - pointer to supported media type.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetMediaSupported( [in] LONG type );

/*++

Method Name:

    SetMediaSupported

Method Description:

    Set supported media type.

Arguments:

    type            - new supported media type.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetInfo( [out, size_is (RMS_INFO_SIZE)] UCHAR *pInfo, [out] SHORT *pSize );

/*++

Method Name:

    GetInfo

Method Description:

    Get supported media information.

Arguments:

    ppInfo          - pointer to string representing supported media information.

    pSize           - pointer to size of supported media information string.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetInfo( [in, size_is (size)] UCHAR *pInfo, [in] SHORT size );

/*++

Method Name:

    SetInfo

Method Description:

    Set supported media information.

Arguments:

    pInfo           - new string representing supported media information.

    Size            - new size of supported media information string.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetOwnerClassId( [out] CLSID *pClassId );

/*++

Method Name:

    GetOwnerClassId

Method Description:

    Get owner class id.

Arguments:

    pClassId        - pointer to current owner class id.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetOwnerClassId( [in] CLSID classId );

/*++

Method Name:

    SetOwnerClassId

Method Description:

    Set owner class id.

Arguments:

    classId         - new value of owner class id.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetMediaSetType( [out] LONG *pType );

/*++

Method Name:

    GetMediaSetType

Method Description:

    Get Media Set type.

Arguments:

    pType           - pointer to media set type.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetMediaSetType( [in] LONG type );

/*++

Method Name:

    SetMediaSetType

Method Description:

    Set Media Set type.

Arguments:

    type            - new value of media set type.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetMaxCartridges( [out] LONG *pNum );

/*++

Method Name:

    GetMaxCartridges

Method Description:

    Get maximum number of cartridges in library.

Arguments:

    pNum            - pointer to returned maximum number of cartridges

Return Value:

    S_OK            - successful

--*/

    HRESULT SetMaxCartridges( [in] LONG num );

/*++

Method Name:

    SetMaxCartridges

Method Description:

    Set maximum number of cartridges in library.

Arguments:

    num             - new value for maximum number of cartridges

Return Value:

    S_OK            - successful

--*/

    HRESULT GetOccupancy( [out] LONG *pNum );

/*++

Method Name:

    GetOccupancy

Method Description:

    Get current number of cartridges in library.

Arguments:

    pNum            - pointer to current number of cartridges in library

Return Value:

    S_OK            - successful

--*/

    HRESULT SetOccupancy( [in] LONG num );

/*++

Method Name:

    SetOccupancy

Method Description:

    Set current number of cartridges in library.

Arguments:

    num             - new value for current number of cartridges in library

Return Value:

    S_OK            - successful

--*/

    HRESULT IsMediaCopySupported(void);

/*++

Method Name:

    GetIsMediaCopySupported

Method Description:

    Indicates if media copies can be performed on media contained in the media set.

Arguments:

    None.

Return Value:

    S_OK            - Media copies are supported.
    S_FALSE         - Media copies are not supported for media in the media set.

--*/

    HRESULT SetIsMediaCopySupported( [in] BOOL flag );

/*++

Method Name:

    SetIsMediaCopySupported

Method Description:

    Sets flag that indicates if media copies can be performed on the media in the MediaSet.

Arguments:

    flag            - New value for the media copy supported flag.

Return Value:

    S_OK            - Success.

--*/

    HRESULT Allocate([in] REFGUID prevSideId, [in, out] LONGLONG *pFreeSpace, [in, string] BSTR displayName, [in] DWORD options, [out] IRmsCartridge **ppCart);

/*++

Routine Description:

    This method finds a single unit of scratch media that meets the selection criteria.

Arguments:

	prevSideId			- An id of an allocated logical media - should be given for allocating the second side
						  Should be set to null value for allocating a new piece of media.
    pFreeSpace          - As input, specifies the required free space for media allocation.
                          As output, receives the free space of the media allocated.
    displayName         - The name given to the allocated media.
    options             - Allocation options, reserved for future use.
    ppCart              - Receives the scratch cartridge found.

Return Values:

    S_OK                        - Success.
    E_RMS_SCRATCH_NOT_FOUND     - A unit of scratch media was not found.

--*/

    HRESULT Deallocate([in] IRmsCartridge *pCart);

/*++

Routine Description:

    This method returns media to scratch status.

Arguments:

    pCart   - The media to be deallocated.

Return Values:

    S_OK    - Success.

--*/

};


/*++

Interface Name:

    IRmsRequest

Interface Description:

    Request Interface

--*/

[
    object,
    uuid(FE37FB10-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsRequest Interface"),
    pointer_default(unique)
]
interface IRmsRequest : IDispatch
{

    HRESULT GetRequestNo( [out] LONG *pRequestNo );

/*++

Method Name:

    GetRequestNo

Method Description:

    Get a request number

Arguments:

    pRequestNo      - pointer to returned request number

Return Value:

    S_OK            - successful

--*/

    HRESULT GetRequestDescription( [in, out, string] BSTR *pDesc );

/*++

Method Name:

    GetRequestDescription

Method Description:

    Get request description.

Arguments:

    pDesc           - pointer to returned request description

Return Value:

    S_OK            - successful

--*/

    HRESULT SetRequestDescription( [in, string] BSTR desc );

/*++

Method Name:

    SetRequestDescription

Method Description:

    Set request description.

Arguments:

    desc            - new value for request description

Return Value:

    S_OK            - successful

--*/

    HRESULT SetIsDone( [in] BOOL flag );

/*++

Method Name:

    SetIsDone

Method Description:

    Set is done flag.

Arguments:

    flag            - new bool  value for 'is done' flag

Return Value:

    S_OK            - successful

--*/

    HRESULT IsDone( void );

/*++

Method Name:

    IsDone

Method Description:

    Check 'is done flag.

Arguments:

    None.

Return Value:

    S_OK            - isdone is true.

    S_FALSE         - isdone is false.

--*/

    HRESULT GetOperation( [in, out, string] BSTR *pOperation );

/*++

Method Name:

    GetOperation

Method Description:

    Get current operation.

Arguments:

    pOperation      - pointer to current operation

Return Value:

    S_OK            - successful

--*/

    HRESULT SetOperation( [in, string] BSTR operation );

/*++

Method Name:

    SetOperation

Method Description:

    Set current operation.

Arguments:

    operation       - new value of current operation

Return Value:

    S_OK            - successful

--*/

    HRESULT GetPercentComplete( [out] BYTE *pPercent );

/*++

Method Name:

    GetPercentComplete

Method Description:

    Get percent complete value.

Arguments:

    pPercent        - pointer to value of percent complete

Return Value:

    S_OK            - successful

--*/

    HRESULT SetPercentComplete( [in] BYTE percent );

/*++

Method Name:

    SetPercentComplete

Method Description:

    Set percent complete value.

Arguments:

    percent         - new value of percent complete

Return Value:

    S_OK            - successful

--*/

//      HRESULT GetStartTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetStartTimestamp

Method Description:

    Get start of operation time stamp.

Arguments:

    pDate           - pointer to start time stamp

Return Value:

    S_OK            - successful

--*/

//      HRESULT GetStopTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetStopTimestamp

Method Description:

    Get stop operation time stamp.

Arguments:

    pDate           - pointer to stop time stamp

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsPartition

Interface Description:

    Partition Interface

--*/

[
    object,
    uuid(FE37FB11-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsPartition Interface"),
    pointer_default(unique)
]
interface IRmsPartition : IDispatch
{
    HRESULT GetPartNo( [out] LONG *pPartNo );

/*++

Method Name:

    GetPartNo

Method Description:

    Get partition number.

Arguments:

    pPartNo         - pointer to value of partition number

Return Value:

    S_OK            - successful

--*/

    HRESULT GetAttributes( [out] LONG *pAttr );

/*++

Method Name:

    GetAttributes

Method Description:

    Get partition attributes.

Arguments:

    pAttr           - pointer to partition attributes

Return Value:

    S_OK            - successful

--*/

    HRESULT SetAttributes( [in] LONG attr );

/*++

Method Name:

    SetAttributes

Method Description:

    Set partition attributes.

Arguments:

    attr            - new value for partition attributes

Return Value:

    S_OK            - successful

--*/

    HRESULT GetIdentifier( [out, size_is (RMS_INFO_SIZE)] UCHAR *pIdent, [out] SHORT *pSize );

/*++

Method Name:

    GetIdentifier

Method Description:

    Get partition identifier.

Arguments:

    ppIdent         - pointer to string for partition identifier

    pSize           - pointer to size of partition identifier string

Return Value:

    S_OK            - successful

--*/

    HRESULT SetIdentifier( [in, size_is (size)] UCHAR *pIdent, [in] SHORT size );

/*++

Method Name:

    SetIdentifier

Method Description:

    Set partition identifier.

Arguments:

    pIdent          - new string value for partition identifier

    size            - new size of partition identifier string

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetStorageInfo( [out] IRmsStorageInfo **ptr );

/*++

Method Name:

    GetStorageInfo

Method Description:

    Get partition storage information.

Arguments:

    ptr             - pointer to partition storage information

Return Value:

    S_OK            - successful

--*/

    HRESULT VerifyIdentifier( void );

/*++

Method Name:

    VerifyIdentifier

Method Description:

    Verify partition identifier.

Arguments:

    None

Return Value:

    S_OK            - successful

--*/

    HRESULT ReadOnMediaId( [out, size_is (RMS_INFO_SIZE)] UCHAR *pId, [out] LONG *pSize );

/*++

Method Name:

    ReadOnMediaId

Method Description:

    Get the read-on-media identifier.

Arguments:

    ppId            - pointer to string for read-on-media identifier

    pSize           - pointer to size of read-on-media identifier string

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsComObject

Interface Description:

    Com Object Interface

--*/

[
    object,
    uuid(FE37FB12-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsComObject Interface"),
    pointer_default(unique)
]
interface IRmsComObject : IDispatch
{
    HRESULT GetObjectId( [out] GUID *pObjectId );

/*++

Method Name:

    GetObjectId

Method Description:

    Returns the GUID assigned to the object.

    The object ID is an internally designated GUID generated by RMS when the
    object is first created.  The Id can be used to reference the object
    through standard collection or database enumeration methods.

Arguments:

    pObjectId   - Receives the object Id.

Return Value:

    S_OK        - Success.

See Also:

    IWsbCollection::Find

--*/

    HRESULT SetObjectId( [in] GUID objectId );

/*++

Method Name:

    SetObjectId

Method Description:

    Sets the GUID assigned to this object.

    The object ID is an internally designated GUID generated by RMS when the
    object is first created.  The Id can be used to reference the object
    through standard collection or database enumeration methods.

Arguments:

    objectId    - The new value for object Id.

Return Value:

    S_OK        - Success.

--*/

    HRESULT GetObjectType( [out] LONG *pType );

/*++

Method Name:

    GetObjectType

Method Description:

    Returns the object type.

Arguments:

    pType           - Receives the object type value.

Return Value:

    S_OK            - Success.

--*/

    HRESULT SetObjectType( [in] LONG type );

/*++

Method Name:

    SetObjectType

Method Description:

    Defines the object type.

Arguments:

    type            - Object type.

Return Value:

    S_OK            - Success.

--*/

    HRESULT IsEnabled( void );
    HRESULT Enable( void );
    HRESULT Disable( [in] HRESULT reason );

    HRESULT GetState( [out] LONG *pState );

/*++

Method Name:

    GetState

Method Description:

    Get current state.

Arguments:

    pState          - pointer to current state

Return Value:

    S_OK            - successful

--*/

    HRESULT SetState( [in] LONG state );

/*++

Method Name:

    SetState

Method Description:

    Set state.

Arguments:

    state           - new value of state

Return Value:

    S_OK            - successful

--*/

    HRESULT GetStatusCode( [out] HRESULT *pResult );

/*++

Method Name:

    GetStatusCode

Method Description:

    Returns the object status value.

Arguments:

    pResult         - Receives the value of the object's status code.

Return Value:

    S_OK            - Success.

--*/

    HRESULT SetStatusCode( [in] HRESULT result );

/*++

Method Name:

    SetStatusCode

Method Description:

    Sets object status.

Arguments:

    result          - New status code for object.

Return Value:

    S_OK            - Success.

--*/

    HRESULT GetName( [in, out, string] BSTR *pName);
    HRESULT SetName( [in, string] BSTR name);

    HRESULT GetDescription( [in, out, string] BSTR *pDesc);
    HRESULT SetDescription( [in, string] BSTR desc);

//  HRESULT GetPermissions( [out] SECURITY_DESCRIPTOR *lpPermit  );

/*++

Method Name:

    GetPermissions

Method Description:

    Get the current value of permissions.

Arguments:

    lpPermit        - pointer to security permissions

Return Value:

    S_OK            - successful

--*/

//  HRESULT SetPermissions( [in] SECURITY_DESCRIPTOR permit  );

/*++

Method Name:

    SetPermissions

Method Description:

    Set the value of permissions.

Arguments:

    permit          - new value of security permissions

Return Value:

    S_OK            - successful

--*/

    HRESULT GetFindBy( [out] LONG *pFindBy );

/*++

Method Name:

    GetFindBy

Method Description:

    Get current findby.

Arguments:

    pFindBy          - pointer to current findby

Return Value:

    S_OK            - successful

--*/

    HRESULT SetFindBy( [in] LONG findby );

/*++

Method Name:

    SetFindBy

Method Description:

    Set findby.

Arguments:

    findby           - new value of findby

Return Value:

    S_OK            - successful

--*/


};


/*++

Interface Name:

    IRmsChangerElement

Interface Description:

    Changer Element Interface

--*/

[
    object,
    uuid(FE37FB13-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsChangerElement Interface"),
    pointer_default(unique)
]
interface IRmsChangerElement : IDispatch
{
    HRESULT GetElementNo( [out] LONG *pElementNo );

/*++

Method Name:

    GetElementNo

Method Description:

    Returns the changer element number.

    This is a positive integer from zero to N-1, where N is the total
    number of elements of a give type.

Arguments:

    pElementNo      - Receives the changer element number.

Return Value:

    S_OK        - successful

--*/

    HRESULT GetLocation( [in, out, unique] LONG *pType, [in, out, unique] GUID *pLibId, [in, out, unique] GUID *pMediaSetId, [in, out, unique] LONG *pPos, [in, out, unique] LONG *pAlt1, [in, out, unique] LONG *pAlt2, [in, out, unique] LONG *pAlt3, [in, out, unique] BOOL *pInvert );

/*++

Method Name:

    GetLocation

Method Description:

    Get changer element location.

Arguments:

    pType           - pointer to changer type.
    pLibId          - pointer to library id.
    pMediaSetId     - pointer to media set id.
    pPos            - pointer to position.
    pAlt1           - pointer to
    pAlt2           - pointer to
    pAlt3           - pointer to
    pInvert         - pointer to invert flag.

Return Value:

    S_OK            - successful

--*/

    HRESULT SetLocation( [in] LONG type, [in] GUID libId, [in] GUID mediaSetId, [in] LONG pos, [in] LONG alt1, [in] LONG alt2, [in] LONG alt3, [in] BOOL invert );

/*++

Method Name:

    SetLocation

Method Description:

    Set changer element location.

Arguments:

    Type            - new value of changer type.
    LibId           - new value of library id.
    MediaSetId      - new value of media set id.
    Pos             - new value of position.
    Alt1            - new value of
    Alt2            - new value of
    Alt3            - new value of
    Invert          - new value of invert flag.


Return Value:

    S_OK            - successful.

--*/

    HRESULT GetMediaSupported( [out] LONG *pType );

/*++

Method Name:

    GetMediaSupported

Method Description:

    Get changer element media supported.

Arguments:

    pType           - pointer to media supported.

Return Value:

    S_OK            - successful.

--*/

    HRESULT SetMediaSupported( [in] LONG type );

/*++

Method Name:

    SetMediaSupported

Method Description:

    Set changer element media supported.

Arguments:

    type            - new media supported type.

Return Value:

    S_OK            - successful.

--*/

    HRESULT SetIsStorage( [in] BOOL flag );

/*++

Method Name:

    SetIsStorage

Method Description:

    Set changer element storage type flag.

Arguments:

    flag            - new changer element storage flag value.

Return Value:

   S_OK             - successful.

--*/

    HRESULT IsStorage( void );

/*++

Method Name:

    IsStorage

Method Description:

    Check value of changer element storage flag.

Arguments:

    None.

Return Value:

    S_OK            - changer element is storage.

    S_FALSE         - changer element is not storage.

--*/

    HRESULT SetIsOccupied( [in] BOOL flag );

/*++

Method Name:

    SetIsOccupied

Method Description:

    Set changer element is occupied flag.

Arguments:

    flag            - new occupied flag value.

Return Value:

    S_OK            - successful.

--*/

    HRESULT IsOccupied( void );

/*++

Method Name:

    IsOccupied

Method Description:

   Check for changer element occupied.

Arguments:

    None.

Return Value:

    S_OK            - Changer element is occupied.

    S_FALSE         - Changer element is not occupied.

--*/

    HRESULT GetCartridge( [out] IRmsCartridge **ptr );

/*++

Method Name:

    GetCartridge

Method Description:

    Get changer element cartridge

Arguments:

    ptr             - pointer to cartridge changer element

Return Value:

    S_OK            - successful

--*/

    HRESULT SetCartridge( [in] IRmsCartridge *ptr );

/*++

Method Name:

    GetCartridge

Method Description:

    Get changer element cartridge

Arguments:

    ptr             - pointer to cartridge changer element

Return Value:

    S_OK            - successful

--*/

    HRESULT GetOwnerClassId( [out] CLSID *pClassId );

/*++

Method Name:

    GetOwnerClassId

Method Description:

    Get changer element owner class id.

Arguments:

    pClassId        - pointer to returned class id.

Return Value:

    S_OK            - successful.

--*/

    HRESULT SetOwnerClassId( [in] CLSID classId );

/*++

Method Name:

    SetOwnerClassId

Method Description:

    Set changer element owner class id.

Arguments:

    classId         - new changer element owner class id value.

Return Value:

    S_OK            - successful

--*/

    HRESULT GetAccessCounters( [out] LONG *pGets, [out] LONG *pPuts );

/*++

Method Name:

    GetAccessCounters

Method Description:

    Get changer element access counters.

Arguments:

    pGets           - pointer to number of gets

    pPuts           - pointer to number of puts

Return Value:

    S_OK            - successful

--*/

    HRESULT ResetAccessCounters( void );

/*++

Method Name:

    ResetAccessCounters

Method Description:

    Reset changer element access counters

Arguments:

    None.

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetResetCounterTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetResetCounterTimestamp

Method Description:

    Get timestamp for last time changer element counters were reset.

Arguments:

    pDate           - pointer to date when counters were last reset

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetLastGetTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetLastGetTimestamp

Method Description:

    Get timestamp for last changer element get.

Arguments:

    pDate           - pointer to date when last get was executed

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetLastPutTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetLastPutTimestamp

Method Description:

    Get timestamp for last changer element put.

Arguments:

    pDate           - pointer to date when last put was executed

Return Value:

    S_OK            - successful

--*/

    HRESULT GetCoordinates( [out] LONG *pX1, [out] LONG *pX2, [out] LONG *pX3 );

/*++

Method Name:

    GetCoordinates

Method Description:

    Get changer element coordinates.

Arguments:

    pX1             - pointer to coordinate X1
    pX2             - pointer to coordinate X2
    pX3             - pointer to coordinate X3

Return Value:

    S_OK            - successful

--*/

    HRESULT SetCoordinates( [in] LONG x1, [in] LONG x2, [in] LONG x3 );

/*++

Method Name:

    SetCoordinates

Method Description:

    Get changer element coordinates.

Arguments:

    pX1             - pointer to coordinate X1
    pX2             - pointer to coordinate X2
    pX3             - pointer to coordinate X3

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsDevice

Interface Description:

    Device Interface

--*/

[
    object,
    uuid(FE37FB14-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsDevice Interface"),
    pointer_default(unique)
]
interface IRmsDevice : IDispatch
{

    HRESULT GetDeviceName( [in, out, string] BSTR *pName );

/*++

Method Name:

    GetDeviceName

Method Description:

    Get device name.

Arguments:

    pName           - pointer to device name

Return Value:

    S_OK            - successful

--*/

    HRESULT SetDeviceName( [in, string] BSTR name );

/*++

Method Name:

    SetDeviceName

Method Description:

    Set device name.

Arguments:

    name            - new value for device name

Return Value:

    S_OK            - successful

--*/
    HRESULT GetDeviceType( [out] LONG *pType );

/*++

Method Name:

    GetDeviceType

Method Description:

    Get device type.

Arguments:

    pType           - pointer to device type

Return Value:

    S_OK            - Success.

--*/

    HRESULT SetDeviceType( [in] LONG type );

/*++

Method Name:

    SetDeviceType

Method Description:

    Set device Type.

Arguments:

    type            - new value for device type

Return Value:

    S_OK            - Success.

--*/

    HRESULT GetDeviceInfo( [out, size_is (RMS_INFO_SIZE)] UCHAR *pId, [out] SHORT *pSize );

/*++

Method Name:

    GetDeviceInfo

Method Description:

    Get device information.

Arguments:

    ppId            - pointer to string for device information

    pSize           - pointer to size of device information string

Return Value:

    S_OK            - successful

--*/

    HRESULT SetDeviceInfo( [in, size_is (size)] UCHAR *pId, [in] SHORT size );

/*++

Method Name:

    SetDeviceInfo

Method Description:

    Set device information.

Arguments:

    pId             - new value for device information string

    size            - new value for size of device information string

Return Value:

    S_OK            - successful

--*/

    HRESULT GetDeviceAddress( [out] BYTE *pPort, [out] BYTE *pBus, [out] BYTE *pId, [out] BYTE *pLun );

/*++

Method Name:

    GetDeviceAddress

Method Description:

    Get device address information.

Arguments:

    pPort           - pointer to port number

    pBus            - pointer to bus address

    pId             - pointer to ID

    pLun            - pointer to logical unit number

Return Value:

    S_OK            - successful

--*/

    HRESULT SetDeviceAddress( [in] BYTE port, [in] BYTE bus, [in] BYTE id, [in] BYTE lun );

/*++

Method Name:

    SetDeviceAddress

Method Description:

    Set device address information.

Arguments:

    port            - new value for port number

    bus             - new value for bus address

    id              - new value for ID

    lun             - new value for logical unit number

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsStorageInfo

Interface Description:

    Storage Information Interface

--*/

[
    object,
    uuid(FE37FB15-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsStorageInfo Interface"),
    pointer_default(unique)
]
interface IRmsStorageInfo : IDispatch
{
    HRESULT GetMountCounters( [out] LONG *pReads, [out] LONG *pWrites );

/*++

Method Name:

    GetMountCounters

Method Description:

    Get current value for mount counters.

Arguments:

    pReads          - pointer to number of reads

    pWrites         - pointer to number of writes

Return Value:

    S_OK            - successful

--*/

    HRESULT GetBytesRead2( [out] LONG *pReadHi, [out] LONG *pReadLo );

/*++

Method Name:

    GetBytesRead2

Method Description:

    Get upper and lower parts of LONGLONG counter for bytes read.

Arguments:

    pReadHi         - pointer to high LONG of number of reads

    pReadLo         - pointer to lower LONG of number of reads

Return Value:

    S_OK            - successful

--*/

    HRESULT GetBytesRead( [out] LONGLONG *pRead );

/*++

Method Name:

    GetBytesRead

Method Description:

    Get LONGLONG counter for bytes read.

Arguments:

    pRead           - pointer to LONGLONG of number of reads

Return Value:

    S_OK            - successful

--*/

    HRESULT SetBytesRead2( [in] LONG readHi, [in] LONG readLo );

/*++

Method Name:

    SetBytesRead2

Method Description:

    Set upper and lower parts of LONGLONG counter for bytes read.

Arguments:

    readHi          - new value for high LONG for number of reads

    readLo          - new value for lower LONG for number of reads

Return Value:

    S_OK            - successful

--*/

    HRESULT SetBytesRead( [in] LONGLONG read );

/*++

Method Name:

    SetBytesRead

Method Description:

    Set LONGLONG counter for bytes read.

Arguments:

    read            - new value for LONGLONG number of reads

Return Value:

    S_OK            - successful

--*/

    HRESULT IncrementBytesRead( [in] LONG val );

/*++

Method Name:

    IncrementBytesRead

Method Description:

    Increment current bytes read by value.

Arguments:

    val             - value to add to current number of reads

Return Value:

    S_OK            - successful

--*/

    HRESULT GetBytesWritten2( [out] LONG *pWriteHi, [out] LONG *pWriteLo );

/*++

Method Name:

    GetBytesWritten2

Method Description:

    Get upper and lower parts of LONGLONG counter for bytes written.

Arguments:

    pWriteHi        - pointer to high LONG of number of writes

    pWriteLo        - pointer to lower LONG of number of writes

Return Value:

    S_OK            - successful

--*/

    HRESULT GetBytesWritten( [out] LONGLONG *pWritten );

/*++

Method Name:

    GetBytesWritten

Method Description:

    Get LONGLONG version of number of bytes written.

Arguments:

    pWritten        - pointer to LONGLONG for number of bytes written

Return Value:

    S_OK            - successful

--*/

    HRESULT SetBytesWritten2( [in] LONG writeHi, [in] LONG writeLo );

/*++

Method Name:

    SetBytesWritten2

Method Description:

    Set upper and lower parts of LONGLONG counter for bytes written.

Arguments:

    writeHi         - new value for high LONG of number of bytes written

    writeLo         - new value for lower LONG of number of bytes written

Return Value:

    S_OK            - successful

--*/

    HRESULT SetBytesWritten( [in] LONGLONG written );

/*++

Method Name:

    SetBytesWritten

Method Description:

    Set LONGLONG version of number of bytes written.

Arguments:

    written         - new value for LONGLONG for number of bytes written

Return Value:

    S_OK            - successful

--*/

    HRESULT IncrementBytesWritten( [in] LONG val );

/*++

Method Name:

    IncrementBytesWritten

Method Description:

    Increment LONGLONG version of number of bytes written by value.

Arguments:

    val             - value to add to LONGLONG for number of bytes written

Return Value:

    S_OK            - successful

--*/

    HRESULT GetCapacity2( [out] LONG *pCapHi, [out] LONG *pCapLo );

/*++

Method Name:

    GetCapacity2

Method Description:

    Get upper and lower parts of LONGLONG counter for media capacity.

Arguments:

    pCapHi          - pointer to high LONG for capacity

    pCapLo          - pointer to lower LONG for capacity

Return Value:

    S_OK            - successful

--*/

    HRESULT GetCapacity( [out] LONGLONG *pCap );

/*++

Method Name:

    GetCapacity

Method Description:

    Get the LONGLONG version of capacity for media.

Arguments:

    pCap            - pointer to capacity

Return Value:

    S_OK            - successful

--*/

    HRESULT GetUsedSpace2( [out] LONG *pUsedHi, [out] LONG *pUsedLo );

/*++

Method Name:

    GetUsedSpace2

Method Description:

    Get upper and lower parts of LONGLONG counter for used space.

Arguments:

    pUsedHi         - pointer to high LONG for amount of space used

    pUsedLo         - pointer to lower LONG for amount of space used

Return Value:

    S_OK            - successful

--*/

    HRESULT GetUsedSpace( [out] LONGLONG *pUsed );

/*++

Method Name:

    GetUsedSpace

Method Description:

    Get the LONGLONG version for used space on media.

Arguments:

    pUsed           - pointer to space used

Return Value:

    S_OK            - successful

--*/

    HRESULT GetLargestFreeSpace2( [out] LONG *pFreeHi, [out] LONG *pFreeLo );

/*++

Method Name:

    GetLargestFreeSpace2

Method Description:

    Get upper and lower parts of LONGLONG counter for largest free space available

Arguments:

    pFreeHi         - pointer to high LONG for largest free space available

    pFreeLo         - pointer to lower LONG for largest free space available

Return Value:

    S_OK            - successful

--*/

    HRESULT GetLargestFreeSpace( [out] LONGLONG *pFree );

/*++

Method Name:

    GetLargestFreeSpace

Method Description:

    Get the LONGLONG version for largest free space available.

Arguments:

    pFree           - pointer to largest free space available.  The value
                      may be zero, or negative to indicate stale infomation.
                      In this the absolute value of *pFree is an approximation.

Return Value:

    S_OK            - successful

See Also:

    IDataMover::GetLargestFreeSpace
    IRmsDrive::GetLargestFreeSpace

--*/
    HRESULT SetCapacity([in] LONGLONG cap);
    HRESULT SetUsedSpace([in] LONGLONG used);
    HRESULT SetFreeSpace([in] LONGLONG free);

    HRESULT ResetCounters( void );

/*++

Method Name:

    ResetCounters

Method Description:

    Reset space counters.

Arguments:

    None

Return Value:

    S_OK            - successful

--*/

//  HRESULT ResetAllCounters( void) = 0;

//  HRESULT GetResetCounterTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetResetCounterTimestamp

Method Description:

    Get the timestamp for the last time the counters were reset.

Arguments:

    pDate           - pointer to timestamp for last time counters were reset

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetLastReadTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetLastReadTimestamp

Method Description:

    Get the timestamp for the last time a read was executed.

Arguments:

    pDate           - pointer to timestamp for last time a read occurred

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetLastWriteTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetLastWriteTimestamp

Method Description:

    Get the timestamp for the last time a write was executed.

Arguments:

    pDate           - pointer to timestamp for last time a write occurred

Return Value:

    S_OK            - successful

--*/

//  HRESULT GetCreatedTimestamp( [out] DATE *pDate );

/*++

Method Name:

    GetCreatedTimestamp

Method Description:

    Get the timestamp for when the file was created.

Arguments:

    pDate           - pointer to timestamp for when the file was created

Return Value:

    S_OK            - successful

--*/

};


/*++

Interface Name:

    IRmsClient

Interface Description:

    Client Interface

--*/

[
    object,
    uuid(FE37FB16-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsClient Interface"),
    pointer_default(unique)
]
interface IRmsClient : IDispatch
{
    HRESULT GetOwnerClassId( [out] CLSID *pClassId );

/*++

Method Name:

    GetOwnerClassId

Method Description:

    Get owner class ID.

Arguments:

    pClassId    - returned value of class id.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetOwnerClassId( [in] CLSID classId );

/*++

Method Name:

    SetOwnerClassId

Method Description:

    Set owner class ID

Arguments:

    classId      - new class id to set the class id to.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT GetName ( [in, out, string] BSTR *pName  );

/*++

Method Name:

    GetName

Method Description:

    Get client name.

Arguments:

    pName    - returned name.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetName ( [in, string] BSTR name  );

/*++

Method Name:

    SetName

Method Description:

    Set client name.

Arguments:

    name         - name to set client to.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT GetPassword ( [in, out, string] BSTR *pName  );

/*++

Method Name:

    GetPassword

Method Description:

    Get client password.

Arguments:

    pPassword    - returned value of client password.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetPassword ( [in, string] BSTR name  );

/*++

Method Name:

    SetPassword

Method Description:

    Set client password.

Arguments:

    password     - new value of client password.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT GetInfo( [out, size_is (RMS_INFO_SIZE)] UCHAR *pInfo, [out] SHORT *pSize );

/*++

Method Name:

    GetInfo

Method Description:

    Get client information.

Arguments:

    ppInfo       - area to save client info.

    pSize        - size of client info data.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetInfo( [in, size_is (size)] UCHAR *pInfo, [in] SHORT size );

/*++

Method Name:

    SetInfo

Method Description:

    Set client information.

Arguments:

    pInfo        - new client information data.

    size         - size of new client information data.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT GetVerifierClass( [out] CLSID *pClassId );

/*++

Method Name:

    GetVerifierClass

Method Description:

    Get verifier class ID.

Arguments:

    pClassId     - verifier class id.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetVerifierClass( [in] CLSID classId );

/*++

Method Name:

    SetVerifierClass

Method Description:

    Set verifier class ID.

Arguments:

    classId      - new verifier class ID.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT GetPortalClass( [out] CLSID *pClassId );

/*++

Method Name:

    GetPortalClass

Method Description:

    Get portal class ID.

Arguments:

    pClassId     - portal class id.

Return Value:

    S_OK         - operation completed successfully

--*/

    HRESULT SetPortalClass( [in] CLSID classId );

/*++

Method Name:

    SetPortalClass

Method Description:

    Set portal class id.

Arguments:

    classId      - new value of portal class id.

Return Value:

    S_OK         - operation completed successfully

--*/

};


/*++

Interface Name:

    IRmsNTMS

Interface Description:

    NTMS Interface

--*/

[
    object,
	uuid(65DF3456-561A-4ADE-A0F4-2DFFF82E4A56),
    //dual,
    helpstring("IRmsNTMS Interface"),
    pointer_default(unique)
]
interface IRmsNTMS : IDispatch
{

    HRESULT IsInstalled( void );
    HRESULT Initialize( void );

    HRESULT Allocate([in] REFGUID fromMediaSet, [in] REFGUID prevSideId, [in, out] LONGLONG *pFreeSpace, [in] BSTR displayName, [in] DWORD options, [out] IRmsCartridge **ppCart);
    HRESULT Mount([in] IRmsCartridge *pCart, [in, out] IRmsDrive **ppDrive, [in, defaultvalue(0)] DWORD options, [in, defaultvalue(0)] DWORD threadId);
    HRESULT Dismount([in] IRmsCartridge *pCart, [in, defaultvalue(0)] DWORD options);
    HRESULT Deallocate([in] IRmsCartridge *pCart);
    HRESULT DismountAll([in] REFGUID fromMediaSet, [in, defaultvalue(0)] DWORD options);

    HRESULT UpdateOmidInfo([in] REFGUID cartId, [in, size_is(size)] BYTE *pBuffer, [in] LONG size, [in] LONG type);
    HRESULT GetBlockSize([in] REFGUID cartId, [out] LONG *pBlockSize);
    HRESULT SetBlockSize([in] REFGUID cartId, [in] LONG blockSize);
    HRESULT ExportDatabase(void);
    HRESULT FindCartridge([in] REFGUID cartId, [out] IRmsCartridge **ppCartridge);

    HRESULT Suspend( void );
    HRESULT Resume( void );

    HRESULT IsMediaCopySupported ([in] REFGUID mediaPoolId);

	HRESULT UpdateDrive([in] IRmsDrive *pDrive);
    HRESULT GetNofAvailableDrives([out] DWORD *pdwNofDrives);

    HRESULT CheckSecondSide([in]REFGUID firstSideId, [out]BOOL *pbValid, [out]GUID *pSecondSideId);
};


/*++

Interface Name:

    IRmsSinkEveryEvent

Interface Description:

    Sink side of connection point interface for Rms objects

--*/

[
    object,
    uuid(FE37FB20-3729-11D0-8CF4-00A0C9190459),
    //dual,
    helpstring("IRmsSinkEveryEvent Interface"),
    pointer_default(unique)
]
interface IRmsSinkEveryEvent : IUnknown
{
    HRESULT ProcessObjectStatusChange( [in] BOOL isEnabled, [in] LONG state, [in] HRESULT statusCode );
/*++

Method Name:

    ProcessObjectStatusChange

Method Description:

    A method implemented by the sink of a connection point.  Typically it is implemented
    by an application that wants to be notified about an object status change.

Arguments:

    isEnabled       - TRUE if the object is enabled for normal processing.

    state           - The current operating state of the object.

    statusCode      - If the object is disabled, this value holds the reason.

Return Value:

    S_OK            - Success.

--*/

};
