{***********************************************************************}
{									}
{ __IsInsIsr  Check if an ISR is installed				}
{									}
{ function  __IsInsIsr(IntType : byte; Ident : _IdentStr;		}
{			   var PSPPtr,EnvPtr : pointer; 		}
{			   var PrevVec	     : pointer) : boolean;	}
{									}
{	      IntType	The interrupt type, or vector.	For this vector }
{			__IsInsIsr checks for the installation of an	}
{			ISR control block.				}
{	      Ident	The ISR identification.  It must match exactly	}
{			the string specified in the ISR control block	}
{			when the ISR was installed.			}
{	      PSPPtr	If a POWER TOOLS ISR is installed, a pointer to }
{			the ISR's program segment prefix is returned	}
{			as PSPPtr.  If an ISR is not installed, PSPPtr	}
{			is set to NIL.					}
{	      EnvPtr	If an ISR is installed, a pointer to the en-	}
{			vironment is returned in EnvPtr.  If an ISR is	}
{			not installed, EnvPtr is set to NIL.		}
{	      PrevVec	If an ISR is installed, the previous vector	}
{			is returned.  This is the same value returned	}
{			when the ISR is installed (see __InsIsr) and	}
{			that is stored in the ISR control block.  If	}
{			no ISR is found, a NIL pointer is returned.	}
{									}
{ Description This function checks to see if a POWER TOOLS ISR control	}
{	      block is installed at the specified interrupt vector.	}
{	      It does this by checking for a match in the identifica-	}
{	      tion string.  If a match is found, the function returns	}
{	      TRUE, and PSPPtr and EnvPtr are set to point to the pro-	}
{	      gram segment prefix and environment respectively.  Other- }
{	      wise, the result is FALSE, and the pointers are set to	}
{	      the NIL pointer.						}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

function  __IsInsIsr(IntType : byte; Ident : _IdentStr;
			 var PSPPtr,EnvPtr : pointer;
			 var PrevVec	   : pointer) : boolean;

  type
    IsrCtrlPtr	= ^_IsrCtrl;

  var
    IsrBlockPtr : IsrCtrlPtr;	       { Copy of installed ISR block	}
    Vector	: pointer;
    IsrIdent	: _IdentStr;
    Env 	: word;

  begin {__IsInsIsr}

    { Get the vector installed at the interrupt type; it points to the	}
    { ISR control block.						}

    GetIntVec(IntType,Vector);
    IsrBlockPtr := IsrCtrlPtr(Vector);

    { The ISR is one installed with __InsIsr if the signature and	}
    { identification strings match.  If they do, the program segment	}
    { prefix (segment) is found in the _IsrPSP field, and		}
    { the environment (segment) is stored at offset $2C within the	}
    { program segment prefix, and the previous vector is stored as a	}
    { field _IsrPreVector within the ISR control block. 		}

    with IsrBlockPtr^ do
      if ((_IsrSignature = 'BCI') and (_IsrIdent = Ident)) then
	 begin
	   PSPPtr     := Ptr(_IsrPSP,0);
	   EnvPtr     := Ptr(MemW[_IsrPSP:$2C],0);
	   PrevVec    := _IsrPreVector;
	   __IsInsIsr := TRUE
	 end
      else
	 begin			       { An ISR was not found here	}
	   PSPPtr     := NIL;
	   EnvPtr     := NIL;
	   PrevVec    := NIL;
	   __IsInsIsr := FALSE
	 end

  end;	{IsInsIsr}
