Microsoft KB Archive/213359

{|
 * width="100%"|

PRB: Windows CE VirtualCopy Failing for Physical Memory

 * }

Q213359

-

The information in this article applies to:


 * Microsoft Windows CE for the Handheld PC

-

SYMPTOMS
VirtualCopy returns error 87, incorrect parameter, when mapping physical memory.

CAUSE
When mapping physical memory, the high bit of the source address is not set.

RESOLUTION
Set the high bit of the source address that is to be copied:

  LPVOID virtreg;

// Allocate memory. irtreg = VirtualAlloc( (LPVOID) 0,  (DWORD) 4096,   (DWORD) MEM_RESERVE, (DWORD) PAGE_NOACCESS);

// Map the memory from location 0xb8000. if (!VirtualCopy( virtreg, (LPVOID) 0x800b8000, (DWORD) 4096, (DWORD) PAGE_READWRITE|PAGE_NOCACHE)) {     DEBUGMSG(ZONE_WARNING,      (TEXT("CFDISK:CFInit VirtualCopy failed %d\r\n"), GetLastError)); }

STATUS
This behavior is by design, based on MIPS-style addressing.

Additional query words:

Keywords : kbDDK kbETK kbWinCE kbDSupport

Issue type : kbprb

Technology :