From dca542e0cd4a566ebe392d6fa558740563f53e63 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 9 Apr 2017 23:02:00 -0500 Subject: [PATCH] Support "asynchronous" LookupName calls (not really executed asynchronously). This allows the "choose" utility from Apple to work. --- atipmapping.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atipmapping.c b/atipmapping.c index 6c5abaa..dfcb74c 100644 --- a/atipmapping.c +++ b/atipmapping.c @@ -10,6 +10,7 @@ #include "asmglue.h" #include "aspinterface.h" #include "installcmds.h" +#include "cmdproc.h" struct ATIPMapping atipMapping; @@ -40,10 +41,6 @@ LongWord DoLookupName(NBPLookupNameRec *commandRec) { Word stateReg; stateReg = ForceRomIn(); - - // TODO support async calls - if (commandRec->async) - return_error(atSyncErr); // Length needed for result, assuming the request is for our type/zone count = offsetof(NBPLUNameBufferRec, entityName) @@ -146,6 +143,9 @@ haveMapping: resultBuf->socketNum = atipMapping.socket; commandRec->actualMatch = 1; commandRec->result = 0; + if ((commandRec->async & AT_ASYNC) && commandRec->completionPtr != 0) { + CallCompletionRoutine((void *)commandRec->completionPtr); + } RestoreStateReg(stateReg); return 0;