* %NULL value is forbidden.
*
* Dereferences @Bcb with the possible cleanup operations if you were the last owner.
+ *
+ * This call does not set the buffer as dirty although it will flush the buffers
+ * already set as dirty. Any flushes will be postponed after return from #IRP
+ * handling by the filesystem driver.
*/
VOID CcUnpinData(IN PVOID Bcb)
{
}
+/**
+ * CcRepinBcb:
+ * @Bcb: #PUBLIB_BCB to be repinned.
+ * %NULL value is forbidden.
+ *
+ * Increases usecount on @Bcb. You must call CcUnpinRepinnedBcb() for such @Bcb
+ * afterwards before returning from the #IRP handling.
+ *
+ * libcaptive does not differentiate between CcUnpinData() and CcUnpinRepinnedBcb().
+ * W32 differentiates.
+ *
+ * This call does not set the buffer as dirty - such buffer will not be flushed automatically.
+ *
+ */
VOID CcRepinBcb(IN PVOID Bcb)
{
PUBLIC_BCB *PublicBcb;
}
+/**
+ * CcUnpinRepinnedBcb:
+ * @Bcb: #PUBLIB_BCB to be unpinned from CcRepinBcb().
+ * %NULL value is forbidden.
+ * @WriteThrough: %TRUE if the buffer should be flushed before finishing this function.
+ * @IoStatus: #PIO_STATUS_BLOCK to return status of this operation.
+ * %NULL value is forbidden. libcaptive always returns %STATUS_SUCCESS here.
+ *
+ * Dereferencing of @Bcb after application of CcRepinBcb().
+ *
+ * This call does not set the buffer as dirty although it will flush the buffers
+ * already set as dirty. Any flushes will be postponed after return from #IRP
+ * handling by the filesystem driver if not requested to be synchronous by @WriteThrough.
+ */
VOID CcUnpinRepinnedBcb(IN PVOID Bcb,IN BOOLEAN WriteThrough,IN PIO_STATUS_BLOCK IoStatus)
{
PUBLIC_BCB *PublicBcb;
g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Bcb=%p,WriteThrough=%d,IoStatus=%p; privbcb->FileObject=%p",G_STRLOC,
Bcb,(gint)WriteThrough,IoStatus,privbcb->FileObject);
- /* FIXME: Should we really mark it as dirty by this function?
- * Undocumented by W32.
- */
- privbcb_set(privbcb,PRIVBCB_ITEM_DIRTY,TRUE);
-
- /* FIXME: Should we really flush the whole 'Bcb'?
- * Or maybe just some writes between CcRepinBcb(Bcb) and now? Who knows?
- * Undocumented by W32.
- */
if (WriteThrough)
captive_privbcb_flush_ordered(privbcb);
CcUnpinData(Bcb);
}
-/*
+/**
+ * CcSetDirtyPinnedData:
+ * @Bcb: #PUBLIB_BCB to be unpinned from CcRepinBcb().
+ * %NULL value is forbidden.
+ * @Lsn: Optional LSN (Linear Sequence Number) to assign to @Bcb.
+ * %NULL pointer is permitted.
+ *
* This call will set the buffer as dirty - such buffer will be flushed automatically.
+ *
+ * You should call it only on CcPin*() buffers - not just CcMapData() buffers
+ * although libcaptive does not differentiate it.
*/
VOID CcSetDirtyPinnedData(IN PVOID Bcb,IN PLARGE_INTEGER Lsn OPTIONAL)
{
struct private_bcb *privbcb, /* value */
struct CcSetFileSizes_param *CcSetFileSizes_param) /* user_data */
{
- g_return_if_fail(PublicBcb!=NULL);
+ g_return_if_fail(validate_Bcb(PublicBcb));
g_return_if_fail(privbcb!=NULL);
g_return_if_fail(CcSetFileSizes_param!=NULL);
*/
VOID CcSetBcbOwnerPointer(IN PVOID Bcb,IN PVOID Owner)
{
- g_return_if_fail(Bcb!=NULL);
+ g_return_if_fail(validate_Bcb(Bcb));
g_return_if_fail(Owner!=NULL);
/* FIXME:thread; NOP if no threads present */
*/
VOID CcUnpinDataForThread(IN PVOID Bcb,IN ERESOURCE_THREAD ResourceThreadId)
{
- g_return_if_fail(Bcb!=NULL);
+ g_return_if_fail(validate_Bcb(Bcb));
g_return_if_fail(ResourceThreadId!=0);
/* FIXME:thread */