AllocPhysMem (Windows Embedded CE 6.0)
This function allocates physically contiguous memory.
LPVOID AllocPhysMem( DWORD cbSize, DWORD fdwProtect, DWORD dwAlignmentMask, DWORD dwFlags, PULONG pPhysicalAddress );
[in] Number of bytes to allocate. The physical memory allocated is rounded up to the nearest page and is aligned on a 64-KB address.
[in] Specifies the protection desired. The following table shows possible values.
Enables execute access to the committed region of pages. An attempt to read or write to the committed region causes an access violation.
Enables execute and read access to the committed region of pages. An attempt to write to the committed region causes an access violation.
Enables execute, read, and write access to the committed region of pages.
Pages in the region become guard pages. Any attempt to read from or write to a guard page causes the system to raise a STATUS_GUARD_PAGE exception and turn off the guard page status. Guard pages thus act as access alarms.
The PAGE_GUARD flag is a page protection modifier. An application uses it with one of the other page protection flags, with one exception: It cannot be used with PAGE_NOACCESS. When an access attempt causes the system to turn off guard page status, the underlying page protection takes over.
If a guard page exception occurs during a system service, the service typically returns a failure status indicator.
Enables read access to the committed region of pages. An attempt to write to the committed region causes an access violation. If the system differentiates between read-only access and execute access, an attempt to execute code in the committed region causes an access violation.
Enables both read and write access to the committed region of pages.
[in] Bit mask that describes the byte alignment needed. If it is set to zero, the default system alignment is used. If it is set to any other value, the kernel attempts to fulfill the memory request, based on the alignment request. The dwAlignmentMask parameter and a physical address determine whether the memory is aligned correctly for the request.
Reserved for future use. Must be set to zero.
[out] Pointer to a DWORD that stores the physical address of the memory allocation.
A valid pointer indicates success. NULL indicates failure. Call GetLastError for extended error information.
If there is no physically contiguous memory to fulfill the request, no attempt is made to move memory to fulfill the request.
|Windows Embedded CE||Windows CE .NET 4.0 and later|