System.Classes.TStreamAdapter.Stat

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Stat(out statstg: TStatStg; grfStatFlag: DWORD): HResult; virtual; stdcall;

C++

virtual HRESULT __stdcall Stat(/* out */ tagSTATSTG &statstg, unsigned grfStatFlag);

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TStreamAdapter

Description

Implements the IStream Stat method.

Stat fills out a TStatStg record with information about the stream object. The grfStatFlag parameter indicates what information in the record, if any, is not needed.

TStatStg is an alias for System.Types.tagSTATSTG. The tagSTATSTG record looks like this:

  tagSTATSTG = record
    pwcsName: POleStr;
    dwType: FixedInt;
    cbSize: Largeint;
    mtime: TFileTime;
    ctime: TFileTime;
    atime: TFileTime;
    grfMode: FixedInt;
    grfLocksSupported: FixedInt;
    clsid: TCLSID;
    grfStateBits: FixedInt;
    reserved: FixedInt;
  end;

Stat ignores the grfStatFlag parameter. It always sets dwType to STGTY_STREAM, grfLocksSupported to LOCK_WRITE, and all of the TFileTime parameters to 0. It sets cbSize to the size of the stream, and leaves the remaining fields unchanged.

TFileTime is an alias for System.Types._FILETIME, which looks like this:

  _FILETIME = record
    dwLowDateTime: DWORD;
    dwHighDateTime: DWORD;
  end;

Stat returns S_OK if it does not encounter any exceptions filling out statstg, E_UNEXPECTED otherwise.

See Also