diff --git a/src/nwconn.c b/src/nwconn.c index f5d21e8..96b2d1e 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -579,10 +579,22 @@ static int handle_ncp_serv(void) } break; - case 0x13 : { /* Get connection ?? */ - /* TODO !!!!!!! */ - *responsedata=(uint8) act_connection; - data_len = 1; + case 0x13 : { /* Get Station Number */ + /* + * This is the old one-byte connection number call used by + * DOS requesters before the richer NCP 23 connection services. + * The SDK describes the client-visible API as + * NWGetConnectionNumber(); older low-level documentation names the + * underlying simple NCP 0x13 "Get Station Number". + */ + if (act_connection > 0 && act_connection < 256) { + *responsedata=(uint8) act_connection; + data_len = 1; + } else { + XDPRINTF((1, 0, "Get Station Number failed, conn=%d", + act_connection)); + completition = 0xff; + } } break;