Get a file object of fscontext pointer from an FCB

Hi all.

I’m developing a pseudo file system driver based on RDBSSLIB.lib and am
hoping someone would know the answers to these questions.

  1. Is the following code the correct way to get a dangling FCB that
    needs to be cleaned up ?
    RX_CONTEXT *rx;

LIST_ENTRY *head = RemoveHeadList
(&(rx->RxDeviceObject->RdbssScavengerInDeviceObject.FcbFinalizationList)
);

FCB *pdanglingfcb = CONTAINING_RECORD (head, FCB,
ScavengerFinalizationList);

  1. How do I get the FILE_OBJECT pointer from a PFCB ?

Thanks a lot for any pointers in the right direction.