From fe2680b65a43fef63fc7783b6bab7fedb6360386 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 16 Apr 2017 18:25:58 -0500 Subject: [PATCH] Bail out early if we're in P8 mode. This avoids any possible strange behavior with calling Marinetti in P8 mode. It also ensures that I/O operations in P8 mode will give an error, but not terminate the connection: it will still be alive when we get back to GS/OS, unless the server has killed it due to inactivity (which is quite possible). --- afpbridge.c | 3 ++- asmglue.h | 4 ++++ aspinterface.c | 10 ++++++++++ atipmapping.c | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/afpbridge.c b/afpbridge.c index 2c8b8c7..56c656d 100644 --- a/afpbridge.c +++ b/afpbridge.c @@ -127,7 +127,8 @@ void pollTask(void) { IncBusyFlag(); stateReg = ForceRomIn(); - PollAllSessions(); + if (OS_KIND == KIND_GSOS) + PollAllSessions(); runQRec.period = 4*60; RestoreStateReg(stateReg); diff --git a/asmglue.h b/asmglue.h index 48a04cd..5f569a9 100644 --- a/asmglue.h +++ b/asmglue.h @@ -10,4 +10,8 @@ extern void RestoreStateReg(Word); void IncBusyFlag(void) inline(0, 0xE10064); void DecBusyFlag(void) inline(0, 0xE10068); +#define OS_KIND (*(Byte*)0xE100BC) +#define KIND_P8 0x00 +#define KIND_GSOS 0x01 + #endif diff --git a/aspinterface.c b/aspinterface.c index 03830d9..89c5279 100644 --- a/aspinterface.c +++ b/aspinterface.c @@ -60,6 +60,11 @@ LongWord DispatchASPCommand(SPCommandRec *commandRec) { { goto callOrig; } + + if (OS_KIND != KIND_GSOS) { + CompleteASPCommand(commandRec, aspNetworkErr); + goto ret; + } for (i = 0; i < MAX_SESSIONS; i++) { if (sessionTbl[i].dsiStatus == needsReset) @@ -93,6 +98,11 @@ LongWord DispatchASPCommand(SPCommandRec *commandRec) { goto callOrig; } + if (OS_KIND != KIND_GSOS) { + CompleteASPCommand(commandRec, aspNetworkErr); + goto ret; + } + /* * Hack to avoid hangs/crashes related to the AppleShare FST's * asynchronous polling to check if volumes have been modified. diff --git a/atipmapping.c b/atipmapping.c index cbc12cb..58baf3c 100644 --- a/atipmapping.c +++ b/atipmapping.c @@ -45,6 +45,9 @@ LongWord DoLookupName(NBPLookupNameRec *commandRec) { stateReg = ForceRomIn(); + if (OS_KIND != KIND_GSOS) + goto passThrough; + // Length needed for result, assuming the request is for our type/zone count = offsetof(NBPLUNameBufferRec, entityName) + ((EntName*)commandRec->entityPtr)->buffer[0] + 1