Reserves space for log buffers, or appends a log record to the log, or does both. The function is atomic.
CLFSUSER_API BOOL ReserveAndAppendLog( IN PVOID pvMarshal, IN PCLFS_WRITE_ENTRY rgWriteEntries, IN ULONG cWriteEntries, IN PCLFS_LSN plsnUndoNext, IN PCLFS_LSN plsnPrevious, IN ULONG cReserveRecords, IN OUT LONGLONG  rgcbReservation, IN ULONG fFlags, OUT PCLFS_LSN plsn, IN OUT LPOVERLAPPED pOverlapped );
A pointer to a marshaling context that is allocated by using the CreateLogMarshallingArea function.
A pointer to an array of CLFS_WRITE_ENTRY buffers to be marshaled into one record.
This parameter is ignored if the cWriteEntries parameter is zero.
The number of write entries in the rgWriteEntries array.
If this value is nonzero, you must specify a buffer in the rgWriteEntries parameter.
A pointer to a CLFS_LSN structure that specifies the log sequence number (LSN) of the next record in the undo-chain.
A pointer to a CLFS_LSN structure that specifies the LSN of the previous record in the previous-chain.
The number of record sizes in the rgcbReservation array.
A pointer to an array of reservation sizes for each record that the cReserveRecords parameter specifies.
This parameter is ignored if the cReserveRecords parameter is zero. If a reservation size is negative, a reservation of that size is released.
The actual space that is reserved for each record, including required overhead, is returned in the individual array elements on successful completion. These values can be passed to the FreeReservedLog function to adjust space that is reserved in the marshaling area.
The flags that specify the behavior of this function.
One or more of the following values can be combined.
A pointer to a CLFS_LSN structure that receives the LSN of the appended record.
A pointer to an OVERLAPPED structure.
This parameter can be NULL if asynchronous operation is not used.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
The following list identifies the possible error codes:
The LSN that is returned by the ReserveAndAppendLog function is not necessarily the next LSN that is used. The LSN that is returned is an estimate of the next LSN, and it varies based on which flags are specified by the fFlags parameter. The LSN that is returned can be used when moving the base tail. This LSN is invalidated by the next call to this function.
If the ReserveAndAppendLog function returns ERROR_LOG_FILE_FULL, there is no more space in the log. This can be resolved in one of the following ways:
- Free any unneeded reservations.
- Advance the base LSN or the log archive tail, or both, to recycle containers.
- Add containers to the log.
If the ReserveAndAppendLog function is called with a valid pOverlapped structure and the log handle is created with the overlapped option, then if a call to this function fails with an error code of ERROR_IO_PENDING, a pointer to a valid read context is placed in the variable that is pointed to by the ppvReadContext parameter.
To complete the log record copy, the client should first synchronize its execution with deferred completion of the overlapped I/O operation by using the GetOverlappedResult function, or one of the synchronization Wait Functions. For more information, see Synchronization and Overlapped Input and Output.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 R2 [desktop apps only]|