anchor.diff:  end;
   
   function VarIsIntf(const Value: Variant): Boolean;
  -begin
  -  Result := (FindVarData(Value)^.VType = varUnknown);
  +var
  +  VType: TVarType;
  +begin
  +  VType := FindVarData(Value)^.VType;
  +  Result := (VType = varUnknown) or (VType = varNull) or (VType = varEmpty);
   end;
   
   function VarIsIntf(const Value: Variant; const IID: TGUID): Boolean;
   begin
  -  Result := (FindVarData(Value)^.VType = varUnknown) and
  -            Supports(IInterface(Value), IID);
  +  Result := VarIsIntf(Value) and Supports(IInterface(Value), IID);
   end;
   
   function VarToIntf(const Value: Variant; const IID: TGUID; out AIntf): Boolean;
   begin
  -  if FindVarData(Value)^.VType = varUnknown then
  +  if VarIsIntf(Value) then
       Result := Supports(IInterface(Value), IID, AIntf)
     else
       Result := false;
  
positive.code:  *                                                        *
   * hprose common unit for delphi.                         *
   *                                                        *
   * LastModified: Nov 23, 2016                             *
   * Author: Ma Bingyao <andot@hprose.com>                  *
   *                                                        *
  \**********************************************************/
  
negative.code:     if P^.VType = varObject then begin
        Result := TObject(P^.VPointer);
      end
      else if (P^.VType <> varNull) and (P^.VType <> varEmpty) then
        Error(reInvalidCast);
    except
      Error(reInvalidCast);
    end;
  