PsAttachSiloToCurrentThread function (ntddk.h)

This routine places a thread temporarily into the specified Silo.

Syntax

PESILO PsAttachSiloToCurrentThread(
  [in] PESILO Silo
);

Parameters

[in] Silo

The silo that the thread is to impersonate. The caller must hold a reference to the silo throughout the duration of the impersonation.

Return value

The previous silo that was attached to the current thread.

Remarks

The specified Silo is attached to the current thread so that it becomes the effective silo for the thread.

The thread then operates within the namespace of the attached silo until PsDetachSiloFromCurrentThread is called.

Examples

PESILO PreviousSilo = PsAttachSiloToCurrentThread(SomeSilo);

// Do work within the silo context

PsDetachSiloFromCurrentThread(PreviousSilo);</pre>

Requirements

Requirement Value
Minimum supported client Windows 10, version 1607
Minimum supported server Windows Server 2016
Target Platform Windows
Header ntddk.h

See also

PsDetachSiloFromCurrentThread