From: Armin Novak Date: Fri, 23 Mar 2018 09:44:32 +0000 (+0100) Subject: Removed reserved COM and LPT check. X-Git-Tag: 2.0.0-rc2~11^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1316b828c9d3147588dc40581dad639b0991cc09;p=platform%2Fupstream%2Ffreerdp.git Removed reserved COM and LPT check. --- diff --git a/winpr/libwinpr/comm/comm.c b/winpr/libwinpr/comm/comm.c index 40e1da4..0c63fc4 100644 --- a/winpr/libwinpr/comm/comm.c +++ b/winpr/libwinpr/comm/comm.c @@ -993,49 +993,6 @@ BOOL WaitCommEvent(HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped) return FALSE; } - -/* Extended API */ - -static BOOL _IsReservedCommDeviceName(LPCTSTR lpName) -{ - int i; - - if (!CommInitialized()) - return FALSE; - - /* Serial ports, COM1-9 */ - for (i = 1; i < 10; i++) - { - TCHAR genericName[5]; - - if (_stprintf_s(genericName, 5, _T("COM%d"), i) < 0) - { - return FALSE; - } - - if (_tcscmp(genericName, lpName) == 0) - return TRUE; - } - - /* Parallel ports, LPT1-9 */ - for (i = 1; i < 10; i++) - { - TCHAR genericName[5]; - - if (_stprintf_s(genericName, 5, _T("LPT%d"), i) < 0) - { - return FALSE; - } - - if (_tcscmp(genericName, lpName) == 0) - return TRUE; - } - - /* FIXME: what about PRN ? */ - return FALSE; -} - - /** * Returns TRUE on success, FALSE otherwise. To get extended error * information, call GetLastError. @@ -1063,15 +1020,6 @@ BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName, goto error_handle; } - if (_tcsncmp(lpDeviceName, _T("\\\\.\\"), 4) != 0) - { - if (_IsReservedCommDeviceName(lpDeviceName)) - { - SetLastError(ERROR_INVALID_DATA); - goto error_handle; - } - } - storedDeviceName = _tcsdup(lpDeviceName); if (storedDeviceName == NULL)