If you look at wsgContext you will see that rdpContext is one of its params:
typedef struct {
/*
* FreeRDP's original portion.
_/
rdpContext p;
/
* Pointer to the main RDP handler.
/
RDP *pRDP;
/
* Pointer to the corresponding Update API module.
_/
Update pUpdate;
/
\ Pointer to the corresponding Primary API module.
/
Primary pPrimary;
/_
* The current color space conversion parameter.
*/
HCLRCONV clrconv;
} wsgContext;
So HOW you can cast struct A to struct B when struct B include A ???!!!!
simply cast small struct A (lets say 100 bytes) to bigger struct B (lets say 1000 bytes), mean the only first 100 bytes in struct B will have data but all the other 900 byes will be garbage or zero, correct?
this mean hclrconv will be garbage as reinterpret_cast(ctx)->clrconv is garbage, right?
I see weird things which not make science:
void Primary::PatBlt(rdpContext _ctx, PATBLTORDER po) { HCLRCONV hclrconv = reinterpret_cast<wsgContext *>(ctx)->clrconv; }
If you look at wsgContext you will see that rdpContext is one of its params:
typedef struct { /* * FreeRDP's original portion. _/ rdpContext p; / * Pointer to the main RDP handler. / RDP *pRDP; / * Pointer to the corresponding Update API module. _/ Update pUpdate; / \ Pointer to the corresponding Primary API module. / Primary pPrimary; /_ * The current color space conversion parameter. */ HCLRCONV clrconv; } wsgContext;
So HOW you can cast struct A to struct B when struct B include A ???!!!!
simply cast small struct A (lets say 100 bytes) to bigger struct B (lets say 1000 bytes), mean the only first 100 bytes in struct B will have data but all the other 900 byes will be garbage or zero, correct?
this mean hclrconv will be garbage as reinterpret_cast(ctx)->clrconv is garbage, right?