Restore SEBPatch
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.SystemComponents.Contracts.Registry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that a registry value has changed.
|
||||
/// </summary>
|
||||
public delegate void RegistryValueChangedEventHandler(string key, string name, object oldValue, object newValue);
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SafeExamBrowser.SystemComponents.Contracts.Registry.Events;
|
||||
|
||||
namespace SafeExamBrowser.SystemComponents.Contracts.Registry
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides functionality related to the Windows registry.
|
||||
/// </summary>
|
||||
public interface IRegistry
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when a registry value previously registred via <see cref="StartMonitoring(string, string)"/> has changed.
|
||||
/// </summary>
|
||||
event RegistryValueChangedEventHandler ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Starts monitoring the specified registry value.
|
||||
/// </summary>
|
||||
void StartMonitoring(string key, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Stops the monitoring of all previously registered registry values.
|
||||
/// </summary>
|
||||
void StopMonitoring();
|
||||
|
||||
/// <summary>
|
||||
/// Stops the monitoring of the specified registry value.
|
||||
/// </summary>
|
||||
void StopMonitoring(string key, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to read the value of the given name under the specified registry key.
|
||||
/// </summary>
|
||||
bool TryRead(string key, string name, out object value);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to read the value names of the given registry key.
|
||||
/// </summary>
|
||||
bool TryGetNames(string key, out IEnumerable<string> names);
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to read the subkey names of the given registry key.
|
||||
/// </summary>
|
||||
bool TryGetSubKeys(string key, out IEnumerable<string> subKeys);
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.SystemComponents.Contracts.Registry
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines registry values used in conjunction with <see cref="IRegistry"/>. Use the pattern "LogicalGroup_Key" resp. "LogicalGroup_Name" to
|
||||
/// allow for a better overview over all values and their usage (where applicable).
|
||||
/// </summary>
|
||||
public static class RegistryValue
|
||||
{
|
||||
/// <summary>
|
||||
/// All registry values located in the machine hive.
|
||||
/// </summary>
|
||||
public static class MachineHive
|
||||
{
|
||||
public const string AppPaths_Key = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths";
|
||||
public const string EaseOfAccess_Key = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Utilman.exe";
|
||||
public const string EaseOfAccess_Name = "Debugger";
|
||||
public const string HardwareConfig_Key = @"HKEY_LOCAL_MACHINE\SYSTEM\HardwareConfig";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// All registry values located in the user hive.
|
||||
/// </summary>
|
||||
public static class UserHive
|
||||
{
|
||||
public const string Cursors_Key = @"HKEY_CURRENT_USER\Control Panel\Cursors";
|
||||
public const string Cursors_AppStarting_Name = "AppStarting";
|
||||
public const string Cursors_Arrow_Name = "Arrow";
|
||||
public const string Cursors_Crosshair_Name = "Crosshair";
|
||||
public const string Cursors_Hand_Name = "Hand";
|
||||
public const string Cursors_Help_Name = "Help";
|
||||
public const string Cursors_IBeam_Name = "IBeam";
|
||||
public const string Cursors_No_Name = "No";
|
||||
public const string Cursors_NWPen_Name = "NWPen";
|
||||
public const string Cursors_Person_Name = "Person";
|
||||
public const string Cursors_Pin_Name = "Pin";
|
||||
public const string Cursors_SizeAll_Name = "SizeAll";
|
||||
public const string Cursors_SizeNESW_Name = "SizeNESW";
|
||||
public const string Cursors_SizeNS_Name = "SizeNS";
|
||||
public const string Cursors_SizeNWSE_Name = "SizeNWSE";
|
||||
public const string Cursors_SizeWE_Name = "SizeWE";
|
||||
public const string Cursors_UpArrow_Name = "UpArrow";
|
||||
public const string Cursors_Wait_Name = "Wait";
|
||||
public const string DeviceCache_Key = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskFlow\DeviceCache";
|
||||
public const string NoDrives_Key = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer";
|
||||
public const string NoDrives_Name = "NoDrives";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user