Code: Select all
PROCEDURE IsHook(typ: DevCPT.Struct): BOOLEAN;
VAR t0: ARRAY 128 OF DevCPT.Struct;
VAR n: INTEGER;
PROCEDURE In(t: DevCPT.Struct): BOOLEAN;
VAR i: INTEGER;
BEGIN
IF n >= LEN(t0) THEN RETURN TRUE END;
FOR i := 0 TO n - 1 DO
IF t0[i] = t THEN RETURN TRUE END;
END;
RETURN FALSE;
END In;
BEGIN
n := 0;
WHILE ((typ.form = pointer) OR (typ.form = comp)) & (typ.BaseTyp # NIL) & ~In(typ.BaseTyp) DO
IF (typ.form = pointer)&(n < LEN(t0)) THEN t0[n] := typ; INC(n); END;
typ := typ.BaseTyp
END;
RETURN (DevCPT.glbMods[typ.mno].name^ = "Kernel") & (typ.strobj.name^ = "Hook^")
END IsHook;