Share via


EncodePointer function

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

Syntax

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 client

Windows Vista, Windows XP with SP2 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008, Windows Server 2003 with SP1 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

DecodePointer

DecodeRemotePointer

EncodeRemotePointer

EncodeSystemPointer