字节对齐

来源:互联网 发布:网络直播收入排名 编辑:程序博客网 时间:2024/06/06 00:49


android freerdp学习



#ifdef __GNUC__
#define ALIGN64 __attribute__((aligned(8)))
#else
#ifdef _WIN32
#define ALIGN64 __declspec(align(8))
#else
#define ALIGN64
#endif
#endif

*********************************************************


/** Defines the options for a given instance of RDP connection.
 *  This is built by the client and given to the FreeRDP library to create the connection
 *  with the expected options.
 *  It is allocated by a call to freerdp_new() and deallocated by a call to freerdp_free().
 *  Some of its content need specific allocation/deallocation - see field description for details.
 */
struct rdp_freerdp
{
ALIGN64 rdpContext* context; /**< (offset 0)
 Pointer to a rdpContext structure.
 Client applications can use the ContextSize field to register a context bigger than the rdpContext
 structure. This allow clients to use additional context information.
 When using this capability, 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() */
UINT64 paddingB[32 - 19]; /* 19 */


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[48 - 35]; /* 35 */


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. */
ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**< (offset 52)
Callback for changed certificate validation. 
Used when a certificate differs from stored fingerprint.
If returns TRUE, the new fingerprint will be trusted and old thrown out. */


ALIGN64 pLogonErrorInfo LogonErrorInfo; /**< (offset 53)  Callback for logon error info, important for logon system messages with RemoteApp */


ALIGN64 pPostDisconnect PostDisconnect; /**< (offset 54)
Callback for cleaning up resources allocated
by connect callbacks. */


UINT64 paddingD[64 - 55]; /* 55 */


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. */


UINT64 paddingE[80 - 66]; /* 66 */
};

0 0