Share via


MapPtrToProcess (Windows CE 5.0)

Send Feedback

This function is deprecated. Use the MapCallerPtr function instead.

This function maps an unmapped pointer to a process.

LPVOID MapPtrToProcess( LPVOID lpv, HANDLE hProc);

Parameters

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

Return Values

If successful, returns a mapped version of the lpv pointer; otherwise, the return value is NULL.

Remarks

The handle for hProc is obtained using GetCurrentProcessId or GetCallerProcess.

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 within calls to the other process.

Requirements

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

See Also

UnMapPtr | MapCallerPtr | GetOwnerProcess | GetCallerProcess | GetCurrentProcessId

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.