InterlockedExchangePointer (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function atomically exchanges a pair of values. The function prevents more than one thread from using the same variable simultaneously.

If you are exchanging pointer values, this function supersedes InterlockedExchange.

PVOID InterlockedExchangePointer(
  PVOID* Target,
  PVOID Value


[in, out] Pointer to the pointer to the value to exchange. The function sets the value to Value.
[in] New value for Target.

Return Values

The function returns the initial value pointed to by Target.


The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple threads. The threads of different processes can use this mechanism, if the variable is in shared memory.


OS Versions: Windows CE .NET 4.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib.

See Also


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.