ProtectionPolicyManager.ProtectedAccessSuspending 事件

定义

注意

从 2022 年 7 月开始,Microsoft 将弃用 Windows 信息保护 (WIP) 和支持 WIP 的 API。 Microsoft 将继续在受支持的 Windows 版本上支持 WIP。 新版本的 Windows 不包含 WIP 的新功能,将来的 Windows 版本中不支持它。 有关详细信息,请参阅宣布 Windows 信息保护的日落

出于数据保护需求,Microsoft 建议使用Microsoft Purview 信息保护Microsoft Purview 数据丢失防护。 Purview 简化了配置设置,并提供一组高级功能。

应用注册以接收保护将被暂停的通知的事件。

// Register
static event_token ProtectedAccessSuspending(EventHandler<ProtectedAccessSuspendingEventArgs> const& handler) const;

// Revoke with event_token
static void ProtectedAccessSuspending(event_token const* cookie) const;

// Revoke with event_revoker
static ProtectionPolicyManager::ProtectedAccessSuspending_revoker ProtectedAccessSuspending(auto_revoke_t, EventHandler<ProtectedAccessSuspendingEventArgs> const& handler) const;
public static event System.EventHandler<ProtectedAccessSuspendingEventArgs> ProtectedAccessSuspending;
function onProtectedAccessSuspending(eventArgs) { /* Your code */ }
Windows.Security.EnterpriseData.ProtectionPolicyManager.addEventListener("protectedaccesssuspending", onProtectedAccessSuspending);
Windows.Security.EnterpriseData.ProtectionPolicyManager.removeEventListener("protectedaccesssuspending", onProtectedAccessSuspending);
- or -
Windows.Security.EnterpriseData.ProtectionPolicyManager.onprotectedaccesssuspending = onProtectedAccessSuspending;
Public Shared Custom Event ProtectedAccessSuspending As EventHandler(Of ProtectedAccessSuspendingEventArgs) 

事件类型

Windows 要求

应用功能
enterpriseDataPolicy

注解

设计用于处理企业内容的应用必须确保它不会在内存中保留任何敏感数据。 为了确保这一点,它会注册 ProtectedAccessSuspending 和 ProtectedAccessResumed 事件,以便在设备锁定或解锁时收到通知。 在临时删除设备上预配的数据保护密钥之前,将触发 ProtectedAccessSuspending。 锁定设备时会删除这些密钥,以防止在设备锁定时未经授权访问加密数据。 当密钥在设备解锁时再次可用后,将触发 ProtectedAccessResumed。 锁定设备后,应用可确保使用 DataProtectionManager 保护内存中的任何敏感内容。 它还会关闭其受保护文件的打开文件句柄,以确保系统不会在内存中缓存任何敏感数据。

适用于

另请参阅