FreeRdp(一):主要数据结构

    /** RDP连接实例
     *  这是创建连接后的客户端选项
   * 数据结构申请内存调用freerdp_new,释放为freerdp_free
*/ struct rdp_freerdp { ALIGN64 rdpContext* context; /**< (offset 0) 一个指向rdpContext的结构. 客户端应用可以注册大于rdpContext结构的字段,
             这里允许客户端使用附加的消息。
                当使用这个模块的时候, client application should ALWAYS declare their structure with the rdpContext field first, and any additional content following it. Can be allocated by a call to freerdp_context_new(). Must be deallocated by a call to freerdp_context_free() before deallocating the current instance.
*/ ALIGN64 RDP_CLIENT_ENTRY_POINTS* pClientEntryPoints; UINT64 paddingA[16 - 2]; /* 2 */ ALIGN64 rdpInput* input; /* (offset 16) Input handle for the connection. Will be initialized by a call to freerdp_context_new() */ ALIGN64 rdpUpdate* update; /* (offset 17) Update display parameters. Used to register display events callbacks and settings. Will be initialized by a call to freerdp_context_new() */ ALIGN64 rdpSettings* settings; /**< (offset 18) Pointer to a rdpSettings structure. Will be used to maintain the required RDP settings. Will be initialized by a call to freerdp_context_new() */ ALIGN64 rdpAutoDetect* autodetect; /* (offset 19) Auto-Detect handle for the connection. Will be initialized by a call to freerdp_context_new() */ UINT64 paddingB[32 - 20]; /* 20 */ ALIGN64 size_t ContextSize; /* (offset 32) Specifies the size of the 'context' field. freerdp_context_new() will use this size to allocate the context buffer. freerdp_new() sets it to sizeof(rdpContext). If modifying it, there should always be a minimum of sizeof(rdpContext), as the freerdp library will assume it can use the 'context' field to set the required informations in it. Clients will typically make it bigger, and use a context structure embedding the rdpContext, and adding additional information after that. */ ALIGN64 pContextNew ContextNew; /**< (offset 33) Callback for context allocation Can be set before calling freerdp_context_new() to have it executed after allocation and initialization. Must be set to NULL if not needed. */ ALIGN64 pContextFree ContextFree; /**< (offset 34) Callback for context deallocation Can be set before calling freerdp_context_free() to have it executed before deallocation. Must be set to NULL if not needed. */ UINT64 paddingC[47 - 35]; /* 35 */ ALIGN64 UINT ConnectionCallbackState; /* 47 */ ALIGN64 pPreConnect PreConnect; /**< (offset 48) Callback for pre-connect operations. Can be set before calling freerdp_connect() to have it executed before the actual connection happens. Must be set to NULL if not needed. */ ALIGN64 pPostConnect PostConnect; /**< (offset 49) Callback for post-connect operations. Can be set before calling freerdp_connect() to have it executed after the actual connection has succeeded. Must be set to NULL if not needed. */ ALIGN64 pAuthenticate Authenticate; /**< (offset 50) Callback for authentication. It is used to get the username/password when it was not provided at connection time. */ ALIGN64 pVerifyCertificate VerifyCertificate; /**< (offset 51) Callback for certificate validation. Used to verify that an unknown certificate is trusted. DEPRECATED: Use VerifyChangedCertificateEx*/ ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**< (offset 52) Callback for changed certificate validation. Used when a certificate differs from stored fingerprint. DEPRECATED: Use VerifyChangedCertificateEx */ ALIGN64 pVerifyX509Certificate VerifyX509Certificate; /**< (offset 53) Callback for X509 certificate verification (PEM format) */ ALIGN64 pLogonErrorInfo LogonErrorInfo; /**< (offset 54) Callback for logon error info, important for logon system messages with RemoteApp */ ALIGN64 pPostDisconnect PostDisconnect; /**< (offset 55) Callback for cleaning up resources allocated by connect callbacks. */ ALIGN64 pAuthenticate GatewayAuthenticate; /**< (offset 56) Callback for gateway authentication. It is used to get the username/password when it was not provided at connection time. */ ALIGN64 pPresentGatewayMessage PresentGatewayMessage; /**< (offset 57) Callback for gateway consent messages. It is used to present consent messages to the user. */ UINT64 paddingD[64 - 58]; /* 58 */ ALIGN64 pSendChannelData SendChannelData; /* (offset 64) Callback for sending data to a channel. By default, it is set by freerdp_new() to freerdp_send_channel_data(), which eventually calls freerdp_channel_send() */ ALIGN64 pReceiveChannelData ReceiveChannelData; /* (offset 65) Callback for receiving data from a channel. This is called by freerdp_channel_process() (if not NULL). Clients will typically use a function that calls freerdp_channels_data() to perform the needed tasks. */ ALIGN64 pVerifyCertificateEx VerifyCertificateEx; /**< (offset 66) Callback for certificate validation. Used to verify that an unknown certificate is trusted. */ ALIGN64 pVerifyChangedCertificateEx VerifyChangedCertificateEx; /**< (offset 67) Callback for changed certificate validation. Used when a certificate differs from stored fingerprint. */ UINT64 paddingE[80 - 68]; /* 68 */ };
    struct rdp_context
    {
        ALIGN64 freerdp* instance;  /**< (offset 0)
                               Pointer to a rdp_freerdp structure.
                               This is a back-link to retrieve the freerdp instance from the context.
                               It is set by the freerdp_context_new() function */
        ALIGN64 freerdp_peer* peer; /**< (offset 1)
                               Pointer to the client peer.
                               This is set by a call to freerdp_peer_context_new() during peer
                               initialization. This field is used only on the server side. */
        ALIGN64 BOOL ServerMode;    /**< (offset 2) true when context is in server mode */

        ALIGN64 UINT32 LastError; /* 3 */

        UINT64 paddingA[16 - 4]; /* 4 */
        
        ALIGN64 int argc;    /**< (offset 16)
                        Number of arguments given to the program at launch time.
                        Used to keep this data available and used later on, typically just before
                        connection initialization.
                        @see freerdp_parse_args() */
        ALIGN64 char** argv; /**< (offset 17)
                        List of arguments given to the program at launch time.
                        Used to keep this data available and used later on, typically just before
                        connection initialization.
                        @see freerdp_parse_args() */

        ALIGN64 wPubSub* pubSub; /* (offset 18) */

        ALIGN64 HANDLE channelErrorEvent; /* (offset 19)*/
        ALIGN64 UINT channelErrorNum;     /*(offset 20)*/
        ALIGN64 char* errorDescription;   /*(offset 21)*/

        UINT64 paddingB[32 - 22]; /* 22 */

        ALIGN64 rdpRdp*
            rdp;                           /**< (offset 32)
                                      Pointer to a rdp_rdp structure used to keep the connection's parameters.
                                      It is allocated by freerdp_context_new() and deallocated by
                                      freerdp_context_free(), at the same              time that this rdp_context
                                      structure -              there is no need to specifically allocate/deallocate this. */
        ALIGN64 rdpGdi* gdi;               /**< (offset 33)
                                      Pointer to a rdp_gdi structure used to keep the gdi settings.
                                      It is allocated by gdi_init() and deallocated by gdi_free().
                                      It must be deallocated before deallocating this rdp_context structure. */
        ALIGN64 rdpRail* rail;             /* 34 */
        ALIGN64 rdpCache* cache;           /* 35 */
        ALIGN64 rdpChannels* channels;     /* 36 */
        ALIGN64 rdpGraphics* graphics;     /* 37 */
        ALIGN64 rdpInput* input;           /* 38 */
        ALIGN64 rdpUpdate* update;         /* 39 */
        ALIGN64 rdpSettings* settings;     /* 40 */
        ALIGN64 rdpMetrics* metrics;       /* 41 */
        ALIGN64 rdpCodecs* codecs;         /* 42 */
        ALIGN64 rdpAutoDetect* autodetect; /* 43 */
        ALIGN64 HANDLE abortEvent;         /* 44 */
        ALIGN64 int disconnectUltimatum;   /* 45 */
        UINT64 paddingC[64 - 46];          /* 46 */

        UINT64 paddingD[96 - 64];  /* 64 */
        UINT64 paddingE[128 - 96]; /* 96 */
    };

 

client
posted @ 2022-06-02 16:14  Ansing  阅读(659)  评论(0编辑  收藏  举报