Skip to Content
Amiga Assembly Library v41.21 — Motorola 68020 shared library for Commodore Amiga

UnlockREI

Synopsis

rei = UnlockREI(lockrei, name) D0 A0 A1

C Prototype

BOOL UnlockREI(struct REI *, STRPTR);

Description

Unlocks a REI previously blocked by LockREI(). In addition to reactivating the window functions associated with the REI, this command restores the mouse pointer that was previously set to the wait/busy state.

If both inputs are NULL, this function fails. Unlike LockREI(), which automatically takes the currently active REI, UnlockREI() requires an explicit target for safety reasons.

Inputs

  • lockrei — Pointer to a REI structure previously blocked via LockREI(). If NULL, the name parameter will be used to locate the REI.
  • name — Pointer to a null-terminated string containing the name of the REI to unlock. This parameter is only considered when lockrei is NULL.

Result

  • rei — If NULL, it was not possible to unlock the REI, or the REI was not previously blocked. Otherwise, returns the address of the successfully unlocked REI.

See Also

LockREI

Implementation

The original 68020 assembly implementation:

; (25-Jan-1995) --- rei = UnlockREI(rei, name) (a0/a1) _LVOUnlockREI movem.l a5-a6,-(sp) move.l a0,d0 * Was an address passed?? bne.s URmain move.l a1,d0 * Was the name passed then?? bne.s URname URexit movem.l (sp)+,a5-a6 rts URname move.l ab_ExecBase(a6),a0 move.l ([ThisTask.w,a0],TC_Userdata.w),d0 * struct List * beq.s URexit move.l d0,a0 FINDNAME beq.s URexit * Exit failure... URmain move.l d0,a5 * A5 = struct REI * BTSTL REIB_LOCK,rei_Flags(a5) * Check if it's locked... beq.s URexit * well... then why unlock it.. exit lea rei_Request(a5),a0 * Request move.l rei_Window(a5),a1 * This Window move.l ab_IntuiBase(a6),a6 * Intuition... jsr _LVOEndRequest(a6) * Unlock!! -- resume messages... move.l rei_Window(a5),a0 * Window another lea ULTAG(pc),a1 * Normal Pointer jsr _LVOSetWindowPointerA(a6) * Clear pointer to normal BCLRL REIB_LOCK,rei_Flags(a5) * clear the lock bit, since... UREI_LK movem.l (sp)+,a5-a6 rts ULTAG dc.l WA_BusyPointer,0,TAG_DONE
Last updated on