diff options
author | akallabeth <akallabeth@posteo.net> | 2021-03-01 12:29:33 +0300 |
---|---|---|
committer | akallabeth <akallabeth@users.noreply.github.com> | 2021-03-01 12:58:24 +0300 |
commit | 136a58fbd0c3c2421a4e02d6422119406f1c32c2 (patch) | |
tree | 7ecc713af38407ed30b7b7abcf7d878feb4f416a | |
parent | f7295b31d790d45176fafe46a9c6f4dde890e7a0 (diff) |
Added -DDEFINE_NO_DEPRECATED CMake option2.3.1
With that option all symbols marked deprecated are no longer
compiled. This helps testing compatibility of external apps.
27 files changed, 129 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c35eea1..50d8bed83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,10 @@ include(InstallFreeRDPMan) include(GetGitRevisionDescription) include(SetFreeRDPCMakeInstallDir) +if (DEFINE_NO_DEPRECATED) + add_definitions(-DDEFINE_NO_DEPRECATED) +endif() + # Soname versioning set(BUILD_NUMBER 0) if ($ENV{BUILD_NUMBER}) @@ -6,6 +6,10 @@ Noteworthy changes: * Also add some more EXPERIMENTAL warnings to CMake flags as some were not clear enough. * Fixed a memory leak in xfreerdp (mouse pointer updates) +* No longer activating some compile time debug options with -DWITH_DEBUG_ALL=ON + which might leak sensitive information. +* Added -DDEFINE_NO_DEPRECATED for developers to detect use of deprecated + symbols For a complete and detailed change log since the last release run: git log 2.3.0..2.3.1 diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index d4588e10b..b465a6311 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -28,11 +28,15 @@ endif() set(${MODULE_PREFIX}_SRCS client.c cmdline.c - compatibility.c - compatibility.h file.c geometry.c) +if(NOT DEFINE_NO_DEPRECATED) + list(APPEND ${MODULE_PREFIX}_SRCS + compatibility.c + compatibility.h) +endif() + foreach(FREERDP_CHANNELS_CLIENT_SRC ${FREERDP_CHANNELS_CLIENT_SRCS}) get_filename_component(NINC ${FREERDP_CHANNELS_CLIENT_SRC} PATH) include_directories(${NINC}) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index f17ba6647..53d52f419 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1341,8 +1341,10 @@ static int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv, static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* flags) { +#if !defined(DEFINE_NO_DEPRECATED) int old_cli_status; size_t old_cli_count; +#endif int posix_cli_status; size_t posix_cli_count; int windows_cli_status; @@ -1353,7 +1355,10 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* fla argc, argv, &windows_cli_count, ignoreUnknown); posix_cli_status = freerdp_detect_posix_style_command_line_syntax(argc, argv, &posix_cli_count, ignoreUnknown); +#if !defined(DEFINE_NO_DEPRECATED) old_cli_status = freerdp_detect_old_command_line_syntax(argc, argv, &old_cli_count); +#endif + /* Default is POSIX syntax */ *flags = COMMAND_LINE_SEPARATOR_SPACE; *flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; @@ -1370,6 +1375,7 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* fla *flags = COMMAND_LINE_SEPARATOR_COLON; *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; } +#if !defined(DEFINE_NO_DEPRECATED) else if (old_cli_status >= 0) { /* Ignore legacy parsing in case there is an error in the command line. */ @@ -1380,9 +1386,13 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* fla compatibility = TRUE; } } - WLog_DBG(TAG, "windows: %d/%d posix: %d/%d compat: %d/%d", windows_cli_status, windows_cli_count, posix_cli_status, posix_cli_count, old_cli_status, old_cli_count); +#else + WLog_DBG(TAG, "windows: %d/%d posix: %d/%d", windows_cli_status, windows_cli_count, + posix_cli_status, posix_cli_count); +#endif + return compatibility; } @@ -1574,12 +1584,14 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, freerdp_settings_set_string(settings, FreeRDP_ProxyUsername, NULL); freerdp_settings_set_string(settings, FreeRDP_ProxyPassword, NULL); +#if !defined(DEFINE_NO_DEPRECATED) if (compatibility) { WLog_WARN(TAG, "Using deprecated command-line interface!"); return freerdp_client_parse_old_command_line_arguments(argc, argv, settings); } else +#endif { if (allowUnknown) flags |= COMMAND_LINE_IGN_UNKNOWN_KEYWORD; @@ -2582,6 +2594,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (enable) settings->SupportGraphicsPipeline = TRUE; } +#if !defined(DEFINE_NO_DEPRECATED) #ifdef WITH_GFX_H264 CommandLineSwitchCase(arg, "gfx-h264") { @@ -2632,6 +2645,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } } #endif +#endif CommandLineSwitchCase(arg, "rfx") { settings->RemoteFxCodec = enable; @@ -2875,6 +2889,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, if (rc) return rc; } +#if !defined(DEFINE_NO_DEPRECATED) CommandLineSwitchCase(arg, "cert-name") { if (!copy_value(arg->Value, &settings->CertificateName)) @@ -2892,6 +2907,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { settings->AutoDenyCertificate = enable; } +#endif CommandLineSwitchCase(arg, "authentication") { settings->Authentication = enable; diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 807373b3e..59ff56753 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -89,6 +89,7 @@ static const COMMAND_LINE_ARGUMENT_A args[] = { "subsequent connections if the certificate does not match" " * fingerprints ... A list of certificate hashes that are accepted unconditionally for a " "connection" }, +#if !defined(DEFINE_NO_DEPRECATED) { "cert-deny", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "[deprecated, use /cert:deny] Automatically abort connection for any certificate that can " "not be validated." }, @@ -98,6 +99,7 @@ static const COMMAND_LINE_ARGUMENT_A args[] = { "[deprecated, use /cert:name:<name>] Certificate name" }, { "cert-tofu", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "[deprecated, use /cert:tofu] Automatically accept certificate on first connect" }, +#endif { "client-build-number", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "Client Build Number sent to server (influences smartcard behaviour, see [MS-RDPESC])" }, { "client-hostname", COMMAND_LINE_VALUE_REQUIRED, "<name>", NULL, NULL, -1, NULL, @@ -163,9 +165,11 @@ static const COMMAND_LINE_ARGUMENT_A args[] = { #ifdef WITH_GFX_H264 { "gfx", COMMAND_LINE_VALUE_OPTIONAL, "[[RFX|AVC420|AVC444],mask:<value>]", NULL, NULL, -1, NULL, "RDP8 graphics pipeline" }, +#if !defined(DEFINE_NO_DEPRECATED) { "gfx-h264", COMMAND_LINE_VALUE_OPTIONAL, "[[AVC420|AVC444],mask:<value>] [DEPRECATED] use /gfx:avc420 instead", NULL, NULL, -1, NULL, "RDP8.1 graphics pipeline using H264 codec" }, +#endif #else { "gfx", COMMAND_LINE_VALUE_OPTIONAL, "RFX", NULL, NULL, -1, NULL, "RDP8 graphics pipeline" }, #endif diff --git a/client/common/compatibility.h b/client/common/compatibility.h index b512a40da..42eab8d38 100644 --- a/client/common/compatibility.h +++ b/client/common/compatibility.h @@ -23,8 +23,12 @@ #include <freerdp/api.h> #include <freerdp/freerdp.h> -FREERDP_LOCAL int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count); -FREERDP_LOCAL int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, - rdpSettings* settings); +#if !defined(DEFINE_NO_DEPRECATED) +FREERDP_LOCAL WINPR_DEPRECATED(int freerdp_detect_old_command_line_syntax(int argc, char** argv, + size_t* count)); +FREERDP_LOCAL +WINPR_DEPRECATED(int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, + rdpSettings* settings)); +#endif #endif /* FREERDP_CLIENT_COMMON_COMPATIBILITY_H */ diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index c6f0cb935..1a6a359b7 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -172,6 +172,8 @@ option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." OFF) option(WITH_CAIRO "Use CAIRO image library for screen resizing" OFF) option(WITH_SWSCALE "Use SWScale image library for screen resizing" OFF) +option(DEFINE_NO_DEPRECATED "Compile without legacy functions and symbols" OFF) + if (ANDROID) include(ConfigOptionsAndroid) endif(ANDROID) diff --git a/include/freerdp/channels/rdpei.h b/include/freerdp/channels/rdpei.h index 03bb3e8b1..842bc791b 100644 --- a/include/freerdp/channels/rdpei.h +++ b/include/freerdp/channels/rdpei.h @@ -38,8 +38,10 @@ enum }; /* Client Ready Flags */ +#if !defined(DEFINE_NO_DEPRECATED) #define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 /* Deprecated */ #define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 /* Deprecated */ +#endif #define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 #define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 diff --git a/include/freerdp/client.h b/include/freerdp/client.h index 37e01b077..bb0f64ad5 100644 --- a/include/freerdp/client.h +++ b/include/freerdp/client.h @@ -104,21 +104,21 @@ extern "C" char** domain); FREERDP_API BOOL client_cli_gw_authenticate(freerdp* instance, char** username, char** password, char** domain); - - FREERDP_API DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name, - const char* subject, const char* issuer, - const char* fingerprint, BOOL host_mismatch); - +#if !defined(DEFINE_NO_DEPRECATED) + FREERDP_API WINPR_DEPRECATED(DWORD client_cli_verify_certificate( + freerdp* instance, const char* common_name, const char* subject, const char* issuer, + const char* fingerprint, BOOL host_mismatch)); +#endif FREERDP_API DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, const char* common_name, const char* subject, const char* issuer, const char* fingerprint, DWORD flags); - - FREERDP_API DWORD client_cli_verify_changed_certificate( +#if !defined(DEFINE_NO_DEPRECATED) + FREERDP_API WINPR_DEPRECATED(DWORD client_cli_verify_changed_certificate( freerdp* instance, const char* common_name, const char* subject, const char* issuer, const char* fingerprint, const char* old_subject, const char* old_issuer, - const char* old_fingerprint); - + const char* old_fingerprint)); +#endif FREERDP_API DWORD client_cli_verify_changed_certificate_ex( freerdp* instance, const char* host, UINT16 port, const char* common_name, const char* subject, const char* issuer, const char* fingerprint, const char* old_subject, diff --git a/include/freerdp/client/rdpsnd.h b/include/freerdp/client/rdpsnd.h index 8050aa399..191e905f5 100644 --- a/include/freerdp/client/rdpsnd.h +++ b/include/freerdp/client/rdpsnd.h @@ -52,7 +52,9 @@ struct rdpsnd_device_plugin pcGetVolume GetVolume; pcSetVolume SetVolume; pcPlay Play; +#if !defined(DEFINE_NO_DEPRECATED) pcStart Start; /* Deprecated, unused. */ +#endif pcClose Close; pcFree Free; pcDefaultFormat DefaultFormat; diff --git a/include/freerdp/codec/nsc.h b/include/freerdp/codec/nsc.h index 8e5ed3202..6a1c35c40 100644 --- a/include/freerdp/codec/nsc.h +++ b/include/freerdp/codec/nsc.h @@ -44,8 +44,11 @@ extern "C" typedef struct _NSC_CONTEXT NSC_CONTEXT; +#if !defined(DEFINE_NO_DEPRECATED) FREERDP_API WINPR_DEPRECATED(BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context, UINT32 pixel_format)); +#endif + FREERDP_API BOOL nsc_context_set_parameters(NSC_CONTEXT* context, NSC_PARAMETER what, UINT32 value); diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h index df602db89..76631feea 100644 --- a/include/freerdp/codec/progressive.h +++ b/include/freerdp/codec/progressive.h @@ -37,20 +37,23 @@ extern "C" { #endif +#if !defined(DEFINE_NO_DEPRECATED) FREERDP_API WINPR_DEPRECATED(int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize)); +#endif FREERDP_API int progressive_compress_ex(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, UINT32 SrcFormat, UINT32 Width, UINT32 Height, UINT32 ScanLine, const REGION16* invalidRegion, BYTE** ppDstData, UINT32* pDstSize); - +#if !defined(DEFINE_NO_DEPRECATED) FREERDP_API WINPR_DEPRECATED(INT32 progressive_decompress( PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, REGION16* invalidRegion, UINT16 surfaceId)); +#endif FREERDP_API INT32 progressive_decompress_ex(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, diff --git a/include/freerdp/codec/rfx.h b/include/freerdp/codec/rfx.h index ff358be7d..7ffb47cc1 100644 --- a/include/freerdp/codec/rfx.h +++ b/include/freerdp/codec/rfx.h @@ -190,9 +190,11 @@ extern "C" size_t numRects, const BYTE* data, UINT32 width, UINT32 height, size_t scanline); +#if !defined(DEFINE_NO_DEPRECATED) FREERDP_API WINPR_DEPRECATED(RFX_MESSAGE* rfx_encode_messages( RFX_CONTEXT* context, const RFX_RECT* rects, int numRects, const BYTE* data, int width, int height, int scanline, int* numMessages, int maxDataSize)); +#endif FREERDP_API RFX_MESSAGE* rfx_encode_messages_ex(RFX_CONTEXT* context, const RFX_RECT* rects, size_t numRects, const BYTE* data, UINT32 width, diff --git a/include/freerdp/crypto/crypto.h b/include/freerdp/crypto/crypto.h index 9c855a782..33f1a1e3f 100644 --- a/include/freerdp/crypto/crypto.h +++ b/include/freerdp/crypto/crypto.h @@ -67,6 +67,7 @@ extern "C" FREERDP_API void crypto_cert_print_info(X509* xcert); FREERDP_API void crypto_cert_free(CryptoCert cert); +#if !defined(DEFINE_NO_DEPRECATED) /* Deprecated function names: crypto_cert_subject_alt_name and crypto_cert_subject_alt_name_free. Use crypto_cert_get_dns_names and crypto_cert_dns_names_free instead. @@ -74,8 +75,11 @@ extern "C" Note: email and upn amongst others are also alt_names, but the old crypto_cert_get_alt_names returned only the dns_names */ - FREERDP_API char** crypto_cert_subject_alt_name(X509* xcert, int* count, int** lengths); - FREERDP_API void crypto_cert_subject_alt_name_free(int count, int* lengths, char** alt_names); + FREERDP_API WINPR_DEPRECATED(char** crypto_cert_subject_alt_name(X509* xcert, int* count, + int** lengths)); + FREERDP_API WINPR_DEPRECATED(void crypto_cert_subject_alt_name_free(int count, int* lengths, + char** alt_names)); +#endif FREERDP_API BOOL x509_verify_certificate(CryptoCert cert, const char* certificate_store_path); FREERDP_API rdpCertificateData* crypto_get_certificate_data(X509* xcert, const char* hostname, diff --git a/include/freerdp/error.h b/include/freerdp/error.h index a928a645a..1bfbdfc9b 100644 --- a/include/freerdp/error.h +++ b/include/freerdp/error.h @@ -177,6 +177,7 @@ extern "C" FREERDP_API const char* freerdp_get_error_info_name(UINT32 code); FREERDP_API const char* freerdp_get_error_info_category(UINT32 code); +#if !defined(DEFINE_NO_DEPRECATED) /** * DEPRECATED! * This static variable holds an error code if the return value from connect is FALSE. @@ -185,7 +186,7 @@ extern "C" * The value can hold one of the defined error codes below OR an error according to errno */ - FREERDP_API extern int connectErrorCode; + FREERDP_API WINPR_DEPRECATED(extern int connectErrorCode); #define ERRORSTART 10000 #define PREECONNECTERROR ERRORSTART + 1 @@ -201,6 +202,7 @@ extern "C" #define AUTHENTICATIONERROR ERRORSTART + 9 #define INSUFFICIENTPRIVILEGESERROR ERRORSTART + 10 #define CANCELEDBYUSER ERRORSTART + 11 +#endif /** * FreeRDP Context Error Codes diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index ac0678ad6..b5b38c027 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -83,6 +83,7 @@ extern "C" typedef BOOL (*pAuthenticate)(freerdp* instance, char** username, char** password, char** domain); +#if !defined(DEFINE_NO_DEPRECATED) /** @brief Callback used if user interaction is required to accept * an unknown certificate. * @@ -100,7 +101,7 @@ extern "C" typedef DWORD (*pVerifyCertificate)(freerdp* instance, const char* common_name, const char* subject, const char* issuer, const char* fingerprint, BOOL host_mismatch); - +#endif /** @brief Callback used if user interaction is required to accept * an unknown certificate. * @@ -119,6 +120,7 @@ extern "C" const char* common_name, const char* subject, const char* issuer, const char* fingerprint, DWORD flags); +#if !defined(DEFINE_NO_DEPRECATED) /** @brief Callback used if user interaction is required to accept * a changed certificate. * @@ -139,6 +141,7 @@ extern "C" const char* subject, const char* issuer, const char* new_fingerprint, const char* old_subject, const char* old_issuer, const char* old_fingerprint); +#endif /** @brief Callback used if user interaction is required to accept * a changed certificate. @@ -361,14 +364,17 @@ extern "C" Callback for authentication. It is used to get the username/password when it was not provided at connection time. */ - ALIGN64 pVerifyCertificate VerifyCertificate; /**< (offset 51) - Callback for certificate validation. - Used to verify that an unknown certificate is - trusted. DEPRECATED: Use VerifyChangedCertificateEx*/ - ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**< (offset 52) - Callback for changed certificate - validation. Used when a certificate differs from stored fingerprint. - DEPRECATED: Use VerifyChangedCertificateEx */ +#if !defined(DEFINE_NO_DEPRECATED) + WINPR_DEPRECATED(ALIGN64 pVerifyCertificate VerifyCertificate); /**< (offset 51) + Callback for certificate validation. + Used to verify that an unknown certificate is + trusted. DEPRECATED: Use VerifyChangedCertificateEx*/ + WINPR_DEPRECATED( + ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate); /**< (offset 52) + Callback for changed certificate + validation. Used when a certificate differs from stored fingerprint. + DEPRECATED: Use VerifyChangedCertificateEx */ +#endif ALIGN64 pVerifyX509Certificate VerifyX509Certificate; /**< (offset 53) Callback for X509 certificate verification (PEM diff --git a/include/freerdp/gdi/gdi.h b/include/freerdp/gdi/gdi.h index 7c5fc5685..c67f4287a 100644 --- a/include/freerdp/gdi/gdi.h +++ b/include/freerdp/gdi/gdi.h @@ -517,7 +517,9 @@ struct rdp_gdi void (*free)(void*); BOOL inGfxFrame; - BOOL graphicsReset; /* deprecated, remove with FreeRDP v3 */ +#if !defined(DEFINE_NO_DEPRECATED) + WINPR_DEPRECATED(BOOL graphicsReset); /* deprecated, remove with FreeRDP v3 */ +#endif BOOL suppressOutput; UINT16 outputSurfaceId; RdpgfxClientContext* gfx; diff --git a/include/freerdp/rail.h b/include/freerdp/rail.h index 961ea8f8f..019aff89a 100644 --- a/include/freerdp/rail.h +++ b/include/freerdp/rail.h @@ -28,11 +28,13 @@ #define RAIL_SVC_CHANNEL_NAME "rail" +#if !defined(DEFINE_NO_DEPRECATED) /* DEPRECATED: RAIL PDU flags use the spec conformant naming with TS_ prefix */ #define RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001 #define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002 #define RAIL_EXEC_FLAG_FILE 0x0004 #define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008 +#endif /* RAIL PDU flags */ #define TS_RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001 @@ -124,11 +126,13 @@ enum SPI_MASK #include <shellapi.h> #endif +#if !defined(DEFINE_NO_DEPRECATED) /* DEPRECATED: Client Information PDU * use the spec conformant naming scheme TS_ below */ #define RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 #define RAIL_CLIENTSTATUS_AUTORECONNECT 0x00000002 +#endif /* Client Information PDU */ #define TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE 0x00000001 @@ -167,12 +171,14 @@ enum SPI_MASK #define TF_SFT_NOEXTRAICONSONMINIMIZED 0x00000400 #define TF_SFT_DESKBAND 0x00000800 +#if !defined(DEFINE_NO_DEPRECATED) /* DEPRECATED: Extended Handshake Flags * use the spec conformant naming scheme TS_ below */ #define RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 #define RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED 0x00000002 #define RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED 0x00000004 +#endif /* Extended Handshake Flags */ #define TS_RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF 0x00000001 @@ -521,6 +527,7 @@ struct _RAIL_GET_APPID_RESP_EX }; typedef struct _RAIL_GET_APPID_RESP_EX RAIL_GET_APPID_RESP_EX; +#if !defined(DEFINE_NO_DEPRECATED) /* DEPRECATED: RAIL Constants * use the spec conformant naming scheme TS_ below */ @@ -548,6 +555,7 @@ typedef struct _RAIL_GET_APPID_RESP_EX RAIL_GET_APPID_RESP_EX; #define RDP_RAIL_ORDER_POWER_DISPLAY_REQUEST 0x0016 #define RDP_RAIL_ORDER_SNAP_ARRANGE 0x0017 #define RDP_RAIL_ORDER_GET_APPID_RESP_EX 0x0018 +#endif /* RAIL Constants */ diff --git a/include/freerdp/server/rdpei.h b/include/freerdp/server/rdpei.h index 844f53f4e..b784e78c2 100644 --- a/include/freerdp/server/rdpei.h +++ b/include/freerdp/server/rdpei.h @@ -61,8 +61,10 @@ extern "C" FREERDP_API UINT rdpei_server_init(RdpeiServerContext* context); FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext* context); +#if !defined(DEFINE_NO_DEPRECATED) FREERDP_API WINPR_DEPRECATED(UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version)); +#endif FREERDP_API UINT rdpei_server_send_sc_ready_ex(RdpeiServerContext* context, UINT32 version, UINT32 features); diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index deddb1c43..31f38a6ea 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -120,7 +120,9 @@ typedef enum #define RNS_UD_CS_STRONG_ASYMMETRIC_KEYS 0x0008 #define RNS_UD_CS_VALID_CONNECTION_TYPE 0x0020 #define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040 +#if !defined(DEFINE_NO_DEPRECATED) #define RNS_UD_CS_SUPPORT_NETWORK_AUTODETECT 0x0080 /* DEPRECATED: Compatibility define */ +#endif #define RNS_UD_CS_SUPPORT_NETCHAR_AUTODETECT 0x0080 #define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100 #define RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE 0x0200 @@ -1634,6 +1636,7 @@ extern "C" UINT32 GatewayEnabled, UINT32 GatewayBypassLocal); +#if !defined(DEFINE_NO_DEPRECATED) /* DEPRECATED: * the functions freerdp_get_param_* and freerdp_set_param_* are deprecated. * use freerdp_settings_get_* and freerdp_settings_set_* as a replacement! @@ -1660,6 +1663,7 @@ extern "C" int id)); FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_string(rdpSettings* settings, int id, const char* param)); +#endif FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings* settings, size_t id); FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL param); diff --git a/libfreerdp/core/errinfo.c b/libfreerdp/core/errinfo.c index e635847dc..c8006bf50 100644 --- a/libfreerdp/core/errinfo.c +++ b/libfreerdp/core/errinfo.c @@ -34,7 +34,9 @@ ERRINFO_##_code, "ERRINFO_" #_code, ERRINFO_##_code##_STRING, category \ } +#if !defined(DEFINE_NO_DEPRECATED) int connectErrorCode; +#endif /* Protocol-independent codes */ diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 9094bc346..2ce9cf771 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -163,7 +163,9 @@ BOOL freerdp_connect(freerdp* instance) /* We always set the return code to 0 before we start the connect sequence*/ instance->ConnectionCallbackState = CLIENT_STATE_INITIAL; +#if !defined(DEFINE_NO_DEPRECATED) connectErrorCode = 0; +#endif freerdp_set_last_error_log(instance->context, FREERDP_ERROR_SUCCESS); clearChannelError(instance->context); ResetEvent(instance->context->abortEvent); @@ -894,6 +896,7 @@ void freerdp_set_last_error_ex(rdpContext* context, UINT32 lastError, const char context->LastError = lastError; +#if !defined(DEFINE_NO_DEPRECATED) switch (lastError) { case FREERDP_ERROR_PRE_CONNECT_FAILED: @@ -948,6 +951,7 @@ void freerdp_set_last_error_ex(rdpContext* context, UINT32 lastError, const char connectErrorCode = CONNECTERROR; break; } +#endif } const char* freerdp_get_logon_error_info_type(UINT32 type) diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index cf512704b..e61bd3bf1 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -725,11 +725,13 @@ char* crypto_cert_get_upn(X509* x509) return result; } +#if !defined(DEFINE_NO_DEPRECATED) /* Deprecated name.*/ void crypto_cert_subject_alt_name_free(int count, int* lengths, char** alt_names) { crypto_cert_dns_names_free(count, lengths, alt_names); } +#endif void crypto_cert_dns_names_free(int count, int* lengths, char** dns_names) { @@ -751,11 +753,13 @@ void crypto_cert_dns_names_free(int count, int* lengths, char** dns_names) } } +#if !defined(DEFINE_NO_DEPRECATED) /* Deprecated name.*/ char** crypto_cert_subject_alt_name(X509* xcert, int* count, int** lengths) { return crypto_cert_get_dns_names(xcert, count, lengths); } +#endif char** crypto_cert_get_dns_names(X509* x509, int* count, int** lengths) { diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 4677bb5b4..d72998ab2 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1548,6 +1548,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U accept_certificate = instance->VerifyCertificateEx( instance, hostname, port, common_name, subject, issuer, fingerprint, flags); } +#if !defined(DEFINE_NO_DEPRECATED) else if (instance->VerifyCertificate) { WLog_WARN(TAG, "The VerifyCertificate callback is deprecated, migrate your " @@ -1555,6 +1556,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U accept_certificate = instance->VerifyCertificate( instance, common_name, subject, issuer, fingerprint, !hostname_match); } +#endif } else if (match == -1) { @@ -1594,6 +1596,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U instance, hostname, port, common_name, subject, issuer, fingerprint, old_subject, old_issuer, old_fingerprint, flags | VERIFY_CERT_FLAG_CHANGED); } +#if !defined(DEFINE_NO_DEPRECATED) else if (instance->VerifyChangedCertificate) { WLog_WARN(TAG, "The VerifyChangedCertificate callback is deprecated, migrate " @@ -1602,6 +1605,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U instance, common_name, subject, issuer, fingerprint, old_subject, old_issuer, old_fingerprint); } +#endif free(old_subject); free(old_issuer); diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 524a57529..238c8138d 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -1502,6 +1502,7 @@ BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, InitializeCriticalSection(&gfx->mux); PROFILER_CREATE(gfx->SurfaceProfiler, "GFX-PROFILER"); +#if !defined(DEFINE_NO_DEPRECATED) /** * gdi->graphicsReset will be removed in FreeRDP v3 from public headers, * since the EGFX Reset Graphics PDU seems to be optional. @@ -1509,6 +1510,7 @@ BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, * we simply initialize it with TRUE here for now. */ gdi->graphicsReset = TRUE; +#endif return TRUE; } diff --git a/winpr/include/winpr/shell.h b/winpr/include/winpr/shell.h index f88291e43..fd5e7200e 100644 --- a/winpr/include/winpr/shell.h +++ b/winpr/include/winpr/shell.h @@ -52,6 +52,7 @@ struct _FILEDESCRIPTORW }; typedef struct _FILEDESCRIPTORW FILEDESCRIPTORW; +#if !defined(DEFINE_NO_DEPRECATED) /* Legacy definition, some types do not match the windows equivalent. */ struct _FILEDESCRIPTOR { @@ -68,6 +69,7 @@ struct _FILEDESCRIPTOR WCHAR cFileName[260]; }; typedef struct _FILEDESCRIPTOR FILEDESCRIPTOR; +#endif /* FILEDESCRIPTOR.dwFlags */ typedef enum @@ -84,9 +86,11 @@ typedef enum FD_UNICODE = 0x80000000 } FD_FLAGS; +#if !defined(DEFINE_NO_DEPRECATED) /* Deprecated, here for compatibility */ #define FD_SHOWPROGRESSUI FD_PROGRESSUI #define FD_WRITESTIME FD_WRITETIME +#endif /* FILEDESCRIPTOR.dwFileAttributes */ #define FILE_ATTRIBUTE_READONLY 0x00000001 diff --git a/winpr/include/winpr/wlog.h b/winpr/include/winpr/wlog.h index b2fe8e162..292eac3d6 100644 --- a/winpr/include/winpr/wlog.h +++ b/winpr/include/winpr/wlog.h @@ -195,10 +195,12 @@ extern "C" WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log); WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, const char* format); +#if !defined(DEFINE_NO_DEPRECATED) /** Deprecated */ WINPR_API WINPR_DEPRECATED(BOOL WLog_Init(void)); /** Deprecated */ WINPR_API WINPR_DEPRECATED(BOOL WLog_Uninit(void)); +#endif typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg); typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg); |