Support "asynchronous" LookupName calls (not really executed asynchronously).

This allows the "choose" utility from Apple to work.
This commit is contained in:
Stephen Heumann 2017-04-09 23:02:00 -05:00
parent 35bcc701d3
commit dca542e0cd
1 changed files with 4 additions and 4 deletions

View File

@ -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;