Esempio n. 1
0
NTSTATUS VBoxMRxCreateSrvCall(PMRX_SRV_CALL pSrvCall, PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
{
    PMRX_SRVCALLDOWN_STRUCTURE SrvCalldownStructure = (PMRX_SRVCALLDOWN_STRUCTURE)(pCallbackContext->SrvCalldownStructure);
    RT_NOREF(pSrvCall);

    Log(("VBOXSF: MRxCreateSrvCall: %p.\n", pSrvCall));

    if (IoGetCurrentProcess() == RxGetRDBSSProcess())
    {
        Log(("VBOXSF: MRxCreateSrvCall: Called in context of RDBSS process\n"));

        vbsfExecuteCreateSrvCall(pCallbackContext);
    }
    else
    {
        NTSTATUS Status;

        Log(("VBOXSF: MRxCreateSrvCall: Dispatching to worker thread\n"));

        Status = RxDispatchToWorkerThread(VBoxMRxDeviceObject, DelayedWorkQueue,
                                          (PWORKER_THREAD_ROUTINE)vbsfExecuteCreateSrvCall,
                                          pCallbackContext);

        if (Status == STATUS_SUCCESS)
            Log(("VBOXSF: MRxCreateSrvCall: queued\n"));
        else
        {
            pCallbackContext->Status = Status;
            SrvCalldownStructure->CallBack(pCallbackContext);
        }
    }

    /* RDBSS expect this. */
    return STATUS_PENDING;
}
Esempio n. 2
0
File: file.c Progetto: carmark/vbox
NTSTATUS VBoxMRxRead(IN PRX_CONTEXT RxContext)
{
    NTSTATUS Status = RxDispatchToWorkerThread(VBoxMRxDeviceObject, DelayedWorkQueue,
                                               vbsfReadWorker,
                                               RxContext);

    Log(("VBOXSF: MRxRead: RxDispatchToWorkerThread: Status 0x%08X\n", Status));

    if (Status == STATUS_SUCCESS)
        Status = STATUS_PENDING;

    return Status;
}
Esempio n. 3
0
NTSTATUS VBoxMRxCreateSrvCall (PMRX_SRV_CALL pSrvCall, PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
/*++

 Routine Description:

 This routine patches the RDBSS created srv call instance with the information required
 by the mini redirector.

 Arguments:

 RxContext        - Supplies the context of the original create/ioctl

 CallBackContext  - the call back context in RDBSS for continuation.

 Return Value:

 RXSTATUS - The return status for the operation

 --*/
{
    NTSTATUS Status;

    PMRX_SRVCALLDOWN_STRUCTURE SrvCalldownStructure = (PMRX_SRVCALLDOWN_STRUCTURE)(pCallbackContext->SrvCalldownStructure);

    Assert(pSrvCall);
    Assert(NodeType(pSrvCall) == RDBSS_NTC_SRVCALL);

    Log(("VBOXSF: VBoxMRxCreateSrvCall: Called %p.\n", pSrvCall));

    //
    // If this request was made on behalf of the RDBSS, do ExecuteCreatSrvCall
    // immediately. If the request was made from somewhere else, create a work item
    // and place it on a queue for a worker thread to process later. This distinction
    // is made to simplify transport handle management.
    //
    if (IoGetCurrentProcess() == RxGetRDBSSProcess())
    {
        Log(("VBOXSF: VBoxMRxCreateSrvCall: Called in context of RDBSS process\n"));

        //
        // Peform the processing immediately because RDBSS is the initiator of this
        // request
        //

        ExecuteCreateSrvCall(pCallbackContext);
    }
    else
    {
        Log(("VBOXSF: VBoxMRxCreateSrvCall: Dispatching to worker thread\n"));

        //
        // Dispatch the request to a worker thread because the redirected drive
        // buffering sub-system (RDBSS) was not the initiator
        //

        Status = RxDispatchToWorkerThread(VBoxMRxDeviceObject, DelayedWorkQueue, (PWORKER_THREAD_ROUTINE)ExecuteCreateSrvCall, /* explicit cast for first parameter type */
        pCallbackContext);

        if (Status == STATUS_SUCCESS)
        {
            Log(("VBOXSF: VBoxMRxCreateSrvCall: queued!\n"));
        }
        else
        {
            pCallbackContext->Status = Status;
            SrvCalldownStructure->CallBack(pCallbackContext);
        }
    }

    //
    // The wrapper expects PENDING.
    //
    return STATUS_PENDING;
}