LONG ExtentLength; // in KBs
+ //
+ // We pin the Cc File Object between AcquireFileForNtCreateSection
+ // and ReleaseFileForNtCreateSection. Protected by SOP lock
+ //
+
+ PFILE_OBJECT SectionCreateFO;
+
} File;
struct
AFSAcquireExcl( &pFcb->NPFcb->SectionObjectResource,
TRUE);
+ if( NULL == pFcb->Specific.File.SectionCreateFO )
+ {
+ //
+ // If not re-entrant then save and reference
+ //
+ pFcb->Specific.File.SectionCreateFO =
+ CcGetFileObjectFromSectionPtrs( &pFcb->NPFcb->SectionObjectPointers );
+ if( NULL != pFcb->Specific.File.SectionCreateFO )
+ {
+ ObReferenceObject( pFcb->Specific.File.SectionCreateFO);
+ }
+ }
+
return;
}
if( ExIsResourceAcquiredExclusiveLite( &pFcb->NPFcb->SectionObjectResource))
{
+ PFILE_OBJECT fileObject = pFcb->Specific.File.SectionCreateFO;
+ pFcb->Specific.File.SectionCreateFO = NULL;
AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
PsGetCurrentThread()));
AFSReleaseResource( &pFcb->NPFcb->SectionObjectResource);
+
+ //
+ // Now defer the Cc file object (if there was one) now that we are lock free
+ //
+
+ if( NULL != fileObject )
+ {
+ ObDereferenceObject( fileObject );
+ }
}
return;