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保護記憶體中的任何敏感性內容。 它也會關閉其受保護檔案的開啟檔案控制碼,以確保系統不會快取記憶體中的任何敏感性資料。

適用於

另請參閱