コード例 #1
0
NTSTATUS
WDFEXPORT(WdfDmaTransactionInitializeUsingOffset)(
    __in
    PWDF_DRIVER_GLOBALS DriverGlobals,
    __in
    WDFDMATRANSACTION DmaTransaction,
    __in
    PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
    __in
    WDF_DMA_DIRECTION DmaDirection,
    __in
    PMDL Mdl,
    __in
    size_t Offset,
    __in
    __drv_when(Length == 0, __drv_reportError(Length cannot be zero))
    size_t Length
    )
{
    //
    // Stub this out by calling the regular initialize method.  Eventually 
    // the regular initialize method will call this instead.
    //

    return WDFEXPORT(WdfDmaTransactionInitialize)(
            DriverGlobals,
            DmaTransaction,
            EvtProgramDmaFunction,
            DmaDirection,
            Mdl,
            (PVOID) (((ULONG_PTR) MmGetMdlVirtualAddress(Mdl)) + Offset),
コード例 #2
0
ファイル: resrcsup.c プロジェクト: kcrazy/winekit
#pragma alloc_text(PAGE, CdAcquireForCache)
#pragma alloc_text(PAGE, CdFilterCallbackAcquireForCreateSection)
#pragma alloc_text(PAGE, CdAcquireResource)
#pragma alloc_text(PAGE, CdNoopAcquire)
#pragma alloc_text(PAGE, CdNoopRelease)
#pragma alloc_text(PAGE, CdReleaseForCreateSection)
#pragma alloc_text(PAGE, CdReleaseFromCache)
#endif



__drv_mustHoldCriticalRegion
BOOLEAN
CdAcquireResource (
    __in PIRP_CONTEXT IrpContext,
    __inout __drv_when( (!IgnoreWait && FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT )), __drv_deref(__drv_acquiresResource(ExResourceType))) PERESOURCE Resource,
    __in BOOLEAN IgnoreWait,
    __in TYPE_OF_ACQUIRE Type
    )

/*++

Routine Description:

    This is the single routine used to acquire file system resources.  It
    looks at the IgnoreWait flag to determine whether to try to acquire the
    resource without waiting.  Returning TRUE/FALSE to indicate success or
    failure.  Otherwise it is driven by the WAIT flag in the IrpContext and
    will raise CANT_WAIT on a failure.

Arguments:
コード例 #3
0
        //
        CallCleanup();
    }

    return TRUE;
}

//
// Despite the name this function may not always be called with lock held
// but if Unlock is TRUE, lock must be held.
//
_When_(Unlock, _Releases_lock_(this->m_SpinLock.m_Lock))
__drv_when(Unlock, __drv_requiresIRQL(DISPATCH_LEVEL))
VOID
FxObject::DeletedAndDisposedWorkerLocked(
    __in __drv_when(Unlock, __drv_restoresIRQL) KIRQL OldIrql,
    __in                                        BOOLEAN Unlock
    )
{
    SetObjectStateLocked(FxObjectStateDeletedAndDisposed);

    if (Unlock) {
        m_SpinLock.Release(OldIrql);
    }

    DestroyChildren();

    //
    // Release the final reference on the object
    //
    RELEASE(NULL);
コード例 #4
0
ファイル: fxcxdeviceinitapi.cpp プロジェクト: AntejaVM/WDF
}

_Must_inspect_result_
__drv_maxIRQL(DISPATCH_LEVEL)
WDFAPI
NTSTATUS
WDFEXPORT(WdfCxDeviceInitAssignWdmIrpPreprocessCallback)(
    __in
    PWDF_DRIVER_GLOBALS DriverGlobals,
    __in
    PWDFCXDEVICE_INIT   CxDeviceInit,
    __in
    PFN_WDFCXDEVICE_WDM_IRP_PREPROCESS EvtCxDeviceWdmIrpPreprocess,
    __in
    UCHAR MajorFunction,
    __drv_when(NumMinorFunctions > 0, __in_bcount(NumMinorFunctions))
    __drv_when(NumMinorFunctions == 0, __in_opt)
    PUCHAR MinorFunctions,
    __in
    ULONG NumMinorFunctions
    )
{
    DDI_ENTRY();
        
    PFX_DRIVER_GLOBALS fxDriverGlobals;
    PFX_DRIVER_GLOBALS cxDriverGlobals;
    NTSTATUS status;

    cxDriverGlobals = GetFxDriverGlobals(DriverGlobals);
    FxPointerNotNull(cxDriverGlobals, CxDeviceInit);
    fxDriverGlobals = CxDeviceInit->ClientDriverGlobals;
コード例 #5
0
ファイル: transform.cpp プロジェクト: kcrazy/winekit
        HRESULT
        S_OK - On success
        E_*  - On error

    Note:

        The annotation on pphProfiles is intended to express that, when
            *pcProfiles >  0, pphProfiles ought to be annotated with __deref_out_ecount(*pcProfiles)
            *pcProfiles == 0, pphProfiles ought to be annotated with __deref_out_opt

    --*/
    HRESULT
    GetProfileData(
        __ecount(1) __post __elem_readableTo(1)
        __post __drv_when(*pcProfiles >  0,  __post __deref __elem_writableTo(*pcProfiles) __post __deref __valid __refparam)
        __post __drv_when(*pcProfiles == 0,  __post __deref __maybenull)
                                                                HPROFILE** pphProfiles,
        __out                                                   DWORD*     pcProfiles
        )
    {
        HRESULT hr = S_OK;

        if (SUCCEEDED(hr = CHECK_POINTER(pphProfiles, E_POINTER)) &&
            SUCCEEDED(hr = CHECK_POINTER(pcProfiles, E_POINTER)) &&
            SUCCEEDED(hr = CHECK_POINTER(m_phProfiles, E_PENDING)))
        {
            *pphProfiles = 0;
            *pcProfiles = 0;

            if (m_cProfiles > 0)