diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index e9006c2bf..6907c7022 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -2209,6 +2209,14 @@ extern "C" */ FREERDP_API const char* freerdp_rdp_version_string(UINT32 version); + /** \brief Returns a string representation of \b RDPDR_DTYP_* + * + * \param type The integer of the \b RDPDR_DTYP_* to stringify + * + * \return A string representation of the \b RDPDR_DTYP_* or "RDPDR_DTYP_UNKNOWN" + */ + FREERDP_API const char* freerdp_rdpdr_dtyp_string(UINT32 type); + #ifdef __cplusplus } #endif diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 9b7d61299..f9cb4a4ba 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -2057,3 +2057,22 @@ WCHAR* freerdp_settings_get_string_as_utf16(const rdpSettings* settings, size_t return NULL; return ConvertUtf8ToWCharAlloc(str, pCharLen); } + +const char* freerdp_rdpdr_dtyp_string(UINT32 type) +{ + switch (type) + { + case RDPDR_DTYP_FILESYSTEM: + return "RDPDR_DTYP_FILESYSTEM"; + case RDPDR_DTYP_PARALLEL: + return "RDPDR_DTYP_PARALLEL"; + case RDPDR_DTYP_PRINT: + return "RDPDR_DTYP_PRINT"; + case RDPDR_DTYP_SERIAL: + return "RDPDR_DTYP_SERIAL"; + case RDPDR_DTYP_SMARTCARD: + return "RDPDR_DTYP_SMARTCARD"; + default: + return "RDPDR_DTYP_UNKNOWN"; + } +}