Partager via


VirtualSetAttributes (Windows CE 5.0)

Send Feedback

This function enables driver developers 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 VirtualSetAttributes(LPVOIDlpvAddress,DWORDcbSize,DWORDdwNewFlags,DWORDdwMask,LPDWORDlpdwOldFlags);

Parameters

  • lpvAddress
    [in] The start address of the virtual memory whose attributes are to be changed.
  • cbSize
    [in] The length, in bytes, of the virtual memory whose attributes are to be changed.
  • dwNewFlags
    [in] Specifies the new value of the bits to be set.
  • dwMask
    [in] Specifies which bits are to be changed.
  • lpdwOldFlags
    [in] If this parameter is not NULL, *lpdwOldFlags will contain 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

The dwMask parameter specifies the bits to be changed. For example, if original value=0x00100010, dwMask=0x30, and dwNewFlags=0x030, then the new value will be 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 will be returned through lpdwOldFlags.

Note   It is highly recommended that you do not change the actual physical page number, which are bits 10 through 31 for most CPUs. Otherwise, it will result in an unexpected system behavior.

The VirtualSetAttributes 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 VirtualSetAttributes function can be used on the x86 and XScale microprocessors to speed up the display buffer.

The VirtualSetAttributes function does not work on SHx processors.

Requirements

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

See Also

NKVirtualSetAttributes | Kernel Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.