From 22576d73659d94d0044f2b9e0eb18e175906ea63 Mon Sep 17 00:00:00 2001 From: Will Hedgecock Date: Fri, 21 Jan 2022 12:09:25 -0600 Subject: [PATCH] Ignore LPT parallel devices on Windows --- src/main/c/Windows/SerialPort_Windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/c/Windows/SerialPort_Windows.c b/src/main/c/Windows/SerialPort_Windows.c index 1f98594..3ed7560 100644 --- a/src/main/c/Windows/SerialPort_Windows.c +++ b/src/main/c/Windows/SerialPort_Windows.c @@ -132,7 +132,7 @@ JNIEXPORT jobjectArray JNICALL Java_com_fazecast_jSerialComm_SerialPort_getCommP comPortString = (comPort[0] == L'\\') ? (wcsrchr(comPort, L'\\') + 1) : comPort; if (key != INVALID_HANDLE_VALUE) RegCloseKey(key); - if (!comPortString) + if (!comPortString || wcsstr(comPortString, L"LPT")) continue; // Fetch the friendly name for this device