📄 rmafiles.pas
字号:
unit RmaFiles;
interface
uses
PnResult, PnTypes, RmaAuth, RmaPckts;
(****************************************************************************
*
* $Id: rmafiles.h,v 1.83 1999/10/24 22:07:54 smpatel Exp $
*
* Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved..
*
* http://www.real.com/devzone
*
* This program contains proprietary
* information of Progressive Networks, Inc, and is licensed
* subject to restrictions on use and distribution.
*
*
* RealMedia Architecture File Format and File System Plug-in Interfaces.
*
*)
(****************************************************************************
* Defines:
* PN_FILE_XXXX
* Purpose:
* Flags for opening file objects
*)
const
PN_FILE_READ = 1;
{$EXTERNALSYM PN_FILE_READ}
PN_FILE_WRITE = 2;
{$EXTERNALSYM PN_FILE_WRITE}
PN_FILE_BINARY = 4;
{$EXTERNALSYM PN_FILE_BINARY}
PN_FILE_NOTRUNC = 8;
{$EXTERNALSYM PN_FILE_NOTRUNC}
(****************************************************************************
* Defines:
* RMA_FILEADVISE_XXXX
* Purpose:
* Flags for file object Advise method
*)
RMA_FILEADVISE_RANDOMACCESS = 1;
{$EXTERNALSYM RMA_FILEADVISE_RANDOMACCESS}
PN_S_IFMT = 61440; // 0170000;
{$EXTERNALSYM PN_S_IFMT}
PN_S_IFDIR = 16384; // 0040000;
{$EXTERNALSYM PN_S_IFDIR}
PN_S_IFCHR = 8192; // 0020000;
{$EXTERNALSYM PN_S_IFCHR}
PN_S_IFIFO = 4096; // 0010000;
{$EXTERNALSYM PN_S_IFIFO}
PN_S_IFREG = 32768; // 0100000;
{$EXTERNALSYM PN_S_IFREG}
(****************************************************************************
*
* Interface:
*
* IRMAFileResponse
*
* Purpose:
*
* Object that exports file response API
*
* IID_IRMAFileResponse:
*
* {00000201-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileResponse: TGUID = '{00000201-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileResponse}
type
IRMAFileResponse = interface (IUnknown)
['{00000201-0901-11d1-8B06-00A024406D59}']
(************************************************************************
* Method:
* IRMAFileResponse::InitDone
* Purpose:
* Notification interface provided by users of the IRMAFileObject
* interface. This method is called by the IRMAFileObject when the
* initialization of the file is complete. If the file is not valid
* for the file system, the status PNR_FAILED should be
* returned.
*)
function InitDone(status: PN_RESULT): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileResponse::CloseDone
* Purpose:
* Notification interface provided by users of the IRMAFileObject
* interface. This method is called by the IRMAFileObject when the
* close of the file is complete.
*)
function CloseDone(status: PN_RESULT): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileResponse::ReadDone
* Purpose:
* Notification interface provided by users of the IRMAFileObject
* interface. This method is called by the IRMAFileObject when the
* last read from the file is complete and a buffer is available.
*)
function ReadDone(status: PN_RESULT; pBuffer: IRMABuffer): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileResponse::WriteDone
* Purpose:
* Notification interface provided by users of the IRMAFileObject
* interface. This method is called by the IRMAFileObject when the
* last write to the file is complete.
*)
function WriteDone(status: PN_RESULT): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileResponse::SeekDone
* Purpose:
* Notification interface provided by users of the IRMAFileObject
* interface. This method is called by the IRMAFileObject when the
* last seek in the file is complete.
*)
function SeekDone(status: PN_RESULT): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileResponse}
(****************************************************************************
*
* Interface:
*
* IRMAFileObject
*
* Purpose:
*
* Object that exports file control API
*
* IID_IRMAFileObject:
*
* {00000200-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileObject: TGUID = '{00000200-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileObject}
type
IRMAFileObject = interface (IUnknown)
['{00000200-0901-11d1-8B06-00A024406D59}']
(************************************************************************
* Method:
* IRMAFileObject::Init
* Purpose:
* Associates a file object with the file response object it should
* notify of operation completness. This method should also check
* for validity of the object (for example by opening it if it is
* a local file).
*)
function Init(ulFlags: ULONG32; pFileResponse: IRMAFileResponse): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::GetFilename
* Purpose:
* Returns the filename (without any path information) associated
* with a file object.
*
* Note: The returned pointer's lifetime expires as soon as the
* caller returns from a function which was called from the RMA
* core (i.e. when you return control to the RMA core)
*
*)
function GetFilename(var pFilename: PChar): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::Close
* Purpose:
* Closes the file resource and releases all resources associated
* with the object.
*)
function Close: HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::Read
* Purpose:
* Reads a buffer of data of the specified length from the file
* and asynchronously returns it to the caller via the
* IRMAFileResponse interface passed in to Init.
*)
function Read(ulCount: ULONG32): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::Write
* Purpose:
* Writes a buffer of data to the file and asynchronously notifies
* the caller via the IRMAFileResponse interface passed in to Init,
* of the completeness of the operation.
*)
function Write(pBuffer: IRMABuffer): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::Seek
* Purpose:
* Seeks to an offset in the file and asynchronously notifies
* the caller via the IRMAFileResponse interface passed in to Init,
* of the completeness of the operation.
* If the bRelative flag is TRUE, it is a relative seek; else
* an absolute seek.
*)
function Seek(ulOffset: ULONG32; bRelative: BOOL): HRESULT; stdcall;
(************************************************************************
* Method:
* IRMAFileObject::Advise
* Purpose:
* To pass information to the File Object advising it about usage
* heuristics.
*)
function Advise(ulInfo: ULONG32): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileObject}
(****************************************************************************
*
* Interface:
*
* IRMAFileSystemObject
*
* Purpose:
*
* Object that allows a Controller to communicate with a specific
* File System plug-in session
*
* IID_IRMAFileSystemObject:
*
* {00000202-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileSystemObject: TGUID = '{00000202-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileSystemObject}
type
IRMAFileSystemObject = interface (IUnknown)
['{00000202-0901-11d1-8B06-00A024406D59}']
(************************************************************************
* Method:
* IRMAFileSystemObject::GetFileSystemInfo
* Purpose:
* Returns information vital to the instantiation of file system
* plugin.
*
* pShortName should be a short, human readable name in the form
* of "company-fsname". For example: pShortName = "pn-local".
*)
function GetFileSystemInfo(var pShortName, pProtocol: PChar): HRESULT; stdcall;
function InitFileSystem(pOptions: IRMAValues): HRESULT; stdcall;
function CreateFile(out ppFileObject: IUnknown): HRESULT; stdcall;
(*
* The following method is deprecated and should return PNR_NOTIMPL
*)
function CreateDir(out ppDirObject: IUnknown): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileSystemObject}
(****************************************************************************
*
* Interface:
*
* IRMAFileStatResponse
*
* Purpose:
*
* Returns information about a specific File object
*
* IID_IRMAFileStatResponse:
*
* {00000206-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileStatResponse: TGUID = '{00000206-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileStatResponse}
type
IRMAFileStatResponse = interface (IUnknown)
['{00000206-0901-11d1-8B06-00A024406D59}']
function StatDone(status: PN_RESULT; ulSize, ulCreationTime, ulAccessTime,
ulModificationTime, ulMode: UINT32): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileStatResponse}
(****************************************************************************
*
* Interface:
*
* IRMAFileStat
*
* Purpose:
*
* Gets information about a specific File object
*
* IID_IRMAFileStat:
*
* {00000205-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileStat: TGUID = '{00000205-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileStat}
type
IRMAFileStat = interface (IUnknown)
['{00000205-0901-11d1-8B06-00A024406D59}']
function Stat(pFileStatResponse: IRMAFileStatResponse): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileStat}
(****************************************************************************
*
* Interface:
*
* IRMAFileSystemManagerResponse
*
* Purpose:
*
* Gives out File System objects based on URLs
*
* IID_IRMAFileSystemManagerResponse:
*
* {00000208-0901-11d1-8B06-00A024406D59}
*
*)
const
IID_IRMAFileSystemManagerResponse: TGUID = '{00000208-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAFileSystemManagerResponse}
type
IRMAFileSystemManagerResponse = interface (IUnknown)
['{00000208-0901-11d1-8B06-00A024406D59}']
(************************************************************************
* Method:
* IRMAFileSystemManagerResponse::InitDone
* Purpose:
*)
function InitDone(status: PN_RESULT): HRESULT; stdcall;
function FileObjectReady(status: PN_RESULT; pObject: IUnknown): HRESULT; stdcall;
(*
* The following method is deprecated and should return PNR_NOTIMPL
*)
function DirObjectReady(status: PN_RESULT; pDirObject: IUnknown): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAFileSystemManagerResponse}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -