EncodePointer Function

Encodes the specified pointer. Encoded pointers can be used to provide another layer of protection for pointer values.

Syntax

C++
PVOID EncodePointer(
  __in  PVOID Ptr
);

Parameters

Ptr [in]

The pointer to be encoded.

Return Value

The function returns the encoded pointer.

Remarks

Encoding globally available pointers helps protect them from being exploited. The EncodePointer function obfuscates the pointer value with a secret so that it cannot be predicted by an external agent. The secret used by EncodePointer is different for each process.

A pointer must be decoded before it can be used.

Requirements

Minimum supported clientWindows Vista, Windows XP with SP2
Minimum supported serverWindows Server 2008, Windows Server 2003 with SP1
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

DecodePointer
EncodeSystemPointer

Send comments about this topic to Microsoft

Build date: 10/22/2009

Tags :


Community Content

JChung2007
Not properly guarded
EncodePointer and its related set of functions are not properly guarded with a _WIN32_WINNT >= 0x0501 #ifdef.
Tags :

NZSchoolTech
Application Compatibility
If an application is incompatible with the use of these functions, set its compatibility settings to "Windows 2000".
Tags :

Page view tracker