// ntddk.h
PESILO PsAttachSiloToCurrentThread(
[in] PESILO Silo
);
View the official Windows Driver Kit DDI referenceNo description available.
This routine places a thread temporarily into the specified Silo.
Silo [in]The silo that the thread is to impersonate. The caller must hold a reference to the silo throughout the duration of the impersonation.
The previous silo that was attached to the current thread.
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.
PESILO PreviousSilo = PsAttachSiloToCurrentThread(SomeSilo);
// Do work within the silo context
PsDetachSiloFromCurrentThread(PreviousSilo);</pre>