Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 3 - Name-Binding Protocol (NBP) / NBP Reference
Routines / Handling Name and Address Requests


PKillNBP

The PKillNBP function cancels NBP function calls to the PLookupName, PRegisterName, or PConfirmName function.

FUNCTION PKillNBP (thePBptr: MPPPBPtr; async: Boolean): OSErr;
thePBptr
A pointer to an MPP parameter block.
async
A Boolean that specifies whether the function should be executed asynchronously or synchronously. Specify TRUE for asynchronous execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe function result.
-->ioRefNumIntegerThe .MPP driver reference number.
-->csCodeIntegerAlways killNBP.
-->nKillQElPtrA pointer to a queue element.

Field Description
ioCompletion
A pointer to a completion routine that you can provide. When you execute a function asynchronously, the .MPP driver calls your completion routine when it completes execution of the function if you specify a pointer to the routine as the value of this field. Specify NIL for this field if you do not wish to provide a completion routine. If you execute a function synchronously, the .MPP driver ignores the ioCompletion field. For information about completion routines, see the chapter "Introduction to AppleTalk" in this book.
ioResult
The result of the function. When you execute the function asynchro-
nously, the function sets this field to 1 and returns a function result of noErr as soon as the function begins execution. When the function completes execution, it sets the ioResult field to the actual result code.
ioRefNum
The .MPP driver reference number. The MPW interface fills in
this field.
csCode
The command code of the .MPP command to be executed. The MPW interface fills in this field.
nKillQEl
A pointer to the MPP parameter block for the NBP request you want to cancel.
DESCRIPTION
When you call the PLookupName, PRegisterName, or PConfirmName function asyn-
chronously, the Device Manager puts your request in the .MPP driver's queue with
other requests. If you want to cancel a pending NBP request, you pass a pointer to the parameter block for that request to the PKillNBP function.

If the function's parameter block is in the .MPP driver's queue waiting for the function
to be executed, the PKillNBP function deletes the entry from the queue and returns
a function result of noErr. The function whose parameter block is deleted completes execution and returns a function result of reqAborted, indicating that the function
was canceled.

If the function has already been executed, that is, it is no longer in the queue, PKillNBP returns a function result of cbNotFound, indicating that the parameter block for the function to be canceled was not in the .MPP driver's queue.

The function also calls the completion routine for the canceled request with the result code reqAborted (-1105) in the D0 register.

ASSEMBLY-LANGUAGE INFORMATION
To execute the PKillNBP function from assembly language, call the _Control trap macro with a value of killNBP in the csCode field of the parameter block. To execute the _Control trap asynchronously, include the value ,ASYNC in the operand field.
To execute this function from assembly language, you must also specify the driver reference number.

RESULT CODES
noErr0No error
cbNotFound-1102NBP queue element not found

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996