Project: Stream Extension Classes
Unit: PJIStreams
Class: TPJHandleIStreamWrapper
Applies to: ~>3.0
function Stat(out statstg: TStatStg; grfStatFlag: Longint): HResult;
virtual; stdcall;
Stat retrieves a STATSTG structure that provides information about the wrapped THandleStream.
This version of Stat extends the method inherited from TPJIStreamWrapper to provide creation, modification and last access times for any file whose handle is encapsulated by the wrapped stream.
Parameters:
- statstg -- Receives the required TStatStg (STATSTG) record.
- grfStatFlag -- Specifies which members of the TStatStg record are not to contain information. Possible values are:
- STATFLAG_DEFAULT: Omits the stream name from the record.
- STATFLAG_NORMAL: Includes the stream name in the record. In this case the name should be freed by the caller using the task allocator.
Returns:
- S_OK on success.
- E_UNEXPECTED if an exception occurs
- STG_E_INVALIDFLAG if grfStatFlag is not valid
- STG_E_INVALIDPOINTER if statstg is not a valid pointer.
The following fields of TStatStg are supported:
- dwType: Set to STGTY_STREAM.
- cbSize: Set to the size of the underlying stream.
- pwcsName: Set to the name of the stream. This is made up of wrapper class name followed by name of wrapped class in parentheses. This field is only set if the grfStatFlag parameter is set to STATFLAG_NORMAL. When set, the value must be freed using the task allocator.
- mtime: Set to the last modification time of any file whose handle is associated with the wrapped THandleStream.
- ctime: Set to the creation time of any file whose handle is associated with the wrapped THandleStream.
- atime: Set to the last access time of any file whose handle is associated with the wrapped THandleStream.
Other fields are set to zero.