From 7c243da6e153143a6f42e4b88d63d9bf8492cf00 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 20 Nov 2019 11:30:14 +0100 Subject: [PATCH] Remove symbols exported by accident. --- channels/client/addin.c | 6 +- channels/cliprdr/server/cliprdr_main.c | 4 +- channels/geometry/client/geometry_main.c | 2 +- channels/rdpei/client/rdpei_main.c | 51 +- channels/rdpsnd/client/rdpsnd_main.c | 2 +- channels/server/channels.c | 2 +- .../smartcard/client/smartcard_operations.c | 2 +- channels/smartcard/client/smartcard_pack.c | 4 +- channels/tsmf/client/gstreamer/tsmf_X11.c | 4 +- .../tsmf/client/gstreamer/tsmf_gstreamer.c | 6 +- .../tsmf/client/gstreamer/tsmf_platform.h | 2 - channels/tsmf/client/tsmf_ifman.c | 2 +- channels/video/client/video_main.c | 2 +- client/common/cmdline.c | 6 +- libfreerdp/codec/audio.c | 2 +- libfreerdp/codec/h264.c | 2 +- libfreerdp/codec/nsc_encode.c | 3 +- libfreerdp/codec/rfx.c | 8 +- libfreerdp/codec/rfx_neon.c | 4 +- libfreerdp/codec/rfx_quantization.c | 4 +- libfreerdp/codec/rfx_quantization.h | 3 - libfreerdp/core/activation.c | 17 +- libfreerdp/core/activation.h | 8 +- libfreerdp/core/autodetect.c | 2 +- libfreerdp/core/connection.c | 1 + libfreerdp/core/display.c | 4 +- libfreerdp/core/gcc.c | 33 ++ libfreerdp/core/gcc.h | 33 -- libfreerdp/core/info.c | 2 +- libfreerdp/core/info.h | 3 - libfreerdp/core/license.c | 8 +- libfreerdp/core/listener.c | 3 +- libfreerdp/core/mcs.c | 10 + libfreerdp/core/mcs.h | 11 +- libfreerdp/core/peer.c | 8 +- libfreerdp/core/proxy.c | 3 +- libfreerdp/core/proxy.h | 2 +- libfreerdp/core/rdp.c | 7 +- libfreerdp/core/rdp.h | 7 - libfreerdp/core/security.c | 10 +- libfreerdp/core/tpdu.c | 2 + libfreerdp/core/tpdu.h | 1 - libfreerdp/core/transport.c | 2 +- libfreerdp/core/update.c | 9 +- libfreerdp/crypto/certificate.c | 2 +- libfreerdp/crypto/crypto.c | 4 +- libfreerdp/crypto/der.c | 2 +- libfreerdp/crypto/per.c | 2 +- libfreerdp/gdi/gdi.c | 3 +- libfreerdp/locale/keyboard.c | 6 +- libfreerdp/locale/keyboard_x11.c | 2 +- libfreerdp/locale/keyboard_xkbfile.c | 8 +- libfreerdp/locale/keyboard_xkbfile.h | 4 - libfreerdp/primitives/prim_alphaComp_opt.c | 6 +- libfreerdp/primitives/prim_templates.h | 482 +++++++++--------- libfreerdp/utils/stopwatch.c | 4 +- rdtk/librdtk/rdtk_nine_patch.c | 5 +- server/shadow/shadow_client.c | 2 +- server/shadow/shadow_client.h | 1 - server/shadow/shadow_mcevent.c | 16 +- server/shadow/shadow_mcevent.h | 15 +- uwac/libuwac/uwac-clipboard.c | 2 +- uwac/libuwac/uwac-display.c | 11 +- uwac/libuwac/uwac-utils.c | 2 +- uwac/libuwac/uwac-window.c | 16 +- winpr/include/winpr/synch.h | 16 - winpr/include/winpr/sysinfo.h | 5 + winpr/libwinpr/CMakeLists.txt | 2 +- winpr/libwinpr/clipboard/clipboard.c | 9 +- winpr/libwinpr/com/CMakeLists.txt | 22 - winpr/libwinpr/com/ModuleOptions.cmake | 9 - winpr/libwinpr/com/com.c | 123 ----- winpr/libwinpr/com/test/.gitignore | 3 - winpr/libwinpr/com/test/CMakeLists.txt | 22 - winpr/libwinpr/com/test/TestComReference.c | 7 - winpr/libwinpr/comm/comm_serial_sys.c | 8 +- winpr/libwinpr/crypto/cipher.c | 4 +- winpr/libwinpr/file/file.c | 2 +- winpr/libwinpr/file/generic.c | 4 +- winpr/libwinpr/file/namedPipeClient.c | 2 +- winpr/libwinpr/file/pattern.c | 5 +- winpr/libwinpr/io/device.c | 11 +- winpr/libwinpr/registry/registry_reg.c | 6 +- winpr/libwinpr/rpc/ndr.c | 18 +- winpr/libwinpr/rpc/ndr_structure.c | 2 +- winpr/libwinpr/smartcard/smartcard_inspect.c | 2 +- winpr/libwinpr/sspi/CredSSP/credssp.c | 2 +- winpr/libwinpr/sspi/NTLM/ntlm_compute.c | 14 +- winpr/libwinpr/sspi/Schannel/schannel.c | 55 +- .../libwinpr/sspi/Schannel/schannel_openssl.c | 2 +- winpr/libwinpr/synch/CMakeLists.txt | 2 - winpr/libwinpr/synch/condition.c | 62 --- winpr/libwinpr/synch/srw.c | 68 --- winpr/libwinpr/sysinfo/sysinfo.c | 22 + winpr/libwinpr/thread/process.c | 22 +- winpr/libwinpr/utils/CMakeLists.txt | 2 - winpr/libwinpr/utils/collections/ArrayList.c | 2 +- winpr/libwinpr/utils/collections/BipBuffer.c | 4 +- winpr/libwinpr/utils/collections/Dictionary.c | 6 +- winpr/libwinpr/utils/collections/HashTable.c | 6 +- .../libwinpr/utils/collections/KeyValuePair.c | 53 -- .../utils/collections/ListDictionary.c | 6 +- winpr/libwinpr/utils/collections/Reference.c | 4 +- winpr/libwinpr/utils/collections/StreamPool.c | 12 +- winpr/libwinpr/utils/lodepng/lodepng.c | 10 +- winpr/libwinpr/utils/sam.c | 2 +- winpr/libwinpr/utils/trio/trio.c | 2 +- winpr/libwinpr/utils/wlog/Appender.c | 2 +- winpr/libwinpr/utils/wlog/SyslogAppender.c | 2 +- winpr/libwinpr/utils/wlog/TextMessage.c | 27 - winpr/libwinpr/wnd/wnd.c | 6 +- winpr/libwinpr/wtsapi/wtsapi.c | 2 +- 112 files changed, 599 insertions(+), 982 deletions(-) delete mode 100644 winpr/libwinpr/com/CMakeLists.txt delete mode 100644 winpr/libwinpr/com/ModuleOptions.cmake delete mode 100644 winpr/libwinpr/com/com.c delete mode 100644 winpr/libwinpr/com/test/.gitignore delete mode 100644 winpr/libwinpr/com/test/CMakeLists.txt delete mode 100644 winpr/libwinpr/com/test/TestComReference.c delete mode 100644 winpr/libwinpr/synch/condition.c delete mode 100644 winpr/libwinpr/synch/srw.c delete mode 100644 winpr/libwinpr/utils/collections/KeyValuePair.c delete mode 100644 winpr/libwinpr/utils/wlog/TextMessage.c diff --git a/channels/client/addin.c b/channels/client/addin.c index ee30c53a4..336de3b03 100644 --- a/channels/client/addin.c +++ b/channels/client/addin.c @@ -43,8 +43,8 @@ extern const STATIC_ENTRY_TABLE CLIENT_STATIC_ENTRY_TABLES[]; -void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABLE* table, - const char* identifier) +static void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABLE* table, + const char* identifier) { size_t index = 0; STATIC_ENTRY* pEntry; @@ -330,7 +330,7 @@ void freerdp_channels_addin_list_free(FREERDP_ADDIN** ppAddins) extern const STATIC_ENTRY CLIENT_VirtualChannelEntryEx_TABLE[]; -BOOL freerdp_channels_is_virtual_channel_entry_ex(LPCSTR pszName) +static BOOL freerdp_channels_is_virtual_channel_entry_ex(LPCSTR pszName) { size_t i; diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index d8a733bc5..34ff4d74d 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -76,7 +76,7 @@ * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) +static UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) { UINT rc; size_t pos, size; @@ -970,7 +970,7 @@ static UINT cliprdr_server_init(CliprdrServerContext* context) * * @return 0 on success, otherwise a Win32 error code */ -UINT cliprdr_server_read(CliprdrServerContext* context) +static UINT cliprdr_server_read(CliprdrServerContext* context) { wStream* s; size_t position; diff --git a/channels/geometry/client/geometry_main.c b/channels/geometry/client/geometry_main.c index eb7b33864..f08b76cf1 100644 --- a/channels/geometry/client/geometry_main.c +++ b/channels/geometry/client/geometry_main.c @@ -99,7 +99,7 @@ void mappedGeometryUnref(MAPPED_GEOMETRY* g) free(g); } -void freerdp_rgndata_reset(FREERDP_RGNDATA* data) +static void freerdp_rgndata_reset(FREERDP_RGNDATA* data) { data->nRectCount = 0; } diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 27e09ea4a..573babd0a 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -115,22 +115,22 @@ typedef struct _RDPEI_PLUGIN RDPEI_PLUGIN; * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_frame(RdpeiClientContext* context); +static UINT rdpei_send_frame(RdpeiClientContext* context); -const char* RDPEI_EVENTID_STRINGS[] = { "", - "EVENTID_SC_READY", - "EVENTID_CS_READY", - "EVENTID_TOUCH", - "EVENTID_SUSPEND_TOUCH", - "EVENTID_RESUME_TOUCH", - "EVENTID_DISMISS_HOVERING_CONTACT" }; +static const char* RDPEI_EVENTID_STRINGS[] = { "", + "EVENTID_SC_READY", + "EVENTID_CS_READY", + "EVENTID_TOUCH", + "EVENTID_SUSPEND_TOUCH", + "EVENTID_RESUME_TOUCH", + "EVENTID_DISMISS_HOVERING_CONTACT" }; /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_add_frame(RdpeiClientContext* context) +static UINT rdpei_add_frame(RdpeiClientContext* context) { int i; RDPINPUT_CONTACT_DATA* contact; @@ -241,7 +241,8 @@ out: * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId, UINT32 pduLength) +static UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId, + UINT32 pduLength) { UINT status; Stream_SetPosition(s, 0); @@ -263,7 +264,7 @@ UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) +static UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) { UINT status; wStream* s; @@ -292,7 +293,7 @@ UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) return status; } -void rdpei_print_contact_flags(UINT32 contactFlags) +static void rdpei_print_contact_flags(UINT32 contactFlags) { if (contactFlags & CONTACT_FLAG_DOWN) WLog_DBG(TAG, " CONTACT_FLAG_DOWN"); @@ -318,7 +319,7 @@ void rdpei_print_contact_flags(UINT32 contactFlags) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) +static UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) { UINT32 index; int rectSize = 2; @@ -401,7 +402,8 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT_TOUCH_FRAME* frame) +static UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, + RDPINPUT_TOUCH_FRAME* frame) { UINT status; wStream* s; @@ -443,7 +445,7 @@ UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT_TOUCH * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +static UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { UINT32 protocolVersion; Stream_Read_UINT32(s, protocolVersion); /* protocolVersion (4 bytes) */ @@ -464,7 +466,7 @@ UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +static UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { RdpeiClientContext* rdpei = (RdpeiClientContext*)callback->plugin->pInterface; UINT error = CHANNEL_RC_OK; @@ -481,7 +483,7 @@ UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +static UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { RdpeiClientContext* rdpei = (RdpeiClientContext*)callback->plugin->pInterface; UINT error = CHANNEL_RC_OK; @@ -498,7 +500,7 @@ UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +static UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 eventId; UINT32 pduLength; @@ -699,7 +701,7 @@ static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) * Channel Client Interface */ -int rdpei_get_version(RdpeiClientContext* context) +static int rdpei_get_version(RdpeiClientContext* context) { RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; return rdpei->version; @@ -745,7 +747,7 @@ UINT rdpei_send_frame(RdpeiClientContext* context) * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact) +static UINT rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact) { RDPINPUT_CONTACT_POINT* contactPoint; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*)context->handle; @@ -763,7 +765,8 @@ UINT rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* conta * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +static UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId) { unsigned int i; int contactIdlocal = -1; @@ -812,7 +815,8 @@ UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +static UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId) { unsigned int i; int contactIdlocal = -1; @@ -858,7 +862,8 @@ UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +static UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, + int* contactId) { unsigned int i; int contactIdlocal = -1; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 68ff694f5..f7adfd2eb 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -677,7 +677,7 @@ static BOOL rdpsnd_set_subsystem(rdpsndPlugin* rdpsnd, const char* subsystem) return (rdpsnd->subsystem != NULL); } -BOOL rdpsnd_set_device_name(rdpsndPlugin* rdpsnd, const char* device_name) +static BOOL rdpsnd_set_device_name(rdpsndPlugin* rdpsnd, const char* device_name) { free(rdpsnd->device_name); rdpsnd->device_name = _strdup(device_name); diff --git a/channels/server/channels.c b/channels/server/channels.c index 95a6ab5f2..3d342b2d8 100644 --- a/channels/server/channels.c +++ b/channels/server/channels.c @@ -52,7 +52,7 @@ #include #include -void freerdp_channels_dummy() +void freerdp_channels_dummy(void) { audin_server_context* audin; RdpsndServerContext* rdpsnd; diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index fc1e8a2f2..568700a5d 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -39,7 +39,7 @@ #include "smartcard_main.h" -const char* smartcard_get_ioctl_string(UINT32 ioControlCode, BOOL funcName) +static const char* smartcard_get_ioctl_string(UINT32 ioControlCode, BOOL funcName) { switch (ioControlCode) { diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index b2ce09a0f..53c7baeff 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -901,8 +901,8 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, const List free(mszA); } -LONG smartcard_unpack_connect_common(SMARTCARD_DEVICE* smartcard, wStream* s, - Connect_Common* common) +static LONG smartcard_unpack_connect_common(SMARTCARD_DEVICE* smartcard, wStream* s, + Connect_Common* common) { LONG status; diff --git a/channels/tsmf/client/gstreamer/tsmf_X11.c b/channels/tsmf/client/gstreamer/tsmf_X11.c index f7b339c95..2c70b1e6f 100644 --- a/channels/tsmf/client/gstreamer/tsmf_X11.c +++ b/channels/tsmf/client/gstreamer/tsmf_X11.c @@ -428,7 +428,7 @@ int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, i return 0; } -int tsmf_window_pause(TSMFGstreamerDecoder* decoder) +static int tsmf_window_pause(TSMFGstreamerDecoder* decoder) { if (!decoder) return -1; @@ -436,7 +436,7 @@ int tsmf_window_pause(TSMFGstreamerDecoder* decoder) return 0; } -int tsmf_window_resume(TSMFGstreamerDecoder* decoder) +static int tsmf_window_resume(TSMFGstreamerDecoder* decoder) { if (!decoder) return -1; diff --git a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c index 64a7b6824..61ea6a82c 100644 --- a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c +++ b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c @@ -62,7 +62,7 @@ static int tsmf_gstreamer_pipeline_set_state(TSMFGstreamerDecoder* mdecoder, GstState desired_state); static BOOL tsmf_gstreamer_buffer_level(ITSMFDecoder* decoder); -const char* get_type(TSMFGstreamerDecoder* mdecoder) +static const char* get_type(TSMFGstreamerDecoder* mdecoder) { if (!mdecoder) return NULL; @@ -995,7 +995,7 @@ static BOOL tsmf_gstreamer_update_rendering_area(ITSMFDecoder* decoder, int newX return TRUE; } -BOOL tsmf_gstreamer_ack(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* stream) +static BOOL tsmf_gstreamer_ack(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* stream) { TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF(""); @@ -1004,7 +1004,7 @@ BOOL tsmf_gstreamer_ack(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* st return TRUE; } -BOOL tsmf_gstreamer_sync(ITSMFDecoder* decoder, void (*cb)(void*), void* stream) +static BOOL tsmf_gstreamer_sync(ITSMFDecoder* decoder, void (*cb)(void*), void* stream) { TSMFGstreamerDecoder* mdecoder = (TSMFGstreamerDecoder*)decoder; DEBUG_TSMF(""); diff --git a/channels/tsmf/client/gstreamer/tsmf_platform.h b/channels/tsmf/client/gstreamer/tsmf_platform.h index 970a59984..b6f0b33cd 100644 --- a/channels/tsmf/client/gstreamer/tsmf_platform.h +++ b/channels/tsmf/client/gstreamer/tsmf_platform.h @@ -63,8 +63,6 @@ typedef struct _TSMFGstreamerDecoder } TSMFGstreamerDecoder; -const char* get_type(TSMFGstreamerDecoder* mdecoder); - const char* tsmf_platform_get_video_sink(void); const char* tsmf_platform_get_audio_sink(void); diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index 752666d33..a71a03fda 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -309,7 +309,7 @@ UINT tsmf_ifman_remove_stream(TSMF_IFMAN* ifman) return status; } -float tsmf_stream_read_float(wStream* s) +static float tsmf_stream_read_float(wStream* s) { float fValue; UINT32 iValue; diff --git a/channels/video/client/video_main.c b/channels/video/client/video_main.c index 3b820b026..a161a1143 100644 --- a/channels/video/client/video_main.c +++ b/channels/video/client/video_main.c @@ -174,7 +174,7 @@ static void video_client_context_set_geometry(VideoClientContext* video, video->priv->geometry = geometry; } -VideoClientContextPriv* VideoClientContextPriv_new(VideoClientContext* video) +static VideoClientContextPriv* VideoClientContextPriv_new(VideoClientContext* video) { VideoClientContextPriv* ret = calloc(1, sizeof(*ret)); if (!ret) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 71b8c2a0f..64b413b01 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1192,7 +1192,7 @@ BOOL freerdp_set_connection_type(rdpSettings* settings, UINT32 type) return TRUE; } -int freerdp_map_keyboard_layout_name_to_id(char* name) +static int freerdp_map_keyboard_layout_name_to_id(char* name) { int i; int id = 0; @@ -1323,8 +1323,8 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg return detect_status; } -int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, size_t* count, - BOOL ignoreUnknown) +static int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, size_t* count, + BOOL ignoreUnknown) { int status; DWORD flags; diff --git a/libfreerdp/codec/audio.c b/libfreerdp/codec/audio.c index caea6db95..5f118757f 100644 --- a/libfreerdp/codec/audio.c +++ b/libfreerdp/codec/audio.c @@ -254,7 +254,7 @@ BOOL audio_format_compatible(const AUDIO_FORMAT* with, const AUDIO_FORMAT* what) return TRUE; } -BOOL audio_format_valid(const AUDIO_FORMAT* format) +static BOOL audio_format_valid(const AUDIO_FORMAT* format) { if (!format) return FALSE; diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index 1e82f7230..8756c5838 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -524,7 +524,7 @@ static BOOL CALLBACK h264_register_subsystems(PINIT_ONCE once, PVOID param, PVOI return i > 0; } -BOOL h264_context_init(H264_CONTEXT* h264) +static BOOL h264_context_init(H264_CONTEXT* h264) { int i; diff --git a/libfreerdp/codec/nsc_encode.c b/libfreerdp/codec/nsc_encode.c index 722ae6d51..501558c1c 100644 --- a/libfreerdp/codec/nsc_encode.c +++ b/libfreerdp/codec/nsc_encode.c @@ -418,7 +418,8 @@ static void nsc_rle_compress_data(NSC_CONTEXT* context) } } -UINT32 nsc_compute_byte_count(NSC_CONTEXT* context, UINT32* ByteCount, UINT32 width, UINT32 height) +static UINT32 nsc_compute_byte_count(NSC_CONTEXT* context, UINT32* ByteCount, UINT32 width, + UINT32 height) { UINT32 tempWidth; UINT32 tempHeight; diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index c36d9f7bf..59a4afef9 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -1391,7 +1391,7 @@ static BOOL computeRegion(const RFX_RECT* rects, int numRects, REGION16* region, #define TILE_NO(v) ((v) / 64) -BOOL setupWorkers(RFX_CONTEXT* context, int nbTiles) +static BOOL setupWorkers(RFX_CONTEXT* context, int nbTiles) { RFX_CONTEXT_PRIV* priv = context->priv; void* pmem; @@ -1647,8 +1647,8 @@ skip_encoding_loop: return NULL; } -RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, int* numMessages, - int maxDataSize) +static RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* context, RFX_MESSAGE* message, int* numMessages, + int maxDataSize) { int i, j; UINT32 tileDataSize; @@ -1813,7 +1813,7 @@ static BOOL rfx_write_message_region(RFX_CONTEXT* context, wStream* s, RFX_MESSA return TRUE; } -BOOL rfx_write_message_frame_end(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) +static BOOL rfx_write_message_frame_end(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; diff --git a/libfreerdp/codec/rfx_neon.c b/libfreerdp/codec/rfx_neon.c index 7c719f91f..c98955ade 100644 --- a/libfreerdp/codec/rfx_neon.c +++ b/libfreerdp/codec/rfx_neon.c @@ -50,7 +50,7 @@ rfx_quantization_decode_block_NEON(INT16* buffer, const int buffer_size, const U } while (buf < buf_end); } -void rfx_quantization_decode_NEON(INT16* buffer, const UINT32* quantVals) +static void rfx_quantization_decode_NEON(INT16* buffer, const UINT32* quantVals) { rfx_quantization_decode_block_NEON(&buffer[0], 1024, quantVals[8] - 1); /* HL1 */ rfx_quantization_decode_block_NEON(&buffer[1024], 1024, quantVals[7] - 1); /* LH1 */ @@ -220,7 +220,7 @@ rfx_dwt_2d_decode_block_NEON(INT16* buffer, INT16* idwt, int subband_width) rfx_dwt_2d_decode_block_vert_NEON(l_dst, h_dst, buffer, subband_width); } -void rfx_dwt_2d_decode_NEON(INT16* buffer, INT16* dwt_buffer) +static void rfx_dwt_2d_decode_NEON(INT16* buffer, INT16* dwt_buffer) { rfx_dwt_2d_decode_block_NEON(buffer + 3840, dwt_buffer, 8); rfx_dwt_2d_decode_block_NEON(buffer + 3072, dwt_buffer, 16); diff --git a/libfreerdp/codec/rfx_quantization.c b/libfreerdp/codec/rfx_quantization.c index f9fd33a00..1c71b05e8 100644 --- a/libfreerdp/codec/rfx_quantization.c +++ b/libfreerdp/codec/rfx_quantization.c @@ -43,8 +43,8 @@ * LL3 4032 8x8 64 */ -void rfx_quantization_decode_block(const primitives_t* prims, INT16* buffer, int buffer_size, - UINT32 factor) +static void rfx_quantization_decode_block(const primitives_t* prims, INT16* buffer, int buffer_size, + UINT32 factor) { if (factor == 0) return; diff --git a/libfreerdp/codec/rfx_quantization.h b/libfreerdp/codec/rfx_quantization.h index ae6349d3c..4f7ae7e14 100644 --- a/libfreerdp/codec/rfx_quantization.h +++ b/libfreerdp/codec/rfx_quantization.h @@ -26,7 +26,4 @@ FREERDP_LOCAL void rfx_quantization_decode(INT16* buffer, const UINT32* quantization_values); FREERDP_LOCAL void rfx_quantization_encode(INT16* buffer, const UINT32* quantization_values); -FREERDP_LOCAL void rfx_quantization_decode_block(const primitives_t* prims, INT16* buffer, - int buffer_size, UINT32 factor); - #endif /* FREERDP_LIB_CODEC_RFX_QUANTIZATION_H */ diff --git a/libfreerdp/core/activation.c b/libfreerdp/core/activation.c index 0697949cc..98381e228 100644 --- a/libfreerdp/core/activation.c +++ b/libfreerdp/core/activation.c @@ -34,8 +34,13 @@ static const char* const CTRLACTION_STRINGS[] = "CTRLACTION_COOPERATE" }; */ +static BOOL rdp_recv_server_synchronize_pdu(rdpRdp* rdp, wStream* s); +static BOOL rdp_recv_client_font_list_pdu(wStream* s); +static BOOL rdp_recv_server_font_map_pdu(rdpRdp* rdp, wStream* s); +static BOOL rdp_recv_client_font_map_pdu(rdpRdp* rdp, wStream* s); +static BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp); -void rdp_write_synchronize_pdu(wStream* s, rdpSettings* settings) +static void rdp_write_synchronize_pdu(wStream* s, rdpSettings* settings) { Stream_Write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */ Stream_Write_UINT16(s, settings->PduSource); /* targetUser (2 bytes) */ @@ -87,7 +92,7 @@ BOOL rdp_send_client_synchronize_pdu(rdpRdp* rdp) return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SYNCHRONIZE, rdp->mcs->userId); } -BOOL rdp_recv_control_pdu(wStream* s, UINT16* action) +static BOOL rdp_recv_control_pdu(wStream* s, UINT16* action) { if (Stream_GetRemainingLength(s) < 8) return FALSE; @@ -98,7 +103,7 @@ BOOL rdp_recv_control_pdu(wStream* s, UINT16* action) return TRUE; } -void rdp_write_client_control_pdu(wStream* s, UINT16 action) +static void rdp_write_client_control_pdu(wStream* s, UINT16 action) { Stream_Write_UINT16(s, action); /* action (2 bytes) */ Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ @@ -152,13 +157,13 @@ BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action) return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); } -void rdp_write_persistent_list_entry(wStream* s, UINT32 key1, UINT32 key2) +static void rdp_write_persistent_list_entry(wStream* s, UINT32 key1, UINT32 key2) { Stream_Write_UINT32(s, key1); /* key1 (4 bytes) */ Stream_Write_UINT32(s, key2); /* key2 (4 bytes) */ } -void rdp_write_client_persistent_key_list_pdu(wStream* s, rdpSettings* settings) +static void rdp_write_client_persistent_key_list_pdu(wStream* s, rdpSettings* settings) { Stream_Write_UINT16(s, 0); /* numEntriesCache0 (2 bytes) */ Stream_Write_UINT16(s, 0); /* numEntriesCache1 (2 bytes) */ @@ -192,7 +197,7 @@ BOOL rdp_recv_client_font_list_pdu(wStream* s) return TRUE; } -void rdp_write_client_font_list_pdu(wStream* s, UINT16 flags) +static void rdp_write_client_font_list_pdu(wStream* s, UINT16 flags) { Stream_Write_UINT16(s, 0); /* numberFonts (2 bytes) */ Stream_Write_UINT16(s, 0); /* totalNumFonts (2 bytes) */ diff --git a/libfreerdp/core/activation.h b/libfreerdp/core/activation.h index 8a9d95073..77ea69afc 100644 --- a/libfreerdp/core/activation.h +++ b/libfreerdp/core/activation.h @@ -42,22 +42,16 @@ FREERDP_LOCAL BOOL rdp_recv_deactivate_all(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_deactivate_all(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_recv_synchronize_pdu(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL BOOL rdp_recv_server_synchronize_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_server_synchronize_pdu(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_client_synchronize_pdu(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_recv_control_pdu(wStream* s, UINT16* action); + FREERDP_LOCAL BOOL rdp_recv_server_control_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action); FREERDP_LOCAL BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp); -FREERDP_LOCAL BOOL rdp_recv_client_font_list_pdu(wStream* s); FREERDP_LOCAL BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags); FREERDP_LOCAL BOOL rdp_recv_font_map_pdu(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL BOOL rdp_recv_server_font_map_pdu(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL BOOL rdp_recv_client_font_map_pdu(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_server_accept_client_control_pdu(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s); diff --git a/libfreerdp/core/autodetect.c b/libfreerdp/core/autodetect.c index 52a6c5176..b57ab07c7 100644 --- a/libfreerdp/core/autodetect.c +++ b/libfreerdp/core/autodetect.c @@ -316,7 +316,7 @@ static BOOL autodetect_send_netchar_result(rdpContext* context, UINT16 sequenceN return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ); } -BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber) +static BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber) { wStream* s; /* Send the response PDU to the server */ diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index d0db2f89a..59842ab0a 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -185,6 +185,7 @@ */ static int rdp_client_connect_finalize(rdpRdp* rdp); +static BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp); static BOOL rdp_client_reset_codecs(rdpContext* context) { diff --git a/libfreerdp/core/display.c b/libfreerdp/core/display.c index 58f1798b4..d8a0c5371 100644 --- a/libfreerdp/core/display.c +++ b/libfreerdp/core/display.c @@ -19,8 +19,8 @@ #include "display.h" -BOOL display_write_monitor_layout_pdu(wStream* s, UINT32 monitorCount, - const MONITOR_DEF* monitorDefArray) +static BOOL display_write_monitor_layout_pdu(wStream* s, UINT32 monitorCount, + const MONITOR_DEF* monitorDefArray) { UINT32 index; const MONITOR_DEF* monitor; diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 4026c604b..e74993426 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -33,6 +33,39 @@ #define TAG FREERDP_TAG("core.gcc") +static BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length); +static BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length); +static BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length); +static void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length); + +static void gcc_write_client_core_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_write_server_core_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static void gcc_write_client_security_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static void gcc_write_client_network_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_write_server_network_data(wStream* s, rdpMcs* mcs); +static void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); +static void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_server_message_channel_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, + UINT16 blockLength); +static void gcc_write_client_multitransport_channel_data(wStream* s, rdpMcs* mcs); +static BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); +static void gcc_write_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); + static DWORD rdp_version_common(DWORD serverVersion, DWORD clientVersion) { DWORD version = MIN(serverVersion, clientVersion); diff --git a/libfreerdp/core/gcc.h b/libfreerdp/core/gcc.h index 02560d353..b65740f71 100644 --- a/libfreerdp/core/gcc.h +++ b/libfreerdp/core/gcc.h @@ -34,40 +34,7 @@ FREERDP_LOCAL BOOL gcc_read_conference_create_request(wStream* s, rdpMcs* mcs); FREERDP_LOCAL void gcc_write_conference_create_request(wStream* s, wStream* userData); FREERDP_LOCAL BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs); FREERDP_LOCAL void gcc_write_conference_create_response(wStream* s, wStream* userData); -FREERDP_LOCAL BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length); FREERDP_LOCAL void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length); FREERDP_LOCAL BOOL gcc_write_server_data_blocks(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length); -FREERDP_LOCAL void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length); -FREERDP_LOCAL BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_core_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_write_server_core_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_security_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_network_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_write_server_network_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_message_channel_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, - UINT16 blockLength); -FREERDP_LOCAL void gcc_write_client_multitransport_channel_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); -FREERDP_LOCAL void gcc_write_server_multitransport_channel_data(wStream* s, rdpMcs* mcs); #endif /* FREERDP_LIB_CORE_GCC_H */ diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 1c9506dd8..64757674a 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -67,7 +67,7 @@ static struct { INFO_HIDEF_RAIL_SUPPORTED, "INFO_HIDEF_RAIL_SUPPORTED" }, }; -FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags) +static char* rdp_info_package_flags_description(UINT32 flags) { char* result; size_t maximum_size = 1; /* Reserve space for the terminating '\0' by strcat if all flags set */ diff --git a/libfreerdp/core/info.h b/libfreerdp/core/info.h index 13d688563..7b666cfab 100644 --- a/libfreerdp/core/info.h +++ b/libfreerdp/core/info.h @@ -58,13 +58,10 @@ #define SAVE_SESSION_PDU_VERSION_ONE 0x0001 -FREERDP_LOCAL void rdp_write_auto_reconnect_cookie(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_recv_client_info(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_client_info(rdpRdp* rdp); FREERDP_LOCAL BOOL rdp_recv_save_session_info(rdpRdp* rdp, wStream* s); FREERDP_LOCAL BOOL rdp_send_save_session_info(rdpContext* context, UINT32 type, void* data); FREERDP_LOCAL BOOL rdp_send_server_status_info(rdpContext* context, UINT32 status); -FREERDP_LOCAL char* rdp_info_package_flags_description(UINT32 flags); - #endif /* FREERDP_LIB_CORE_INFO_H */ diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index d40363a6b..dbaac78c3 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -321,7 +321,7 @@ error_path: * @return if the operation completed successfully */ -BOOL license_read_preamble(wStream* s, BYTE* bMsgType, BYTE* flags, UINT16* wMsgSize) +static BOOL license_read_preamble(wStream* s, BYTE* bMsgType, BYTE* flags, UINT16* wMsgSize) { /* preamble (4 bytes) */ if (Stream_GetRemainingLength(s) < 4) @@ -634,7 +634,7 @@ BOOL license_generate_hwid(rdpLicense* license) WINPR_MD5_DIGEST_LENGTH); } -BOOL license_get_server_rsa_public_key(rdpLicense* license) +static BOOL license_get_server_rsa_public_key(rdpLicense* license) { BYTE* Exponent; BYTE* Modulus; @@ -907,8 +907,8 @@ BOOL license_write_binary_blob(wStream* s, const LICENSE_BLOB* blob) return TRUE; } -BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLOB* blob, - UINT32 ModulusLength) +static BOOL license_write_encrypted_premaster_secret_blob(wStream* s, const LICENSE_BLOB* blob, + UINT32 ModulusLength) { UINT32 length; length = ModulusLength + 8; diff --git a/libfreerdp/core/listener.c b/libfreerdp/core/listener.c index db9182eb0..68b0c0217 100644 --- a/libfreerdp/core/listener.c +++ b/libfreerdp/core/listener.c @@ -269,7 +269,8 @@ static BOOL freerdp_listener_get_fds(freerdp_listener* instance, void** rfds, in return TRUE; } -DWORD freerdp_listener_get_event_handles(freerdp_listener* instance, HANDLE* events, DWORD nCount) +static DWORD freerdp_listener_get_event_handles(freerdp_listener* instance, HANDLE* events, + DWORD nCount) { int index; rdpListener* listener = (rdpListener*)instance->listener; diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index 9caa2dddb..5eabe4c04 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -192,6 +192,16 @@ static const char* const mcs_result_enumerated[] = }; */ +static BOOL mcs_merge_domain_parameters(DomainParameters* targetParameters, + DomainParameters* minimumParameters, + DomainParameters* maximumParameters, + DomainParameters* pOutParameters); + +static BOOL mcs_write_connect_initial(wStream* s, rdpMcs* mcs, wStream* userData); +static BOOL mcs_write_connect_response(wStream* s, rdpMcs* mcs, wStream* userData); +static BOOL mcs_read_domain_mcspdu_header(wStream* s, enum DomainMCSPDU* domainMCSPDU, + UINT16* length); + static int mcs_initialize_client_channels(rdpMcs* mcs, rdpSettings* settings) { UINT32 index; diff --git a/libfreerdp/core/mcs.h b/libfreerdp/core/mcs.h index fc0bcc66d..8c030a139 100644 --- a/libfreerdp/core/mcs.h +++ b/libfreerdp/core/mcs.h @@ -154,14 +154,6 @@ struct rdp_mcs #define MCS_TYPE_CONNECT_INITIAL 0x65 #define MCS_TYPE_CONNECT_RESPONSE 0x66 -FREERDP_LOCAL BOOL mcs_merge_domain_parameters(DomainParameters* targetParameters, - DomainParameters* minimumParameters, - DomainParameters* maximumParameters, - DomainParameters* pOutParameters); - -FREERDP_LOCAL BOOL mcs_write_connect_initial(wStream* s, rdpMcs* mcs, wStream* userData); -FREERDP_LOCAL BOOL mcs_write_connect_response(wStream* s, rdpMcs* mcs, wStream* userData); - FREERDP_LOCAL BOOL mcs_recv_connect_initial(rdpMcs* mcs, wStream* s); FREERDP_LOCAL BOOL mcs_send_connect_initial(rdpMcs* mcs); FREERDP_LOCAL BOOL mcs_recv_connect_response(rdpMcs* mcs, wStream* s); @@ -178,8 +170,7 @@ FREERDP_LOCAL BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, wStream* s, UINT16 FREERDP_LOCAL BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, UINT16 channelId); FREERDP_LOCAL BOOL mcs_recv_disconnect_provider_ultimatum(rdpMcs* mcs, wStream* s, int* reason); FREERDP_LOCAL BOOL mcs_send_disconnect_provider_ultimatum(rdpMcs* mcs); -FREERDP_LOCAL BOOL mcs_read_domain_mcspdu_header(wStream* s, enum DomainMCSPDU* domainMCSPDU, - UINT16* length); + FREERDP_LOCAL void mcs_write_domain_mcspdu_header(wStream* s, enum DomainMCSPDU domainMCSPDU, UINT16 length, BYTE options); diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index f4807c523..e56ffa487 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -108,8 +108,8 @@ static BOOL freerdp_peer_virtual_channel_close(freerdp_peer* client, HANDLE hCha return TRUE; } -int freerdp_peer_virtual_channel_read(freerdp_peer* client, HANDLE hChannel, BYTE* buffer, - UINT32 length) +static int freerdp_peer_virtual_channel_read(freerdp_peer* client, HANDLE hChannel, BYTE* buffer, + UINT32 length) { return 0; /* this needs to be implemented by the server application */ } @@ -181,7 +181,7 @@ static int freerdp_peer_virtual_channel_write(freerdp_peer* client, HANDLE hChan return 1; } -void* freerdp_peer_virtual_channel_get_data(freerdp_peer* client, HANDLE hChannel) +static void* freerdp_peer_virtual_channel_get_data(freerdp_peer* client, HANDLE hChannel) { rdpPeerChannel* peerChannel = (rdpPeerChannel*)hChannel; @@ -191,7 +191,7 @@ void* freerdp_peer_virtual_channel_get_data(freerdp_peer* client, HANDLE hChanne return peerChannel->extra; } -int freerdp_peer_virtual_channel_set_data(freerdp_peer* client, HANDLE hChannel, void* data) +static int freerdp_peer_virtual_channel_set_data(freerdp_peer* client, HANDLE hChannel, void* data) { rdpPeerChannel* peerChannel = (rdpPeerChannel*)hChannel; diff --git a/libfreerdp/core/proxy.c b/libfreerdp/core/proxy.c index d2b14eb01..1bd8fc459 100644 --- a/libfreerdp/core/proxy.c +++ b/libfreerdp/core/proxy.c @@ -65,7 +65,8 @@ static const char* rplstat[] = { "succeeded", static BOOL http_proxy_connect(BIO* bufferedBio, const char* hostname, UINT16 port); static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, const char* proxyPassword, const char* hostname, UINT16 port); -void proxy_read_environment(rdpSettings* settings, char* envname); +static void proxy_read_environment(rdpSettings* settings, char* envname); +static BOOL proxy_parse_uri(rdpSettings* settings, const char* uri); BOOL proxy_prepare(rdpSettings* settings, const char** lpPeerHostname, UINT16* lpPeerPort, const char** lpProxyUsername, const char** lpProxyPassword) diff --git a/libfreerdp/core/proxy.h b/libfreerdp/core/proxy.h index 96f85d43f..ac2341c3d 100644 --- a/libfreerdp/core/proxy.h +++ b/libfreerdp/core/proxy.h @@ -25,7 +25,7 @@ BOOL proxy_prepare(rdpSettings* settings, const char** lpPeerHostname, UINT16* lpPeerPort, const char** lpProxyUsername, const char** lpProxyPassword); -BOOL proxy_parse_uri(rdpSettings* settings, const char* uri); + BOOL proxy_connect(rdpSettings* settings, BIO* bio, const char* proxyUsername, const char* proxyPassword, const char* hostname, UINT16 port); diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index 53d6bfb0d..567275be9 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -34,7 +34,7 @@ #define TAG FREERDP_TAG("core.rdp") -const char* DATA_PDU_TYPE_STRINGS[80] = { +static const char* DATA_PDU_TYPE_STRINGS[80] = { "?", "?", /* 0x00 - 0x01 */ "Update", /* 0x02 */ @@ -102,6 +102,11 @@ const char* DATA_PDU_TYPE_STRINGS[80] = { "?" /* 0x41 - 0x46 */ }; +static void rdp_read_flow_control_pdu(wStream* s, UINT16* type); +static void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type, + UINT16 channel_id); +static void rdp_write_share_data_header(wStream* s, UINT16 length, BYTE type, UINT32 share_id); + /** * Read RDP Security Header.\n * @msdn{cc240579} diff --git a/libfreerdp/core/rdp.h b/libfreerdp/core/rdp.h index 5c194a64b..19e1c28eb 100644 --- a/libfreerdp/core/rdp.h +++ b/libfreerdp/core/rdp.h @@ -186,16 +186,11 @@ FREERDP_LOCAL void rdp_write_security_header(wStream* s, UINT16 flags); FREERDP_LOCAL BOOL rdp_read_share_control_header(wStream* s, UINT16* length, UINT16* type, UINT16* channel_id); -FREERDP_LOCAL void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type, - UINT16 channel_id); FREERDP_LOCAL BOOL rdp_read_share_data_header(wStream* s, UINT16* length, BYTE* type, UINT32* share_id, BYTE* compressed_type, UINT16* compressed_len); -FREERDP_LOCAL void rdp_write_share_data_header(wStream* s, UINT16 length, BYTE type, - UINT32 share_id); - FREERDP_LOCAL wStream* rdp_send_stream_init(rdpRdp* rdp); FREERDP_LOCAL wStream* rdp_send_stream_pdu_init(rdpRdp* rdp); @@ -218,8 +213,6 @@ FREERDP_LOCAL int rdp_recv_message_channel_pdu(rdpRdp* rdp, wStream* s, UINT16 s FREERDP_LOCAL int rdp_recv_out_of_sequence_pdu(rdpRdp* rdp, wStream* s); -FREERDP_LOCAL void rdp_read_flow_control_pdu(wStream* s, UINT16* type); - FREERDP_LOCAL int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra); FREERDP_LOCAL int rdp_check_fds(rdpRdp* rdp); diff --git a/libfreerdp/core/security.c b/libfreerdp/core/security.c index 4cca6d02c..9ef9b1afd 100644 --- a/libfreerdp/core/security.c +++ b/libfreerdp/core/security.c @@ -188,7 +188,7 @@ void security_mac_salt_key(const BYTE* session_key_blob, const BYTE* client_rand memcpy(output, session_key_blob, 16); } -BOOL security_md5_16_32_32(const BYTE* in0, const BYTE* in1, const BYTE* in2, BYTE* output) +static BOOL security_md5_16_32_32(const BYTE* in0, const BYTE* in1, const BYTE* in2, BYTE* output) { WINPR_DIGEST_CTX* md5 = NULL; BOOL result = FALSE; @@ -217,8 +217,8 @@ out: return result; } -BOOL security_md5_16_32_32_Allow_FIPS(const BYTE* in0, const BYTE* in1, const BYTE* in2, - BYTE* output) +static BOOL security_md5_16_32_32_Allow_FIPS(const BYTE* in0, const BYTE* in1, const BYTE* in2, + BYTE* output) { WINPR_DIGEST_CTX* md5 = NULL; BOOL result = FALSE; @@ -253,7 +253,7 @@ BOOL security_licensing_encryption_key(const BYTE* session_key_blob, const BYTE* output); } -void security_UINT32_le(BYTE* output, UINT32 value) +static void security_UINT32_le(BYTE* output, UINT32 value) { output[0] = (value)&0xFF; output[1] = (value >> 8) & 0xFF; @@ -645,7 +645,7 @@ BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp) return TRUE; } -BOOL security_key_update(BYTE* key, BYTE* update_key, int key_len, rdpRdp* rdp) +static BOOL security_key_update(BYTE* key, BYTE* update_key, int key_len, rdpRdp* rdp) { BYTE sha1h[WINPR_SHA1_DIGEST_LENGTH]; WINPR_DIGEST_CTX* sha1 = NULL; diff --git a/libfreerdp/core/tpdu.c b/libfreerdp/core/tpdu.c index 3c879b895..3cad8ea8c 100644 --- a/libfreerdp/core/tpdu.c +++ b/libfreerdp/core/tpdu.c @@ -65,6 +65,8 @@ * | ... | */ +static void tpdu_write_header(wStream* s, UINT16 length, BYTE code); + /** * Read TPDU header. * @param s stream diff --git a/libfreerdp/core/tpdu.h b/libfreerdp/core/tpdu.h index ee6e61ec8..66fba0095 100644 --- a/libfreerdp/core/tpdu.h +++ b/libfreerdp/core/tpdu.h @@ -43,7 +43,6 @@ enum X224_TPDU_TYPE #define TPDU_DISCONNECT_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_DISCONNECT_REQUEST_HEADER_LENGTH) FREERDP_LOCAL BOOL tpdu_read_header(wStream* s, BYTE* code, BYTE* li); -FREERDP_LOCAL void tpdu_write_header(wStream* s, UINT16 length, BYTE code); FREERDP_LOCAL BOOL tpdu_read_connection_request(wStream* s, BYTE* li); FREERDP_LOCAL void tpdu_write_connection_request(wStream* s, UINT16 length); FREERDP_LOCAL BOOL tpdu_read_connection_confirm(wStream* s, BYTE* li); diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 239045c1c..3f7db6bfb 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -550,7 +550,7 @@ static void transport_bio_error_log(rdpTransport* transport, LPCSTR biofunc, BIO } } -SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) +static SSIZE_T transport_read_layer(rdpTransport* transport, BYTE* data, size_t bytes) { SSIZE_T read = 0; rdpRdp* rdp = transport->context->rdp; diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index 44571e87c..e7434f3d6 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -864,7 +864,7 @@ static BOOL update_set_bounds(rdpContext* context, const rdpBounds* bounds) return TRUE; } -BOOL update_bounds_is_null(rdpBounds* bounds) +static BOOL update_bounds_is_null(rdpBounds* bounds) { if ((bounds->left == 0) && (bounds->top == 0) && (bounds->right == 0) && (bounds->bottom == 0)) return TRUE; @@ -872,7 +872,7 @@ BOOL update_bounds_is_null(rdpBounds* bounds) return FALSE; } -BOOL update_bounds_equals(rdpBounds* bounds1, rdpBounds* bounds2) +static BOOL update_bounds_equals(rdpBounds* bounds1, rdpBounds* bounds2) { if ((bounds1->left == bounds2->left) && (bounds1->top == bounds2->top) && (bounds1->right == bounds2->right) && (bounds1->bottom == bounds2->bottom)) @@ -881,7 +881,7 @@ BOOL update_bounds_equals(rdpBounds* bounds1, rdpBounds* bounds2) return FALSE; } -int update_prepare_bounds(rdpContext* context, ORDER_INFO* orderInfo) +static int update_prepare_bounds(rdpContext* context, ORDER_INFO* orderInfo) { int length = 0; rdpUpdate* update = context->update; @@ -946,7 +946,8 @@ static int update_prepare_order_info(rdpContext* context, ORDER_INFO* orderInfo, return length; } -int update_write_order_info(rdpContext* context, wStream* s, ORDER_INFO* orderInfo, size_t offset) +static int update_write_order_info(rdpContext* context, wStream* s, ORDER_INFO* orderInfo, + size_t offset) { size_t position; WINPR_UNUSED(context); diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 016455764..f5fc31e50 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -70,7 +70,7 @@ static BOOL certificate_line_is_comment(const char* line, size_t length) return TRUE; } -BOOL certificate_store_init(rdpCertificateStore* certificate_store) +static BOOL certificate_store_init(rdpCertificateStore* certificate_store) { char* server_path = NULL; rdpSettings* settings; diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index 41e8cccd4..225152845 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -193,8 +193,8 @@ int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, return crypto_rsa_private(input, length, key_length, modulus, private_exponent, output); } -int crypto_rsa_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, - const BYTE* private_exponent, BYTE* output) +static int crypto_rsa_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, + const BYTE* private_exponent, BYTE* output) { return crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, output); diff --git a/libfreerdp/crypto/der.c b/libfreerdp/crypto/der.c index 205d9027b..b87b6dc00 100644 --- a/libfreerdp/crypto/der.c +++ b/libfreerdp/crypto/der.c @@ -77,7 +77,7 @@ int der_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc) return der_write_length(s, length) + 1; } -void der_write_universal_tag(wStream* s, BYTE tag, BOOL pc) +static void der_write_universal_tag(wStream* s, BYTE tag, BOOL pc) { Stream_Write_UINT8(s, (ER_CLASS_UNIV | ER_PC(pc)) | (ER_TAG_MASK & tag)); } diff --git a/libfreerdp/crypto/per.c b/libfreerdp/crypto/per.c index 1024e851c..444e43308 100644 --- a/libfreerdp/crypto/per.c +++ b/libfreerdp/crypto/per.c @@ -373,7 +373,7 @@ void per_write_object_identifier(wStream* s, BYTE oid[6]) * @param length string length */ -void per_write_string(wStream* s, BYTE* str, int length) +static void per_write_string(wStream* s, BYTE* str, int length) { int i; diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index bcb2eee08..7ff86edad 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -973,7 +973,8 @@ static BOOL gdi_frame_marker(rdpContext* context, const FRAME_MARKER_ORDER* fram return TRUE; } -BOOL gdi_surface_frame_marker(rdpContext* context, const SURFACE_FRAME_MARKER* surfaceFrameMarker) +static BOOL gdi_surface_frame_marker(rdpContext* context, + const SURFACE_FRAME_MARKER* surfaceFrameMarker) { WLog_Print(context->gdi->log, WLOG_DEBUG, "frameId %" PRIu32 " frameAction %" PRIu32 "", surfaceFrameMarker->frameId, surfaceFrameMarker->frameAction); diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index 3c86a8843..de202d11a 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -61,7 +61,8 @@ int freerdp_detect_keyboard(DWORD* keyboardLayoutId) return 0; } -int freerdp_keyboard_init_apple(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rdp_scancode[256]) +static int freerdp_keyboard_init_apple(DWORD* keyboardLayoutId, + DWORD x11_keycode_to_rdp_scancode[256]) { DWORD vkcode; DWORD keycode; @@ -79,7 +80,8 @@ int freerdp_keyboard_init_apple(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rd return 0; } -int freerdp_keyboard_init_x11_evdev(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rdp_scancode[256]) +static int freerdp_keyboard_init_x11_evdev(DWORD* keyboardLayoutId, + DWORD x11_keycode_to_rdp_scancode[256]) { DWORD vkcode; DWORD keycode; diff --git a/libfreerdp/locale/keyboard_x11.c b/libfreerdp/locale/keyboard_x11.c index 58b4bce66..7ec8793b0 100644 --- a/libfreerdp/locale/keyboard_x11.c +++ b/libfreerdp/locale/keyboard_x11.c @@ -146,7 +146,7 @@ int freerdp_detect_keyboard_layout_from_xkb(DWORD* keyboardLayoutId) return 0; } -char* freerdp_detect_keymap_from_xkb() +static char* freerdp_detect_keymap_from_xkb(void) { char* pch; char* beg; diff --git a/libfreerdp/locale/keyboard_xkbfile.c b/libfreerdp/locale/keyboard_xkbfile.c index 9fb59d490..047782a0e 100644 --- a/libfreerdp/locale/keyboard_xkbfile.c +++ b/libfreerdp/locale/keyboard_xkbfile.c @@ -48,7 +48,7 @@ struct _XKB_KEY_NAME_SCANCODE }; typedef struct _XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE; -XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = { +static const XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = { { "AB00", RDP_SCANCODE_LSHIFT }, { "AB01", RDP_SCANCODE_KEY_Z }, // evdev 52 { "AB02", RDP_SCANCODE_KEY_X }, // evdev 53 @@ -310,7 +310,11 @@ XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] = { { "XFER", RDP_SCANCODE_CONVERT_JP }, // JP alias of evdev 100 Henkan }; -void* freerdp_keyboard_xkb_init() +static int detect_keyboard_layout_from_xkbfile(void* display, DWORD* keyboardLayoutId); +static int freerdp_keyboard_load_map_from_xkbfile(void* display, + DWORD x11_keycode_to_rdp_scancode[256]); + +static void* freerdp_keyboard_xkb_init(void) { int status; diff --git a/libfreerdp/locale/keyboard_xkbfile.h b/libfreerdp/locale/keyboard_xkbfile.h index e59bd8016..7bf194749 100644 --- a/libfreerdp/locale/keyboard_xkbfile.h +++ b/libfreerdp/locale/keyboard_xkbfile.h @@ -27,8 +27,4 @@ FREERDP_LOCAL int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, DWORD x11_keycode_to_rdp_scancode[256]); -FREERDP_LOCAL int detect_keyboard_layout_from_xkbfile(void* display, DWORD* keyboardLayoutId); -FREERDP_LOCAL int freerdp_keyboard_load_map_from_xkbfile(void* display, - DWORD x11_keycode_to_rdp_scancode[256]); - #endif /* FREERDP_LIB_LOCALE_KEYBOARD_XKB_H */ diff --git a/libfreerdp/primitives/prim_alphaComp_opt.c b/libfreerdp/primitives/prim_alphaComp_opt.c index aa615e60c..16b636faa 100644 --- a/libfreerdp/primitives/prim_alphaComp_opt.c +++ b/libfreerdp/primitives/prim_alphaComp_opt.c @@ -45,9 +45,9 @@ static primitives_t* generic = NULL; #ifdef WITH_SSE2 #if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) -pstatus_t sse2_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, - UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, - UINT32 height) +static pstatus_t sse2_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, + UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, + UINT32 height) { const UINT32* sptr1 = (const UINT32*)pSrc1; const UINT32* sptr2 = (const UINT32*)pSrc2; diff --git a/libfreerdp/primitives/prim_templates.h b/libfreerdp/primitives/prim_templates.h index 4333a1e78..47872651e 100644 --- a/libfreerdp/primitives/prim_templates.h +++ b/libfreerdp/primitives/prim_templates.h @@ -196,252 +196,252 @@ * SCD = Source, Constant, Destination * PRE = preload xmm0 with the constant. */ -#define SSE3_SCD_PRE_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ - pstatus_t _name_(const _type_* pSrc, _type_ val, _type_* pDst, INT32 len) \ - { \ - int shifts = 0; \ - UINT32 offBeatMask; \ - const _type_* sptr = pSrc; \ - _type_* dptr = pDst; \ - size_t count; \ - __m128i xmm0; \ - if (len < 16) /* pointless if too small */ \ - { \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - if (sizeof(_type_) == 1) \ - shifts = 1; \ - else if (sizeof(_type_) == 2) \ - shifts = 2; \ - else if (sizeof(_type_) == 4) \ - shifts = 3; \ - else if (sizeof(_type_) == 8) \ - shifts = 4; \ - offBeatMask = (1 << (shifts - 1)) - 1; \ - if ((ULONG_PTR)pDst & offBeatMask) \ - { \ - /* Incrementing the pointer skips over 16-byte boundary. */ \ - return _fallback_(pSrc, val, pDst, len); \ - } \ - /* Get to the 16-byte boundary now. */ \ - while ((ULONG_PTR)dptr & 0x0f) \ - { \ - _slowWay_; \ - if (--len == 0) \ - return PRIMITIVES_SUCCESS; \ - } \ - /* Use 4 128-bit SSE registers. */ \ - count = len >> (7 - shifts); \ - len -= count << (7 - shifts); \ - xmm0 = _mm_set1_epi32(val); \ - if ((ULONG_PTR)sptr & 0x0f) \ - { \ - while (count--) \ - { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_lddqu_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - xmm2 = _op_(xmm2, xmm0); \ - xmm3 = _op_(xmm3, xmm0); \ - xmm4 = _op_(xmm4, xmm0); \ - _mm_store_si128((__m128i*)dptr, xmm1); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm2); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm3); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm4); \ - dptr += (16 / sizeof(_type_)); \ - } \ - } \ - else \ - { \ - while (count--) \ - { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_load_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_load_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_load_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_load_si128((__m128i*)sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - xmm2 = _op_(xmm2, xmm0); \ - xmm3 = _op_(xmm3, xmm0); \ - xmm4 = _op_(xmm4, xmm0); \ - _mm_store_si128((__m128i*)dptr, xmm1); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm2); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm3); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm4); \ - dptr += (16 / sizeof(_type_)); \ - } \ - } \ - /* Use a single 128-bit SSE register. */ \ - count = len >> (5 - shifts); \ - len -= count << (5 - shifts); \ - while (count--) \ - { \ - __m128i xmm1 = LOAD_SI128(sptr); \ - sptr += (16 / sizeof(_type_)); \ - xmm1 = _op_(xmm1, xmm0); \ - _mm_store_si128((__m128i*)dptr, xmm1); \ - dptr += (16 / sizeof(_type_)); \ - } \ - /* Finish off the remainder. */ \ - while (len--) \ - { \ - _slowWay_; \ - } \ - return PRIMITIVES_SUCCESS; \ +#define SSE3_SCD_PRE_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ + static pstatus_t _name_(const _type_* pSrc, _type_ val, _type_* pDst, INT32 len) \ + { \ + int shifts = 0; \ + UINT32 offBeatMask; \ + const _type_* sptr = pSrc; \ + _type_* dptr = pDst; \ + size_t count; \ + __m128i xmm0; \ + if (len < 16) /* pointless if too small */ \ + { \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + if (sizeof(_type_) == 1) \ + shifts = 1; \ + else if (sizeof(_type_) == 2) \ + shifts = 2; \ + else if (sizeof(_type_) == 4) \ + shifts = 3; \ + else if (sizeof(_type_) == 8) \ + shifts = 4; \ + offBeatMask = (1 << (shifts - 1)) - 1; \ + if ((ULONG_PTR)pDst & offBeatMask) \ + { \ + /* Incrementing the pointer skips over 16-byte boundary. */ \ + return _fallback_(pSrc, val, pDst, len); \ + } \ + /* Get to the 16-byte boundary now. */ \ + while ((ULONG_PTR)dptr & 0x0f) \ + { \ + _slowWay_; \ + if (--len == 0) \ + return PRIMITIVES_SUCCESS; \ + } \ + /* Use 4 128-bit SSE registers. */ \ + count = len >> (7 - shifts); \ + len -= count << (7 - shifts); \ + xmm0 = _mm_set1_epi32(val); \ + if ((ULONG_PTR)sptr & 0x0f) \ + { \ + while (count--) \ + { \ + __m128i xmm1, xmm2, xmm3, xmm4; \ + xmm1 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_lddqu_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + xmm2 = _op_(xmm2, xmm0); \ + xmm3 = _op_(xmm3, xmm0); \ + xmm4 = _op_(xmm4, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + else \ + { \ + while (count--) \ + { \ + __m128i xmm1, xmm2, xmm3, xmm4; \ + xmm1 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm2 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm3 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm4 = _mm_load_si128((__m128i*)sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + xmm2 = _op_(xmm2, xmm0); \ + xmm3 = _op_(xmm3, xmm0); \ + xmm4 = _op_(xmm4, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm4); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + /* Use a single 128-bit SSE register. */ \ + count = len >> (5 - shifts); \ + len -= count << (5 - shifts); \ + while (count--) \ + { \ + __m128i xmm1 = LOAD_SI128(sptr); \ + sptr += (16 / sizeof(_type_)); \ + xmm1 = _op_(xmm1, xmm0); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + } \ + /* Finish off the remainder. */ \ + while (len--) \ + { \ + _slowWay_; \ + } \ + return PRIMITIVES_SUCCESS; \ } /* ---------------------------------------------------------------------------- * SSD = Source1, Source2, Destination */ -#define SSE3_SSD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ - pstatus_t _name_(const _type_* pSrc1, const _type_* pSrc2, _type_* pDst, UINT32 len) \ - { \ - int shifts = 0; \ - UINT32 offBeatMask; \ - const _type_* sptr1 = pSrc1; \ - const _type_* sptr2 = pSrc2; \ - _type_* dptr = pDst; \ - size_t count; \ - if (len < 16) /* pointless if too small */ \ - { \ - return _fallback_(pSrc1, pSrc2, pDst, len); \ - } \ - if (sizeof(_type_) == 1) \ - shifts = 1; \ - else if (sizeof(_type_) == 2) \ - shifts = 2; \ - else if (sizeof(_type_) == 4) \ - shifts = 3; \ - else if (sizeof(_type_) == 8) \ - shifts = 4; \ - offBeatMask = (1 << (shifts - 1)) - 1; \ - if ((ULONG_PTR)pDst & offBeatMask) \ - { \ - /* Incrementing the pointer skips over 16-byte boundary. */ \ - return _fallback_(pSrc1, pSrc2, pDst, len); \ - } \ - /* Get to the 16-byte boundary now. */ \ - while ((ULONG_PTR)dptr & 0x0f) \ - { \ - pstatus_t status; \ - status = _slowWay_; \ - if (status != PRIMITIVES_SUCCESS) \ - return status; \ - if (--len == 0) \ - return PRIMITIVES_SUCCESS; \ - } \ - /* Use 4 128-bit SSE registers. */ \ - count = len >> (7 - shifts); \ - len -= count << (7 - shifts); \ - if (((ULONG_PTR)sptr1 & 0x0f) || ((ULONG_PTR)sptr2 & 0x0f)) \ - { \ - /* Unaligned loads */ \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_lddqu_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm1 = _mm_lddqu_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm5 = _mm_lddqu_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm6 = _mm_lddqu_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm7 = _mm_lddqu_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm4); \ - xmm1 = _op_(xmm1, xmm5); \ - xmm2 = _op_(xmm2, xmm6); \ - xmm3 = _op_(xmm3, xmm7); \ - _mm_store_si128((__m128i*)dptr, xmm0); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm1); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm2); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm3); \ - dptr += (16 / sizeof(_type_)); \ - } \ - } \ - else \ - { \ - /* Aligned loads */ \ - while (count--) \ - { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_load_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm1 = _mm_load_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm2 = _mm_load_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm3 = _mm_load_si128((__m128i*)sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm4 = _mm_load_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm5 = _mm_load_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm6 = _mm_load_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm7 = _mm_load_si128((__m128i*)sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm4); \ - xmm1 = _op_(xmm1, xmm5); \ - xmm2 = _op_(xmm2, xmm6); \ - xmm3 = _op_(xmm3, xmm7); \ - _mm_store_si128((__m128i*)dptr, xmm0); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm1); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm2); \ - dptr += (16 / sizeof(_type_)); \ - _mm_store_si128((__m128i*)dptr, xmm3); \ - dptr += (16 / sizeof(_type_)); \ - } \ - } \ - /* Use a single 128-bit SSE register. */ \ - count = len >> (5 - shifts); \ - len -= count << (5 - shifts); \ - while (count--) \ - { \ - __m128i xmm0, xmm1; \ - xmm0 = LOAD_SI128(sptr1); \ - sptr1 += (16 / sizeof(_type_)); \ - xmm1 = LOAD_SI128(sptr2); \ - sptr2 += (16 / sizeof(_type_)); \ - xmm0 = _op_(xmm0, xmm1); \ - _mm_store_si128((__m128i*)dptr, xmm0); \ - dptr += (16 / sizeof(_type_)); \ - } \ - /* Finish off the remainder. */ \ - while (len--) \ - { \ - _slowWay_; \ - } \ - return PRIMITIVES_SUCCESS; \ +#define SSE3_SSD_ROUTINE(_name_, _type_, _fallback_, _op_, _slowWay_) \ + static pstatus_t _name_(const _type_* pSrc1, const _type_* pSrc2, _type_* pDst, UINT32 len) \ + { \ + int shifts = 0; \ + UINT32 offBeatMask; \ + const _type_* sptr1 = pSrc1; \ + const _type_* sptr2 = pSrc2; \ + _type_* dptr = pDst; \ + size_t count; \ + if (len < 16) /* pointless if too small */ \ + { \ + return _fallback_(pSrc1, pSrc2, pDst, len); \ + } \ + if (sizeof(_type_) == 1) \ + shifts = 1; \ + else if (sizeof(_type_) == 2) \ + shifts = 2; \ + else if (sizeof(_type_) == 4) \ + shifts = 3; \ + else if (sizeof(_type_) == 8) \ + shifts = 4; \ + offBeatMask = (1 << (shifts - 1)) - 1; \ + if ((ULONG_PTR)pDst & offBeatMask) \ + { \ + /* Incrementing the pointer skips over 16-byte boundary. */ \ + return _fallback_(pSrc1, pSrc2, pDst, len); \ + } \ + /* Get to the 16-byte boundary now. */ \ + while ((ULONG_PTR)dptr & 0x0f) \ + { \ + pstatus_t status; \ + status = _slowWay_; \ + if (status != PRIMITIVES_SUCCESS) \ + return status; \ + if (--len == 0) \ + return PRIMITIVES_SUCCESS; \ + } \ + /* Use 4 128-bit SSE registers. */ \ + count = len >> (7 - shifts); \ + len -= count << (7 - shifts); \ + if (((ULONG_PTR)sptr1 & 0x0f) || ((ULONG_PTR)sptr2 & 0x0f)) \ + { \ + /* Unaligned loads */ \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm2 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm3 = _mm_lddqu_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm4 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm5 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm6 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm7 = _mm_lddqu_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm4); \ + xmm1 = _op_(xmm1, xmm5); \ + xmm2 = _op_(xmm2, xmm6); \ + xmm3 = _op_(xmm3, xmm7); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + else \ + { \ + /* Aligned loads */ \ + while (count--) \ + { \ + __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ + xmm0 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm2 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm3 = _mm_load_si128((__m128i*)sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm4 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm5 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm6 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm7 = _mm_load_si128((__m128i*)sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm4); \ + xmm1 = _op_(xmm1, xmm5); \ + xmm2 = _op_(xmm2, xmm6); \ + xmm3 = _op_(xmm3, xmm7); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm1); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm2); \ + dptr += (16 / sizeof(_type_)); \ + _mm_store_si128((__m128i*)dptr, xmm3); \ + dptr += (16 / sizeof(_type_)); \ + } \ + } \ + /* Use a single 128-bit SSE register. */ \ + count = len >> (5 - shifts); \ + len -= count << (5 - shifts); \ + while (count--) \ + { \ + __m128i xmm0, xmm1; \ + xmm0 = LOAD_SI128(sptr1); \ + sptr1 += (16 / sizeof(_type_)); \ + xmm1 = LOAD_SI128(sptr2); \ + sptr2 += (16 / sizeof(_type_)); \ + xmm0 = _op_(xmm0, xmm1); \ + _mm_store_si128((__m128i*)dptr, xmm0); \ + dptr += (16 / sizeof(_type_)); \ + } \ + /* Finish off the remainder. */ \ + while (len--) \ + { \ + _slowWay_; \ + } \ + return PRIMITIVES_SUCCESS; \ } #endif /* FREERDP_LIB_PRIM_TEMPLATES_H */ diff --git a/libfreerdp/utils/stopwatch.c b/libfreerdp/utils/stopwatch.c index 672c408f3..b30890cd9 100644 --- a/libfreerdp/utils/stopwatch.c +++ b/libfreerdp/utils/stopwatch.c @@ -32,7 +32,7 @@ LARGE_INTEGER stopwatch_freq = { 0, 0 }; #include #endif -void stopwatch_set_time(UINT64* usecs) +static void stopwatch_set_time(UINT64* usecs) { #ifdef _WIN32 LARGE_INTEGER perfcount; @@ -45,7 +45,7 @@ void stopwatch_set_time(UINT64* usecs) #endif } -STOPWATCH* stopwatch_create() +STOPWATCH* stopwatch_create(void) { STOPWATCH* sw; #ifdef _WIN32 diff --git a/rdtk/librdtk/rdtk_nine_patch.c b/rdtk/librdtk/rdtk_nine_patch.c index 35a97973b..a189021f1 100644 --- a/rdtk/librdtk/rdtk_nine_patch.c +++ b/rdtk/librdtk/rdtk_nine_patch.c @@ -26,8 +26,9 @@ #include "rdtk_nine_patch.h" -int rdtk_image_copy_alpha_blend(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, int nWidth, - int nHeight, BYTE* pSrcData, int nSrcStep, int nXSrc, int nYSrc) +static int rdtk_image_copy_alpha_blend(BYTE* pDstData, int nDstStep, int nXDst, int nYDst, + int nWidth, int nHeight, BYTE* pSrcData, int nSrcStep, + int nXSrc, int nYSrc) { int x, y; BYTE A, R, G, B; diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 61946543c..cba104225 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -1483,7 +1483,7 @@ static BOOL shadow_client_send_resize(rdpShadowClient* client, SHADOW_GFX_STATUS * * @return TRUE on success */ -BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region) +static BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region) { UINT32 numRects = 0; const RECTANGLE_16* rects; diff --git a/server/shadow/shadow_client.h b/server/shadow/shadow_client.h index aced407a7..9334924fc 100644 --- a/server/shadow/shadow_client.h +++ b/server/shadow/shadow_client.h @@ -26,7 +26,6 @@ extern "C" { #endif - BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* region); BOOL shadow_client_accepted(freerdp_listener* instance, freerdp_peer* client); #ifdef __cplusplus diff --git a/server/shadow/shadow_mcevent.c b/server/shadow/shadow_mcevent.c index abeb343eb..4b4dee8e4 100644 --- a/server/shadow/shadow_mcevent.c +++ b/server/shadow/shadow_mcevent.c @@ -26,13 +26,27 @@ #define TAG SERVER_TAG("shadow.mcevent") +struct rdp_shadow_multiclient_event +{ + HANDLE event; /* Kickoff event */ + HANDLE barrierEvent; /* Represents that all clients have consumed event */ + HANDLE doneEvent; /* Event handling finished. Server could continue */ + wArrayList* subscribers; + CRITICAL_SECTION lock; + int consuming; + int waiting; + + /* For debug */ + int eventid; +}; + struct rdp_shadow_multiclient_subscriber { rdpShadowMultiClientEvent* ref; BOOL pleaseHandle; /* Indicate if server expects my handling in this turn */ }; -rdpShadowMultiClientEvent* shadow_multiclient_new() +rdpShadowMultiClientEvent* shadow_multiclient_new(void) { rdpShadowMultiClientEvent* event = (rdpShadowMultiClientEvent*)calloc(1, sizeof(rdpShadowMultiClientEvent)); diff --git a/server/shadow/shadow_mcevent.h b/server/shadow/shadow_mcevent.h index 720dca67b..08ef6f350 100644 --- a/server/shadow/shadow_mcevent.h +++ b/server/shadow/shadow_mcevent.h @@ -30,26 +30,13 @@ * by multiple clients. All clients should wait others before continue * Server should wait for all clients before continue */ -struct rdp_shadow_multiclient_event -{ - HANDLE event; /* Kickoff event */ - HANDLE barrierEvent; /* Represents that all clients have consumed event */ - HANDLE doneEvent; /* Event handling finished. Server could continue */ - wArrayList* subscribers; - CRITICAL_SECTION lock; - int consuming; - int waiting; - - /* For debug */ - int eventid; -}; #ifdef __cplusplus extern "C" { #endif - rdpShadowMultiClientEvent* shadow_multiclient_new(); + rdpShadowMultiClientEvent* shadow_multiclient_new(void); void shadow_multiclient_free(rdpShadowMultiClientEvent* event); void shadow_multiclient_publish(rdpShadowMultiClientEvent* event); void shadow_multiclient_wait(rdpShadowMultiClientEvent* event); diff --git a/uwac/libuwac/uwac-clipboard.c b/uwac/libuwac/uwac-clipboard.c index 78d5bce01..1d5c8fbf0 100644 --- a/uwac/libuwac/uwac-clipboard.c +++ b/uwac/libuwac/uwac-clipboard.c @@ -126,7 +126,7 @@ static void UwacRegisterDeviceListener(UwacSeat* s) wl_data_device_add_listener(s->data_device, &data_device_listener, s); } -UwacReturnCode UwacCreateDataSource(UwacSeat* s) +static UwacReturnCode UwacCreateDataSource(UwacSeat* s) { if (!s) return UWAC_ERROR_INTERNAL; diff --git a/uwac/libuwac/uwac-display.c b/uwac/libuwac/uwac-display.c index 4784b5374..bde409732 100644 --- a/uwac/libuwac/uwac-display.c +++ b/uwac/libuwac/uwac-display.c @@ -49,7 +49,8 @@ static const char* event_names[] = { "touch cancel", "touch frame end", "frame done", "close", NULL }; -bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code, const char* msg, ...) +static bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code, const char* msg, + ...) { va_list args; va_start(args, msg); @@ -298,15 +299,15 @@ static void registry_handle_global_remove(void* data, struct wl_registry* regist } } -void UwacDestroyGlobal(UwacGlobal* global) +static void UwacDestroyGlobal(UwacGlobal* global) { free(global->interface); wl_list_remove(&global->link); free(global); } -void* display_bind(UwacDisplay* display, uint32_t name, const struct wl_interface* interface, - uint32_t version) +static void* display_bind(UwacDisplay* display, uint32_t name, const struct wl_interface* interface, + uint32_t version) { return wl_registry_bind(display->registry, name, interface, version); } @@ -322,7 +323,7 @@ int UwacDisplayWatchFd(UwacDisplay* display, int fd, uint32_t events, UwacTask* return epoll_ctl(display->epoll_fd, EPOLL_CTL_ADD, fd, &ep); } -void UwacDisplayUnwatchFd(UwacDisplay* display, int fd) +static void UwacDisplayUnwatchFd(UwacDisplay* display, int fd) { epoll_ctl(display->epoll_fd, EPOLL_CTL_DEL, fd, NULL); } diff --git a/uwac/libuwac/uwac-utils.c b/uwac/libuwac/uwac-utils.c index 6cb1ec0ca..1dda08d3f 100644 --- a/uwac/libuwac/uwac-utils.c +++ b/uwac/libuwac/uwac-utils.c @@ -35,7 +35,7 @@ * This part is an adaptation of client/window.c from the weston project. */ -void* fail_on_null(void* p) +static void* fail_on_null(void* p) { if (p == NULL) { diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index d2d380177..28c2fd4c1 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -52,7 +52,7 @@ static void buffer_release(void* data, struct wl_buffer* buffer) static const struct wl_buffer_listener buffer_listener = { buffer_release }; -void UwacWindowDestroyBuffers(UwacWindow* w) +static void UwacWindowDestroyBuffers(UwacWindow* w) { int i; @@ -72,8 +72,8 @@ void UwacWindowDestroyBuffers(UwacWindow* w) w->buffers = NULL; } -int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32_t width, - uint32_t height, enum wl_shm_format format); +static int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32_t width, + uint32_t height, enum wl_shm_format format); static void xdg_handle_toplevel_configure(void* data, struct xdg_toplevel* xdg_toplevel, int32_t width, int32_t height, struct wl_array* states) @@ -238,13 +238,13 @@ static const struct ivi_surface_listener ivi_surface_listener = { }; #endif -void shell_ping(void* data, struct wl_shell_surface* surface, uint32_t serial) +static void shell_ping(void* data, struct wl_shell_surface* surface, uint32_t serial) { wl_shell_surface_pong(surface, serial); } -void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edges, int32_t width, - int32_t height) +static void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edges, + int32_t width, int32_t height) { UwacWindow* window = (UwacWindow*)data; UwacConfigureEvent* event; @@ -291,7 +291,7 @@ void shell_configure(void* data, struct wl_shell_surface* surface, uint32_t edge } } -void shell_popup_done(void* data, struct wl_shell_surface* surface) +static void shell_popup_done(void* data, struct wl_shell_surface* surface) { } @@ -358,7 +358,7 @@ error_mmap: return ret; } -UwacBuffer* UwacWindowFindFreeBuffer(UwacWindow* w) +static UwacBuffer* UwacWindowFindFreeBuffer(UwacWindow* w) { int i, ret; diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h index 4921e625b..984fafdf6 100644 --- a/winpr/include/winpr/synch.h +++ b/winpr/include/winpr/synch.h @@ -118,22 +118,6 @@ extern "C" #define OpenEvent OpenEventA #endif - /* Slim Reader/Writer (SRW) Lock */ - - typedef PVOID RTL_SRWLOCK; - typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; - - WINPR_API VOID InitializeSRWLock(PSRWLOCK SRWLock); - - WINPR_API VOID AcquireSRWLockExclusive(PSRWLOCK SRWLock); - WINPR_API VOID AcquireSRWLockShared(PSRWLOCK SRWLock); - - WINPR_API BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); - WINPR_API BOOL TryAcquireSRWLockShared(PSRWLOCK SRWLock); - - WINPR_API VOID ReleaseSRWLockExclusive(PSRWLOCK SRWLock); - WINPR_API VOID ReleaseSRWLockShared(PSRWLOCK SRWLock); - /* Condition Variable */ typedef PVOID RTL_CONDITION_VARIABLE; diff --git a/winpr/include/winpr/sysinfo.h b/winpr/include/winpr/sysinfo.h index 07e460c9e..c14e999d9 100644 --- a/winpr/include/winpr/sysinfo.h +++ b/winpr/include/winpr/sysinfo.h @@ -291,14 +291,19 @@ extern "C" #define MAX_COMPUTERNAME_LENGTH 31 + WINPR_API BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize); + WINPR_API BOOL GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize); + WINPR_API BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD lpnSize); WINPR_API BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD lpnSize); #ifdef UNICODE +#define GetComputerName GetComputerNameW #define GetComputerNameEx GetComputerNameExW #else +#define GetComputerName GetComputerNameA #define GetComputerNameEx GetComputerNameExA #endif diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index 62766c806..d9673f2d4 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -94,7 +94,7 @@ endif() # Level "1" API as defined for MinCore.lib set(WINPR_CORE synch locale library file comm pipe interlocked security environment crypto registry credentials path io memory input shell - heap utils error com timezone sysinfo pool handle thread) + heap utils error timezone sysinfo pool handle thread) foreach(DIR ${WINPR_CORE}) add_subdirectory(${DIR}) diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index a44028831..2e88d75bb 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -44,7 +44,7 @@ * http://www.w3.org/TR/clipboard-apis/ */ -const char* CF_STANDARD_STRINGS[CF_MAX] = { +static const char* CF_STANDARD_STRINGS[CF_MAX] = { "CF_RAW", /* 0 */ "CF_TEXT", /* 1 */ "CF_BITMAP", /* 2 */ @@ -65,7 +65,8 @@ const char* CF_STANDARD_STRINGS[CF_MAX] = { "CF_DIBV5" /* 17 */ }; -wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, const char* name) +static wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, + const char* name) { UINT32 index; wClipboardFormat* format = NULL; @@ -113,7 +114,7 @@ wClipboardFormat* ClipboardFindFormat(wClipboard* clipboard, UINT32 formatId, co return format; } -wClipboardSynthesizer* ClipboardFindSynthesizer(wClipboardFormat* format, UINT32 formatId) +static wClipboardSynthesizer* ClipboardFindSynthesizer(wClipboardFormat* format, UINT32 formatId) { UINT32 index; wClipboardSynthesizer* synthesizer; @@ -354,7 +355,7 @@ UINT32 ClipboardGetFormatIds(wClipboard* clipboard, UINT32** ppFormatIds) return count; } -BOOL ClipboardInitFormats(wClipboard* clipboard) +static BOOL ClipboardInitFormats(wClipboard* clipboard) { UINT32 formatId = 0; wClipboardFormat* format; diff --git a/winpr/libwinpr/com/CMakeLists.txt b/winpr/libwinpr/com/CMakeLists.txt deleted file mode 100644 index 1b82dbc69..000000000 --- a/winpr/libwinpr/com/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# WinPR: Windows Portable Runtime -# libwinpr-com cmake build script -# -# Copyright 2013 Marc-Andre Moreau -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -winpr_module_add(com.c) - -if(BUILD_TESTING) - add_subdirectory(test) -endif() diff --git a/winpr/libwinpr/com/ModuleOptions.cmake b/winpr/libwinpr/com/ModuleOptions.cmake deleted file mode 100644 index 37c3b962a..000000000 --- a/winpr/libwinpr/com/ModuleOptions.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -set(MINWIN_LAYER "1") -set(MINWIN_GROUP "core") -set(MINWIN_MAJOR_VERSION "1") -set(MINWIN_MINOR_VERSION "0") -set(MINWIN_SHORT_NAME "com") -set(MINWIN_LONG_NAME "Component Object Model (COM)") -set(MODULE_LIBRARY_NAME "api-ms-win-${MINWIN_GROUP}-${MINWIN_SHORT_NAME}-l${MINWIN_LAYER}-${MINWIN_MAJOR_VERSION}-${MINWIN_MINOR_VERSION}") - diff --git a/winpr/libwinpr/com/com.c b/winpr/libwinpr/com/com.c deleted file mode 100644 index 95111e4fc..000000000 --- a/winpr/libwinpr/com/com.c +++ /dev/null @@ -1,123 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * Component Object Model (COM) - * - * Copyright 2013 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -/** - * api-ms-win-core-com-l1-1-0.dll: - * - * CLSIDFromProgID - * CLSIDFromString - * CoAddRefServerProcess - * CoAllowUnmarshalerCLSID - * CoCancelCall - * CoCopyProxy - * CoCreateFreeThreadedMarshaler - * CoCreateGuid - * CoCreateInstance - * CoCreateInstanceEx - * CoCreateInstanceFromApp - * CoDecodeProxy - * CoDecrementMTAUsage - * CoDisableCallCancellation - * CoDisconnectContext - * CoDisconnectObject - * CoEnableCallCancellation - * CoFreeUnusedLibraries - * CoFreeUnusedLibrariesEx - * CoGetApartmentType - * CoGetCallContext - * CoGetCallerTID - * CoGetCancelObject - * CoGetClassObject - * CoGetContextToken - * CoGetCurrentLogicalThreadId - * CoGetCurrentProcess - * CoGetDefaultContext - * CoGetInterfaceAndReleaseStream - * CoGetMalloc - * CoGetMarshalSizeMax - * CoGetObjectContext - * CoGetPSClsid - * CoGetStandardMarshal - * CoGetStdMarshalEx - * CoGetTreatAsClass - * CoImpersonateClient - * CoIncrementMTAUsage - * CoInitializeEx - * CoInitializeSecurity - * CoInvalidateRemoteMachineBindings - * CoIsHandlerConnected - * CoLockObjectExternal - * CoMarshalHresult - * CoMarshalInterface - * CoMarshalInterThreadInterfaceInStream - * CoQueryAuthenticationServices - * CoQueryClientBlanket - * CoQueryProxyBlanket - * CoRegisterClassObject - * CoRegisterPSClsid - * CoRegisterSurrogate - * CoReleaseMarshalData - * CoReleaseServerProcess - * CoResumeClassObjects - * CoRevertToSelf - * CoRevokeClassObject - * CoSetCancelObject - * CoSetProxyBlanket - * CoSuspendClassObjects - * CoSwitchCallContext - * CoTaskMemAlloc - * CoTaskMemFree - * CoTaskMemRealloc - * CoTestCancel - * CoUninitialize - * CoUnmarshalHresult - * CoUnmarshalInterface - * CoWaitForMultipleHandles - * CoWaitForMultipleObjects - * CreateStreamOnHGlobal - * FreePropVariantArray - * GetHGlobalFromStream - * IIDFromString - * ProgIDFromCLSID - * PropVariantClear - * PropVariantCopy - * StringFromCLSID - * StringFromGUID2 - * StringFromIID - */ - -#ifndef _WIN32 - -HRESULT CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit) -{ - return S_OK; -} - -void CoUninitialize(void) -{ -} - -#endif diff --git a/winpr/libwinpr/com/test/.gitignore b/winpr/libwinpr/com/test/.gitignore deleted file mode 100644 index 4a027eed9..000000000 --- a/winpr/libwinpr/com/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -TestCom -TestCom.c - diff --git a/winpr/libwinpr/com/test/CMakeLists.txt b/winpr/libwinpr/com/test/CMakeLists.txt deleted file mode 100644 index 73c30a231..000000000 --- a/winpr/libwinpr/com/test/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(MODULE_NAME "TestCom") -set(MODULE_PREFIX "TEST_COM") - -set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c) - -set(${MODULE_PREFIX}_TESTS - TestComReference.c) - -create_test_sourcelist(${MODULE_PREFIX}_SRCS - ${${MODULE_PREFIX}_DRIVER} - ${${MODULE_PREFIX}_TESTS}) - -add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) - -set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") - -foreach(test ${${MODULE_PREFIX}_TESTS}) - get_filename_component(TestName ${test} NAME_WE) - add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName}) -endforeach() - -set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test") diff --git a/winpr/libwinpr/com/test/TestComReference.c b/winpr/libwinpr/com/test/TestComReference.c deleted file mode 100644 index e527d8031..000000000 --- a/winpr/libwinpr/com/test/TestComReference.c +++ /dev/null @@ -1,7 +0,0 @@ - -#include - -int TestComReference(int argc, char* argv[]) -{ - return 0; -} diff --git a/winpr/libwinpr/comm/comm_serial_sys.c b/winpr/libwinpr/comm/comm_serial_sys.c index 520e28f72..16a6ce3cf 100644 --- a/winpr/libwinpr/comm/comm_serial_sys.c +++ b/winpr/libwinpr/comm/comm_serial_sys.c @@ -1520,7 +1520,7 @@ static BOOL _set_xon(WINPR_COMM* pComm) return TRUE; } -BOOL _get_dtrrts(WINPR_COMM* pComm, ULONG* pMask) +static BOOL _get_dtrrts(WINPR_COMM* pComm, ULONG* pMask) { UINT32 lines = 0; if (ioctl(pComm->fd, TIOCMGET, &lines) < 0) @@ -1540,7 +1540,7 @@ BOOL _get_dtrrts(WINPR_COMM* pComm, ULONG* pMask) return TRUE; } -BOOL _config_size(WINPR_COMM* pComm, ULONG* pSize) +static BOOL _config_size(WINPR_COMM* pComm, ULONG* pSize) { /* http://msdn.microsoft.com/en-us/library/ff546548%28v=vs.85%29.aspx */ if (!pSize) @@ -1550,7 +1550,7 @@ BOOL _config_size(WINPR_COMM* pComm, ULONG* pSize) return TRUE; } -BOOL _immediate_char(WINPR_COMM* pComm, const UCHAR* pChar) +static BOOL _immediate_char(WINPR_COMM* pComm, const UCHAR* pChar) { BOOL result; DWORD nbBytesWritten = -1; @@ -1568,7 +1568,7 @@ BOOL _immediate_char(WINPR_COMM* pComm, const UCHAR* pChar) return result; } -BOOL _reset_device(WINPR_COMM* pComm) +static BOOL _reset_device(WINPR_COMM* pComm) { /* http://msdn.microsoft.com/en-us/library/dn265347%28v=vs.85%29.aspx */ return TRUE; diff --git a/winpr/libwinpr/crypto/cipher.c b/winpr/libwinpr/crypto/cipher.c index 5d49471dc..09e98bf4a 100644 --- a/winpr/libwinpr/crypto/cipher.c +++ b/winpr/libwinpr/crypto/cipher.c @@ -43,7 +43,7 @@ * RC4 */ -WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOOL override_fips) +static WINPR_RC4_CTX* winpr_RC4_New_Internal(const BYTE* key, size_t keylen, BOOL override_fips) { WINPR_RC4_CTX* ctx = NULL; #if defined(WITH_OPENSSL) @@ -136,7 +136,7 @@ extern mbedtls_md_type_t winpr_mbedtls_get_md_type(int md); #endif #if defined(WITH_OPENSSL) -const EVP_CIPHER* winpr_openssl_get_evp_cipher(int cipher) +static const EVP_CIPHER* winpr_openssl_get_evp_cipher(int cipher) { const EVP_CIPHER* evp = NULL; diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index 617aee6c0..019149e3e 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -863,7 +863,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw return pFile; } -BOOL IsFileDevice(LPCTSTR lpDeviceName) +static BOOL IsFileDevice(LPCTSTR lpDeviceName) { return TRUE; } diff --git a/winpr/libwinpr/file/generic.c b/winpr/libwinpr/file/generic.c index d22e13b01..9f6dc9f8b 100644 --- a/winpr/libwinpr/file/generic.c +++ b/winpr/libwinpr/file/generic.c @@ -183,10 +183,10 @@ static wArrayList* _HandleCreators; static pthread_once_t _HandleCreatorsInitialized = PTHREAD_ONCE_INIT; -HANDLE_CREATOR* GetNamedPipeClientHandleCreator(void); +extern HANDLE_CREATOR* GetNamedPipeClientHandleCreator(void); #if defined __linux__ && !defined ANDROID -HANDLE_CREATOR* GetCommHandleCreator(void); +extern HANDLE_CREATOR* GetCommHandleCreator(void); #endif /* __linux__ && !defined ANDROID */ static void _HandleCreatorsInit() diff --git a/winpr/libwinpr/file/namedPipeClient.c b/winpr/libwinpr/file/namedPipeClient.c index 876d7433f..ec4302bb3 100644 --- a/winpr/libwinpr/file/namedPipeClient.c +++ b/winpr/libwinpr/file/namedPipeClient.c @@ -61,7 +61,7 @@ static BOOL NamedPipeClientIsHandled(HANDLE handle) return TRUE; } -BOOL NamedPipeClientCloseHandle(HANDLE handle) +static BOOL NamedPipeClientCloseHandle(HANDLE handle) { WINPR_NAMED_PIPE* pNamedPipe = (WINPR_NAMED_PIPE*)handle; diff --git a/winpr/libwinpr/file/pattern.c b/winpr/libwinpr/file/pattern.c index 620490302..36cdff4f2 100644 --- a/winpr/libwinpr/file/pattern.c +++ b/winpr/libwinpr/file/pattern.c @@ -83,8 +83,9 @@ LPSTR FilePatternFindNextWildcardA(LPCSTR lpPattern, DWORD* pFlags) return NULL; } -BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, LPCSTR lpX, size_t cchX, - LPCSTR lpY, size_t cchY, LPCSTR lpWildcard, LPSTR* ppMatchEnd) +static BOOL FilePatternMatchSubExpressionA(LPCSTR lpFileName, size_t cchFileName, LPCSTR lpX, + size_t cchX, LPCSTR lpY, size_t cchY, LPCSTR lpWildcard, + LPSTR* ppMatchEnd) { LPSTR lpMatch; diff --git a/winpr/libwinpr/io/device.c b/winpr/libwinpr/io/device.c index b1ac27b76..4415ad594 100644 --- a/winpr/libwinpr/io/device.c +++ b/winpr/libwinpr/io/device.c @@ -64,7 +64,7 @@ #define DEVICE_FILE_PREFIX_PATH "\\Device\\" -char* GetDeviceFileNameWithoutPrefixA(LPCSTR lpName) +static char* GetDeviceFileNameWithoutPrefixA(LPCSTR lpName) { char* lpFileName; @@ -79,7 +79,7 @@ char* GetDeviceFileNameWithoutPrefixA(LPCSTR lpName) return lpFileName; } -char* GetDeviceFileUnixDomainSocketBaseFilePathA() +static char* GetDeviceFileUnixDomainSocketBaseFilePathA(void) { char* lpTempPath; char* lpPipePath; @@ -93,7 +93,7 @@ char* GetDeviceFileUnixDomainSocketBaseFilePathA() return lpPipePath; } -char* GetDeviceFileUnixDomainSocketFilePathA(LPCSTR lpName) +static char* GetDeviceFileUnixDomainSocketFilePathA(LPCSTR lpName) { char* lpPipePath = NULL; char* lpFileName = NULL; @@ -239,7 +239,8 @@ VOID _IoDeleteDeviceEx(PDEVICE_OBJECT_EX DeviceObject) * http://msdn.microsoft.com/en-us/library/windows/hardware/ff549043/ */ -NTSTATUS _IoCreateSymbolicLinkEx(PUNICODE_STRING SymbolicLinkName, PUNICODE_STRING DeviceName) +static NTSTATUS _IoCreateSymbolicLinkEx(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { return STATUS_SUCCESS; } @@ -249,7 +250,7 @@ NTSTATUS _IoCreateSymbolicLinkEx(PUNICODE_STRING SymbolicLinkName, PUNICODE_STRI * http://msdn.microsoft.com/en-us/library/windows/hardware/ff549085/ */ -NTSTATUS _IoDeleteSymbolicLinkEx(PUNICODE_STRING SymbolicLinkName) +static NTSTATUS _IoDeleteSymbolicLinkEx(PUNICODE_STRING SymbolicLinkName) { return STATUS_SUCCESS; } diff --git a/winpr/libwinpr/registry/registry_reg.c b/winpr/libwinpr/registry/registry_reg.c index 401cf399f..60dac3f25 100644 --- a/winpr/libwinpr/registry/registry_reg.c +++ b/winpr/libwinpr/registry/registry_reg.c @@ -337,7 +337,7 @@ static RegKey* reg_load_key(Reg* reg, RegKey* key) return subkey; } -void reg_load(Reg* reg) +static void reg_load(Reg* reg) { reg_load_start(reg); @@ -388,7 +388,7 @@ static void reg_unload_key(Reg* reg, RegKey* key) free(key); } -void reg_unload(Reg* reg) +static void reg_unload(Reg* reg) { RegKey* pKey; RegKey* pKeyNext; @@ -490,7 +490,7 @@ void reg_print_key(Reg* reg, RegKey* key) } } -void reg_print(Reg* reg) +static void reg_print(Reg* reg) { RegKey* pKey; pKey = reg->root_key->subkeys; diff --git a/winpr/libwinpr/rpc/ndr.c b/winpr/libwinpr/rpc/ndr.c index 6108cee42..58eeeb588 100644 --- a/winpr/libwinpr/rpc/ndr.c +++ b/winpr/libwinpr/rpc/ndr.c @@ -47,7 +47,7 @@ * http://dvlabs.tippingpoint.com/blog/2007/11/24/msrpc-ndr-types/ */ -void NdrPrintParamAttributes(PARAM_ATTRIBUTES attributes) +static void NdrPrintParamAttributes(PARAM_ATTRIBUTES attributes) { if (attributes.ServerAllocSize) WLog_INFO(TAG, "ServerAllocSize, "); @@ -86,8 +86,8 @@ void NdrPrintParamAttributes(PARAM_ATTRIBUTES attributes) WLog_INFO(TAG, "MustSize, "); } -void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char* pMemory, - NDR_PARAM* param) +static void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char* pMemory, + NDR_PARAM* param) { unsigned char type; PFORMAT_STRING pFormat; @@ -144,8 +144,8 @@ void NdrProcessParam(PMIDL_STUB_MESSAGE pStubMsg, NDR_PHASE phase, unsigned char } } -void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_PHASE phase, - void** fpuArgs, unsigned short numberParams) +static void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_PHASE phase, + void** fpuArgs, unsigned short numberParams) { unsigned int i; NDR_PARAM* params; @@ -183,8 +183,8 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P } } -void NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, - PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum) +static void NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum) { pRpcMessage->Handle = NULL; pRpcMessage->RpcFlags = 0; @@ -202,7 +202,7 @@ void NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMs pStubMsg->PointerLength = 0; } -void NdrPrintOptFlags(INTERPRETER_OPT_FLAGS optFlags) +static void NdrPrintOptFlags(INTERPRETER_OPT_FLAGS optFlags) { if (optFlags.ClientMustSize) WLog_INFO(TAG, "ClientMustSize, "); @@ -226,7 +226,7 @@ void NdrPrintOptFlags(INTERPRETER_OPT_FLAGS optFlags) WLog_INFO(TAG, "HasExtensions, "); } -void NdrPrintExtFlags(INTERPRETER_OPT_FLAGS2 extFlags) +static void NdrPrintExtFlags(INTERPRETER_OPT_FLAGS2 extFlags) { if (extFlags.HasNewCorrDesc) WLog_INFO(TAG, "HasNewCorrDesc, "); diff --git a/winpr/libwinpr/rpc/ndr_structure.c b/winpr/libwinpr/rpc/ndr_structure.c index fdce9aeed..8ef4bbd3f 100644 --- a/winpr/libwinpr/rpc/ndr_structure.c +++ b/winpr/libwinpr/rpc/ndr_structure.c @@ -102,7 +102,7 @@ void NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned WLog_ERR(TAG, "warning: NdrConformantVaryingStructBufferSize unimplemented"); } -ULONG NdrComplexStructMemberSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) +static ULONG NdrComplexStructMemberSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { ULONG size = 0; diff --git a/winpr/libwinpr/smartcard/smartcard_inspect.c b/winpr/libwinpr/smartcard/smartcard_inspect.c index 75fc08abc..e89683a13 100644 --- a/winpr/libwinpr/smartcard/smartcard_inspect.c +++ b/winpr/libwinpr/smartcard/smartcard_inspect.c @@ -1324,7 +1324,7 @@ SCardApiFunctionTable Inspect_SCardApiFunctionTable = { #define SMARTCARD_INSPECT_FILEPATH "C:\\Windows\\Temp" #endif -void Inspect_InitLog() +static void Inspect_InitLog(void) { wLogLayout* layout; wLogAppender* appender; diff --git a/winpr/libwinpr/sspi/CredSSP/credssp.c b/winpr/libwinpr/sspi/CredSSP/credssp.c index a2fb23413..e98f4942d 100644 --- a/winpr/libwinpr/sspi/CredSSP/credssp.c +++ b/winpr/libwinpr/sspi/CredSSP/credssp.c @@ -97,7 +97,7 @@ static SECURITY_STATUS SEC_ENTRY credssp_QueryContextAttributes(PCtxtHandle phCo return SEC_E_UNSUPPORTED_FUNCTION; } -SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleW( +static SECURITY_STATUS SEC_ENTRY credssp_AcquireCredentialsHandleW( SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c index 60526467f..71895c245 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c @@ -121,7 +121,7 @@ void ntlm_print_version_info(NTLM_VERSION_INFO* versionInfo) WLog_INFO(TAG, "\tNTLMRevisionCurrent: 0x%02" PRIX8 "", versionInfo->NTLMRevisionCurrent); } -int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) +static int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) { size_t size; Stream_Read_UINT8(s, challenge->RespType); @@ -146,7 +146,7 @@ int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* chal return 1; } -int ntlm_write_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) +static int ntlm_write_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) { ULONG length; Stream_Write_UINT8(s, challenge->RespType); @@ -201,7 +201,7 @@ void ntlm_generate_timestamp(NTLM_CONTEXT* context) ntlm_current_time(context->Timestamp); } -int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) +static int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) { WINPR_SAM* sam; WINPR_SAM_ENTRY* entry; @@ -256,7 +256,7 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) return 1; } -int ntlm_convert_password_hash(NTLM_CONTEXT* context, BYTE* hash) +static int ntlm_convert_password_hash(NTLM_CONTEXT* context, BYTE* hash) { int status; int i, hn, ln; @@ -589,7 +589,8 @@ void ntlm_decrypt_random_session_key(NTLM_CONTEXT* context) * @param signing_key Destination signing key */ -int ntlm_generate_signing_key(BYTE* exported_session_key, PSecBuffer sign_magic, BYTE* signing_key) +static int ntlm_generate_signing_key(BYTE* exported_session_key, PSecBuffer sign_magic, + BYTE* signing_key) { int length; BYTE* value; @@ -649,7 +650,8 @@ void ntlm_generate_server_signing_key(NTLM_CONTEXT* context) * @param sealing_key Destination sealing key */ -int ntlm_generate_sealing_key(BYTE* exported_session_key, PSecBuffer seal_magic, BYTE* sealing_key) +static int ntlm_generate_sealing_key(BYTE* exported_session_key, PSecBuffer seal_magic, + BYTE* sealing_key) { BYTE* p; SecBuffer buffer; diff --git a/winpr/libwinpr/sspi/Schannel/schannel.c b/winpr/libwinpr/sspi/Schannel/schannel.c index a00841874..81b6f945a 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel.c +++ b/winpr/libwinpr/sspi/Schannel/schannel.c @@ -28,9 +28,9 @@ #include "../sspi.h" -char* SCHANNEL_PACKAGE_NAME = "Schannel"; +static char* SCHANNEL_PACKAGE_NAME = "Schannel"; -SCHANNEL_CONTEXT* schannel_ContextNew() +SCHANNEL_CONTEXT* schannel_ContextNew(void) { SCHANNEL_CONTEXT* context; context = (SCHANNEL_CONTEXT*)calloc(1, sizeof(SCHANNEL_CONTEXT)); @@ -58,14 +58,14 @@ void schannel_ContextFree(SCHANNEL_CONTEXT* context) free(context); } -SCHANNEL_CREDENTIALS* schannel_CredentialsNew() +static SCHANNEL_CREDENTIALS* schannel_CredentialsNew(void) { SCHANNEL_CREDENTIALS* credentials; credentials = (SCHANNEL_CREDENTIALS*)calloc(1, sizeof(SCHANNEL_CREDENTIALS)); return credentials; } -void schannel_CredentialsFree(SCHANNEL_CREDENTIALS* credentials) +static void schannel_CredentialsFree(SCHANNEL_CREDENTIALS* credentials) { free(credentials); } @@ -87,8 +87,9 @@ static ALG_ID schannel_SupportedAlgs[] = { CALG_AES_128, CALG_DSS_SIGN, CALG_ECDSA }; -SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) +static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCredential, + ULONG ulAttribute, + void* pBuffer) { if (ulAttribute == SECPKG_ATTR_SUPPORTED_ALGS) { @@ -115,13 +116,14 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCre return SEC_E_UNSUPPORTED_FUNCTION; } -SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA(PCredHandle phCredential, - ULONG ulAttribute, void* pBuffer) +static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA(PCredHandle phCredential, + ULONG ulAttribute, + void* pBuffer) { return schannel_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); } -SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW( +static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW( SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) @@ -156,7 +158,7 @@ SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW( return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA( +static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA( SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) @@ -174,7 +176,7 @@ SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA( return status; } -SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredential) +static SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredential) { SCHANNEL_CREDENTIALS* credentials; @@ -190,7 +192,7 @@ SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredentia return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW( +static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW( PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) @@ -219,7 +221,7 @@ SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW( return status; } -SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA( +static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA( PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry) @@ -239,7 +241,7 @@ SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA( return status; } -SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext( +static SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext( PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp) @@ -265,7 +267,7 @@ SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext( return status; } -SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext) +static SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext) { SCHANNEL_CONTEXT* context; context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext); @@ -277,8 +279,8 @@ SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext) return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, ULONG ulAttribute, - void* pBuffer) +static SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, + ULONG ulAttribute, void* pBuffer) { if (!phContext) return SEC_E_INVALID_HANDLE; @@ -309,20 +311,22 @@ SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, return SEC_E_UNSUPPORTED_FUNCTION; } -SECURITY_STATUS SEC_ENTRY schannel_MakeSignature(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) +static SECURITY_STATUS SEC_ENTRY schannel_MakeSignature(PCtxtHandle phContext, ULONG fQOP, + PSecBufferDesc pMessage, ULONG MessageSeqNo) { return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) +static SECURITY_STATUS SEC_ENTRY schannel_VerifySignature(PCtxtHandle phContext, + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { return SEC_E_OK; } -SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, - PSecBufferDesc pMessage, ULONG MessageSeqNo) +static SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, + PSecBufferDesc pMessage, + ULONG MessageSeqNo) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; @@ -335,8 +339,9 @@ SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG f return status; } -SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, - ULONG MessageSeqNo, ULONG* pfQOP) +static SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext, + PSecBufferDesc pMessage, + ULONG MessageSeqNo, ULONG* pfQOP) { SECURITY_STATUS status; SCHANNEL_CONTEXT* context; diff --git a/winpr/libwinpr/sspi/Schannel/schannel_openssl.c b/winpr/libwinpr/sspi/Schannel/schannel_openssl.c index 9641e358a..7b8b00d97 100644 --- a/winpr/libwinpr/sspi/Schannel/schannel_openssl.c +++ b/winpr/libwinpr/sspi/Schannel/schannel_openssl.c @@ -49,7 +49,7 @@ struct _SCHANNEL_OPENSSL #include "../../log.h" #define TAG WINPR_TAG("sspi.schannel") -char* openssl_get_ssl_error_string(int ssl_error) +static char* openssl_get_ssl_error_string(int ssl_error) { switch (ssl_error) { diff --git a/winpr/libwinpr/synch/CMakeLists.txt b/winpr/libwinpr/synch/CMakeLists.txt index 0c584e539..c682fb36f 100644 --- a/winpr/libwinpr/synch/CMakeLists.txt +++ b/winpr/libwinpr/synch/CMakeLists.txt @@ -18,14 +18,12 @@ winpr_module_add( address.c barrier.c - condition.c critical.c event.c init.c mutex.c semaphore.c sleep.c - srw.c synch.h timer.c wait.c) diff --git a/winpr/libwinpr/synch/condition.c b/winpr/libwinpr/synch/condition.c deleted file mode 100644 index ca347e5f1..000000000 --- a/winpr/libwinpr/synch/condition.c +++ /dev/null @@ -1,62 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * Synchronization Functions - * - * Copyright 2012 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "synch.h" - -/** - * InitializeConditionVariable - * SleepConditionVariableCS - * SleepConditionVariableSRW - * WakeAllConditionVariable - * WakeConditionVariable - */ - -#ifndef _WIN32 - -VOID InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable) -{ -} - -BOOL SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, - PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds) -{ - return TRUE; -} - -BOOL SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, - DWORD dwMilliseconds, ULONG Flags) -{ - return TRUE; -} - -VOID WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable) -{ -} - -VOID WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable) -{ -} - -#endif diff --git a/winpr/libwinpr/synch/srw.c b/winpr/libwinpr/synch/srw.c deleted file mode 100644 index 5def4e564..000000000 --- a/winpr/libwinpr/synch/srw.c +++ /dev/null @@ -1,68 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * Synchronization Functions - * - * Copyright 2012 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -/** - * InitializeSRWLock - * AcquireSRWLockExclusive - * AcquireSRWLockShared - * TryAcquireSRWLockExclusive - * TryAcquireSRWLockShared - * ReleaseSRWLockExclusive - * ReleaseSRWLockShared - */ - -#ifndef _WIN32 - -VOID InitializeSRWLock(PSRWLOCK SRWLock) -{ -} - -VOID AcquireSRWLockExclusive(PSRWLOCK SRWLock) -{ -} - -VOID AcquireSRWLockShared(PSRWLOCK SRWLock) -{ -} - -BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock) -{ - return TRUE; -} - -BOOL TryAcquireSRWLockShared(PSRWLOCK SRWLock) -{ - return TRUE; -} - -VOID ReleaseSRWLockExclusive(PSRWLOCK SRWLock) -{ -} - -VOID ReleaseSRWLockShared(PSRWLOCK SRWLock) -{ -} - -#endif diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index 9ee66acdc..4613176f7 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -386,6 +386,28 @@ BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation) #if !defined(_WIN32) || defined(_UWP) +BOOL GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize) +{ + BOOL rc; + LPSTR buffer = NULL; + if (!lpnSize || (*lpnSize > INT_MAX)) + return FALSE; + + if (*lpnSize > 0) + { + buffer = malloc(*lpnSize); + if (!buffer) + return FALSE; + } + rc = GetComputerNameA(buffer, lpnSize); + + if (rc && (*lpnSize > 0)) + ConvertToUnicode(CP_UTF8, 0, buffer, (int)*lpnSize, &lpBuffer, (int)*lpnSize); + free(buffer); + + return rc; +} + BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize) { char* dot; diff --git a/winpr/libwinpr/thread/process.c b/winpr/libwinpr/thread/process.c index 25ef1aa95..317ac7ab7 100644 --- a/winpr/libwinpr/thread/process.c +++ b/winpr/libwinpr/thread/process.c @@ -143,11 +143,12 @@ static char* FindApplicationPath(char* application) static HANDLE CreateProcessHandle(pid_t pid); static BOOL ProcessHandleCloseHandle(HANDLE handle); -BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, - LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, - DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, - LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) +static BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, + LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, + DWORD dwCreationFlags, LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { pid_t pid; int numArgs; @@ -453,17 +454,6 @@ DWORD GetCurrentProcessId(VOID) return ((DWORD)getpid()); } -DWORD GetProcessId(HANDLE Process) -{ - WINPR_PROCESS* process; - process = (WINPR_PROCESS*)Process; - - if (!process) - return 0; - - return (DWORD)process->pid; -} - BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode) { WINPR_PROCESS* process; diff --git a/winpr/libwinpr/utils/CMakeLists.txt b/winpr/libwinpr/utils/CMakeLists.txt index ee5f73bac..0149ba12b 100644 --- a/winpr/libwinpr/utils/CMakeLists.txt +++ b/winpr/libwinpr/utils/CMakeLists.txt @@ -29,7 +29,6 @@ set(${MODULE_PREFIX}_COLLECTIONS_SRCS collections/LinkedList.c collections/HashTable.c collections/ListDictionary.c - collections/KeyValuePair.c collections/CountdownEvent.c collections/BufferPool.c collections/ObjectPool.c @@ -76,7 +75,6 @@ set(${MODULE_PREFIX}_WLOG_SRCS wlog/Layout.h wlog/Message.c wlog/Message.h - wlog/TextMessage.c wlog/DataMessage.c wlog/DataMessage.h wlog/ImageMessage.c diff --git a/winpr/libwinpr/utils/collections/ArrayList.c b/winpr/libwinpr/utils/collections/ArrayList.c index 64dca5384..f8fc3df06 100644 --- a/winpr/libwinpr/utils/collections/ArrayList.c +++ b/winpr/libwinpr/utils/collections/ArrayList.c @@ -143,7 +143,7 @@ void ArrayList_SetItem(wArrayList* arrayList, int index, void* obj) * Shift a section of the list. */ -BOOL ArrayList_Shift(wArrayList* arrayList, int index, int count) +static BOOL ArrayList_Shift(wArrayList* arrayList, int index, int count) { if (count > 0) { diff --git a/winpr/libwinpr/utils/collections/BipBuffer.c b/winpr/libwinpr/utils/collections/BipBuffer.c index bf679ef46..3efe3b7cd 100644 --- a/winpr/libwinpr/utils/collections/BipBuffer.c +++ b/winpr/libwinpr/utils/collections/BipBuffer.c @@ -46,7 +46,7 @@ void BipBuffer_Clear(wBipBuffer* bb) BipBlock_Clear(bb->writeR); } -BOOL BipBuffer_AllocBuffer(wBipBuffer* bb, size_t size) +static BOOL BipBuffer_AllocBuffer(wBipBuffer* bb, size_t size) { if (size < 1) return FALSE; @@ -104,7 +104,7 @@ BOOL BipBuffer_Grow(wBipBuffer* bb, size_t size) return TRUE; } -void BipBuffer_FreeBuffer(wBipBuffer* bb) +static void BipBuffer_FreeBuffer(wBipBuffer* bb) { if (bb->buffer) { diff --git a/winpr/libwinpr/utils/collections/Dictionary.c b/winpr/libwinpr/utils/collections/Dictionary.c index 62f2b64eb..861527a0f 100644 --- a/winpr/libwinpr/utils/collections/Dictionary.c +++ b/winpr/libwinpr/utils/collections/Dictionary.c @@ -45,7 +45,7 @@ int Dictionary_Count(wDictionary* dictionary) * Gets a value indicating whether the Dictionary has a fixed size. */ -BOOL Dictionary_IsFixedSized(wDictionary* dictionary) +static BOOL Dictionary_IsFixedSized(wDictionary* dictionary) { return FALSE; } @@ -54,7 +54,7 @@ BOOL Dictionary_IsFixedSized(wDictionary* dictionary) * Gets a value indicating whether the Dictionary is read-only. */ -BOOL Dictionary_IsReadOnly(wDictionary* dictionary) +static BOOL Dictionary_IsReadOnly(wDictionary* dictionary) { return FALSE; } @@ -63,7 +63,7 @@ BOOL Dictionary_IsReadOnly(wDictionary* dictionary) * Gets a value indicating whether the Dictionary is synchronized (thread safe). */ -BOOL Dictionary_IsSynchronized(wDictionary* dictionary) +static BOOL Dictionary_IsSynchronized(wDictionary* dictionary) { return dictionary->synchronized; } diff --git a/winpr/libwinpr/utils/collections/HashTable.c b/winpr/libwinpr/utils/collections/HashTable.c index 68cb4417b..164a5d0a5 100644 --- a/winpr/libwinpr/utils/collections/HashTable.c +++ b/winpr/libwinpr/utils/collections/HashTable.c @@ -104,7 +104,7 @@ static long HashTable_CalculateIdealNumOfBuckets(wHashTable* table) return idealNumOfBuckets; } -void HashTable_Rehash(wHashTable* table, int numOfBuckets) +static void HashTable_Rehash(wHashTable* table, int numOfBuckets) { int index; UINT32 hashValue; @@ -148,8 +148,8 @@ void HashTable_Rehash(wHashTable* table, int numOfBuckets) table->numOfBuckets = numOfBuckets; } -void HashTable_SetIdealRatio(wHashTable* table, float idealRatio, float lowerRehashThreshold, - float upperRehashThreshold) +static void HashTable_SetIdealRatio(wHashTable* table, float idealRatio, float lowerRehashThreshold, + float upperRehashThreshold) { table->idealRatio = idealRatio; table->lowerRehashThreshold = lowerRehashThreshold; diff --git a/winpr/libwinpr/utils/collections/KeyValuePair.c b/winpr/libwinpr/utils/collections/KeyValuePair.c deleted file mode 100644 index bb4799c56..000000000 --- a/winpr/libwinpr/utils/collections/KeyValuePair.c +++ /dev/null @@ -1,53 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * System.Collections.Generic.KeyValuePair - * - * Copyright 2012 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include - -/** - * C equivalent of the C# KeyValuePair Structure: - * http://msdn.microsoft.com/en-us/library/5tbh8a42.aspx - */ - -wKeyValuePair* KeyValuePair_New(void* key, void* value) -{ - wKeyValuePair* keyValuePair; - - keyValuePair = (wKeyValuePair*)malloc(sizeof(wKeyValuePair)); - if (!keyValuePair) - return NULL; - - keyValuePair->key = key; - keyValuePair->value = value; - - return keyValuePair; -} - -void KeyValuePair_Free(wKeyValuePair* keyValuePair) -{ - if (!keyValuePair) - return; - - free(keyValuePair); -} diff --git a/winpr/libwinpr/utils/collections/ListDictionary.c b/winpr/libwinpr/utils/collections/ListDictionary.c index b71267f88..22a2ad4e4 100644 --- a/winpr/libwinpr/utils/collections/ListDictionary.c +++ b/winpr/libwinpr/utils/collections/ListDictionary.c @@ -72,7 +72,7 @@ int ListDictionary_Count(wListDictionary* listDictionary) * Gets a value indicating whether the ListDictionary has a fixed size. */ -BOOL ListDictionary_IsFixedSized(wListDictionary* listDictionary) +static BOOL ListDictionary_IsFixedSized(wListDictionary* listDictionary) { return FALSE; } @@ -81,7 +81,7 @@ BOOL ListDictionary_IsFixedSized(wListDictionary* listDictionary) * Gets a value indicating whether the ListDictionary is read-only. */ -BOOL ListDictionary_IsReadOnly(wListDictionary* listDictionary) +static BOOL ListDictionary_IsReadOnly(wListDictionary* listDictionary) { return FALSE; } @@ -90,7 +90,7 @@ BOOL ListDictionary_IsReadOnly(wListDictionary* listDictionary) * Gets a value indicating whether the ListDictionary is synchronized (thread safe). */ -BOOL ListDictionary_IsSynchronized(wListDictionary* listDictionary) +static BOOL ListDictionary_IsSynchronized(wListDictionary* listDictionary) { return listDictionary->synchronized; } diff --git a/winpr/libwinpr/utils/collections/Reference.c b/winpr/libwinpr/utils/collections/Reference.c index f9b6d6bbb..b16001cb2 100644 --- a/winpr/libwinpr/utils/collections/Reference.c +++ b/winpr/libwinpr/utils/collections/Reference.c @@ -34,7 +34,7 @@ * http://msdn.microsoft.com/en-us/library/windows/desktop/ms693431/ */ -wReference* ReferenceTable_FindEntry(wReferenceTable* referenceTable, void* ptr) +static wReference* ReferenceTable_FindEntry(wReferenceTable* referenceTable, void* ptr) { UINT32 index = 0; BOOL found = FALSE; @@ -51,7 +51,7 @@ wReference* ReferenceTable_FindEntry(wReferenceTable* referenceTable, void* ptr) return (found) ? reference : NULL; } -wReference* ReferenceTable_GetFreeEntry(wReferenceTable* referenceTable) +static wReference* ReferenceTable_GetFreeEntry(wReferenceTable* referenceTable) { UINT32 index = 0; BOOL found = FALSE; diff --git a/winpr/libwinpr/utils/collections/StreamPool.c b/winpr/libwinpr/utils/collections/StreamPool.c index 46892a019..b8b3cb5f8 100644 --- a/winpr/libwinpr/utils/collections/StreamPool.c +++ b/winpr/libwinpr/utils/collections/StreamPool.c @@ -29,7 +29,7 @@ * Methods */ -void StreamPool_ShiftUsed(wStreamPool* pool, int index, int count) +static void StreamPool_ShiftUsed(wStreamPool* pool, int index, int count) { if (count > 0) { @@ -66,7 +66,7 @@ void StreamPool_ShiftUsed(wStreamPool* pool, int index, int count) * Adds a used stream to the pool. */ -void StreamPool_AddUsed(wStreamPool* pool, wStream* s) +static void StreamPool_AddUsed(wStreamPool* pool, wStream* s) { if ((pool->uSize + 1) >= pool->uCapacity) { @@ -88,7 +88,7 @@ void StreamPool_AddUsed(wStreamPool* pool, wStream* s) * Removes a used stream from the pool. */ -void StreamPool_RemoveUsed(wStreamPool* pool, wStream* s) +static void StreamPool_RemoveUsed(wStreamPool* pool, wStream* s) { int index; BOOL found = FALSE; @@ -106,7 +106,7 @@ void StreamPool_RemoveUsed(wStreamPool* pool, wStream* s) StreamPool_ShiftUsed(pool, index, -1); } -void StreamPool_ShiftAvailable(wStreamPool* pool, int index, int count) +static void StreamPool_ShiftAvailable(wStreamPool* pool, int index, int count) { if (count > 0) { @@ -241,7 +241,7 @@ out_fail: * Lock the stream pool */ -void StreamPool_Lock(wStreamPool* pool) +static void StreamPool_Lock(wStreamPool* pool) { EnterCriticalSection(&pool->lock); } @@ -250,7 +250,7 @@ void StreamPool_Lock(wStreamPool* pool) * Unlock the stream pool */ -void StreamPool_Unlock(wStreamPool* pool) +static void StreamPool_Unlock(wStreamPool* pool) { LeaveCriticalSection(&pool->lock); } diff --git a/winpr/libwinpr/utils/lodepng/lodepng.c b/winpr/libwinpr/utils/lodepng/lodepng.c index c9aaf22a0..9c4046dea 100644 --- a/winpr/libwinpr/utils/lodepng/lodepng.c +++ b/winpr/libwinpr/utils/lodepng/lodepng.c @@ -325,7 +325,7 @@ static void string_set(char** out, const char* in) /* ////////////////////////////////////////////////////////////////////////// */ -unsigned lodepng_read32bitInt(const unsigned char* buffer) +static unsigned lodepng_read32bitInt(const unsigned char* buffer) { return (unsigned)((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]); } @@ -3020,8 +3020,8 @@ size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* colo return (w * h * lodepng_get_bpp(color) + 7) / 8; } -size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, - unsigned bitdepth) +static size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, + unsigned bitdepth) { return (w * h * lodepng_get_bpp_lct(colortype, bitdepth) + 7) / 8; } @@ -3277,7 +3277,7 @@ unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) return 0; } -void lodepng_info_swap(LodePNGInfo* a, LodePNGInfo* b) +static void lodepng_info_swap(LodePNGInfo* a, LodePNGInfo* b) { LodePNGInfo temp = *a; *a = *b; @@ -3911,7 +3911,7 @@ void lodepng_color_profile_init(LodePNGColorProfile* profile) }*/ /*Returns how many bits needed to represent given value (max 8 bit)*/ -unsigned getValueRequiredBits(unsigned char value) +static unsigned getValueRequiredBits(unsigned char value) { if (value == 0 || value == 255) return 1; diff --git a/winpr/libwinpr/utils/sam.c b/winpr/libwinpr/utils/sam.c index 39ebd36c8..b76302477 100644 --- a/winpr/libwinpr/utils/sam.c +++ b/winpr/libwinpr/utils/sam.c @@ -154,7 +154,7 @@ static void HexStrToBin(char* str, BYTE* bin, int length) } } -BOOL SamReadEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry) +static BOOL SamReadEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry) { char* p[5]; size_t LmHashLength; diff --git a/winpr/libwinpr/utils/trio/trio.c b/winpr/libwinpr/utils/trio/trio.c index 58b66613b..ec765ce5a 100644 --- a/winpr/libwinpr/utils/trio/trio.c +++ b/winpr/libwinpr/utils/trio/trio.c @@ -4032,7 +4032,7 @@ TRIO_PRIVATE void TrioOutStreamStringDynamic TRIO_ARGS2((self, output), trio_cla /************************************************************************* * TrioArrayGetter */ -trio_pointer_t TrioArrayGetter(trio_pointer_t context, int index, int type) +static trio_pointer_t TrioArrayGetter(trio_pointer_t context, int index, int type) { /* Utility function for the printfv family */ trio_pointer_t* argarray = (trio_pointer_t*)context; diff --git a/winpr/libwinpr/utils/wlog/Appender.c b/winpr/libwinpr/utils/wlog/Appender.c index 90dee75ca..64905bf0e 100644 --- a/winpr/libwinpr/utils/wlog/Appender.c +++ b/winpr/libwinpr/utils/wlog/Appender.c @@ -93,7 +93,7 @@ BOOL WLog_CloseAppender(wLog* log) return status; } -wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType) +static wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType) { wLogAppender* appender; diff --git a/winpr/libwinpr/utils/wlog/SyslogAppender.c b/winpr/libwinpr/utils/wlog/SyslogAppender.c index 693ddd7f5..700303f9c 100644 --- a/winpr/libwinpr/utils/wlog/SyslogAppender.c +++ b/winpr/libwinpr/utils/wlog/SyslogAppender.c @@ -114,7 +114,7 @@ static BOOL WLog_SyslogAppender_WriteImageMessage(wLog* log, wLogAppender* appen return TRUE; } -void WLog_SyslogAppender_Free(wLogAppender* appender) +static void WLog_SyslogAppender_Free(wLogAppender* appender) { free(appender); } diff --git a/winpr/libwinpr/utils/wlog/TextMessage.c b/winpr/libwinpr/utils/wlog/TextMessage.c deleted file mode 100644 index f127360d3..000000000 --- a/winpr/libwinpr/utils/wlog/TextMessage.c +++ /dev/null @@ -1,27 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * WinPR Logger - * - * Copyright 2013 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -void wlog_TextMessage_dummy() -{ - /* avoid no symbol ranlib warning */ -} diff --git a/winpr/libwinpr/wnd/wnd.c b/winpr/libwinpr/wnd/wnd.c index cb18e2447..fce45bc12 100644 --- a/winpr/libwinpr/wnd/wnd.c +++ b/winpr/libwinpr/wnd/wnd.c @@ -36,7 +36,7 @@ static wArrayList* g_WindowClasses = NULL; -BOOL InitializeWindowClasses() +static BOOL InitializeWindowClasses(void) { if (g_WindowClasses) return TRUE; @@ -45,7 +45,7 @@ BOOL InitializeWindowClasses() return g_WindowClasses != NULL; } -WNDCLASSEXA* CloneWindowClass(CONST WNDCLASSEXA* lpwcx) +static WNDCLASSEXA* CloneWindowClass(CONST WNDCLASSEXA* lpwcx) { WNDCLASSEXA* _lpwcx = NULL; @@ -69,7 +69,7 @@ WNDCLASSEXA* CloneWindowClass(CONST WNDCLASSEXA* lpwcx) return _lpwcx; } -WNDCLASSEXA* FindWindowClass(LPCSTR lpClassName) +static WNDCLASSEXA* FindWindowClass(LPCSTR lpClassName) { int index; int count; diff --git a/winpr/libwinpr/wtsapi/wtsapi.c b/winpr/libwinpr/wtsapi/wtsapi.c index 8500cf951..bc1557932 100644 --- a/winpr/libwinpr/wtsapi/wtsapi.c +++ b/winpr/libwinpr/wtsapi/wtsapi.c @@ -56,7 +56,7 @@ static WtsApiFunctionTable WtsApi32_WtsApiFunctionTable = { 0 }; WtsApi32_WtsApiFunctionTable.p##_name = (##_type)GetProcAddress(g_WtsApi32Module, "WT" \ "S" #_name); -BOOL WtsApi32_InitializeWtsApi(void) +static BOOL WtsApi32_InitializeWtsApi(void) { g_WtsApi32Module = LoadLibraryA("wtsapi32.dll");