' ########################################################################################
' Microsoft Windows
' File: txlogpub.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_txlogpub_PBI)
#DEFINE PBX_txlogpub_PBI
%EQUATE `TXLOGPUB_INC = 1
' /* header files for imported files */
#INCLUDE ONCE "Legacy/COM/Unknwn.inc"
'//+-------------------------------------------------------------------------
'//
'// Microsoft Windows
'// Copyright (c) Microsoft Corporation. All rights reserved.
'//
'//--------------------------------------------------------------------------
'// LSN
'// LSN is the fundamental cookie returned from the log as the name of a
'// newly-written log record. LSNs from successively written records to a
'// given log are always monotonically increasing. LSNs are directly
'// comparable: lsn2 is later in the log than lsn1 if and only if as integers
'// lsn2 > lsn1.
'//
'// Neither the value zero nor the value MAXLSN are ever used as the value of
'// an actual LSN.
'typedef LARGE_INTEGER LSN;
%EQUATE `MAXLSN = &H7FFFFFFFFFFFFFFF&&
'// RECORD_READING_POLICY
'// The RECORD_READING_POLICY enumeration values specify a hint about the
'// order in which records will be read from a log. It is used by
'// ILog::SetAccessPolicyHint.
' enum RECORD_READING_POLICY
%EQUATE `RECORD_READING_POLICY_FORWARD = 1
%EQUATE `RECORD_READING_POLICY_BACKWARD = 2
%EQUATE `RECORD_READING_POLICY_RANDOM = 3
'// ILog
'// An interface to the lowest level of a log implementation. This level
'// takes care of writing the records to disk in a stable manner. Recovery
'// protocols, transaction awareness, and the like are provided by a higher
'// semantic level.
$CLSID_SimpleFileBasedLog = GUID$("{E16C0593-128F-11D1-97E4-00C04FB9618A}")
' ########################################################################################
' ILog interface
' IID = FF222117-0C6C-11D2-B89A-00C04FB9618A
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ILog_INTERFACE_DEFINED)
 %ILog_INTERFACE_DEFINED = 1
$IID_ILog = GUID$("{FF222117-0C6C-11D2-B89A-00C04FB9618A}")
INTERFACE ILog $IID_ILog
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Force ( ' VTable offset = 12
 BYVAL lsnMinToForce AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD AppendRecord ( ' VTable offset = 16
 BYREF rgBlob AS BLOB
 , BYVAL cBlob AS DWORD
 , BYVAL fForceNow AS LONG
 , BYREF plsn AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD ReadRecord ( ' VTable offset = 20
 BYVAL lsnToRead AS QUAD
 , BYREF plsnPrev AS QUAD
 , BYREF plsnNext AS QUAD
 , BYREF ppbData AS DWORD
 , BYREF pcbData AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ReadRecordPrefix ( ' VTable offset = 24
 BYVAL lsnToRead AS QUAD
 , BYREF plsnPrev AS QUAD
 , BYREF plsnNext AS QUAD
 , BYREF pbData AS DWORD
 , BYREF pcbData AS DWORD
 , BYREF pcbRecord AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetLogLimits ( ' VTable offset = 28
 BYREF plsnFirst AS QUAD
 , BYREF plsnLast AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD TruncatePrefix ( ' VTable offset = 32
 BYVAL lsnFirstToKeep AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD SetAccessPolicyHint ( ' VTable offset = 36
 BYVAL policy AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ILog_INTERFACE_DEFINED__ */
'// IFileBasedLogInit
'// An interface used to initialize an instance of a file based implementation of
'// ILog. This interface defines the single method InitNew, which is used to
'// create a log on a new log file. Objects that implement IFileBasedLogInit
'// should also implement IPersistFile, to allow existing log files to be opened.
' ########################################################################################
' IFileBasedLogInit interface
' IID = 00951E8C-1294-11D1-97E4-00C04FB9618A
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFileBasedLogInit_INTERFACE_DEFINED)
 %IFileBasedLogInit_INTERFACE_DEFINED = 1
$IID_IFileBasedLogInit = GUID$("{00951E8C-1294-11D1-97E4-00C04FB9618A}")
INTERFACE IFileBasedLogInit $IID_IFileBasedLogInit
 INHERIT IUnknown
 ' =====================================================================================
 METHOD InitNew ( ' VTable offset = 12
 BYREF filename AS WSTRINGZ
 , BYVAL cbCapacityHint AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFileBasedLogInit_INTERFACE_DEFINED__ */
#ENDIF
