MapPtrToProcess (deprecated) (Compact 7)

3/12/2014

This function maps an unmapped pointer to a process.

Note

This function is deprecated. Developers working with Windows Embedded Compact 7, Windows Embedded Compact 7, or later versions should see Kernel Buffer Marshaling Functions.

Syntax

LPVOID MapPtrToProcess(
  LPVOID lpv,
  HANDLE hProc
);

Parameters

  • lpv
    [out] Long pointer to be mapped.
  • hProc
    [in] Handle to the process which the lpv pointer is to be mapped to.

Return Value

A mapped version of the lpv pointer indicates success. NULL indicates failure.

Remarks

The handle to hProc is obtained using GetCurrentProcessId or GetCallerProcess (deprecated).

The OEM*** functions typically do not call this function. This kernel function is primarily provided for use by device drivers. However, any application can call this function.

If the pointer is already mapped, MapPtrToProcess returns the original pointer if the application calling the function has the access necessary to dereference that pointer. Otherwise, NULL is returned.

If the pointer is unmapped, MapPtrToProcess first maps the pointer, and then returns the mapped pointer if the application calling the function can access it. Otherwise, NULL is returned.

This function should be called to map pointers that are passed to a protected server library where the pointer is not a parameter directly, but it is, rather, obtained from a structure and must be adjusted for the address space.

For example, to pass the pointer pPointer to another process, first make the following call:

pPointer_retval = MapPtrToProcess(pPointer, (HANDLE) GetCurrentProcessId());

Then pPointer_retval can be passed in calls to the other process.

Requirements

Header

pkfuncs.h

Library

coredll.lib

See Also

Reference

Kernel Functions
UnMapPtr
MapCallerPtr (deprecated)
GetOwnerProcess
GetCallerProcess (deprecated)
GetCurrentProcessId