Sample Code

Windows Driver Samples/ Native Wi-Fi Miniport Sample Driver/ C++/ hvl/ hvl_utils.h/

#pragma once

// BUGBUG: Would it ever be called at dispatch?
#define ACQUIRE_LOCK(pStruct, DispatchLevel)                \
{                                                           \
    if (DispatchLevel)                                      \
    {                                                       \
        NdisDprAcquireSpinLock(&pStruct->Lock);             \
    }                                                       \
    else                                                    \
    {                                                       \
        NdisAcquireSpinLock(&pStruct->Lock);                \
    }                                                       \
    pStruct->fLocked = TRUE;                                \
}                                                           \

#define RELEASE_LOCK(pStruct, DispatchLevel)                \
{                                                           \
    pStruct->fLocked = FALSE;                               \
    if (DispatchLevel)                                      \
    {                                                       \
        NdisDprReleaseSpinLock(&pStruct->Lock);             \
    }                                                       \
    else                                                    \
    {                                                       \
        NdisReleaseSpinLock(&pStruct->Lock);                \
    }                                                       \
}                                                           \



NDIS_STATUS
AllocateMemory(NDIS_HANDLE ndisHandle, ULONG ulSize, PVOID *ppvMem);

VOID
FreeMemory(PVOID pvMem);

#define ALLOC_MEM(ndisHandle, cb, ppvMem)     AllocateMemory(ndisHandle, cb, (PVOID*)ppvMem)
#define FREE_MEM(pvMem)                FreeMemory((PVOID)pvMem)


Our Services

  • What our customers say about us?

© 2011-2025 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS