And, of course I am using these declarations in a COM-Port.decls file:
.lib "Kernel32.dll" apiCreateFile%(lpFileName$, dwDesiredAccess, dwShareMode, lpSecurrityAttributes, dwCreationDistribution, dwFlagsAndAttributes, hTemplateFile) : "CreateFileA" apiSetupComm%(hFile, dwInQueue, dwOutQueue) : "SetupComm" apiGetCommState%(hFile, lpDCB*) : "GetCommState" apiSetCommState%(hFile, lpCDB*) : "SetCommState" apiSetCommMask%(hFile, dwEvtMask) : "SetCommMask" apiCloseHandle%(hObject) : "CloseHandle" apiEscapeCommFunction%(hFile, dwFunc) : "EscapeCommFunction" apiWriteFile%(hFile, lpBuffer*, nNumberOfBytesToWrite, lpNumberOfBytesWritten*, lpOverlapped) : "WriteFile" apiSetCommTimeouts%(hFile, lpCommTimeouts*) : "SetCommTimeouts" apiClearCommError%(hFile, lpErrors*, lpStat*) : "ClearCommError" apiReadFile%(hFile, lpBuffer*, nNumberOfBytesToRead, lpNumberOfBytesRead*, lpOverlapped) : "ReadFile"