Fixed check for reserved com devices.
This commit is contained in:
parent
7c3d75bf1d
commit
6f1b8f04c6
@ -1065,7 +1065,7 @@ BOOL DefineCommDevice(/* DWORD dwFlags,*/ LPCTSTR lpDeviceName,
|
|||||||
|
|
||||||
if (_tcsncmp(lpDeviceName, _T("\\\\.\\"), 4) != 0)
|
if (_tcsncmp(lpDeviceName, _T("\\\\.\\"), 4) != 0)
|
||||||
{
|
{
|
||||||
if (!_IsReservedCommDeviceName(lpDeviceName))
|
if (_IsReservedCommDeviceName(lpDeviceName))
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_DATA);
|
SetLastError(ERROR_INVALID_DATA);
|
||||||
goto error_handle;
|
goto error_handle;
|
||||||
@ -1470,9 +1470,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess,
|
|||||||
|
|
||||||
return (HANDLE)pComm;
|
return (HANDLE)pComm;
|
||||||
error_handle:
|
error_handle:
|
||||||
|
|
||||||
CloseHandle(pComm);
|
CloseHandle(pComm);
|
||||||
|
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user