NKVirtualSetAttributes (Windows CE 5.0)

Send Feedback

This function enables OEMs to change the per-page attributes for a range of virtual memory, which is usually copied from a physical location not known to the kernel.

BOOL NKVirtualSetAttributes(LPVOIDlpvAddress,DWORDcbSize,DWORDdwNewFlags,DWORDdwMask,LPDWORDlpdwOldFlags);

Parameters

  • lpvAddress
    [in] Start address of the virtual memory whose attributes are to be changed.
  • cbSize
    [in] Length, in bytes, of the virtual memory whose attributes are to be changed.
  • dwNewFlags
    [in] New value of the bits to be set.
  • dwMask
    [in] Bits that are to be changed.
  • lpdwOldFlags
    [in] If this parameter is not NULL, *lpdwOldFlags contains the original value of the page entry of the first page upon return.

Return Values

Returns TRUE if the function succeeded, and FALSE if it failed.

Remarks

NkVirtualSetAttributes is only available for use by the OAL.

The dwMask parameter specifies the bits to be changed. For example, if original value=0x00100010, dwMask=0x30, and dwNewFlags=0x030, the new value is 0x00100030.

The new value is calculated using the following formula:

newValue = (oldValue & ~dwMask)|(dwNewFlags & dwMask);

If dwMask is 0 (zero), it behaves similar to a query function. This means that nothing is changed and the original page entry is returned through lpdwOldFlags.

Note   Do not change the physical page number, which are bits 10 through 31 for most CPUs. Changing the page number causes unexpected system behavior.

The NKVirtualSetAttributes function changes the TLB entry directly. The calling function should be aware of what CPU architecture it is running on and which attributes to change.

The NKVirtualSetAttributes function can be used on the x86 and XScale microprocessors to speed up the display buffer.

The NKVirtualSetAttributes function does not work on SHx processors.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Pkfuncs.h.
Link Library: Coredll.lib.

See Also

VirtualSetAttributes

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.