Added -DDEFINE_NO_DEPRECATED CMake option 2.3.1
authorakallabeth <akallabeth@posteo.net>
Mon, 1 Mar 2021 09:29:33 +0000 (10:29 +0100)
committerakallabeth <akallabeth@users.noreply.github.com>
Mon, 1 Mar 2021 09:58:24 +0000 (10:58 +0100)
With that option all symbols marked deprecated are no longer
compiled. This helps testing compatibility of external apps.

27 files changed:
CMakeLists.txt
ChangeLog
client/common/CMakeLists.txt
client/common/cmdline.c
client/common/cmdline.h
client/common/compatibility.h
cmake/ConfigOptions.cmake
include/freerdp/channels/rdpei.h
include/freerdp/client.h
include/freerdp/client/rdpsnd.h
include/freerdp/codec/nsc.h
include/freerdp/codec/progressive.h
include/freerdp/codec/rfx.h
include/freerdp/crypto/crypto.h
include/freerdp/error.h
include/freerdp/freerdp.h
include/freerdp/gdi/gdi.h
include/freerdp/rail.h
include/freerdp/server/rdpei.h
include/freerdp/settings.h
libfreerdp/core/errinfo.c
libfreerdp/core/freerdp.c
libfreerdp/crypto/crypto.c
libfreerdp/crypto/tls.c
libfreerdp/gdi/gfx.c
winpr/include/winpr/shell.h
winpr/include/winpr/wlog.h

index c2c35ee..50d8bed 100644 (file)
@@ -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})
index d2d8ce3..620a25d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index d4588e1..b465a63 100644 (file)
@@ -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})
index f17ba66..53d52f4 100644 (file)
@@ -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;
index 807373b..59ff567 100644 (file)
@@ -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
index b512a40..42eab8d 100644 (file)
 #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 */
index c6f0cb9..1a6a359 100644 (file)
@@ -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)
index 03bb3e8..842bc79 100644 (file)
@@ -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
index 37e01b0..bb0f64a 100644 (file)
@@ -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,
index 8050aa3..191e905 100644 (file)
@@ -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;
index 8e5ed32..6a1c35c 100644 (file)
@@ -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);
 
index df602db..76631fe 100644 (file)
@@ -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,
index ff358be..7ffb47c 100644 (file)
@@ -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,
index 9c855a7..33f1a1e 100644 (file)
@@ -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,
index a928a64..1bfbdfc 100644 (file)
@@ -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
index ac0678a..b5b38c0 100644 (file)
@@ -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
index 7c5fc56..c67f428 100644 (file)
@@ -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;
index 961ea8f..019aff8 100644 (file)
 
 #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 */
 
index 844f53f..b784e78 100644 (file)
@@ -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);
index deddb1c..31f38a6 100644 (file)
@@ -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);
index e635847..c8006bf 100644 (file)
@@ -34,7 +34,9 @@
                ERRINFO_##_code, "ERRINFO_" #_code, ERRINFO_##_code##_STRING, category \
        }
 
+#if !defined(DEFINE_NO_DEPRECATED)
 int connectErrorCode;
+#endif
 
 /* Protocol-independent codes */
 
index 9094bc3..2ce9cf7 100644 (file)
@@ -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)
index cf51270..e61bd3b 100644 (file)
@@ -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)
 {
index 4677bb5..d72998a 100644 (file)
@@ -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);
index 524a575..238c813 100644 (file)
@@ -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;
 }
index f88291e..fd5e720 100644 (file)
@@ -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
index b2fe8e1..292eac3 100644 (file)
@@ -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);