/*++

© 1998 Seagate Software, Inc.  All rights reserved

Module Name:

    fsaprv.idl

Abstract:

    IDL source for 'private' (non-exposed) interfaces in the FSA (File System Agent) that 
    are contained in the FSA service (RsFsa.exe).

    This file defines the FSA 'private' interfaces (IFsaFilterPriv, IFsaFilterRecallPriv, 
    IFsaResourcePriv, and IFsaScanItemPriv), as well as the premigrated and recovery 
    interfaces (IFsaPremigratedDb, IFsaPremigratedRec and IFsaRecoveryRec), and will be 
    processed by the MIDL tool to produce the type library (Fsa.tlb) and marshalling code.

Author:

    Chuck Bardeen   [cbardeen]   29-Oct-1996

Revision History:

--*/

interface IFsaFilterPriv;
interface IFsaFilterRecallPriv;
interface IFsaResourcePriv;
interface IFsaScanItemPriv;

import "oaidl.idl";
import "fsaint.idl";
import "jobint.idl";

[
    object,
    uuid(3DEFB163-BAEC-11d2-9EE9-00104B226B3E),
    helpstring("IFsaFilterPriv Interface"),
    pointer_default(unique)
]
interface IFsaFilterPriv : IUnknown
{
    HRESULT Init([in] IFsaServer* pServer);
    HRESULT SetIdentifier([in] GUID id);
    HRESULT IoctlThread(void);
    HRESULT PipeThread(void);
    HRESULT SendCancel([in] IFsaFilterRecallPriv *pRecallPriv);
    HRESULT SendComplete([in] IFsaFilterRecallPriv *recall, [in] HRESULT result);
};


[
    object,
    uuid(23A05997-DA21-4998-A354-8797303FB91E),
    helpstring("IFsaFilterRecallPriv Interface"),
    pointer_default(unique)
]
interface IFsaFilterRecallPriv : IUnknown
{
    HRESULT Cancel(void);
    HRESULT CancelByDriver(void);
    HRESULT Delete(void);
    HRESULT GetClient([out] IFsaFilterClient** ppClient);
    HRESULT GetDriversRecallId([out] ULONGLONG* pId);
    HRESULT SetDriversRecallId([in] ULONGLONG pId);
    HRESULT SetThreadId([in] DWORD pId);
    HRESULT GetPlaceholder([out] FSA_PLACEHOLDER* pPlaceholder);
    HRESULT Init([in] IFsaFilterClient* pClient, [in] ULONGLONG pDriversRecallId, 
                 [in] IFsaResource* pResource, [in, string] OLECHAR* path, 
                 [in] LONGLONG fileId, 
                 [in] LONGLONG offset, [in] LONGLONG size, [in] ULONG mode, 
                 [in] FSA_PLACEHOLDER* pPlaceholder, [in] IFsaFilterPriv* pFilterPriv);
    HRESULT SetIdentifier([in] GUID id);
    HRESULT StartRecall([in] ULONGLONG offset, [in] ULONGLONG size);
    HRESULT GetStream([out] IStream **ppStream);
    // The following are also in the public interface.
    HRESULT CompareToIdentifier([in] GUID id, [out] SHORT* pResult);
    HRESULT CompareToIRecall([in] IFsaFilterRecall* pRecall, [out] SHORT* pResult);
    HRESULT CompareToDriversRecallId([in] ULONGLONG id, [out] SHORT* pResult);
    HRESULT CompareToDriversContextId([in] ULONGLONG id, [out] SHORT* pResult);
    HRESULT CompareBy([in] FSA_RECALL_COMPARE by);
    HRESULT GetIdentifier([out] GUID* pId);
    HRESULT GetMode([out] ULONG* pMode);
    HRESULT GetOffset([out] LONGLONG* pOffset);
    HRESULT GetPath([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT GetResource([out] IFsaResource** ppResource);
    HRESULT GetSession([out] IHsmSession** ppSession);
    HRESULT GetSize([out] LONGLONG* pSize);
    HRESULT GetState([out] HSM_JOB_STATE* pState);
    HRESULT GetUserName([in, out, string] OLECHAR** pName, [in] ULONG bufferSize);
    HRESULT WasCancelled(void);
    HRESULT LogComplete([in] HRESULT hr);

};


[
    object,
    uuid(27F72BA5-B1C5-4708-8700-D950B9EAE27B),
    helpstring("IFsaResourcePriv Interface"),
    pointer_default(unique)
]
interface IFsaResourcePriv : IHsmSystemState
{
    HRESULT AddPremigratedSize([in] LONGLONG size);
    HRESULT AddTruncatedSize([in] LONGLONG size);
    HRESULT DoRecovery(void);
    HRESULT FilterSawOpen([in] IHsmSession* pSession, [in] IFsaFilterRecall* pRecall, 
                          [in, string] OLECHAR* path, [in] LONGLONG fileId,
                          [in] LONGLONG requestOffset, 
                          [in] LONGLONG requestSize, [in] FSA_PLACEHOLDER* pPlaceholder, 
                          [in] ULONG mode, [in] FSA_RESULT_ACTION resultAction, [in] DWORD threadId);
    HRESULT FilterSawDelete([in] GUID filterId, [in, string] OLECHAR* path, 
                            [in] LONGLONG size, [in] FSA_PLACEHOLDER* pPlaceholder);
    HRESULT GetPremigrated([in] REFIID riid, [out, iid_is(riid)] void** ppDb);
    HRESULT GetUnmanageDb([in] REFIID riid, [out, iid_is(riid)] void** ppDb);
    HRESULT InitializeUnmanageDb(void);
    HRESULT TerminateUnmanageDb(void);
    HRESULT Init([in] IFsaServer* pServer, [in, string] OLECHAR* path, [in, string] OLECHAR *dosname);
    HRESULT RemovePremigratedSize([in] LONGLONG size);
    HRESULT RemoveTruncatedSize([in] LONGLONG size);
    HRESULT SetAlternatePath([in, string] OLECHAR* path);
    HRESULT SetIdentifier([in] GUID id);
    HRESULT SetName([in, string] OLECHAR* name);
    HRESULT SetOldPath([in, string] OLECHAR* oldPath);
    HRESULT SetPath([in, string] OLECHAR* path);
    HRESULT SetUserFriendlyName([in, string] OLECHAR* path);
    HRESULT SetStickyName([in, string] OLECHAR* path);
    HRESULT SetSerial([in] ULONG serial);
    HRESULT UpdateFrom([in] IFsaServer* pServer, [in] IFsaResource* pResource);
};


[
    object,
    uuid(03150C1E-9580-4A1F-91B3-BE2367E4F400),
    helpstring("IFsaScanItemPriv Interface"),
    pointer_default(unique)
]
interface IFsaScanItemPriv : IUnknown
{
    HRESULT FindFirst([in] IFsaResource* pResource, [in, string] OLECHAR* path, 
                      [in] IHsmSession* pSession);
    HRESULT FindFirstInRPIndex([in] IFsaResource* pResource, [in] IHsmSession* pSession);
    HRESULT FindFirstInDbIndex([in] IFsaResource* pResource, [in] IHsmSession* pSession);
    HRESULT FindNext(void);
    HRESULT FindNextInRPIndex(void);
    HRESULT FindNextInDbIndex(void);
    HRESULT TruncateInternal([in] LONGLONG offset, [in] LONGLONG size);  
    HRESULT VerifyInternal([in] LONGLONG offset, [in] LONGLONG size, 
                           [in] LONGLONG usn1, [in] LONGLONG usn2);
};


[
    object,
    uuid(E4D900C9-DFD0-4F8D-8F44-1555C2E3E15F),
    helpstring("IFsaPremigratedDb Interface"),
    pointer_default(unique)
]
interface IFsaPremigratedDb : IWsbDb
{
    HRESULT Init([in, string] OLECHAR* name, [in] IWsbDbSys* pDbSys, [out] BOOL* pCreated);
};


[
    object,
    uuid(5E2526D3-400D-11d1-A3D5-00609704F787),
    helpstring("IFsaPremigratedRec Interface"),
    pointer_default(unique)
]
interface IFsaPremigratedRec : IWsbDbEntity
{
    HRESULT GetAccessTime([out] FILETIME* pAccessTime);
    HRESULT GetBagId([out] GUID* pId);
    HRESULT GetBagOffset([out] LONGLONG* pOffset);
    HRESULT GetFileId([out] LONGLONG* pFileId);
    HRESULT GetFileUSN([out] LONGLONG* pFileUSN);
    HRESULT GetOffset([out] LONGLONG* pOffset);
    HRESULT GetPath([out, string] OLECHAR** ppPath, [in] ULONG bufferSize);
    HRESULT GetRecallTime([out] FILETIME* pTime);
    HRESULT GetSize([out] LONGLONG* pSize);
    HRESULT IsWaitingForClose(void);
    HRESULT SetAccessTime([in] FILETIME pAccessTime);
    HRESULT SetFromScanItem([in] IFsaScanItem* pScanItem, [in] LONGLONG offset, 
                            [in] LONGLONG size, [in] BOOL isWaitingForClose);
    HRESULT SetBagId([in] GUID pId);
    HRESULT SetBagOffset([in] LONGLONG pOffset);
    HRESULT SetFileId([in] LONGLONG pFileId);
    HRESULT SetFileUSN([in] LONGLONG pFileUSN);
    HRESULT SetIsWaitingForClose([in] BOOL isWaiting);
    HRESULT SetOffset([in] LONGLONG pOffset);
    HRESULT SetPath([in, string] OLECHAR* pPath);
    HRESULT SetRecallTime([in] FILETIME time);
    HRESULT SetSize([in] LONGLONG pSize);
};


[
    object,
    uuid(74D85681-44D8-11d1-A3D7-00609704F787),
    helpstring("IFsaRecoveryRec Interface"),
    pointer_default(unique)
]
interface IFsaRecoveryRec : IWsbDbEntity
{
    HRESULT GetBagId([out] GUID* pId);
    HRESULT GetBagOffset([out] LONGLONG* pOffset);
    HRESULT GetFileId([out] LONGLONG* pFileId);
    HRESULT GetOffsetSize([out] LONGLONG* pOffset, [out] LONGLONG* pSize);
    HRESULT GetPath([out, string] OLECHAR** ppPath, [in] ULONG bufferSize);
    HRESULT GetRecoveryCount([out] LONG* pCount);
    HRESULT GetStatus([out] ULONG* pStatus);
    HRESULT SetBagId([in] GUID pId);
    HRESULT SetBagOffset([in] LONGLONG pOffset);
    HRESULT SetFileId([in] LONGLONG pFileId);
    HRESULT SetOffsetSize([in] LONGLONG Offset, [in] LONGLONG Size);
    HRESULT SetPath([in, string] OLECHAR* pPath);
    HRESULT SetRecoveryCount([in] LONG Count);
    HRESULT SetStatus([in] ULONG Status);
};

[
    object,
    uuid(3F676047-90B6-48D6-B479-28E57AD4B746),
    helpstring("IFsaUnmanageDb Interface"),
    pointer_default(unique)
]
interface IFsaUnmanageDb : IWsbDb
{
    HRESULT Init([in, string] OLECHAR* name, [in] IWsbDbSys* pDbSys, [out] BOOL* pCreated);
};


[
    object,
    uuid(90D54B53-EDB6-401D-81C5-47D7B4842EC0),
    helpstring("IFsaUnmanageRec Interface"),
    pointer_default(unique)
]
interface IFsaUnmanageRec : IWsbDbEntity
{
    HRESULT GetMediaId([out] GUID* pId);
    HRESULT GetFileOffset([out] LONGLONG* pOffset);
    HRESULT GetFileId([out] LONGLONG* pFileId);
    HRESULT SetMediaId([in] GUID pId);
    HRESULT SetFileOffset([in] LONGLONG pOffset);
    HRESULT SetFileId([in] LONGLONG pFileId);
};

