anchor.diff:    {Open an existing cabinet}
   var
     Abort : Boolean;
  -  FileHandle : Integer;
  +  Stream : TFileStream;
   begin
       {verify that the archive can be opened and is a cabinet}
  -  FileHandle := FileOpen(FArchiveName, fmOpenRead or fmShareDenyNone);
  -  if (FileHandle <= 0) then
  -    raise EAbReadError.Create;
  +  Stream := TFileStream.Create(FArchiveName, fmOpenRead or fmShareDenyNone);
     try
  -    if not FDIIsCabinet(FFDIContext, FileHandle, @FFDICabInfo) then begin
  +    if not FDIIsCabinet(FFDIContext, Integer(Stream), @FFDICabInfo) then begin
         CloseCabFile;
         raise EAbInvalidCabFile.Create;
       end;
     finally
  -    FileClose(FileHandle);
  +    Stream.Free;
     end;
   
       {store information about the cabinet}
  
positive.code: procedure TAbCabArchive.ExtractItemToStreamAt(Index : Integer; OutStream : TStream);
  begin
    {not implemented for cabinet archives}
  end;
  {----------------------------------------------------------------------------}
  function TAbCabArchive.GetItem(ItemIndex : Integer) : TAbCabItem;
  
negative.code: function FDI_FileOpen(lpPathName: PAnsiChar; Flag, Mode: Integer) : Integer;
    cdecl;
    {open a file}
  var
    Handle : Integer;
  begin
    Handle := FileOpen(string(lpPathName), fmOpenRead or fmShareDenyWrite);
    if Handle <> -1 then
      Result := Integer(TFileStream.Create(Handle))
    else
      Result := -1;
  end;
  { -------------------------------------------------------------------------- }
  function FDI_FileRead(hFile: HFILE; lpBuffer: Pointer; uBytes: UINT) : UINT;
    cdecl;
    {read from a file}
  begin
    Result := TStream(hFile).Read(lpBuffer^, uBytes);
  end;
  { -------------------------------------------------------------------------- }
  function FDI_FileWrite(hFile: HFILE; lpBuffer: Pointer; uBytes: UINT) : UINT;
    cdecl;
    {write to a file}
  begin
    Result := TStream(hFile).Write(lpBuffer^, uBytes);
  end;
  { -------------------------------------------------------------------------- }
  procedure FDI_FileClose(hFile : HFILE);
    cdecl;
    {close a file}
  begin
    TStream(hFile).Free;
  end;
  { -------------------------------------------------------------------------- }
  function FDI_FileSeek(hFile : HFILE; Offset : Longint; Origin : Integer) : Longint;
    cdecl;
    {reposition file pointer}
  begin
    Result := TStream(hFile).Seek(Offset, Origin);
  end;
  { -------------------------------------------------------------------------- }
  function FDI_EnumerateFiles(fdint : FDINOTIFICATIONTYPE;
  