Fixed argument const correctness

This commit is contained in:
Armin Novak 2021-08-27 12:47:46 +02:00 committed by akallabeth
parent f1bde376b1
commit 737f5a2036
9 changed files with 36 additions and 22 deletions

View File

@ -112,7 +112,7 @@ extern "C"
FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
/* Glyph Class */
typedef BOOL (*pGlyph_New)(rdpContext* context, const rdpGlyph* glyph);
typedef BOOL (*pGlyph_New)(rdpContext* context, rdpGlyph* glyph);
typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph);
typedef BOOL (*pGlyph_Draw)(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y,
INT32 w, INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant);
@ -158,9 +158,9 @@ extern "C"
UINT32 paddingA[16 - 4]; /* 4 */
};
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap);
FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer);
FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph);
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, const rdpBitmap* bitmap);
FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, const rdpPointer* pointer);
FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, const rdpGlyph* glyph);
FREERDP_API rdpGraphics* graphics_new(rdpContext* context);
FREERDP_API void graphics_free(rdpGraphics* graphics);

View File

@ -48,7 +48,8 @@ typedef void (*psPeerDisconnect)(freerdp_peer* peer);
typedef BOOL (*psPeerCapabilities)(freerdp_peer* peer);
typedef BOOL (*psPeerPostConnect)(freerdp_peer* peer);
typedef BOOL (*psPeerActivate)(freerdp_peer* peer);
typedef BOOL (*psPeerLogon)(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic);
typedef BOOL (*psPeerLogon)(freerdp_peer* peer, const SEC_WINNT_AUTH_IDENTITY* identity,
BOOL automatic);
typedef BOOL (*psPeerAdjustMonitorsLayout)(freerdp_peer* peer);
typedef BOOL (*psPeerClientCapabilities)(freerdp_peer* peer);

View File

@ -38,7 +38,7 @@ rdpBitmap* Bitmap_Alloc(rdpContext* context)
if (bitmap)
{
CopyMemory(bitmap, graphics->Bitmap_Prototype, sizeof(rdpBitmap));
*bitmap = *graphics->Bitmap_Prototype;
bitmap->data = NULL;
}
@ -84,9 +84,13 @@ BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, UINT16 width, UINT16 height)
return TRUE;
}
void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap)
void graphics_register_bitmap(rdpGraphics* graphics, const rdpBitmap* bitmap)
{
CopyMemory(graphics->Bitmap_Prototype, bitmap, sizeof(rdpBitmap));
WINPR_ASSERT(graphics);
WINPR_ASSERT(graphics->Bitmap_Prototype);
WINPR_ASSERT(bitmap);
*graphics->Bitmap_Prototype = *bitmap;
}
/* Pointer Class */
@ -99,7 +103,7 @@ rdpPointer* Pointer_Alloc(rdpContext* context)
if (pointer)
{
CopyMemory(pointer, graphics->Pointer_Prototype, sizeof(rdpPointer));
*pointer = *graphics->Pointer_Prototype;
}
return pointer;
@ -118,9 +122,13 @@ static BOOL Pointer_New(rdpContext* context, rdpPointer* pointer)
}
/* static method */
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
void graphics_register_pointer(rdpGraphics* graphics, const rdpPointer* pointer)
{
CopyMemory(graphics->Pointer_Prototype, pointer, sizeof(rdpPointer));
WINPR_ASSERT(graphics);
WINPR_ASSERT(graphics->Pointer_Prototype);
WINPR_ASSERT(pointer);
*graphics->Pointer_Prototype = *pointer;
}
/* Glyph Class */
@ -170,9 +178,13 @@ rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, UINT32 cx, UINT32 c
return glyph;
}
void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph)
void graphics_register_glyph(rdpGraphics* graphics, const rdpGlyph* glyph)
{
CopyMemory(graphics->Glyph_Prototype, glyph, sizeof(rdpGlyph));
WINPR_ASSERT(graphics);
WINPR_ASSERT(graphics->Glyph_Prototype);
WINPR_ASSERT(glyph);
*graphics->Glyph_Prototype = *glyph;
}
/* Graphics Module */

View File

@ -215,7 +215,7 @@ static BOOL gdi_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL p
}
/* Glyph Class */
static BOOL gdi_Glyph_New(rdpContext* context, const rdpGlyph* glyph)
static BOOL gdi_Glyph_New(rdpContext* context, rdpGlyph* glyph)
{
BYTE* data;
gdiGlyph* gdi_glyph;

View File

@ -141,7 +141,8 @@ static BOOL wf_peer_activate(freerdp_peer* client)
return TRUE;
}
static BOOL wf_peer_logon(freerdp_peer* client, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic)
static BOOL wf_peer_logon(freerdp_peer* client, const SEC_WINNT_AUTH_IDENTITY* identity,
BOOL automatic)
{
wfreerdp_server_peer_callback_event(((rdpContext*)client->context)->peer->pId,
FREERDP_SERVER_WIN_SRV_CALLBACK_EVENT_AUTH);

View File

@ -92,7 +92,7 @@ static BOOL pf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
}
/* Glyph Class */
static BOOL pf_Glyph_New(rdpContext* context, const rdpGlyph* glyph)
static BOOL pf_Glyph_New(rdpContext* context, rdpGlyph* glyph)
{
return TRUE;
}

View File

@ -601,7 +601,7 @@ static BOOL shadow_client_activate(freerdp_peer* peer)
return shadow_client_refresh_rect(&client->context, 0, NULL);
}
static BOOL shadow_client_logon(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity,
static BOOL shadow_client_logon(freerdp_peer* peer, const SEC_WINNT_AUTH_IDENTITY* identity,
BOOL automatic)
{
char* user = NULL;

View File

@ -1490,14 +1490,14 @@ struct _WtsApiFunctionTable
typedef struct _WtsApiFunctionTable WtsApiFunctionTable;
typedef WtsApiFunctionTable* PWtsApiFunctionTable;
typedef PWtsApiFunctionTable(CDECL* INIT_WTSAPI_FN)(void);
typedef const WtsApiFunctionTable*(CDECL* INIT_WTSAPI_FN)(void);
#ifdef __cplusplus
extern "C"
{
#endif
WINPR_API BOOL WTSRegisterWtsApiFunctionTable(PWtsApiFunctionTable table);
WINPR_API BOOL WTSRegisterWtsApiFunctionTable(const WtsApiFunctionTable* table);
WINPR_API const CHAR* WTSErrorToString(UINT error);
WINPR_API const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state);

View File

@ -46,7 +46,7 @@
static HMODULE g_WtsApiModule = NULL;
static PWtsApiFunctionTable g_WtsApi = NULL;
static const WtsApiFunctionTable* g_WtsApi = NULL;
#if defined(_WIN32)
static HMODULE g_WtsApi32Module = NULL;
@ -674,7 +674,7 @@ const CHAR* WTSSessionStateToString(WTS_CONNECTSTATE_CLASS state)
return "INVALID_STATE";
}
BOOL WTSRegisterWtsApiFunctionTable(PWtsApiFunctionTable table)
BOOL WTSRegisterWtsApiFunctionTable(const WtsApiFunctionTable* table)
{
/* Use InitOnceExecuteOnce here as well - otherwise a table set with this
function is overriden on the first use of a WTS* API call (due to
@ -777,7 +777,7 @@ static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID*
WINPR_UNUSED(context);
if (param)
{
g_WtsApi = (PWtsApiFunctionTable)param;
g_WtsApi = (const WtsApiFunctionTable*)param;
return TRUE;
}