windows-nt/Source/XPSP1/NT/com/ole32/stg/ref/h/refilb.hxx

78 lines
2 KiB
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1996.
//
// File: fileilb.hxx
//
// Contents:
//
// Classes:
//
// Functions:
//
//----------------------------------------------------------------------------
#ifndef __FILEILB_HXX__
#define __FILEILB_HXX__
#include "storage.h"
#define ILB_DELETEONERR 1
#define ILB_DELETEONRELEASE 2
class CFileILB: public ILockBytes
{
public:
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj);
STDMETHOD_(ULONG,AddRef) (THIS);
STDMETHOD_(ULONG,Release) (THIS);
// *** ILockBytes methods ***
STDMETHOD(ReadAt) (THIS_ ULARGE_INTEGER ulOffset,
VOID HUGEP *pv,
ULONG cb,
ULONG FAR *pcbRead);
STDMETHOD(WriteAt) (THIS_ ULARGE_INTEGER ulOffset,
VOID const HUGEP *pv,
ULONG cb,
ULONG FAR *pcbWritten);
STDMETHOD(Flush) (THIS);
STDMETHOD(SetSize) (THIS_ ULARGE_INTEGER cb);
STDMETHOD(LockRegion) (THIS_ ULARGE_INTEGER libOffset,
ULARGE_INTEGER cb,
DWORD dwLockType);
STDMETHOD(UnlockRegion) (THIS_ ULARGE_INTEGER libOffset,
ULARGE_INTEGER cb,
DWORD dwLockType);
STDMETHOD(Stat) (THIS_ STATSTG FAR *pstatstg, DWORD grfStatFlag);
CFileILB(const TCHAR *pszName,
DWORD grfMode,
BOOL fOpenFile=TRUE);
~CFileILB();
SCODE Open(DWORD grfMode);
SCODE Create(DWORD grfMode);
ULONG ReleaseOnError(void); // same as release, but it will not delete
// non-scratch or newly created files
private:
FILE * _f;
ULONG _ulRef;
char *_pszName; // we always use ANSI char when dealing with
// I/O
unsigned short _fDelete;
};
#endif // #ifndef __FILEILB_HXX__