Share via


EncodeSystemPointer function

Encodes the specified pointer with a system-specific value. Encoded pointers can be used to provide another layer of protection for pointer values.

Syntax

PVOID EncodeSystemPointer(
   PVOID Ptr
);

Parameters

  • Ptr
    The system pointer to be encoded.

Return value

The function returns the encoded pointer.

Remarks

Encoding globally available pointers helps protect them from being exploited. The EncodeSystemPointer function obfuscates the pointer value with a secret so that it cannot be predicted by an external agent. The secret used by EncodeSystemPointer is the same for each process on a given computer, and is known to all the processes on that computer.

A pointer must be decoded before it can be used.

Using EncodeSystemPointer/DecodeSystemPointer is faster than using EncodePointer/DecodePointer, but the encoded system pointers are more vulnerable to attack because the value can be predicted on a per-machine basis.

Requirements

Minimum supported client

Windows Vista, Windows XP with SP2 [desktop apps only]

Minimum supported server

Windows Server 2008, Windows Server 2003 with SP1 [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

DecodeSystemPointer

EncodePointer