Share via


pfnSetMemoryAttributes (Windows Embedded CE 6.0)

1/5/2010

This function is initialized to NULL. OEMs can initialize this function to support changes to memory attributes.

Syntax

extern BOOL (*pfnSetMemoryAttributes)( 
  LPVOID pVirtualAddr, 
  LPVOID pPhysAddr, 
  DWORD cbSize, 
  DWORD dwAttributes 
); 

Parameters

  • pVirtualAddr
    [in] Beginning virtual memory address.

    The memory address must be page aligned.

  • pPhysAddr
    [in] Corresponding physical memory address shifted by 8 bits or PHYSICAL_ADDRESS_UNKNOWN.

    If the value of this parameter is not set to PHYSICAL_ADDRESS_UNKNOWN, the physical address, for which pPhysAddr is less than 8, must be page aligned.

    The range specified must be physically contiguous, which means that the range (pVirtualAddr -> pVirtualAddr + cbSize) must be mapped to (pPhysAddr -> pPhysAddr + cbSize).

  • cbSize
    [in] Size, in bytes, of the memory to be changed.

    The size must be in multiple of pages.

  • dwAttributes
    [in] Memory attribute to be set.

    Only PAGE_WRITECOMBINE is supported. Write-combining allows bus write transfers to be combined into a larger transfer before bursting.

Return Value

Nonzero indicates success. Zero indicates failure.

Remarks

This function pointer is initialized to NULL. If this function is left initialized as NULL, any call to the CeSetMemoryAttributes function fails.

To update the function pointer, OEMs should declare pfnSetMemoryAttributes and initialize it in the call to the OEMInit function. The following code example shows how to do this.

BOOL SetMemoryAttributes (LPVOID pVirtualAddr, LPVOID pPhysAddr, DWORD cbSize, DWORD dwAttributes);

OEMInit()
{
    //…
    g_pOemGlobal->pfnSetMemoryAttributes = SetMemoryAttributes;
}

Requirements

Header oemglobal.h
Library None
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

Optional OAL Functions
OEMGLOBAL
NKVirtualSetAttributes
OEMInit

Other Resources

CeSetMemoryAttributes