TestimoX

API Reference

Class

RegFile

Namespace ADPlayground.Gpo.GpoLocal
Assembly ADPlayground
Implements
Modifiers sealed

Represents a .reg file and allows policy manipulation.

Inheritance

  • Object
  • RegFile

Constructors

Methods

public Void Apply(IPolicySource target) #
Returns: Void

Applies the entire model to a target policy source.

Parameters

target ADPlayground.Gpo.GpoLocal.IPolicySource requiredposition: 0
ApplyDifference 3 overloads
public Void ApplyDifference(PolFile oldVersion, PolFile newVersion) #
Returns: Void

Applies the delta between this model and an optional previous version to a target policy source.

Parameters

oldVersion ADPlayground.Gpo.GpoLocal.RegFile requiredposition: 0
target ADPlayground.Gpo.GpoLocal.IPolicySource requiredposition: 1
ApplyDifference(ADPlayground.Gpo.GpoLocal.RegFile oldVersion, ADPlayground.Gpo.GpoLocal.PolFile target) #

Applies the delta between this model and an optional previous version to a POL file.

Parameters

oldVersion ADPlayground.Gpo.GpoLocal.RegFile required
target ADPlayground.Gpo.GpoLocal.PolFile required
ApplyDifference(ADPlayground.Gpo.GpoLocal.PolFile oldVersion, ADPlayground.Gpo.GpoLocal.PolFile newVersion) #

Applies the delta between a previous POL and this model into another POL file.

Parameters

oldVersion ADPlayground.Gpo.GpoLocal.PolFile required
newVersion ADPlayground.Gpo.GpoLocal.PolFile required
public Void ApplyFromPolFile(PolFile source) #
Returns: Void

Merges settings from a POL file into this in-memory .reg model.

Parameters

source ADPlayground.Gpo.GpoLocal.PolFile requiredposition: 0
public Void ApplyToPolFile(PolFile target) #
Returns: Void

Applies the model to the specified POL file in place.

Parameters

target ADPlayground.Gpo.GpoLocal.PolFile requiredposition: 0
public virtual Void ClearKey(String key) #
Returns: Void

Clears all values in a key by adding a **delvals marker.

Parameters

key System.String requiredposition: 0
public virtual Boolean ContainsValue(String key, String value) #
Returns: Boolean

Determines whether a value is present for a given key in the in-memory .reg model, accounting for pending delete operations.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Value name.

Returns

True when a value entry exists and is not scheduled for deletion.

public virtual Void DeleteValue(String key, String value) #
Returns: Void

Marks a value for deletion by adding a **del.value entry.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public IEnumerable<PolEntry> Enumerate() #
Returns: IEnumerable<PolEntry>

Enumerates POL entries representing the current .reg model, excluding delete markers.

public virtual Void ForgetKeyClearance(String key) #
Returns: Void

Removes any existing **delvals markers for the specified key.

Parameters

key System.String requiredposition: 0
public virtual Void ForgetValue(String key, String value) #
Returns: Void

Removes a value entry from the model and clears any matching delete markers.

Parameters

key System.String requiredposition: 0
value System.String requiredposition: 1
public IReadOnlyList<String> GetKeyNames(String key) #
Returns: IReadOnlyList<String>

Returns direct subkey names under the specified key from the in-memory .reg model.

Parameters

key System.String requiredposition: 0
Registry key to enumerate.

Returns

List of subkey names.

public virtual IReadOnlyList<String> GetSubKeyNames(String key) #
Returns: IReadOnlyList<String>

Gets subkey names under the specified key by inspecting in-memory entries.

Parameters

key System.String requiredposition: 0
public virtual Object GetValue(String key, String value) #
Returns: Object

Retrieves the value data for a given key/value pair.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Value name.

Returns

Typed value data, or null when not present.

public RegistryValueKind GetValueKind(String key, String value) #
Returns: RegistryValueKind

Gets the value kind for a given key/value pair.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Value name.

Returns

Kind of the value as represented in the .reg file.

public virtual IReadOnlyList<String> GetValueNames(String key) #
Returns: IReadOnlyList<String>

Returns value names under the specified key from the in-memory .reg model.

Parameters

key System.String requiredposition: 0
Registry key path (e.g., HKLM\\Software\\...)

Returns

List of value names; does not include delete markers (**).

public static RegFile Load(String file) #
Returns: RegFile

Loads a .reg file into a RegFile instance.

Parameters

file System.String requiredposition: 0
Path to a .reg file.

Returns

Parsed RegFile.

public Void Save(String file) #
Returns: Void

Saves the in-memory .reg model to disk.

Parameters

file System.String requiredposition: 0
Destination file path.
public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #
Returns: Void

Sets or replaces a value in the model.

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Value name.
data System.Object requiredposition: 2
Value data.
dataType Microsoft.Win32.RegistryValueKind requiredposition: 3
Registry value kind.
public virtual Boolean WillDeleteValue(String key, String value) #
Returns: Boolean

Indicates whether a given key/value pair has a pending delete marker (e.g., **del.value or **delvals).

Parameters

key System.String requiredposition: 0
Registry key path.
value System.String requiredposition: 1
Value name.

Returns

True if a delete marker exists that would remove the value.