WindowsIntegrityPolicy クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
現在のWindows 10セキュア モード (10 S モード) と、モードが変更されたときに発生するイベントに関する情報を提供します。
public ref class WindowsIntegrityPolicy abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class WindowsIntegrityPolicy final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class WindowsIntegrityPolicy
Public Class WindowsIntegrityPolicy
- 継承
- 属性
Windows の要件
デバイス ファミリ |
Windows 10, version 1809 (10.0.17763.0 で導入)
|
API contract |
Windows.Foundation.UniversalApiContract (v7.0 で導入)
|
例
public class WindowsLockdownExample
{
public WindowsLockdownExample()
{
Windows.System.Profile.WindowsIntegrityPolicy.PolicyChanged += this.WindowsIntegrityPolicy_PolicyChanged;
}
~WindowsLockdownExample()
{
Windows.System.Profile.WindowsIntegrityPolicy.PolicyChanged -= this.WindowsIntegrityPolicy_PolicyChanged;
}
private void WindowsIntegrityPolicy_PolicyChanged(object sender, object e)
{
// Windows secure mode (10 S mode) has changed.
this.ProcessWindowsIntegrityPolicy();
if (!Windows.System.Profile.WindowsIntegrityPolicy.IsEnabled)
{
// There are certain things that you may want to do when Windows secure mode
// (10 S mode) has changed from the enabled to the disabled state. For example,
// a security application might want to offer anti-virus software on this
// device.
}
}
public void ProcessWindowsIntegrityPolicy()
{
// Check Windows secure mode (10 S mode) status.
if (Windows.System.Profile.WindowsIntegrityPolicy.IsEnabled)
{
// Windows secure mode (10 S mode) is enabled.
if (Windows.System.Profile.WindowsIntegrityPolicy.IsEnabledForTrial)
{
// Furthermore, it has been enabled for trial purposes. Respond accordingly.
// For example, logging/tagging this device for the organization to
// monitor devices that are under trial mode.
}
else
{
// It has been enabled for normal scenarios. Respond accordingly.
// For example, don’t try to invoke any process that will be blocked
// by the policy, or change your UI or error message. For example,
// security software could show a different error message about the process
// being blocked when Windows secure mode (10 S mode) is enabled.
}
}
// Check whether Windows secure mode (10 S mode) can be disabled, and whether disabling is supported.
if (Windows.System.Profile.WindowsIntegrityPolicy.CanDisable)
{
if (Windows.System.Profile.WindowsIntegrityPolicy.IsDisableSupported)
{
// Windows secure mode (10 S mode) can be disabled, and disabling is supported.
// Respond accordingly. For example, report this information back to any cloud-based
// solution, in case it need to push any policy disabling package to the right devices.
}
else
{
// Windows secure mode (10 S mode) can be disabled, but disabling is not supported.
// So, Windows secure mode (10 S mode) can never be changed. Work around this situation.
// For example, show the appropriate error message when you fail to disable Windows
// secure mode (10 S mode).
}
}
}
}
注釈
Windows では、モードとして 10 S (Windows ロックダウンとも呼ばれます) が提供されます。 Windows が 10 S モードの場合、Microsoft コンポーネントと ユニバーサル Windows プラットフォーム (UWP) アプリのみを実行できます。 や cmd.exe
などのregedit.exe
特定のコンポーネントも許可されません。 UWP アプリ (特にセキュリティ アプリとファイアウォール アプリ) は、適切に動作するためには、現在の 10 S モードに注意する必要があります。 このようなアプリは、10 S モードが有効から無効に切り替わるときにも通知する必要があります。
プロパティ
CanDisable |
セキュア モード (10 S モード) Windows 10、実行時またはオフライン、または元の機器製造元 (OEM)、またはサード パーティによって無効にできるかどうかを示す値を取得します。 |
IsDisableSupported |
サードパーティ ベンダーが実行時にセキュリティで保護されたモード (10 S モード) を無効 Windows 10にするための公開方法 (API) があるかどうかを示す値 (他の必要な条件については「備考」を参照) を取得します。 |
IsEnabled |
セキュア モード (10 S モード) が有効 (Windows ロックダウン モード) Windows 10かどうかを示す値を取得します。 |
IsEnabledForTrial |
試用目的でセキュア モード (10 S モード) が有効 (Windows ロックダウン モード) Windows 10かどうかを示す値を取得します。 |
イベント
PolicyChanged |
現在のWindows 10セキュア モード (10 S モード) が変更されたときに発生します。 |