ThreadNetworkContext Class

Definition

Note

Starting in July 2022, Microsoft is deprecating Windows Information Protection (WIP) and the APIs that support WIP. Microsoft will continue to support WIP on supported versions of Windows. New versions of Windows won't include new capabilities for WIP, and it won't be supported in future versions of Windows. For more information, see Announcing sunset of Windows Information Protection.

For your data protection needs, Microsoft recommends that you use Microsoft Purview Information Protection and Microsoft Purview Data Loss Prevention. Purview simplifies the configuration set-up and provides an advanced set of capabilities.

A protected network context for an enterprise identity. The creation of the context tags all network connections made thereafter on the current thread with the identity, and allows access to enterprise resources that are access controlled by the enterprise's policy.

Note

Although is attributed as being agile, Close (or ) must be called on the originating thread in order to avoid an exception.

public ref class ThreadNetworkContext sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Security.EnterpriseData.EnterpriseDataContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ThreadNetworkContext final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Security.EnterpriseData.EnterpriseDataContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ThreadNetworkContext : System.IDisposable
Public NotInheritable Class ThreadNetworkContext
Implements IDisposable
Inheritance
Object Platform::Object IInspectable ThreadNetworkContext
Attributes
Implements

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
Windows Mobile Extension SDK (introduced in 10.0.10240.0)
API contract
Windows.Security.EnterpriseData.EnterpriseDataContract (introduced in v1.0)

Methods

Close()

Note

Starting in July 2022, Microsoft is deprecating Windows Information Protection (WIP) and the APIs that support WIP. Microsoft will continue to support WIP on supported versions of Windows. New versions of Windows won't include new capabilities for WIP, and it won't be supported in future versions of Windows. For more information, see Announcing sunset of Windows Information Protection.

For your data protection needs, Microsoft recommends that you use Microsoft Purview Information Protection and Microsoft Purview Data Loss Prevention. Purview simplifies the configuration set-up and provides an advanced set of capabilities.

Closes the protected network context. To avoid race conditions against other tasks, the app must call Close after access to the protected resource is initiated.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Applies to

See also