libfreerdp-core: added MS-TSGU interface definitions
This commit is contained in:
parent
e9aee05684
commit
b6af8cd206
@ -41,6 +41,7 @@
|
||||
|
||||
typedef int BOOL, *PBOOL, *LPBOOL;
|
||||
typedef unsigned char BYTE, *PBYTE, *LPBYTE;
|
||||
typedef BYTE byte;
|
||||
typedef BYTE BOOLEAN, *PBOOLEAN;
|
||||
typedef wchar_t WCHAR, *PWCHAR;
|
||||
typedef WCHAR* BSTR;
|
||||
@ -100,6 +101,17 @@ typedef unsigned short USHORT;
|
||||
typedef void VOID, *PVOID, *LPVOID;
|
||||
typedef unsigned short WORD, *PWORD, *LPWORD;
|
||||
|
||||
typedef void* PCONTEXT_HANDLE;
|
||||
typedef PCONTEXT_HANDLE* PPCONTEXT_HANDLE;
|
||||
|
||||
typedef struct _GUID
|
||||
{
|
||||
unsigned long Data1;
|
||||
unsigned short Data2;
|
||||
unsigned short Data3;
|
||||
byte Data4[8];
|
||||
} GUID, UUID, *PGUID;
|
||||
|
||||
#ifdef UNICODE
|
||||
#define _T(x) L ## x
|
||||
#else
|
||||
|
@ -73,6 +73,60 @@ uint8 tsg_packet5[20] =
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
void Opnum0NotUsedOnWire(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HRESULT TsProxyCreateTunnel(PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse,
|
||||
PTUNNEL_CONTEXT_HANDLE_SERIALIZE* tunnelContext, unsigned long* tunnelId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT TsProxyAuthorizeTunnel(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT TsProxyMakeTunnelCall(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
unsigned long procId, PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT TsProxyCreateChannel(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
PTSENDPOINTINFO tsEndPointInfo, PCHANNEL_CONTEXT_HANDLE_SERIALIZE* channelContext, unsigned long* channelId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Opnum5NotUsedOnWire(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HRESULT TsProxyCloseChannel(PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE* context)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT TsProxyCloseTunnel(PTUNNEL_CONTEXT_HANDLE_SERIALIZE* context)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD TsProxySetupReceivePipe(byte pRpcMessage[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD TsProxySendToServer(byte pRpcMessage[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
{
|
||||
int status = -1;
|
||||
@ -97,6 +151,17 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
|
||||
DEBUG_TSG("rpch_connect success");
|
||||
|
||||
/**
|
||||
* OpNum = 1
|
||||
*
|
||||
* HRESULT TsProxyCreateTunnel(
|
||||
* [in, ref] PTSG_PACKET tsgPacket,
|
||||
* [out, ref] PTSG_PACKET* tsgPacketResponse,
|
||||
* [out] PTUNNEL_CONTEXT_HANDLE_SERIALIZE* tunnelContext,
|
||||
* [out] unsigned long* tunnelId
|
||||
* );
|
||||
*/
|
||||
|
||||
status = rpch_write(rpch, tsg_packet1, sizeof(tsg_packet1), 1);
|
||||
|
||||
if (status <= 0)
|
||||
@ -126,6 +191,17 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
|
||||
memcpy(tsg_packet2 + 4, tsg->tunnelContext, 16);
|
||||
|
||||
/**
|
||||
* OpNum = 2
|
||||
*
|
||||
* HRESULT TsProxyAuthorizeTunnel(
|
||||
* [in] PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
* [in, ref] PTSG_PACKET tsgPacket,
|
||||
* [out, ref] PTSG_PACKET* tsgPacketResponse
|
||||
* );
|
||||
*
|
||||
*/
|
||||
|
||||
status = rpch_write(rpch, tsg_packet2, sizeof(tsg_packet2), 2);
|
||||
|
||||
if (status <= 0)
|
||||
@ -145,6 +221,17 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
memcpy(tsg_packet3 + 4, tsg->tunnelContext, 16);
|
||||
status = rpch_write(rpch, tsg_packet3, sizeof(tsg_packet3), 3);
|
||||
|
||||
/**
|
||||
* OpNum = 3
|
||||
*
|
||||
* HRESULT TsProxyMakeTunnelCall(
|
||||
* [in] PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
* [in] unsigned long procId,
|
||||
* [in, ref] PTSG_PACKET tsgPacket,
|
||||
* [out, ref] PTSG_PACKET* tsgPacketResponse
|
||||
* );
|
||||
*/
|
||||
|
||||
if (status <= 0)
|
||||
{
|
||||
printf("rpch_write opnum=3 failed!\n");
|
||||
@ -168,6 +255,17 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
stream_write(s_p4, dest_addr_unic, dest_addr_unic_len);
|
||||
stream_write_uint16(s_p4,0x0000); /* unicode zero to terminate hostname string */
|
||||
|
||||
/**
|
||||
* OpNum = 4
|
||||
*
|
||||
* HRESULT TsProxyCreateChannel(
|
||||
* [in] PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
* [in, ref] PTSENDPOINTINFO tsEndPointInfo,
|
||||
* [out] PCHANNEL_CONTEXT_HANDLE_SERIALIZE* channelContext,
|
||||
* [out] unsigned long* channelId
|
||||
* );
|
||||
*/
|
||||
|
||||
status = rpch_write(rpch, s_p4->data, s_p4->size, 4);
|
||||
|
||||
if (status <= 0)
|
||||
@ -195,6 +293,15 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
|
||||
#endif
|
||||
|
||||
memcpy(tsg_packet5 + 4, tsg->channelContext, 16);
|
||||
|
||||
/**
|
||||
* OpNum = 8
|
||||
*
|
||||
* DWORD TsProxySetupReceivePipe(
|
||||
* [in, max_is(32767)] byte pRpcMessage[]
|
||||
* );
|
||||
*/
|
||||
|
||||
status = rpch_write(rpch, tsg_packet5, sizeof(tsg_packet5), 8);
|
||||
|
||||
if (status <= 0)
|
||||
|
@ -28,6 +28,7 @@ typedef struct rdp_tsg rdpTsg;
|
||||
|
||||
#include <time.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/wintypes.h>
|
||||
#include <freerdp/settings.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/wait_obj.h>
|
||||
@ -42,6 +43,223 @@ struct rdp_tsg
|
||||
rdpTransport* transport;
|
||||
};
|
||||
|
||||
typedef PCONTEXT_HANDLE PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE;
|
||||
typedef PCONTEXT_HANDLE PTUNNEL_CONTEXT_HANDLE_SERIALIZE;
|
||||
|
||||
typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE;
|
||||
typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_SERIALIZE;
|
||||
|
||||
typedef wchar_t* RESOURCENAME;
|
||||
|
||||
#define MAX_RESOURCE_NAMES 50
|
||||
|
||||
typedef struct _tsendpointinfo
|
||||
{
|
||||
RESOURCENAME* resourceName;
|
||||
unsigned long numResourceNames;
|
||||
RESOURCENAME* alternateResourceNames;
|
||||
unsigned short numAlternateResourceNames;
|
||||
unsigned long Port;
|
||||
} TSENDPOINTINFO, *PTSENDPOINTINFO;
|
||||
|
||||
#define TSG_PACKET_TYPE_HEADER 0x00004844
|
||||
#define TSG_PACKET_TYPE_VERSIONCAPS 0x00005643
|
||||
#define TSG_PACKET_TYPE_QUARCONFIGREQUEST 0x00005143
|
||||
#define TSG_PACKET_TYPE_QUARREQUEST 0x00005152
|
||||
#define TSG_PACKET_TYPE_RESPONSE 0x00005052
|
||||
#define TSG_PACKET_TYPE_QUARENC_RESPONSE 0x00004552
|
||||
#define TSG_CAPABILITY_TYPE_NAP 0x00000001
|
||||
#define TSG_PACKET_TYPE_CAPS_RESPONSE 0x00004350
|
||||
#define TSG_PACKET_TYPE_MSGREQUEST_PACKET 0x00004752
|
||||
#define TSG_PACKET_TYPE_MESSAGE_PACKET 0x00004750
|
||||
#define TSG_PACKET_TYPE_AUTH 0x00004054
|
||||
#define TSG_PACKET_TYPE_REAUTH 0x00005250
|
||||
#define TSG_ASYNC_MESSAGE_CONSENT_MESSAGE 0x00000001
|
||||
#define TSG_ASYNC_MESSAGE_SERVICE_MESSAGE 0x00000002
|
||||
#define TSG_ASYNC_MESSAGE_REAUTH 0x00000003
|
||||
#define TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST 0x00000001
|
||||
#define TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST 0x00000002
|
||||
|
||||
typedef struct _TSG_PACKET_HEADER
|
||||
{
|
||||
unsigned short ComponentId;
|
||||
unsigned short PacketId;
|
||||
} TSG_PACKET_HEADER, *PTSG_PACKET_HEADER;
|
||||
|
||||
typedef struct _TSG_CAPABILITY_NAP
|
||||
{
|
||||
unsigned long capabilities;
|
||||
} TSG_CAPABILITY_NAP, *PTSG_CAPABILITY_NAP;
|
||||
|
||||
typedef union
|
||||
{
|
||||
TSG_CAPABILITY_NAP tsgCapNap;
|
||||
} TSG_CAPABILITIES_UNION, *PTSG_CAPABILITIES_UNION;
|
||||
|
||||
typedef struct _TSG_PACKET_CAPABILITIES
|
||||
{
|
||||
unsigned long capabilityType;
|
||||
TSG_CAPABILITIES_UNION tsgPacket;
|
||||
} TSG_PACKET_CAPABILITIES, *PTSG_PACKET_CAPABILITIES;
|
||||
|
||||
typedef struct _TSG_PACKET_VERSIONCAPS
|
||||
{
|
||||
TSG_PACKET_HEADER tsgHeader;
|
||||
PTSG_PACKET_CAPABILITIES tsgCaps;
|
||||
unsigned long numCapabilities;
|
||||
unsigned short majorVersion;
|
||||
unsigned short minorVersion;
|
||||
unsigned short quarantineCapabilities;
|
||||
} TSG_PACKET_VERSIONCAPS, *PTSG_PACKET_VERSIONCAPS;
|
||||
|
||||
typedef struct _TSG_PACKET_QUARCONFIGREQUEST
|
||||
{
|
||||
unsigned long flags;
|
||||
} TSG_PACKET_QUARCONFIGREQUEST, *PTSG_PACKET_QUARCONFIGREQUEST;
|
||||
|
||||
typedef struct _TSG_PACKET_QUARREQUEST
|
||||
{
|
||||
unsigned long flags;
|
||||
wchar_t* machineName;
|
||||
unsigned long nameLength;
|
||||
byte* data;
|
||||
unsigned long dataLen;
|
||||
} TSG_PACKET_QUARREQUEST, *PTSG_PACKET_QUARREQUEST;
|
||||
|
||||
typedef struct _TSG_REDIRECTION_FLAGS
|
||||
{
|
||||
BOOL enableAllRedirections;
|
||||
BOOL disableAllRedirections;
|
||||
BOOL driveRedirectionDisabled;
|
||||
BOOL printerRedirectionDisabled;
|
||||
BOOL portRedirectionDisabled;
|
||||
BOOL reserved;
|
||||
BOOL clipboardRedirectionDisabled;
|
||||
BOOL pnpRedirectionDisabled;
|
||||
} TSG_REDIRECTION_FLAGS, *PTSG_REDIRECTION_FLAGS;
|
||||
|
||||
typedef struct _TSG_PACKET_RESPONSE
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long reserved;
|
||||
byte* responseData;
|
||||
unsigned long responseDataLen;
|
||||
TSG_REDIRECTION_FLAGS redirectionFlags;
|
||||
} TSG_PACKET_RESPONSE, *PTSG_PACKET_RESPONSE;
|
||||
|
||||
typedef struct _TSG_PACKET_QUARENC_RESPONSE
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long certChainLen;
|
||||
wchar_t* certChainData;
|
||||
GUID nonce;
|
||||
PTSG_PACKET_VERSIONCAPS versionCaps;
|
||||
} TSG_PACKET_QUARENC_RESPONSE, *PTSG_PACKET_QUARENC_RESPONSE;
|
||||
|
||||
typedef struct TSG_PACKET_STRING_MESSAGE
|
||||
{
|
||||
long isDisplayMandatory;
|
||||
long isConsentMandatory;
|
||||
unsigned long msgBytes;
|
||||
wchar_t* msgBuffer;
|
||||
} TSG_PACKET_STRING_MESSAGE, *PTSG_PACKET_STRING_MESSAGE;
|
||||
|
||||
typedef struct TSG_PACKET_REAUTH_MESSAGE
|
||||
{
|
||||
unsigned __int64 tunnelContext;
|
||||
} TSG_PACKET_REAUTH_MESSAGE, *PTSG_PACKET_REAUTH_MESSAGE;
|
||||
|
||||
typedef union
|
||||
{
|
||||
PTSG_PACKET_STRING_MESSAGE consentMessage;
|
||||
PTSG_PACKET_STRING_MESSAGE serviceMessage;
|
||||
PTSG_PACKET_REAUTH_MESSAGE reauthMessage;
|
||||
} TSG_PACKET_TYPE_MESSAGE_UNION, *PTSG_PACKET_TYPE_MESSAGE_UNION;
|
||||
|
||||
typedef struct _TSG_PACKET_MSG_RESPONSE
|
||||
{
|
||||
unsigned long msgID;
|
||||
unsigned long msgType;
|
||||
long isMsgPresent;
|
||||
TSG_PACKET_TYPE_MESSAGE_UNION messagePacket;
|
||||
} TSG_PACKET_MSG_RESPONSE, *PTSG_PACKET_MSG_RESPONSE;
|
||||
|
||||
typedef struct TSG_PACKET_CAPS_RESPONSE
|
||||
{
|
||||
TSG_PACKET_QUARENC_RESPONSE pktQuarEncResponse;
|
||||
TSG_PACKET_MSG_RESPONSE pktConsentMessage;
|
||||
} TSG_PACKET_CAPS_RESPONSE, *PTSG_PACKET_CAPS_RESPONSE;
|
||||
|
||||
typedef struct TSG_PACKET_MSG_REQUEST
|
||||
{
|
||||
unsigned long maxMessagesPerBatch;
|
||||
} TSG_PACKET_MSG_REQUEST, *PTSG_PACKET_MSG_REQUEST;
|
||||
|
||||
typedef struct _TSG_PACKET_AUTH
|
||||
{
|
||||
TSG_PACKET_VERSIONCAPS tsgVersionCaps;
|
||||
unsigned long cookieLen;
|
||||
byte* cookie;
|
||||
} TSG_PACKET_AUTH, *PTSG_PACKET_AUTH;
|
||||
|
||||
typedef union
|
||||
{
|
||||
PTSG_PACKET_VERSIONCAPS packetVersionCaps;
|
||||
PTSG_PACKET_AUTH packetAuth;
|
||||
} TSG_INITIAL_PACKET_TYPE_UNION, *PTSG_INITIAL_PACKET_TYPE_UNION;
|
||||
|
||||
typedef struct TSG_PACKET_REAUTH
|
||||
{
|
||||
unsigned __int64 tunnelContext;
|
||||
unsigned long packetId;
|
||||
TSG_INITIAL_PACKET_TYPE_UNION tsgInitialPacket;
|
||||
} TSG_PACKET_REAUTH, *PTSG_PACKET_REAUTH;
|
||||
|
||||
typedef union
|
||||
{
|
||||
PTSG_PACKET_HEADER packetHeader;
|
||||
PTSG_PACKET_VERSIONCAPS packetVersionCaps;
|
||||
PTSG_PACKET_QUARCONFIGREQUEST packetQuarConfigRequest;
|
||||
PTSG_PACKET_QUARREQUEST packetQuarRequest;
|
||||
PTSG_PACKET_RESPONSE packetResponse;
|
||||
PTSG_PACKET_QUARENC_RESPONSE packetQuarEncResponse;
|
||||
PTSG_PACKET_CAPS_RESPONSE packetCapsResponse;
|
||||
PTSG_PACKET_MSG_REQUEST packetMsgRequest;
|
||||
PTSG_PACKET_MSG_RESPONSE packetMsgResponse;
|
||||
PTSG_PACKET_AUTH packetAuth;
|
||||
PTSG_PACKET_REAUTH packetReauth;
|
||||
} TSG_PACKET_TYPE_UNION;
|
||||
|
||||
typedef struct _TSG_PACKET
|
||||
{
|
||||
unsigned long packetId;
|
||||
TSG_PACKET_TYPE_UNION tsgPacket;
|
||||
} TSG_PACKET, *PTSG_PACKET;
|
||||
|
||||
void Opnum0NotUsedOnWire(void);
|
||||
|
||||
HRESULT TsProxyCreateTunnel(PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse,
|
||||
PTUNNEL_CONTEXT_HANDLE_SERIALIZE* tunnelContext, unsigned long* tunnelId);
|
||||
|
||||
HRESULT TsProxyAuthorizeTunnel(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse);
|
||||
|
||||
HRESULT TsProxyMakeTunnelCall(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
unsigned long procId, PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPacketResponse);
|
||||
|
||||
HRESULT TsProxyCreateChannel(PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnelContext,
|
||||
PTSENDPOINTINFO tsEndPointInfo, PCHANNEL_CONTEXT_HANDLE_SERIALIZE* channelContext, unsigned long* channelId);
|
||||
|
||||
void Opnum5NotUsedOnWire(void);
|
||||
|
||||
HRESULT TsProxyCloseChannel(PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE* context);
|
||||
|
||||
HRESULT TsProxyCloseTunnel(PTUNNEL_CONTEXT_HANDLE_SERIALIZE* context);
|
||||
|
||||
DWORD TsProxySetupReceivePipe(byte pRpcMessage[]);
|
||||
|
||||
DWORD TsProxySendToServer(byte pRpcMessage[]);
|
||||
|
||||
boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port);
|
||||
|
||||
int tsg_write(rdpTsg* tsg, uint8* data, uint32 length);
|
||||
|
Loading…
Reference in New Issue
Block a user