From 1316b828c9d3147588dc40581dad639b0991cc09 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Fri, 23 Mar 2018 10:44:32 +0100 Subject: [PATCH] Removed reserved COM and LPT check. --- winpr/libwinpr/comm/comm.c | 52 ---------------------------------------------- 1 file changed, 52 deletions(-) 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) -- 2.7.4