/****************************************************************************/
// jetrpc.idl
//
// RPC IDL covering the network interface between the Jet RPC client
// tssdjet.dll (a TS Session Directory provider) and the server (dis.exe -
// server component).
//
// Copyright (C) 2000 Microsoft Corporation
/****************************************************************************/

// Copied from tssd.h for use here.
#define TSSD_MaxDisconnectedSessions 10

// Length of some strings
#define TSSD_UserNameLen 256
#define TSSD_DomainLength 128
#define TSSD_ServAddrLen 64
#define TSSD_AppTypeLen 256

// The number uuid was generated by UUIDGEN, and
// is unique across time and space. This number should
// never change for this service.
[
    uuid(aa177641-fc9b-41bd-80ff-f964a701596f),
    version(1.0),
    pointer_default(unique)
]
interface TSSDJetRPC
{
    import "wtypes.idl";
    typedef [context_handle] void *HCLIENTINFO;
    typedef [string] WCHAR *TSSD_UserName;
    typedef [string] WCHAR *TSSD_Domain;
    typedef [string] WCHAR *TSSD_ServAddr;
    typedef [string] WCHAR *TSSD_AppType;
    typedef [range(0,10)] DWORD NumSessions_t;

    typedef struct {
        TSSD_ServAddr ServerAddress;
        DWORD SessionID;
        DWORD TSProtocol;
        TSSD_AppType AppType;
        DWORD ResolutionWidth;
        DWORD ResolutionHeight;
        DWORD ColorDepth;
        DWORD CreateTimeLow;
        DWORD CreateTimeHigh;
        DWORD DisconnectTimeLow;
        DWORD DisconnectTimeHigh;
        DWORD State;
    } TSSD_DiscSessInfo;

    typedef struct {
        TSSD_UserName UserName;
        TSSD_Domain Domain;
        DWORD SessionID;
        DWORD TSProtocol;
        TSSD_AppType AppType;
        DWORD ResolutionWidth;
        DWORD ResolutionHeight;
        DWORD ColorDepth;
        DWORD CreateTimeLow;
        DWORD CreateTimeHigh;
        DWORD DisconnectTimeLow;
        DWORD DisconnectTimeHigh;
        DWORD State;
    } TSSD_RepopInfo;

    DWORD TSSDRpcServerOnline(
            [in] handle_t Binding,
            [in, string] WCHAR *ClusterName,   // Max 64 chars incl. null.
            [out] HCLIENTINFO *hCI,
            [in] DWORD SrvOnlineFlags);

    DWORD TSSDRpcServerOffline(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI);

    DWORD TSSDRpcGetUserDisconnectedSessions(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            [in, string] WCHAR *UserName,  // Max 256 chars incl. null.
            [in, string] WCHAR *Domain,   // Max 128 chars incl. null.
            [in, out, ref] NumSessions_t *pNumSessions,  // Max 10
            // Pointer to an array of Disconnected session info structures
            // Note the comma indicates that the size_is applies to the array.
            [out, size_is(,*pNumSessions)] TSSD_DiscSessInfo **dsi);

    DWORD TSSDRpcCreateSession(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            [in, string] WCHAR *UserName,  // Max 256 chars incl. null.
            [in, string] WCHAR *Domain,   // Max 128 chars incl. null.
            [in] DWORD SessionID,
            [in] DWORD TSProtocol,
            [in, string] WCHAR *AppType,   // Max 256 chars incl. null.
            [in] DWORD ResolutionWidth,
            [in] DWORD ResolutionHeight,
            [in] DWORD ColorDepth,
            [in] DWORD CreateTimeLow,
            [in] DWORD CreateTimeHigh);

    DWORD TSSDRpcDeleteSession(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            DWORD SessionID);

    DWORD TSSDRpcSetSessionDisconnected(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            DWORD SessionID,
            DWORD DiscTimeLow,
            DWORD DiscTimeHigh);

    DWORD TSSDRpcSetSessionReconnected(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            DWORD SessionID,
            DWORD TSProtocol,
            DWORD ResWidth,
            DWORD ResHeight,
            DWORD ColorDepth);

    DWORD TSSDRpcSetServerReconnectPending(
            [in] handle_t Binding,
            [in, string] WCHAR *ServerAddress,
            DWORD AlmostTimeLow,
            DWORD AlmostTimeHigh);

    DWORD TSSDRpcRepopulateAllSessions(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            [in] DWORD NumSessions,
            [in, size_is(NumSessions)] TSSD_RepopInfo rpi[]);

    DWORD TSSDRpcUpdateConfigurationSetting(
            [in] handle_t Binding,
            [in, out] HCLIENTINFO *hCI,
            [in] DWORD dwSetting,
            [in] DWORD dwSettingLength,
            [in, size_is(dwSettingLength)] BYTE pbValue[]);
}

