├── PolicyPlus
├── Version.vb
├── App.config
├── My Project
│ ├── Settings.settings
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Application.Designer.vb
│ ├── Resources.Designer.vb
│ ├── Settings.Designer.vb
│ ├── app.manifest
│ └── Resources.resx
├── BitReinterpretation.vb
├── EditPolMultiStringData.vb
├── EditPolStringData.vb
├── EditPolKey.vb
├── SystemInfo.vb
├── Privilege.vb
├── LanguageOptions.vb
├── XmlExtensions.vb
├── ConfigurationStorage.vb
├── PolicyPlus.sln
├── OpenSection.vb
├── EditPolValue.vb
├── DetailCategory.vb
├── EditPolDelete.vb
├── LoadedAdmx.vb
├── CompiledStructures.vb
├── ExportReg.vb
├── LoadedSupportDefinitions.vb
├── AdmxStructures.vb
├── OpenUserGpo.vb
├── PInvoke.vb
├── ListEditor.vb
├── DetailPolicy.vb
├── PresentationStructures.vb
├── ImportReg.vb
├── ImportSpol.vb
├── OpenUserRegistry.vb
├── DetailProduct.vb
├── FindByRegistry.vb
├── EditPolNumericData.vb
├── OpenAdmxFolder.vb
├── DetailAdmx.vb
├── PolicyStructures.vb
├── DetailSupport.vb
├── InspectSpolFragment.vb
├── EditPolKey.Designer.vb
├── FindById.Designer.vb
├── FindById.vb
├── LoadedProducts.vb
├── OpenUserRegistry.Designer.vb
├── EditPolStringData.Designer.vb
├── OpenSection.Designer.vb
├── LanguageOptions.Designer.vb
├── FindByRegistry.Designer.vb
├── EditPolMultiStringData.Designer.vb
├── EditPolValue.Designer.vb
├── LoadedAdmx.Designer.vb
├── ImportReg.Designer.vb
├── OpenUserGpo.Designer.vb
├── FindByText.vb
├── LoadedSupportDefinitions.Designer.vb
├── EditPolNumericData.Designer.vb
├── FindByText.Designer.vb
├── InspectPolicyElements.Designer.vb
├── EditPolDelete.Designer.vb
├── ListEditor.Designer.vb
├── ExportReg.Designer.vb
├── ImportSpol.Designer.vb
├── EditPol.resx
├── FindById.resx
└── FindByText.resx
├── version.bat
├── INSTALL.md
├── ATTRIBUTION.md
├── COMPILE.md
├── .github
└── workflows
│ └── latest.yml
├── Docs
└── Lexicon.md
├── README.md
└── .gitignore
/PolicyPlus/Version.vb:
--------------------------------------------------------------------------------
1 | ' DO NOT MODIFY THIS FILE. It will be overwritten by version.bat.
2 | Module VersionHolder
3 | Public Const Version As String = ""
4 | End Module
5 |
--------------------------------------------------------------------------------
/PolicyPlus/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/version.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set VF=PolicyPlus\Version.vb
3 | echo ' DO NOT MODIFY THIS FILE. To update it, run version.bat again. > %VF%
4 | echo Module VersionHolder >> %VF%
5 | echo Public Const Version As String = ^" >> %VF%
6 | git describe --always >> %VF%
7 | echo ^" >> %VF%
8 | echo End Module >> %VF%
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/INSTALL.md:
--------------------------------------------------------------------------------
1 | # Installing Policy Plus
2 | Policy Plus requires the .NET Framework, version 4.5 or greater. If that doesn't already come with your Windows version, you can [download it from Microsoft](https://www.microsoft.com/en-us/download/details.aspx?id=30653).
3 | You'll probably have to reboot your computer after installing the Framework.
4 |
5 | Once that's done, you can run the Policy Plus executable without any other installation.
--------------------------------------------------------------------------------
/PolicyPlus/BitReinterpretation.vb:
--------------------------------------------------------------------------------
1 | Imports System.Runtime.InteropServices
2 |
3 |
4 | Public Structure ReinterpretableDword
5 | Public Signed As Integer
6 | Public Unsigned As UInteger
7 | End Structure
8 |
9 |
10 | Public Structure ReinterpretableQword
11 | Public Signed As Long
12 | Public Unsigned As ULong
13 | End Structure
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Main
5 | false
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolMultiStringData.vb:
--------------------------------------------------------------------------------
1 | Public Class EditPolMultiStringData
2 | Private Sub EditPolMultiStringData_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
3 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
4 | End Sub
5 | Public Function PresentDialog(ValueName As String, InitialData As String()) As DialogResult
6 | TextName.Text = ValueName
7 | TextData.Lines = InitialData
8 | TextData.Select()
9 | Return ShowDialog()
10 | End Function
11 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/EditPolStringData.vb:
--------------------------------------------------------------------------------
1 | Public Class EditPolStringData
2 | Public Function PresentDialog(ValueName As String, InitialData As String) As DialogResult
3 | TextName.Text = ValueName
4 | TextData.Text = InitialData
5 | TextData.Select()
6 | TextData.SelectAll()
7 | Return ShowDialog()
8 | End Function
9 | Private Sub EditPolStringData_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
10 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
11 | End Sub
12 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/EditPolKey.vb:
--------------------------------------------------------------------------------
1 | Public Class EditPolKey
2 | Private Sub EditPolKey_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
3 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
4 | End Sub
5 | Private Sub EditPolKey_Shown(sender As Object, e As EventArgs) Handles Me.Shown
6 | TextName.Select()
7 | TextName.SelectAll()
8 | End Sub
9 | Public Function PresentDialog(InitialName As String) As String
10 | TextName.Text = InitialName
11 | If ShowDialog() = DialogResult.OK Then
12 | Return TextName.Text
13 | Else
14 | Return ""
15 | End If
16 | End Function
17 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/SystemInfo.vb:
--------------------------------------------------------------------------------
1 | Public Module SystemInfo
2 |
3 | Public Function HasGroupPolicyInfrastructure() As Boolean
4 | Dim windowsEdition As Integer
5 | PInvoke.GetProductInfo(6, 0, 0, 0, windowsEdition)
6 | Return {6, &H10, &H12, &H40, &H50, 8, &HC, &H27, &H25, &HA, &HE, &H29, &HF, &H26, &H3C,
7 | &H3E, &H3B, &H3D, &H2A, &H1E, &H20, &H1F, &H4D, &H4C, &H67, &H32, &H36, &H33,
8 | &H37, &H18, &H23, &H21, 9, &H19, &H3F, &H38, &H4F, 7, &HD, &H28, &H24, &H34, &H35,
9 | &H17, &H2E, &H14, &H2B, &H60, &H15, &H2C, &H5F, &H16, &H2D, 1, &H1C, &H11, &H1D,
10 | &H79, &H7A}.Contains(windowsEdition)
11 | End Function
12 | End Module
13 |
--------------------------------------------------------------------------------
/ATTRIBUTION.md:
--------------------------------------------------------------------------------
1 | # Attribution
2 |
3 | All icons are from the [FamFamFam "Silk" set](http://www.famfamfam.com/lab/icons/silk/), available under Creative Commons Attribution 2.5.
4 |
5 | Much information on the policy-related formats was gained from Microsoft documentation: [Group Policy File Formats](https://msdn.microsoft.com/en-us/library/aa374150(v=vs.85).aspx) and [Group Policy ADMX Syntax Reference Guide](https://technet.microsoft.com/en-us/library/cc753471(v=ws.10).aspx). [How to add, modify, or delete registry subkeys and values by using a .reg file](https://support.microsoft.com/en-us/help/310516/how-to-add--modify--or-delete-registry-subkeys-and-values-by-using-a) was a good start on understanding the exported Registry format.
--------------------------------------------------------------------------------
/PolicyPlus/Privilege.vb:
--------------------------------------------------------------------------------
1 | Imports System.Runtime.InteropServices
2 | Public Class Privilege
3 | Public Shared Sub EnablePrivilege(Name As String)
4 | ' Enable the given Win32 privilege
5 | Dim luid As PInvokeLuid
6 | Dim priv As PInvokeTokenPrivileges
7 | Dim thisProcToken As IntPtr
8 | PInvoke.OpenProcessToken(PInvoke.GetCurrentProcess, &H28, thisProcToken) ' 0x28 = TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY
9 | PInvoke.LookupPrivilegeValueW(Nothing, Name, luid)
10 | priv.Attributes = 2 ' SE_PRIVILEGE_ENABLED
11 | priv.PrivilegeCount = 1
12 | priv.LUID = luid
13 | PInvoke.AdjustTokenPrivileges(thisProcToken, False, priv, Marshal.SizeOf(priv), IntPtr.Zero, 0)
14 | PInvoke.CloseHandle(thisProcToken)
15 | End Sub
16 | End Class
17 |
--------------------------------------------------------------------------------
/PolicyPlus/LanguageOptions.vb:
--------------------------------------------------------------------------------
1 | Public Class LanguageOptions
2 | Private OriginalLanguage As String
3 | Public NewLanguage As String
4 | Public Function PresentDialog(CurrentLanguage As String) As DialogResult
5 | OriginalLanguage = CurrentLanguage
6 | TextAdmlLanguage.Text = CurrentLanguage
7 | Return ShowDialog()
8 | End Function
9 | Private Sub ButtonOK_Click(sender As Object, e As EventArgs) Handles ButtonOK.Click
10 | Dim selection = TextAdmlLanguage.Text.Trim()
11 | If selection.Split("-"c).Length <> 2 Then
12 | MsgBox("Please enter a valid language code.", MsgBoxStyle.Exclamation)
13 | Exit Sub
14 | End If
15 | If selection = OriginalLanguage Then
16 | DialogResult = DialogResult.Cancel
17 | Else
18 | NewLanguage = selection
19 | DialogResult = DialogResult.OK
20 | End If
21 | End Sub
22 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/XmlExtensions.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel
2 | Imports System.Runtime.CompilerServices
3 | Imports System.Xml
4 | Public Module XmlExtensions
5 | ' Convenience methods for parsing XML in AdmxFile and AdmlFile
6 | Public Function AttributeOrNull(Node As XmlNode, Attribute As String) As String
7 | If Node.Attributes(Attribute) Is Nothing Then Return Nothing Else Return Node.Attributes(Attribute).Value
8 | End Function
9 | Public Function AttributeOrDefault(Node As XmlNode, Attribute As String, DefaultVal As Object) As Object
10 | If Node.Attributes(Attribute) Is Nothing Then Return DefaultVal
11 | Dim converter As TypeConverter = TypeDescriptor.GetConverter(DefaultVal.GetType())
12 | If converter.IsValid(Node.Attributes(Attribute).Value) Then
13 | Return converter.ConvertFromString(Node.Attributes(Attribute).Value)
14 | End If
15 | Return DefaultVal
16 | End Function
17 | End Module
--------------------------------------------------------------------------------
/PolicyPlus/ConfigurationStorage.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.Win32
2 | Public Class ConfigurationStorage
3 | Dim ConfigKey As RegistryKey
4 | Public Sub New(RegistryBase As RegistryHive, Subkey As String)
5 | Try
6 | ConfigKey = RegistryKey.OpenBaseKey(RegistryBase, RegistryView.Default).CreateSubKey(Subkey)
7 | Catch ex As Exception
8 | ' The key couldn't be created
9 | End Try
10 | End Sub
11 | Public Function GetValue(ValueName As String, DefaultValue As Object) As Object
12 | If ConfigKey IsNot Nothing Then Return ConfigKey.GetValue(ValueName, DefaultValue) Else Return DefaultValue
13 | End Function
14 | Public Sub SetValue(ValueName As String, Data As Object)
15 | If ConfigKey IsNot Nothing Then ConfigKey.SetValue(ValueName, Data)
16 | End Sub
17 | Public Function HasValue(ValueName As String) As Boolean
18 | Return ConfigKey IsNot Nothing AndAlso ConfigKey.GetValue(ValueName) IsNot Nothing
19 | End Function
20 | End Class
21 |
--------------------------------------------------------------------------------
/PolicyPlus/PolicyPlus.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PolicyPlus", "PolicyPlus.vbproj", "{3E52E1E6-4FCF-403D-A84C-9C5CB0EDC739}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {3E52E1E6-4FCF-403D-A84C-9C5CB0EDC739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {3E52E1E6-4FCF-403D-A84C-9C5CB0EDC739}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {3E52E1E6-4FCF-403D-A84C-9C5CB0EDC739}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {3E52E1E6-4FCF-403D-A84C-9C5CB0EDC739}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/COMPILE.md:
--------------------------------------------------------------------------------
1 | # Compiling Policy Plus
2 | You can acquire the Policy Plus source code by cloning with [Git](https://git-scm.com/):
3 |
4 | git clone https://github.com/Fleex255/PolicyPlus.git
5 |
6 | It is recommended to set Git to ignore local changes to the autogenerated version file:
7 |
8 | git update-index --assume-unchanged PolicyPlus\Version.vb
9 |
10 | You can run `version.bat` at any time to replace that file with one that specifies your current commit.
11 |
12 | Policy Plus is developed with [Visual Studio 2019 Community](https://visualstudio.microsoft.com/vs/community/). (Fancier Visual Studio editions will work too.)
13 |
14 | To compile, open `PolicyPlus.sln` or `PolicyPlus.vbproj` (from the `PolicyPlus` folder) in Visual Studio. Set the *Solution Configurations* dropdown to Release (or Debug for a debug build).
15 | Choose *Build* | *Build PolicyPlus* from the main menu. The result is `PolicyPlus.exe`, which is set to run on 32-bit or 64-bit environments, preferring to run in a 64-bit process.
16 | You can find that file in the subfolder of `bin` that corresponds to the build type.
--------------------------------------------------------------------------------
/PolicyPlus/OpenSection.vb:
--------------------------------------------------------------------------------
1 | Public Class OpenSection
2 | Public SelectedSection As AdmxPolicySection
3 | Private Sub ButtonOK_Click(sender As Object, e As EventArgs) Handles ButtonOK.Click
4 | ' Report the selected section
5 | If OptUser.Checked Or OptComputer.Checked Then
6 | SelectedSection = If(OptUser.Checked, AdmxPolicySection.User, AdmxPolicySection.Machine)
7 | DialogResult = DialogResult.OK
8 | End If
9 | End Sub
10 | Private Sub OpenSection_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
11 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
12 | End Sub
13 | Private Sub OpenSection_Shown(sender As Object, e As EventArgs) Handles Me.Shown
14 | OptUser.Checked = False
15 | OptComputer.Checked = False
16 | End Sub
17 | Public Function PresentDialog(UserEnabled As Boolean, CompEnabled As Boolean) As DialogResult
18 | OptUser.Enabled = UserEnabled
19 | OptComputer.Enabled = CompEnabled
20 | Return ShowDialog()
21 | End Function
22 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/EditPolValue.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.Win32
2 | Public Class EditPolValue
3 | Public SelectedKind As RegistryValueKind
4 | Public ChosenName As String
5 | Private Sub EditPolValueType_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
6 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
7 | End Sub
8 | Public Function PresentDialog() As DialogResult
9 | TextName.Text = ""
10 | ComboKind.SelectedIndex = 0
11 | Dim dlgRes = ShowDialog()
12 | If dlgRes = DialogResult.OK Then
13 | Select Case ComboKind.SelectedIndex
14 | Case 0
15 | SelectedKind = RegistryValueKind.String
16 | Case 1
17 | SelectedKind = RegistryValueKind.ExpandString
18 | Case 2
19 | SelectedKind = RegistryValueKind.MultiString
20 | Case 3
21 | SelectedKind = RegistryValueKind.DWord
22 | Case 4
23 | SelectedKind = RegistryValueKind.QWord
24 | End Select
25 | ChosenName = TextName.Text
26 | End If
27 | Return dlgRes
28 | End Function
29 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/DetailCategory.vb:
--------------------------------------------------------------------------------
1 | Public Class DetailCategory
2 | Dim SelectedCategory As PolicyPlusCategory
3 | Public Sub PresentDialog(Category As PolicyPlusCategory)
4 | PrepareDialog(Category)
5 | ShowDialog()
6 | End Sub
7 | Private Sub PrepareDialog(Category As PolicyPlusCategory)
8 | SelectedCategory = Category
9 | NameTextbox.Text = Category.DisplayName
10 | IdTextbox.Text = Category.UniqueID
11 | DefinedTextbox.Text = Category.RawCategory.DefinedIn.SourceFile
12 | DisplayCodeTextbox.Text = Category.RawCategory.DisplayCode
13 | InfoCodeTextbox.Text = Category.RawCategory.ExplainCode
14 | ParentButton.Enabled = Category.Parent IsNot Nothing
15 | If Category.Parent IsNot Nothing Then
16 | ParentTextbox.Text = Category.Parent.DisplayName
17 | ElseIf Category.RawCategory.ParentID <> "" Then
18 | ParentTextbox.Text = ""
19 | Else
20 | ParentTextbox.Text = ""
21 | End If
22 | End Sub
23 | Private Sub ParentButton_Click(sender As Object, e As EventArgs) Handles ParentButton.Click
24 | PrepareDialog(SelectedCategory.Parent)
25 | End Sub
26 | End Class
--------------------------------------------------------------------------------
/.github/workflows/latest.yml:
--------------------------------------------------------------------------------
1 | name: Build Latest
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | workflow_dispatch:
7 |
8 | jobs:
9 | BuildLatest:
10 | runs-on: windows-2022
11 |
12 | steps:
13 | - name: Checkout master
14 | uses: actions/checkout@v2
15 | with:
16 | fetch-depth: 0
17 |
18 | - name: Embed version
19 | run: |
20 | cd $env:GITHUB_WORKSPACE
21 | cmd /c version.bat
22 |
23 | - name: Set up MSBuild
24 | uses: microsoft/setup-msbuild@v1.0.2
25 |
26 | - name: Compile
27 | run: msbuild.exe $env:GITHUB_WORKSPACE\PolicyPlus\PolicyPlus.sln /p:platform="Any CPU" /p:configuration="Release"
28 |
29 | - name: Compute hash
30 | run: Get-FileHash "$env:GITHUB_WORKSPACE\PolicyPlus\bin\Release\Policy Plus.exe"
31 |
32 | - name: Upload to S3
33 | uses: stcalica/s3-upload@0.0.1
34 | with:
35 | bucket: ${{ secrets.AWS_S3_BUCKET }}
36 | package: PolicyPlus\bin\Release\Policy Plus.exe
37 | key: PolicyPlusLatest.exe
38 | AWS_REGION: ${{ secrets.AWS_REGION }}
39 | AWS_SECRET_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
40 | AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolDelete.vb:
--------------------------------------------------------------------------------
1 | Public Class EditPolDelete
2 | Public Function PresentDialog(ContainerKey As String) As DialogResult
3 | OptClearFirst.Checked = False
4 | OptDeleteOne.Checked = False
5 | OptPurge.Checked = False
6 | TextKey.Text = ContainerKey
7 | TextValueName.Text = ""
8 | Return ShowDialog()
9 | End Function
10 | Private Sub ButtonOK_Click(sender As Object, e As EventArgs) Handles ButtonOK.Click
11 | If OptClearFirst.Checked Or OptPurge.Checked Then DialogResult = DialogResult.OK
12 | If OptDeleteOne.Checked Then
13 | If TextValueName.Text = "" Then
14 | MsgBox("You must enter a value name.", MsgBoxStyle.Exclamation)
15 | Exit Sub
16 | End If
17 | DialogResult = DialogResult.OK
18 | End If
19 | End Sub
20 | Private Sub EditPolDelete_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
21 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
22 | End Sub
23 | Sub ChoiceChanged(sender As Object, e As EventArgs) Handles OptClearFirst.CheckedChanged, OptDeleteOne.CheckedChanged, OptPurge.CheckedChanged
24 | TextValueName.Enabled = OptDeleteOne.Checked
25 | End Sub
26 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' General Information about an assembly is controlled through the following
6 | ' set of attributes. Change these attribute values to modify the information
7 | ' associated with an assembly.
8 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PolicyPlus/LoadedAdmx.vb:
--------------------------------------------------------------------------------
1 | Public Class LoadedAdmx
2 | Dim Bundle As AdmxBundle
3 | Public Sub PresentDialog(Workspace As AdmxBundle)
4 | LsvAdmx.Items.Clear()
5 | For Each admx In Workspace.Sources.Keys
6 | Dim lsvi = LsvAdmx.Items.Add(IO.Path.GetFileName(admx.SourceFile))
7 | lsvi.SubItems.Add(IO.Path.GetDirectoryName(admx.SourceFile))
8 | lsvi.SubItems.Add(admx.AdmxNamespace)
9 | lsvi.Tag = admx
10 | Next
11 | LoadedAdmx_SizeChanged(Nothing, Nothing)
12 | ChNamespace.Width -= SystemInformation.VerticalScrollBarWidth ' For some reason, this only needs to be taken into account on the first draw
13 | Bundle = Workspace
14 | ShowDialog()
15 | End Sub
16 | Private Sub LsvAdmx_DoubleClick(sender As Object, e As EventArgs) Handles LsvAdmx.DoubleClick
17 | DetailAdmx.PresentDialog(LsvAdmx.SelectedItems(0).Tag, Bundle)
18 | End Sub
19 | Private Sub LoadedAdmx_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
20 | ChNamespace.Width = Math.Max(30, LsvAdmx.ClientRectangle.Width - ChFolder.Width - ChFileTitle.Width)
21 | End Sub
22 | Private Sub LsvAdmx_KeyDown(sender As Object, e As KeyEventArgs) Handles LsvAdmx.KeyDown
23 | If e.KeyCode = Keys.Enter And LsvAdmx.SelectedItems.Count > 0 Then LsvAdmx_DoubleClick(sender, e)
24 | End Sub
25 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/CompiledStructures.vb:
--------------------------------------------------------------------------------
1 | ' Compiled data, more object-oriented and display-worthy than raw data from ADMX files
2 | Public Class PolicyPlusCategory
3 | Public UniqueID As String
4 | Public Parent As PolicyPlusCategory
5 | Public Children As New List(Of PolicyPlusCategory)
6 | Public DisplayName As String
7 | Public DisplayExplanation As String
8 | Public Policies As New List(Of PolicyPlusPolicy)
9 | Public RawCategory As AdmxCategory
10 | End Class
11 | Public Class PolicyPlusProduct
12 | Public UniqueID As String
13 | Public Parent As PolicyPlusProduct
14 | Public Children As New List(Of PolicyPlusProduct)
15 | Public DisplayName As String
16 | Public RawProduct As AdmxProduct
17 | End Class
18 | Public Class PolicyPlusSupport
19 | Public UniqueID As String
20 | Public DisplayName As String
21 | Public Elements As New List(Of PolicyPlusSupportEntry)
22 | Public RawSupport As AdmxSupportDefinition
23 | End Class
24 | Public Class PolicyPlusSupportEntry
25 | Public Product As PolicyPlusProduct
26 | Public SupportDefinition As PolicyPlusSupport ' Only used if this entry actually points to another support definition
27 | Public RawSupportEntry As AdmxSupportEntry
28 | End Class
29 | Public Class PolicyPlusPolicy
30 | Public UniqueID As String
31 | Public Category As PolicyPlusCategory
32 | Public DisplayName As String
33 | Public DisplayExplanation As String
34 | Public SupportedOn As PolicyPlusSupport
35 | Public Presentation As Presentation
36 | Public RawPolicy As AdmxPolicy
37 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/ExportReg.vb:
--------------------------------------------------------------------------------
1 | Public Class ExportReg
2 | Dim Source As PolFile
3 | Public Function PresentDialog(Branch As String, Pol As PolFile, IsUser As Boolean) As DialogResult
4 | Source = Pol
5 | TextBranch.Text = Branch
6 | TextRoot.Text = If(IsUser, "HKEY_CURRENT_USER\", "HKEY_LOCAL_MACHINE\")
7 | TextReg.Text = ""
8 | Return ShowDialog()
9 | End Function
10 | Private Sub ButtonBrowse_Click(sender As Object, e As EventArgs) Handles ButtonBrowse.Click
11 | Using sfd As New SaveFileDialog
12 | sfd.Filter = "Registry scripts|*.reg"
13 | If sfd.ShowDialog = DialogResult.OK Then TextReg.Text = sfd.FileName
14 | End Using
15 | End Sub
16 | Private Sub ExportReg_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
17 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
18 | End Sub
19 | Private Sub ButtonExport_Click(sender As Object, e As EventArgs) Handles ButtonExport.Click
20 | If TextReg.Text = "" Then
21 | MsgBox("Please specify a filename and path for the exported REG.", MsgBoxStyle.Exclamation)
22 | Exit Sub
23 | End If
24 | Dim reg As New RegFile
25 | reg.SetPrefix(TextRoot.Text)
26 | reg.SetSourceBranch(TextBranch.Text)
27 | Try
28 | Source.Apply(reg)
29 | reg.Save(TextReg.Text)
30 | MsgBox("REG exported successfully.", MsgBoxStyle.Information)
31 | DialogResult = DialogResult.OK
32 | Catch ex As Exception
33 | MsgBox("Failed to export REG!", MsgBoxStyle.Exclamation)
34 | End Try
35 | End Sub
36 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/LoadedSupportDefinitions.vb:
--------------------------------------------------------------------------------
1 | Public Class LoadedSupportDefinitions
2 | Dim Definitions As IEnumerable(Of PolicyPlusSupport)
3 | Public Sub PresentDialog(Workspace As AdmxBundle)
4 | TextFilter.Text = ""
5 | Definitions = Workspace.SupportDefinitions.Values
6 | UpdateListing()
7 | ChName.Width = LsvSupport.ClientRectangle.Width - ChDefinedIn.Width - SystemInformation.VerticalScrollBarWidth
8 | ShowDialog()
9 | End Sub
10 | Sub UpdateListing()
11 | ' Add all the (matching) support definitions to the list view
12 | LsvSupport.Items.Clear()
13 | For Each support In Definitions.OrderBy(Function(s) s.DisplayName.Trim()) ' Some default support definitions have leading spaces
14 | If Not support.DisplayName.ToLowerInvariant.Contains(TextFilter.Text.ToLowerInvariant) Then Continue For
15 | Dim lsvi = LsvSupport.Items.Add(support.DisplayName.Trim())
16 | lsvi.SubItems.Add(IO.Path.GetFileName(support.RawSupport.DefinedIn.SourceFile))
17 | lsvi.Tag = support
18 | Next
19 | End Sub
20 | Private Sub LsvSupport_DoubleClick(sender As Object, e As EventArgs) Handles LsvSupport.DoubleClick
21 | DetailSupport.PresentDialog(LsvSupport.SelectedItems(0).Tag)
22 | End Sub
23 | Private Sub TextFilter_TextChanged(sender As Object, e As EventArgs) Handles TextFilter.TextChanged
24 | ' Only repopulate if the form isn't still setting up
25 | If Visible Then UpdateListing()
26 | End Sub
27 | Private Sub LsvSupport_KeyDown(sender As Object, e As KeyEventArgs) Handles LsvSupport.KeyDown
28 | If e.KeyCode = Keys.Enter And LsvSupport.SelectedItems.Count > 0 Then LsvSupport_DoubleClick(sender, e)
29 | End Sub
30 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/AdmxStructures.vb:
--------------------------------------------------------------------------------
1 | ' Raw data loaded from ADMX files
2 | Public Class AdmxProduct
3 | Public ID As String
4 | Public DisplayCode As String
5 | Public Type As AdmxProductType
6 | Public Version As Integer
7 | Public Parent As AdmxProduct
8 | Public DefinedIn As AdmxFile
9 | End Class
10 | Public Enum AdmxProductType
11 | Product
12 | MajorRevision
13 | MinorRevision
14 | End Enum
15 | Public Class AdmxSupportDefinition
16 | Public ID As String
17 | Public DisplayCode As String
18 | Public Logic As AdmxSupportLogicType
19 | Public Entries As List(Of AdmxSupportEntry)
20 | Public DefinedIn As AdmxFile
21 | End Class
22 | Public Enum AdmxSupportLogicType
23 | Blank
24 | AllOf
25 | AnyOf
26 | End Enum
27 | Public Class AdmxSupportEntry
28 | Public ProductID As String
29 | Public IsRange As Boolean
30 | Public MinVersion As Integer?
31 | Public MaxVersion As Integer?
32 | End Class
33 | Public Class AdmxCategory
34 | Public ID As String
35 | Public DisplayCode As String
36 | Public ExplainCode As String
37 | Public ParentID As String
38 | Public DefinedIn As AdmxFile
39 | End Class
40 | Public Class AdmxPolicy
41 | Public ID As String
42 | Public Section As AdmxPolicySection
43 | Public CategoryID As String
44 | Public DisplayCode As String
45 | Public ExplainCode As String
46 | Public SupportedCode As String
47 | Public PresentationID As String
48 | Public ClientExtension As String
49 | Public RegistryKey As String
50 | Public RegistryValue As String
51 | Public AffectedValues As PolicyRegistryList
52 | Public Elements As List(Of PolicyElement)
53 | Public DefinedIn As AdmxFile
54 | End Class
55 | Public Enum AdmxPolicySection
56 | Machine = 1
57 | User = 2
58 | Both = 3
59 | End Enum
--------------------------------------------------------------------------------
/PolicyPlus/OpenUserGpo.vb:
--------------------------------------------------------------------------------
1 | Imports System.Security.Principal
2 | Public Class OpenUserGpo
3 | Public SelectedSid As String
4 | Private Sub SearchButton_Click(sender As Object, e As EventArgs) Handles SearchButton.Click
5 | ' Resolve the username to a security identifier (SID)
6 | Try
7 | Dim userAccount As New NTAccount(UsernameTextbox.Text)
8 | Dim sid As SecurityIdentifier = userAccount.Translate(GetType(SecurityIdentifier))
9 | SidTextbox.Text = sid.ToString
10 | Catch ex As Exception
11 | MsgBox("The name could not be translated to a SID.", MsgBoxStyle.Exclamation)
12 | End Try
13 | End Sub
14 | Private Sub OkButton_Click(sender As Object, e As EventArgs) Handles OkButton.Click
15 | If SidTextbox.Text = "" And UsernameTextbox.Text <> "" Then
16 | ' Automatically resolve if the user didn't click Search
17 | SearchButton_Click(Nothing, Nothing)
18 | If SidTextbox.Text = "" Then Exit Sub
19 | End If
20 | Try
21 | ' Make sure the SID is valid
22 | Dim sid As New SecurityIdentifier(SidTextbox.Text)
23 | Catch ex As Exception
24 | MsgBox("The SID is not valid. Enter a SID in the lower box, or enter a username in the top box and press Search to translate.", MsgBoxStyle.Exclamation)
25 | Exit Sub
26 | End Try
27 | SelectedSid = SidTextbox.Text
28 | DialogResult = DialogResult.OK
29 | End Sub
30 | Private Sub OpenUserGpo_Shown(sender As Object, e As EventArgs) Handles Me.Shown
31 | SidTextbox.Text = ""
32 | UsernameTextbox.Text = ""
33 | End Sub
34 | Private Sub OpenUserGpo_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
35 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
36 | End Sub
37 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/PInvoke.vb:
--------------------------------------------------------------------------------
1 | Imports System.Runtime.InteropServices
2 | Class PInvoke
3 | Declare Function ShowScrollBar Lib "user32.dll" (Handle As IntPtr, Scrollbar As Integer, Show As Boolean) As Boolean
4 | Declare Function RefreshPolicyEx Lib "userenv.dll" (IsMachine As Boolean, Options As UInteger) As Boolean
5 | Declare Unicode Function RegLoadKeyW Lib "advapi32.dll" (HiveKey As IntPtr, Subkey As String, File As String) As Integer
6 | Declare Unicode Function RegUnLoadKeyW Lib "advapi32.dll" (HiveKey As IntPtr, Subkey As String) As Integer
7 | Declare Function GetCurrentProcess Lib "kernel32.dll" () As IntPtr
8 | Declare Function OpenProcessToken Lib "advapi32.dll" (Process As IntPtr, Access As UInteger, ByRef TokenHandle As IntPtr) As Boolean
9 | Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (Token As IntPtr, DisableAll As Boolean, ByRef NewState As PInvokeTokenPrivileges, BufferLength As UInteger, Null As IntPtr, ByRef ReturnLength As UInteger) As Boolean
10 | Declare Unicode Function LookupPrivilegeValueW Lib "advapi32.dll" (SystemName As String, Name As String, ByRef LUID As PInvokeLuid) As Boolean
11 | Declare Function CloseHandle Lib "kernel32.dll" (Handle As IntPtr) As Boolean
12 | Declare Function GetProductInfo Lib "kernel32.dll" (MajorVersion As Integer, MinorVersion As Integer, SPMajor As Integer, SPMinor As Integer, ByRef EditionCode As Integer) As Boolean
13 | Declare Unicode Function SendNotifyMessageW Lib "user32.dll" (Handle As IntPtr, Message As Integer, WParam As UIntPtr, LParam As IntPtr) As Boolean
14 | End Class
15 | Structure PInvokeTokenPrivileges
16 | Public PrivilegeCount As UInteger
17 | Public LUID As PInvokeLuid
18 | Public Attributes As UInteger
19 | End Structure
20 | Structure PInvokeLuid
21 | Public LowPart As UInteger
22 | Public HighPart As Integer
23 | End Structure
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.PolicyPlus.Main
36 | End Sub
37 |
38 | _
39 | Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
40 | Me.MinimumSplashScreenDisplayTime = 0
41 | Return MyBase.OnInitialize(commandLineArgs)
42 | End Function
43 | End Class
44 | End Namespace
45 |
--------------------------------------------------------------------------------
/PolicyPlus/ListEditor.vb:
--------------------------------------------------------------------------------
1 | Public Class ListEditor
2 | Dim UserProvidesNames As Boolean
3 | Public FinalData As Object
4 | Public Function PresentDialog(Title As String, Data As Object, TwoColumn As Boolean) As DialogResult
5 | UserProvidesNames = TwoColumn
6 | NameColumn.Visible = TwoColumn
7 | ElementNameLabel.Text = Title
8 | EntriesDatagrid.Rows.Clear()
9 | If Data IsNot Nothing Then
10 | If TwoColumn Then
11 | Dim dict As Dictionary(Of String, String) = Data
12 | For Each kv In dict
13 | EntriesDatagrid.Rows.Add(kv.Key, kv.Value)
14 | Next
15 | Else
16 | Dim list As List(Of String) = Data
17 | For Each entry In list
18 | EntriesDatagrid.Rows.Add("", entry)
19 | Next
20 | End If
21 | End If
22 | FinalData = Nothing
23 | Return ShowDialog()
24 | End Function
25 | Private Sub OkButton_Click(sender As Object, e As EventArgs) Handles OkButton.Click
26 | If UserProvidesNames Then
27 | ' Check for duplicate keys
28 | Dim dict As New Dictionary(Of String, String)
29 | For Each row As DataGridViewRow In EntriesDatagrid.Rows
30 | If row.IsNewRow Then Continue For
31 | Dim key As String = row.Cells(0).Value
32 | If dict.ContainsKey(key) Then
33 | MsgBox("Multiple entries are named """ & key & """! Remove or rename all but one.", MsgBoxStyle.Exclamation)
34 | Exit Sub
35 | Else
36 | dict.Add(key, row.Cells(1).Value)
37 | End If
38 | Next
39 | FinalData = dict
40 | Else
41 | Dim list As New List(Of String)
42 | For Each row As DataGridViewRow In EntriesDatagrid.Rows
43 | If Not row.IsNewRow Then list.Add(row.Cells(1).Value)
44 | Next
45 | FinalData = list
46 | End If
47 | DialogResult = DialogResult.OK
48 | End Sub
49 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/DetailPolicy.vb:
--------------------------------------------------------------------------------
1 | Public Class DetailPolicy
2 | Dim SelectedPolicy As PolicyPlusPolicy
3 | Public Sub PresentDialog(Policy As PolicyPlusPolicy)
4 | SelectedPolicy = Policy
5 | NameTextbox.Text = Policy.DisplayName
6 | IdTextbox.Text = Policy.UniqueID
7 | DefinedTextbox.Text = Policy.RawPolicy.DefinedIn.SourceFile
8 | DisplayCodeTextbox.Text = Policy.RawPolicy.DisplayCode
9 | InfoCodeTextbox.Text = Policy.RawPolicy.ExplainCode
10 | PresentCodeTextbox.Text = Policy.RawPolicy.PresentationID
11 | Select Case Policy.RawPolicy.Section
12 | Case AdmxPolicySection.Both
13 | SectionTextbox.Text = "User or computer"
14 | Case AdmxPolicySection.Machine
15 | SectionTextbox.Text = "Computer"
16 | Case AdmxPolicySection.User
17 | SectionTextbox.Text = "User"
18 | End Select
19 | SupportButton.Enabled = Policy.SupportedOn IsNot Nothing
20 | If Policy.SupportedOn IsNot Nothing Then
21 | SupportTextbox.Text = Policy.SupportedOn.DisplayName
22 | ElseIf Policy.RawPolicy.SupportedCode <> "" Then
23 | SupportTextbox.Text = ""
24 | Else
25 | SupportTextbox.Text = ""
26 | End If
27 | CategoryButton.Enabled = Policy.Category IsNot Nothing
28 | If Policy.Category IsNot Nothing Then
29 | CategoryTextbox.Text = Policy.Category.DisplayName
30 | ElseIf Policy.RawPolicy.CategoryID <> "" Then
31 | CategoryTextbox.Text = ""
32 | Else
33 | CategoryTextbox.Text = ""
34 | End If
35 | ShowDialog()
36 | End Sub
37 | Private Sub SupportButton_Click(sender As Object, e As EventArgs) Handles SupportButton.Click
38 | DetailSupport.PresentDialog(SelectedPolicy.SupportedOn)
39 | End Sub
40 | Private Sub CategoryButton_Click(sender As Object, e As EventArgs) Handles CategoryButton.Click
41 | DetailCategory.PresentDialog(SelectedPolicy.Category)
42 | End Sub
43 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/PresentationStructures.vb:
--------------------------------------------------------------------------------
1 | ' These structures hold information on how the UI for policy elements appears
2 | Public Class Presentation
3 | Public Name As String
4 | Public Elements As New List(Of PresentationElement)
5 | End Class
6 | Public MustInherit Class PresentationElement
7 | Public ID As String ' refId
8 | Public ElementType As String
9 | End Class
10 | Public Class LabelPresentationElement '
11 | Inherits PresentationElement
12 | Public Text As String ' Inner text
13 | End Class
14 | Public Class NumericBoxPresentationElement '
15 | Inherits PresentationElement
16 | Public DefaultValue As UInteger ' defaultValue
17 | Public HasSpinner As Boolean = True ' spin
18 | Public SpinnerIncrement As UInteger ' spinStep
19 | Public Label As String ' Inner text
20 | End Class
21 | Public Class TextBoxPresentationElement '
22 | Inherits PresentationElement
23 | Public Label As String '
24 | Public DefaultValue As String '
25 | End Class
26 | Public Class CheckBoxPresentationElement '
27 | Inherits PresentationElement
28 | Public DefaultState As Boolean ' defaultChecked
29 | Public Text As String ' Inner text
30 | End Class
31 | Public Class ComboBoxPresentationElement '
32 | Inherits PresentationElement
33 | Public NoSort As Boolean ' noSort
34 | Public Label As String '
35 | Public DefaultText As String '
36 | Public Suggestions As New List(Of String) ' s
37 | End Class
38 | Public Class DropDownPresentationElement '
39 | Inherits PresentationElement
40 | Public NoSort As Boolean ' noSort
41 | Public DefaultItemID As Integer? ' defaultItem
42 | Public Label As String ' Inner text
43 | End Class
44 | Public Class ListPresentationElement '
45 | Inherits PresentationElement
46 | Public Label As String ' Inner text
47 | End Class
48 | Public Class MultiTextPresentationElement '
49 | Inherits PresentationElement
50 | Public Label As String ' Inner text
51 | ' Undocumented, but never appears to have any other parameters
52 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/ImportReg.vb:
--------------------------------------------------------------------------------
1 | Public Class ImportReg
2 | Dim PolicySource As IPolicySource
3 | Public Function PresentDialog(Target As IPolicySource) As DialogResult
4 | TextReg.Text = ""
5 | TextRoot.Text = ""
6 | PolicySource = Target
7 | Return ShowDialog()
8 | End Function
9 | Private Sub ButtonBrowse_Click(sender As Object, e As EventArgs) Handles ButtonBrowse.Click
10 | Using ofd As New OpenFileDialog
11 | ofd.Filter = "Registry scripts|*.reg"
12 | If ofd.ShowDialog() <> DialogResult.OK Then Exit Sub
13 | TextReg.Text = ofd.FileName
14 | If TextRoot.Text = "" Then
15 | Try
16 | Dim reg = RegFile.Load(ofd.FileName, "")
17 | TextRoot.Text = reg.GuessPrefix()
18 | If reg.HasDefaultValues Then MsgBox("This REG file contains data for default values, which cannot be applied to all policy sources.", MsgBoxStyle.Exclamation)
19 | Catch ex As Exception
20 | MsgBox("An error occurred while trying to guess the prefix.", MsgBoxStyle.Exclamation)
21 | End Try
22 | End If
23 | End Using
24 | End Sub
25 | Private Sub ImportReg_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
26 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
27 | End Sub
28 | Private Sub ButtonImport_Click(sender As Object, e As EventArgs) Handles ButtonImport.Click
29 | If TextReg.Text = "" Then
30 | MsgBox("Please specify a REG file to import.", MsgBoxStyle.Exclamation)
31 | Exit Sub
32 | End If
33 | If TextRoot.Text = "" Then
34 | MsgBox("Please specify the prefix used to fully qualify paths in the REG file.", MsgBoxStyle.Exclamation)
35 | Exit Sub
36 | End If
37 | Try
38 | Dim reg = RegFile.Load(TextReg.Text, TextRoot.Text)
39 | reg.Apply(PolicySource)
40 | DialogResult = DialogResult.OK
41 | Catch ex As Exception
42 | MsgBox("Failed to import the REG file.", MsgBoxStyle.Exclamation)
43 | End Try
44 | End Sub
45 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/ImportSpol.vb:
--------------------------------------------------------------------------------
1 | Public Class ImportSpol
2 | Public Spol As SpolFile
3 | Private Sub ButtonOpenFile_Click(sender As Object, e As EventArgs) Handles ButtonOpenFile.Click
4 | Using ofd As New OpenFileDialog
5 | ofd.Filter = "Semantic Policy files|*.spol|All files|*.*"
6 | If ofd.ShowDialog = DialogResult.OK Then
7 | TextSpol.Text = IO.File.ReadAllText(ofd.FileName)
8 | End If
9 | End Using
10 | End Sub
11 | Private Sub ButtonVerify_Click(sender As Object, e As EventArgs) Handles ButtonVerify.Click
12 | Try
13 | Dim spol = SpolFile.FromText(TextSpol.Text)
14 | MsgBox("Validation successful, " & spol.Policies.Count & " policy settings found.", MsgBoxStyle.Information)
15 | Catch ex As Exception
16 | MsgBox("SPOL validation failed: " & ex.Message, MsgBoxStyle.Exclamation)
17 | End Try
18 | End Sub
19 | Private Sub ButtonApply_Click(sender As Object, e As EventArgs) Handles ButtonApply.Click
20 | Try
21 | Spol = SpolFile.FromText(TextSpol.Text) ' Tell the main form that the SPOL is ready to be committed
22 | DialogResult = DialogResult.OK
23 | Catch ex As Exception
24 | MsgBox("The SPOL text is invalid: " & ex.Message, MsgBoxStyle.Exclamation)
25 | End Try
26 | End Sub
27 | Private Sub ImportSpol_Shown(sender As Object, e As EventArgs) Handles Me.Shown
28 | Spol = Nothing
29 | End Sub
30 | Private Sub ImportSpol_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
31 | If e.KeyCode = Keys.Escape And Not (TextSpol.Focused And TextSpol.SelectionLength > 0) Then DialogResult = DialogResult.Cancel
32 | End Sub
33 | Private Sub TextSpol_KeyDown(sender As Object, e As KeyEventArgs) Handles TextSpol.KeyDown
34 | If e.KeyCode = Keys.A And e.Control Then TextSpol.SelectAll()
35 | End Sub
36 | Private Sub ButtonReset_Click(sender As Object, e As EventArgs) Handles ButtonReset.Click
37 | If MsgBox("Are you sure you want to reset the text box?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
38 | TextSpol.Text = "Policy Plus Semantic Policy" & vbCrLf & vbCrLf
39 | End If
40 | End Sub
41 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/OpenUserRegistry.vb:
--------------------------------------------------------------------------------
1 | Public Class OpenUserRegistry
2 | Public SelectedFilePath As String
3 | Private Sub OpenUserRegistry_Shown(sender As Object, e As EventArgs) Handles Me.Shown
4 | ' Set up the UI
5 | SubfoldersListview.Columns(1).Width = SubfoldersListview.ClientSize.Width - SubfoldersListview.Columns(0).Width - SystemInformation.VerticalScrollBarWidth
6 | SubfoldersListview.Items.Clear()
7 | ' Scan for user hives and whether they can be accessed now
8 | Dim canMountHives As Boolean = New Security.Principal.WindowsPrincipal(Security.Principal.WindowsIdentity.GetCurrent).IsInRole(Security.Principal.WindowsBuiltInRole.Administrator)
9 | For Each folder In IO.Directory.EnumerateDirectories("C:\Users")
10 | Dim dirInfo As New IO.DirectoryInfo(folder)
11 | If (dirInfo.Attributes And IO.FileAttributes.ReparsePoint) > 0 Then Continue For
12 | Dim ntuserPath = folder & "\ntuser.dat"
13 | Dim access As String = ""
14 | Try
15 | Using fNtuser As New IO.FileStream(ntuserPath, IO.FileMode.Open, IO.FileAccess.ReadWrite)
16 | access = If(canMountHives, "Yes", "No (unprivileged)")
17 | End Using
18 | Catch ex As UnauthorizedAccessException
19 | access = "No"
20 | Catch ex As IO.FileNotFoundException
21 | access = ""
22 | Catch ex As Exception
23 | access = "No (in use)"
24 | End Try
25 | If access <> "" Then
26 | Dim lvi = SubfoldersListview.Items.Add(IO.Path.GetFileName(folder))
27 | lvi.SubItems.Add(access)
28 | End If
29 | Next
30 | End Sub
31 | Private Sub OkButton_Click(sender As Object, e As EventArgs) Handles OkButton.Click
32 | If SubfoldersListview.SelectedItems.Count = 0 Then Exit Sub
33 | SelectedFilePath = IO.Path.Combine("C:\Users", SubfoldersListview.SelectedItems(0).Text, "ntuser.dat")
34 | DialogResult = DialogResult.OK
35 | End Sub
36 | Private Sub OpenUserRegistry_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
37 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
38 | End Sub
39 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/DetailProduct.vb:
--------------------------------------------------------------------------------
1 | Public Class DetailProduct
2 | Dim SelectedProduct As PolicyPlusProduct
3 | Public Sub PresentDialog(Product As PolicyPlusProduct)
4 | PrepareDialog(Product)
5 | ShowDialog()
6 | End Sub
7 | Private Sub PrepareDialog(Product As PolicyPlusProduct)
8 | SelectedProduct = Product
9 | NameTextbox.Text = Product.DisplayName
10 | IdTextbox.Text = Product.UniqueID
11 | DefinedTextbox.Text = Product.RawProduct.DefinedIn.SourceFile
12 | DisplayCodeTextbox.Text = Product.RawProduct.DisplayCode
13 | Select Case Product.RawProduct.Type
14 | Case AdmxProductType.MajorRevision
15 | KindTextbox.Text = "Major revision"
16 | Case AdmxProductType.MinorRevision
17 | KindTextbox.Text = "Minor revision"
18 | Case AdmxProductType.Product
19 | KindTextbox.Text = "Top-level product"
20 | End Select
21 | VersionTextbox.Text = If(Product.RawProduct.Type = AdmxProductType.Product, "", CStr(Product.RawProduct.Version))
22 | If Product.Parent Is Nothing Then
23 | ParentTextbox.Text = ""
24 | ParentButton.Enabled = False
25 | Else
26 | ParentTextbox.Text = Product.Parent.DisplayName
27 | ParentButton.Enabled = True
28 | End If
29 | ChildrenListview.Items.Clear()
30 | If Product.Children IsNot Nothing Then
31 | For Each child In Product.Children
32 | Dim lsvi = ChildrenListview.Items.Add(child.RawProduct.Version)
33 | lsvi.SubItems.Add(child.DisplayName)
34 | lsvi.Tag = child
35 | Next
36 | End If
37 | End Sub
38 | Private Sub ChildrenListview_ClientSizeChanged(sender As Object, e As EventArgs) Handles ChildrenListview.ClientSizeChanged
39 | ChName.Width = ChildrenListview.ClientSize.Width - ChVersion.Width
40 | End Sub
41 | Private Sub ChildrenListview_DoubleClick(sender As Object, e As EventArgs) Handles ChildrenListview.DoubleClick
42 | If ChildrenListview.SelectedItems.Count = 0 Then Exit Sub
43 | PrepareDialog(ChildrenListview.SelectedItems(0).Tag)
44 | End Sub
45 | Private Sub ParentButton_Click(sender As Object, e As EventArgs) Handles ParentButton.Click
46 | PrepareDialog(SelectedProduct.Parent)
47 | End Sub
48 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/FindByRegistry.vb:
--------------------------------------------------------------------------------
1 | Public Class FindByRegistry
2 | Public Searcher As Func(Of PolicyPlusPolicy, Boolean)
3 | Private Sub FindByRegistry_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
4 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
5 | End Sub
6 | Private Sub SearchButton_Click(sender As Object, e As EventArgs) Handles SearchButton.Click
7 | Dim keyName = KeyTextbox.Text.ToLowerInvariant
8 | Dim valName = ValueTextbox.Text.ToLowerInvariant
9 | If keyName = "" And valName = "" Then
10 | MsgBox("Please enter search terms.", MsgBoxStyle.Exclamation)
11 | Exit Sub
12 | End If
13 | If {"HKLM\", "HKCU\", "HKEY_LOCAL_MACHINE\", "HKEY_CURRENT_USER\"}.Any(Function(bad) keyName.StartsWith(bad, StringComparison.InvariantCultureIgnoreCase)) Then
14 | MsgBox("Policies' root keys are determined only by their section. Remove the root key from the search terms and try again.", MsgBoxStyle.Exclamation)
15 | Exit Sub
16 | End If
17 | Searcher = Function(Policy As PolicyPlusPolicy) As Boolean
18 | Dim affected = PolicyProcessing.GetReferencedRegistryValues(Policy)
19 | For Each rkvp In affected
20 | If valName <> "" Then
21 | If Not rkvp.Value.ToLowerInvariant Like valName Then Continue For
22 | End If
23 | If keyName <> "" Then
24 | If keyName.Contains("*") Or keyName.Contains("?") Then ' Wildcard path
25 | If Not rkvp.Key.ToLowerInvariant Like keyName Then Continue For
26 | ElseIf keyName.Contains("\") Then ' Path root
27 | If Not rkvp.Key.StartsWith(keyName, StringComparison.InvariantCultureIgnoreCase) Then Continue For
28 | Else ' One path component
29 | If Not Split(rkvp.Key, "\").Any(Function(part) part.Equals(keyName, StringComparison.InvariantCultureIgnoreCase)) Then Continue For
30 | End If
31 | End If
32 | Return True
33 | Next
34 | Return False
35 | End Function
36 | DialogResult = DialogResult.OK
37 | End Sub
38 | End Class
--------------------------------------------------------------------------------
/Docs/Lexicon.md:
--------------------------------------------------------------------------------
1 | # What special terms does Policy Plus use?
2 |
3 | This document defines the terms used in Policy Plus documentation, UI, and code.
4 |
5 | * *ADMX workspace*: A collection of ADMX and ADML files, not necessarily all in the same folder, from which policy objects are loaded.
6 | * *Basic state*: The state of a policy (Enabled, Disabled, or Not Configured), not including the extra configuration if Enabled.
7 | * *Display code*: The nonlocalized (ADMX-internal) name of an item, usually a policy.
8 | * *Info code*: The nonlocalized code for a policy's description.
9 | * *Local GPO*: A Group Policy Object that applies to the machine or to all users, stored in `\Windows\System32\GroupPolicy`.
10 | * *Policy element*: A configurable option in a policy beyond the basic state, e.g. a numeric value.
11 | * *Policy loader*: An object that prepares, manages, and cleans up policy sources.
12 | * *Policy object*: Any ADMX-loaded object that has a unique ID: policy, category, product, or support definition.
13 | * *Policy source*: Where the Registry-based policy data is actually stored, either a POL file or a Registry branch.
14 | * *Policy state*: The configured state of a policy, its basic state plus the state of any element.
15 | * *Preference*: A policy that affects a section of the Registry outside the Policies branches and will therefore not be undone if the setting changes to Not Configured.
16 | * *Presentation code*: The ADMX-internal identifier of a policy's presentation, used to match policy elements to presentation elements.
17 | * *Presentation element*: A user interface element that appears in the additional configuration section of a policy, usually corresponding to a policy element, e.g. a spinner for a numeric value.
18 | * *Section*: The type of GPO to which a policy applies: user, computer, or both.
19 | * *Semantic Policy (SPOL) file*: A script specifying the desired state of policies in terms of their basic state and element states.
20 | * *Semantic Policy (SPOL) fragment*: A part of a SPOL file, without the header, that specifies the desired state of one policy.
21 | * *Support definition*: A set of rules that can be attached to a policy to state what products support the policy.
22 | * *Unique ID*: A fully-qualified identifier for a policy object, made up of its ADMX file's namespace and the object's internal ID.
23 | * *User GPO*: A Group Policy Object that applies to one user, stored in `\Windows\System32\GroupPolicyUsers`.
24 | * *User hive*: A Registry hive file specific to a user profile, usually named `ntuser.dat`.
--------------------------------------------------------------------------------
/PolicyPlus/EditPolNumericData.vb:
--------------------------------------------------------------------------------
1 | Public Class EditPolNumericData
2 | Public Function PresentDialog(ValueName As String, InitialData As ULong, IsQword As Boolean) As DialogResult
3 | TextName.Text = ValueName
4 | NumData.Maximum = If(IsQword, ULong.MaxValue, UInteger.MaxValue)
5 | NumData.Value = InitialData
6 | NumData.Select()
7 | Return ShowDialog()
8 | End Function
9 | Private Sub CheckHexadecimal_CheckedChanged(sender As Object, e As EventArgs) Handles CheckHexadecimal.CheckedChanged
10 | NumData.Hexadecimal = CheckHexadecimal.Checked
11 | End Sub
12 | Private Sub EditPolNumericData_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
13 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
14 | End Sub
15 | End Class
16 | ' The normal NumericUpDown has a bug - it's unable to handle numbers greater than 0x7FFFFFF when in hex mode
17 | ' This subclass fixes that bug
18 | ' Adapted from https://social.msdn.microsoft.com/Forums/windows/en-US/6eea9c6c-a43c-4ef1-a7a3-de95e17e77a8/numericupdown-hexadecimal-bug?forum=winforms
19 | Friend Class WideRangeNumericUpDown
20 | Inherits NumericUpDown
21 | Protected Overrides Sub UpdateEditText()
22 | If Hexadecimal Then
23 | If UserEdit Then HexParseEditText()
24 | If Not String.IsNullOrEmpty(Text) Then
25 | ChangingText = True
26 | Text = String.Format("{0:X}", CULng(Value))
27 | End If
28 | Else
29 | MyBase.UpdateEditText()
30 | End If
31 | End Sub
32 | Protected Overrides Sub ValidateEditText()
33 | If Hexadecimal Then
34 | HexParseEditText()
35 | UpdateEditText()
36 | Else
37 | MyBase.ValidateEditText()
38 | End If
39 | End Sub
40 | Private Sub HexParseEditText()
41 | Try
42 | If Not String.IsNullOrEmpty(Text) Then Value = ULong.Parse(Text, Globalization.NumberStyles.HexNumber)
43 | Catch ex As ArgumentOutOfRangeException
44 | Value = Maximum
45 | Catch ex As OverflowException
46 | If Not String.IsNullOrEmpty(Text) Then
47 | If Text.StartsWith("-") Then
48 | Value = Minimum
49 | Else
50 | Value = Maximum
51 | End If
52 | End If
53 | Catch ex As Exception
54 | ' Do nothing
55 | Finally
56 | UserEdit = False
57 | End Try
58 | End Sub
59 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/OpenAdmxFolder.vb:
--------------------------------------------------------------------------------
1 | Imports System.DirectoryServices.ActiveDirectory
2 | Public Class OpenAdmxFolder
3 | Dim SysvolPolicyDefinitionsPath As String = ""
4 | Public SelectedFolder As String
5 | Public ClearWorkspace As Boolean
6 | Private Sub Options_CheckedChanged(sender As Object, e As EventArgs) Handles OptCustomFolder.CheckedChanged, OptSysvol.CheckedChanged, OptLocalFolder.CheckedChanged
7 | Dim customSelected = OptCustomFolder.Checked
8 | TextFolder.Enabled = customSelected
9 | ButtonBrowse.Enabled = customSelected
10 | End Sub
11 | Private Sub OpenAdmxFolder_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
12 | OptCustomFolder.Checked = True
13 | Dim compDomain As Domain = Nothing
14 | Try
15 | compDomain = Domain.GetComputerDomain
16 | Catch ex As Exception
17 | ' Not domain-joined, or no domain controller is available
18 | End Try
19 | If compDomain Is Nothing Then
20 | SysvolPolicyDefinitionsPath = ""
21 | Else
22 | Dim possiblePath = "\\" & compDomain.Name & "\SYSVOL\" & compDomain.Name & "\Policies\PolicyDefinitions"
23 | If IO.Directory.Exists(possiblePath) Then SysvolPolicyDefinitionsPath = possiblePath Else SysvolPolicyDefinitionsPath = ""
24 | End If
25 | OptSysvol.Enabled = (SysvolPolicyDefinitionsPath <> "")
26 | End Sub
27 | Private Sub ButtonOK_Click(sender As Object, e As EventArgs) Handles ButtonOK.Click
28 | If OptLocalFolder.Checked Then
29 | SelectedFolder = Environment.ExpandEnvironmentVariables("%windir%\PolicyDefinitions")
30 | ElseIf OptSysvol.Checked Then
31 | SelectedFolder = SysvolPolicyDefinitionsPath
32 | ElseIf OptCustomFolder.Checked Then
33 | SelectedFolder = TextFolder.Text
34 | End If
35 | If IO.Directory.Exists(SelectedFolder) Then
36 | ClearWorkspace = ClearWorkspaceCheckbox.Checked
37 | DialogResult = DialogResult.OK
38 | Else
39 | MsgBox("The folder you specified does not exist.", MsgBoxStyle.Exclamation)
40 | End If
41 | End Sub
42 | Private Sub ButtonBrowse_Click(sender As Object, e As EventArgs) Handles ButtonBrowse.Click
43 | Using fbd As New FolderBrowserDialog
44 | If fbd.ShowDialog <> DialogResult.OK Then Exit Sub
45 | TextFolder.Text = fbd.SelectedPath
46 | End Using
47 | End Sub
48 | Private Sub OpenAdmxFolder_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
49 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
50 | End Sub
51 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/DetailAdmx.vb:
--------------------------------------------------------------------------------
1 | Public Class DetailAdmx
2 | Public Sub PresentDialog(Admx As AdmxFile, Workspace As AdmxBundle)
3 | TextPath.Text = Admx.SourceFile
4 | TextNamespace.Text = Admx.AdmxNamespace
5 | TextSupersededAdm.Text = Admx.SupersededAdm
6 | Dim fillListview = Sub(Control As ListView, Collection As IEnumerable, IdSelector As Func(Of Object, String), NameSelector As Func(Of Object, String))
7 | Control.Items.Clear()
8 | For Each item In Collection
9 | Dim lsvi = Control.Items.Add(IdSelector(item))
10 | lsvi.Tag = item
11 | lsvi.SubItems.Add(NameSelector(item))
12 | Next
13 | Control.Columns(1).Width = Control.ClientRectangle.Width - Control.Columns(0).Width - SystemInformation.VerticalScrollBarWidth
14 | End Sub
15 | fillListview(LsvPolicies, Workspace.Policies.Values.Where(Function(p) p.RawPolicy.DefinedIn Is Admx), Function(p As PolicyPlusPolicy) p.RawPolicy.ID, Function(p As PolicyPlusPolicy) p.DisplayName)
16 | fillListview(LsvCategories, Workspace.FlatCategories.Values.Where(Function(c) c.RawCategory.DefinedIn Is Admx), Function(c As PolicyPlusCategory) c.RawCategory.ID, Function(c As PolicyPlusCategory) c.DisplayName)
17 | fillListview(LsvProducts, Workspace.FlatProducts.Values.Where(Function(p) p.RawProduct.DefinedIn Is Admx), Function(p As PolicyPlusProduct) p.RawProduct.ID, Function(p As PolicyPlusProduct) p.DisplayName)
18 | fillListview(LsvSupportDefinitions, Workspace.SupportDefinitions.Values.Where(Function(s) s.RawSupport.DefinedIn Is Admx), Function(s As PolicyPlusSupport) s.RawSupport.ID, Function(s As PolicyPlusSupport) s.DisplayName)
19 | ShowDialog()
20 | End Sub
21 | Private Sub LsvPolicies_DoubleClick(sender As Object, e As EventArgs) Handles LsvPolicies.DoubleClick
22 | DetailPolicy.PresentDialog(LsvPolicies.SelectedItems(0).Tag)
23 | End Sub
24 | Private Sub LsvCategories_DoubleClick(sender As Object, e As EventArgs) Handles LsvCategories.DoubleClick
25 | DetailCategory.PresentDialog(LsvCategories.SelectedItems(0).Tag)
26 | End Sub
27 | Private Sub LsvProducts_DoubleClick(sender As Object, e As EventArgs) Handles LsvProducts.DoubleClick
28 | DetailProduct.PresentDialog(LsvProducts.SelectedItems(0).Tag)
29 | End Sub
30 | Private Sub LsvSupportDefinitions_DoubleClick(sender As Object, e As EventArgs) Handles LsvSupportDefinitions.DoubleClick
31 | DetailSupport.PresentDialog(LsvSupportDefinitions.SelectedItems(0).Tag)
32 | End Sub
33 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/PolicyStructures.vb:
--------------------------------------------------------------------------------
1 | ' These structures hold information on the behavior of policies and policy elements
2 | Public Class PolicyRegistryList
3 | Public OnValue As PolicyRegistryValue
4 | Public OnValueList As PolicyRegistrySingleList
5 | Public OffValue As PolicyRegistryValue
6 | Public OffValueList As PolicyRegistrySingleList
7 | End Class
8 | Public Class PolicyRegistrySingleList
9 | Public DefaultRegistryKey As String
10 | Public AffectedValues As List(Of PolicyRegistryListEntry)
11 | End Class
12 | Public Class PolicyRegistryValue '
13 | Public RegistryType As PolicyRegistryValueType
14 | Public StringValue As String
15 | Public NumberValue As UInteger
16 | End Class
17 | Public Class PolicyRegistryListEntry ' -
18 | Public RegistryValue As String
19 | Public RegistryKey As String
20 | Public Value As PolicyRegistryValue
21 | End Class
22 | Public Enum PolicyRegistryValueType
23 | Delete
24 | Numeric
25 | Text
26 | End Enum
27 | Public MustInherit Class PolicyElement
28 | Public ID As String
29 | Public ClientExtension As String
30 | Public RegistryKey As String
31 | Public RegistryValue As String
32 | Public ElementType As String
33 | End Class
34 | Public Class DecimalPolicyElement '
35 | Inherits PolicyElement
36 | Public Required As Boolean
37 | Public Minimum As UInteger
38 | Public Maximum As UInteger = UInteger.MaxValue
39 | Public StoreAsText As Boolean
40 | Public NoOverwrite As Boolean
41 | End Class
42 | Public Class BooleanPolicyElement '
43 | Inherits PolicyElement
44 | Public AffectedRegistry As PolicyRegistryList
45 | End Class
46 | Public Class TextPolicyElement '
47 | Inherits PolicyElement
48 | Public Required As Boolean
49 | Public MaxLength As Integer
50 | Public RegExpandSz As Boolean
51 | Public NoOverwrite As Boolean
52 | End Class
53 | Public Class ListPolicyElement '
54 | Inherits PolicyElement
55 | Public HasPrefix As Boolean
56 | Public NoPurgeOthers As Boolean
57 | Public RegExpandSz As Boolean
58 | Public UserProvidesNames As Boolean
59 | End Class
60 | Public Class EnumPolicyElement '
61 | Inherits PolicyElement
62 | Public Required As Boolean
63 | Public Items As List(Of EnumPolicyElementItem)
64 | End Class
65 | Public Class EnumPolicyElementItem ' -
66 | Public DisplayCode As String
67 | Public Value As PolicyRegistryValue
68 | Public ValueList As PolicyRegistrySingleList '
69 | End Class
70 | Public Class MultiTextPolicyElement '
71 | Inherits PolicyElement
72 | ' This is undocumented, so it's unknown whether there can be other options for it
73 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/DetailSupport.vb:
--------------------------------------------------------------------------------
1 | Public Class DetailSupport
2 | Public Sub PresentDialog(Supported As PolicyPlusSupport)
3 | PrepareDialog(Supported)
4 | ShowDialog()
5 | End Sub
6 | Sub PrepareDialog(Supported As PolicyPlusSupport)
7 | NameTextbox.Text = Supported.DisplayName
8 | IdTextbox.Text = Supported.UniqueID
9 | DefinedTextbox.Text = Supported.RawSupport.DefinedIn.SourceFile
10 | DisplayCodeTextbox.Text = Supported.RawSupport.DisplayCode
11 | Select Case Supported.RawSupport.Logic
12 | Case AdmxSupportLogicType.AllOf
13 | LogicTextbox.Text = "Match all the referenced products"
14 | Case AdmxSupportLogicType.AnyOf
15 | LogicTextbox.Text = "Match any of the referenced products"
16 | Case AdmxSupportLogicType.Blank
17 | LogicTextbox.Text = "Do not match products"
18 | End Select
19 | EntriesListview.Items.Clear()
20 | If Supported.Elements IsNot Nothing Then
21 | For Each element In Supported.Elements
22 | Dim lsvi As ListViewItem
23 | If element.SupportDefinition IsNot Nothing Then
24 | lsvi = EntriesListview.Items.Add(element.SupportDefinition.DisplayName)
25 | ElseIf element.Product IsNot Nothing Then
26 | lsvi = EntriesListview.Items.Add(element.Product.DisplayName)
27 | If element.RawSupportEntry.IsRange Then
28 | If element.RawSupportEntry.MinVersion.HasValue Then lsvi.SubItems.Add(element.RawSupportEntry.MinVersion.Value) Else lsvi.SubItems.Add("")
29 | If element.RawSupportEntry.MaxVersion.HasValue Then lsvi.SubItems.Add(element.RawSupportEntry.MaxVersion.Value) Else lsvi.SubItems.Add("")
30 | End If
31 | Else
32 | lsvi = EntriesListview.Items.Add("")
33 | End If
34 | lsvi.Tag = element
35 | Next
36 | End If
37 | End Sub
38 | Private Sub EntriesListview_ClientSizeChanged(sender As Object, e As EventArgs) Handles EntriesListview.ClientSizeChanged, Me.Shown
39 | ChName.Width = EntriesListview.ClientSize.Width - ChMinVer.Width - ChMaxVer.Width
40 | End Sub
41 | Private Sub EntriesListview_DoubleClick(sender As Object, e As EventArgs) Handles EntriesListview.DoubleClick
42 | If EntriesListview.SelectedItems.Count = 0 Then Exit Sub
43 | Dim supEntry As PolicyPlusSupportEntry = EntriesListview.SelectedItems(0).Tag
44 | If supEntry.Product IsNot Nothing Then
45 | DetailProduct.PresentDialog(supEntry.Product)
46 | ElseIf supEntry.SupportDefinition IsNot Nothing Then
47 | PrepareDialog(supEntry.SupportDefinition)
48 | End If
49 | End Sub
50 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/InspectSpolFragment.vb:
--------------------------------------------------------------------------------
1 | Public Class InspectSpolFragment
2 | Dim SpolFragment As String
3 | Public Function PresentDialog(Policy As PolicyPlusPolicy, AdmxWorkspace As AdmxBundle, CompSource As IPolicySource, UserSource As IPolicySource, CompComments As Dictionary(Of String, String), UserComments As Dictionary(Of String, String)) As DialogResult
4 | ' Show the SPOL text for all the policy's sections
5 | TextPolicyName.Text = Policy.DisplayName
6 | Dim sb As New Text.StringBuilder
7 | Dim addSection = Function(Section As AdmxPolicySection) As Boolean
8 | ' Create SPOL info for one section of the policy
9 | If (Policy.RawPolicy.Section And Section) = 0 Then Return False
10 | Dim polSource = If(Section = AdmxPolicySection.Machine, CompSource, UserSource)
11 | Dim commentsMap = If(Section = AdmxPolicySection.Machine, CompComments, UserComments)
12 | Dim spolState As New SpolPolicyState With {.UniqueID = Policy.UniqueID}
13 | spolState.Section = Section
14 | If commentsMap IsNot Nothing AndAlso commentsMap.ContainsKey(Policy.UniqueID) Then spolState.Comment = commentsMap(Policy.UniqueID)
15 | spolState.BasicState = PolicyProcessing.GetPolicyState(polSource, Policy)
16 | If spolState.BasicState = PolicyState.Enabled Then spolState.ExtraOptions = PolicyProcessing.GetPolicyOptionStates(polSource, Policy)
17 | sb.AppendLine(SpolFile.GetFragment(spolState))
18 | Return True
19 | End Function
20 | addSection(AdmxPolicySection.Machine)
21 | addSection(AdmxPolicySection.User)
22 | SpolFragment = sb.ToString
23 | UpdateTextbox()
24 | Return ShowDialog()
25 | End Function
26 | Private Sub ButtonCopy_Click(sender As Object, e As EventArgs) Handles ButtonCopy.Click
27 | TextSpol.SelectAll()
28 | TextSpol.Copy()
29 | End Sub
30 | Private Sub InspectSpolFragment_Shown(sender As Object, e As EventArgs) Handles Me.Shown
31 | TextSpol.Focus()
32 | TextSpol.SelectAll()
33 | End Sub
34 | Private Sub CheckHeader_CheckedChanged(sender As Object, e As EventArgs) Handles CheckHeader.CheckedChanged
35 | UpdateTextbox()
36 | End Sub
37 | Private Sub UpdateTextbox()
38 | If CheckHeader.Checked Then
39 | TextSpol.Text = "Policy Plus Semantic Policy" & vbCrLf & vbCrLf & SpolFragment
40 | Else
41 | TextSpol.Text = SpolFragment
42 | End If
43 | End Sub
44 | Private Sub TextSpol_KeyDown(sender As Object, e As KeyEventArgs) Handles TextSpol.KeyDown
45 | If e.KeyCode = Keys.A And e.Control Then TextSpol.SelectAll()
46 | End Sub
47 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PolicyPlus.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.PolicyPlus.My.MySettings
68 | Get
69 | Return Global.PolicyPlus.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolKey.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolKey
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Me.TextName = New System.Windows.Forms.TextBox()
27 | Me.ButtonOK = New System.Windows.Forms.Button()
28 | Label1 = New System.Windows.Forms.Label()
29 | Me.SuspendLayout()
30 | '
31 | 'Label1
32 | '
33 | Label1.AutoSize = True
34 | Label1.Location = New System.Drawing.Point(12, 15)
35 | Label1.Name = "Label1"
36 | Label1.Size = New System.Drawing.Size(35, 13)
37 | Label1.TabIndex = 0
38 | Label1.Text = "Name"
39 | '
40 | 'TextName
41 | '
42 | Me.TextName.Location = New System.Drawing.Point(53, 12)
43 | Me.TextName.Name = "TextName"
44 | Me.TextName.Size = New System.Drawing.Size(223, 20)
45 | Me.TextName.TabIndex = 1
46 | '
47 | 'ButtonOK
48 | '
49 | Me.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK
50 | Me.ButtonOK.Location = New System.Drawing.Point(201, 38)
51 | Me.ButtonOK.Name = "ButtonOK"
52 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
53 | Me.ButtonOK.TabIndex = 2
54 | Me.ButtonOK.Text = "OK"
55 | Me.ButtonOK.UseVisualStyleBackColor = True
56 | '
57 | 'EditPolKey
58 | '
59 | Me.AcceptButton = Me.ButtonOK
60 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
61 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
62 | Me.ClientSize = New System.Drawing.Size(288, 73)
63 | Me.Controls.Add(Me.ButtonOK)
64 | Me.Controls.Add(Me.TextName)
65 | Me.Controls.Add(Label1)
66 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
67 | Me.KeyPreview = True
68 | Me.MaximizeBox = False
69 | Me.MinimizeBox = False
70 | Me.Name = "EditPolKey"
71 | Me.ShowIcon = False
72 | Me.ShowInTaskbar = False
73 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
74 | Me.Text = "New Key"
75 | Me.ResumeLayout(False)
76 | Me.PerformLayout()
77 |
78 | End Sub
79 |
80 | Friend WithEvents TextName As TextBox
81 | Friend WithEvents ButtonOK As Button
82 | End Class
83 |
--------------------------------------------------------------------------------
/PolicyPlus/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
59 |
60 |
61 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/PolicyPlus/FindById.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class FindById
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.StatusImage = New System.Windows.Forms.PictureBox()
26 | Me.IdTextbox = New System.Windows.Forms.TextBox()
27 | Me.GoButton = New System.Windows.Forms.Button()
28 | CType(Me.StatusImage, System.ComponentModel.ISupportInitialize).BeginInit()
29 | Me.SuspendLayout()
30 | '
31 | 'StatusImage
32 | '
33 | Me.StatusImage.Location = New System.Drawing.Point(12, 14)
34 | Me.StatusImage.Name = "StatusImage"
35 | Me.StatusImage.Size = New System.Drawing.Size(16, 16)
36 | Me.StatusImage.TabIndex = 0
37 | Me.StatusImage.TabStop = False
38 | '
39 | 'IdTextbox
40 | '
41 | Me.IdTextbox.Location = New System.Drawing.Point(34, 12)
42 | Me.IdTextbox.Name = "IdTextbox"
43 | Me.IdTextbox.Size = New System.Drawing.Size(277, 20)
44 | Me.IdTextbox.TabIndex = 1
45 | Me.IdTextbox.Text = " "
46 | '
47 | 'GoButton
48 | '
49 | Me.GoButton.Location = New System.Drawing.Point(236, 38)
50 | Me.GoButton.Name = "GoButton"
51 | Me.GoButton.Size = New System.Drawing.Size(75, 23)
52 | Me.GoButton.TabIndex = 2
53 | Me.GoButton.Text = "Go"
54 | Me.GoButton.UseVisualStyleBackColor = True
55 | '
56 | 'FindById
57 | '
58 | Me.AcceptButton = Me.GoButton
59 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
60 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
61 | Me.ClientSize = New System.Drawing.Size(323, 73)
62 | Me.Controls.Add(Me.GoButton)
63 | Me.Controls.Add(Me.IdTextbox)
64 | Me.Controls.Add(Me.StatusImage)
65 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
66 | Me.KeyPreview = True
67 | Me.MaximizeBox = False
68 | Me.MinimizeBox = False
69 | Me.Name = "FindById"
70 | Me.ShowIcon = False
71 | Me.ShowInTaskbar = False
72 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
73 | Me.Text = "Find by ID"
74 | CType(Me.StatusImage, System.ComponentModel.ISupportInitialize).EndInit()
75 | Me.ResumeLayout(False)
76 | Me.PerformLayout()
77 |
78 | End Sub
79 |
80 | Friend WithEvents StatusImage As PictureBox
81 | Friend WithEvents IdTextbox As TextBox
82 | Friend WithEvents GoButton As Button
83 | End Class
84 |
--------------------------------------------------------------------------------
/PolicyPlus/FindById.vb:
--------------------------------------------------------------------------------
1 | Public Class FindById
2 | Public AdmxWorkspace As AdmxBundle
3 | Public SelectedPolicy As PolicyPlusPolicy
4 | Public SelectedCategory As PolicyPlusCategory
5 | Public SelectedProduct As PolicyPlusProduct
6 | Public SelectedSupport As PolicyPlusSupport
7 | Public SelectedSection As AdmxPolicySection ' Specifies the section for policies
8 | Dim CategoryImage As Image
9 | Dim PolicyImage As Image
10 | Dim ProductImage As Image
11 | Dim SupportImage As Image
12 | Dim NotFoundImage As Image
13 | Dim BlankImage As Image
14 | Private Sub FindById_Load(sender As Object, e As EventArgs) Handles MyBase.Load
15 | CategoryImage = Main.PolicyIcons.Images(0)
16 | PolicyImage = Main.PolicyIcons.Images(4)
17 | ProductImage = Main.PolicyIcons.Images(10)
18 | SupportImage = Main.PolicyIcons.Images(11)
19 | NotFoundImage = Main.PolicyIcons.Images(8)
20 | BlankImage = Main.PolicyIcons.Images(9)
21 | End Sub
22 | Private Sub IdTextbox_TextChanged(sender As Object, e As EventArgs) Handles IdTextbox.TextChanged
23 | If AdmxWorkspace Is Nothing Then Exit Sub ' Wait until actually shown
24 | SelectedPolicy = Nothing
25 | SelectedCategory = Nothing
26 | SelectedProduct = Nothing
27 | SelectedSupport = Nothing
28 | Dim id = Trim(IdTextbox.Text)
29 | If AdmxWorkspace.FlatCategories.ContainsKey(id) Then
30 | StatusImage.Image = CategoryImage
31 | SelectedCategory = AdmxWorkspace.FlatCategories(id)
32 | ElseIf AdmxWorkspace.FlatProducts.ContainsKey(id) Then
33 | StatusImage.Image = ProductImage
34 | SelectedProduct = AdmxWorkspace.FlatProducts(id)
35 | ElseIf AdmxWorkspace.SupportDefinitions.ContainsKey(id) Then
36 | StatusImage.Image = SupportImage
37 | SelectedSupport = AdmxWorkspace.SupportDefinitions(id)
38 | Else ' Check for a policy
39 | Dim policyAndSection = Split(id, "@", 2)
40 | Dim policyId = policyAndSection(0) ' Cut off the section override
41 | If AdmxWorkspace.Policies.ContainsKey(policyId) Then
42 | StatusImage.Image = PolicyImage
43 | SelectedPolicy = AdmxWorkspace.Policies(policyId)
44 | If policyAndSection.Length = 2 AndAlso policyAndSection(1).Length = 1 AndAlso "UC".Contains(policyAndSection(1)) Then
45 | SelectedSection = If(policyAndSection(1) = "U", AdmxPolicySection.User, AdmxPolicySection.Machine)
46 | Else
47 | SelectedSection = AdmxPolicySection.Both
48 | End If
49 | Else
50 | StatusImage.Image = If(id = "", BlankImage, NotFoundImage)
51 | End If
52 | End If
53 | End Sub
54 | Private Sub FindById_Shown(sender As Object, e As EventArgs) Handles Me.Shown
55 | If IdTextbox.Text = " " Then IdTextbox.Text = "" ' It's set to a single space in the designer
56 | IdTextbox.Focus()
57 | IdTextbox.SelectAll()
58 | End Sub
59 | Private Sub GoButton_Click(sender As Object, e As EventArgs) Handles GoButton.Click
60 | DialogResult = DialogResult.OK ' Close
61 | End Sub
62 | Private Sub FindById_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
63 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
64 | End Sub
65 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/LoadedProducts.vb:
--------------------------------------------------------------------------------
1 | Public Class LoadedProducts
2 | Public Sub PresentDialog(Workspace As AdmxBundle)
3 | ' Fill the top-level products list
4 | LsvTopLevelProducts.SelectedIndices.Clear()
5 | LsvTopLevelProducts.Items.Clear()
6 | For Each product In Workspace.Products.Values.OrderBy(Function(p) p.DisplayName)
7 | Dim lsvi = LsvTopLevelProducts.Items.Add(product.DisplayName)
8 | lsvi.SubItems.Add(product.Children.Count)
9 | lsvi.Tag = product
10 | Next
11 | ' Clear the other lists
12 | UpdateMajorList()
13 | ' Finagle the column widths
14 | For Each lsv In {LsvTopLevelProducts, LsvMajorVersions, LsvMinorVersions}
15 | Dim lastColWidths As Integer = 0
16 | For n = 1 To lsv.Columns.Count - 1
17 | lastColWidths += lsv.Columns(n).Width
18 | Next
19 | lsv.Columns(0).Width = lsv.ClientRectangle.Width - lastColWidths - SystemInformation.VerticalScrollBarWidth
20 | Next
21 | ShowDialog()
22 | End Sub
23 | Sub UpdateMajorList() Handles LsvTopLevelProducts.SelectedIndexChanged
24 | ' Show the major versions of the selected top-level product
25 | LsvMajorVersions.SelectedIndices.Clear()
26 | LsvMajorVersions.Items.Clear()
27 | If LsvTopLevelProducts.SelectedItems.Count > 0 Then
28 | Dim selProduct As PolicyPlusProduct = LsvTopLevelProducts.SelectedItems(0).Tag
29 | For Each product In selProduct.Children.OrderBy(Function(p) p.RawProduct.Version)
30 | Dim lsvi = LsvMajorVersions.Items.Add(product.DisplayName)
31 | lsvi.SubItems.Add(product.RawProduct.Version)
32 | lsvi.SubItems.Add(product.Children.Count)
33 | lsvi.Tag = product
34 | Next
35 | LabelMajorVersion.Text = "Major versions of """ & selProduct.DisplayName & """"
36 | Else
37 | LabelMajorVersion.Text = "Select a product to show its major versions"
38 | End If
39 | UpdateMinorList()
40 | End Sub
41 | Sub UpdateMinorList() Handles LsvMajorVersions.SelectedIndexChanged
42 | LsvMinorVersions.SelectedIndices.Clear()
43 | LsvMinorVersions.Items.Clear()
44 | ' Show the minor versions of the selected major version
45 | If LsvMajorVersions.SelectedItems.Count > 0 Then
46 | Dim selProduct As PolicyPlusProduct = LsvMajorVersions.SelectedItems(0).Tag
47 | For Each product In selProduct.Children.OrderBy(Function(p) p.RawProduct.Version)
48 | Dim lsvi = LsvMinorVersions.Items.Add(product.DisplayName)
49 | lsvi.SubItems.Add(product.RawProduct.Version)
50 | lsvi.Tag = product
51 | Next
52 | LabelMinorVersion.Text = "Minor versions of """ & selProduct.DisplayName & """"
53 | Else
54 | LabelMinorVersion.Text = "Select a major version to show its minor versions"
55 | End If
56 | End Sub
57 | Sub OpenProductDetails(sender As Object, e As EventArgs) Handles LsvTopLevelProducts.DoubleClick, LsvMajorVersions.DoubleClick, LsvMinorVersions.DoubleClick
58 | Dim lsv As ListView = sender
59 | If lsv.SelectedItems.Count = 0 Then Exit Sub
60 | Dim product As PolicyPlusProduct = lsv.SelectedItems(0).Tag
61 | DetailProduct.PresentDialog(product)
62 | End Sub
63 | Sub ListKeyPressed(sender As Object, e As KeyEventArgs) Handles LsvTopLevelProducts.KeyDown, LsvMajorVersions.KeyDown, LsvMinorVersions.KeyDown
64 | If e.KeyCode = Keys.Enter Then
65 | OpenProductDetails(sender, e)
66 | e.Handled = True
67 | End If
68 | End Sub
69 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/OpenUserRegistry.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class OpenUserRegistry
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.SubfoldersListview = New System.Windows.Forms.ListView()
26 | Me.ChUsername = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
27 | Me.ChAccess = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
28 | Me.OkButton = New System.Windows.Forms.Button()
29 | Me.SuspendLayout()
30 | '
31 | 'SubfoldersListview
32 | '
33 | Me.SubfoldersListview.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ChUsername, Me.ChAccess})
34 | Me.SubfoldersListview.FullRowSelect = True
35 | Me.SubfoldersListview.Location = New System.Drawing.Point(12, 12)
36 | Me.SubfoldersListview.MultiSelect = False
37 | Me.SubfoldersListview.Name = "SubfoldersListview"
38 | Me.SubfoldersListview.Size = New System.Drawing.Size(314, 111)
39 | Me.SubfoldersListview.TabIndex = 0
40 | Me.SubfoldersListview.UseCompatibleStateImageBehavior = False
41 | Me.SubfoldersListview.View = System.Windows.Forms.View.Details
42 | '
43 | 'ChUsername
44 | '
45 | Me.ChUsername.Text = "Folder Name"
46 | Me.ChUsername.Width = 196
47 | '
48 | 'ChAccess
49 | '
50 | Me.ChAccess.Text = "Accessible"
51 | Me.ChAccess.Width = 95
52 | '
53 | 'OkButton
54 | '
55 | Me.OkButton.Location = New System.Drawing.Point(251, 129)
56 | Me.OkButton.Name = "OkButton"
57 | Me.OkButton.Size = New System.Drawing.Size(75, 23)
58 | Me.OkButton.TabIndex = 1
59 | Me.OkButton.Text = "OK"
60 | Me.OkButton.UseVisualStyleBackColor = True
61 | '
62 | 'OpenUserRegistry
63 | '
64 | Me.AcceptButton = Me.OkButton
65 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
66 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
67 | Me.ClientSize = New System.Drawing.Size(338, 164)
68 | Me.Controls.Add(Me.OkButton)
69 | Me.Controls.Add(Me.SubfoldersListview)
70 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
71 | Me.KeyPreview = True
72 | Me.MaximizeBox = False
73 | Me.MinimizeBox = False
74 | Me.Name = "OpenUserRegistry"
75 | Me.ShowIcon = False
76 | Me.ShowInTaskbar = False
77 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
78 | Me.Text = "Open User Hive"
79 | Me.ResumeLayout(False)
80 |
81 | End Sub
82 |
83 | Friend WithEvents SubfoldersListview As ListView
84 | Friend WithEvents ChUsername As ColumnHeader
85 | Friend WithEvents ChAccess As ColumnHeader
86 | Friend WithEvents OkButton As Button
87 | End Class
88 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolStringData.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolStringData
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.TextName = New System.Windows.Forms.TextBox()
28 | Me.TextData = New System.Windows.Forms.TextBox()
29 | Me.ButtonOK = New System.Windows.Forms.Button()
30 | Label1 = New System.Windows.Forms.Label()
31 | Label2 = New System.Windows.Forms.Label()
32 | Me.SuspendLayout()
33 | '
34 | 'Label1
35 | '
36 | Label1.AutoSize = True
37 | Label1.Location = New System.Drawing.Point(12, 15)
38 | Label1.Name = "Label1"
39 | Label1.Size = New System.Drawing.Size(63, 13)
40 | Label1.TabIndex = 1
41 | Label1.Text = "Value name"
42 | '
43 | 'Label2
44 | '
45 | Label2.AutoSize = True
46 | Label2.Location = New System.Drawing.Point(12, 41)
47 | Label2.Name = "Label2"
48 | Label2.Size = New System.Drawing.Size(28, 13)
49 | Label2.TabIndex = 3
50 | Label2.Text = "Text"
51 | '
52 | 'TextName
53 | '
54 | Me.TextName.Location = New System.Drawing.Point(81, 12)
55 | Me.TextName.Name = "TextName"
56 | Me.TextName.ReadOnly = True
57 | Me.TextName.Size = New System.Drawing.Size(300, 20)
58 | Me.TextName.TabIndex = 0
59 | '
60 | 'TextData
61 | '
62 | Me.TextData.Location = New System.Drawing.Point(81, 38)
63 | Me.TextData.Name = "TextData"
64 | Me.TextData.Size = New System.Drawing.Size(300, 20)
65 | Me.TextData.TabIndex = 2
66 | '
67 | 'ButtonOK
68 | '
69 | Me.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK
70 | Me.ButtonOK.Location = New System.Drawing.Point(306, 64)
71 | Me.ButtonOK.Name = "ButtonOK"
72 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
73 | Me.ButtonOK.TabIndex = 4
74 | Me.ButtonOK.Text = "OK"
75 | Me.ButtonOK.UseVisualStyleBackColor = True
76 | '
77 | 'EditPolStringData
78 | '
79 | Me.AcceptButton = Me.ButtonOK
80 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
81 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
82 | Me.ClientSize = New System.Drawing.Size(393, 99)
83 | Me.Controls.Add(Me.ButtonOK)
84 | Me.Controls.Add(Label2)
85 | Me.Controls.Add(Me.TextData)
86 | Me.Controls.Add(Label1)
87 | Me.Controls.Add(Me.TextName)
88 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
89 | Me.MaximizeBox = False
90 | Me.MinimizeBox = False
91 | Me.Name = "EditPolStringData"
92 | Me.ShowIcon = False
93 | Me.ShowInTaskbar = False
94 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
95 | Me.Text = "Edit String"
96 | Me.ResumeLayout(False)
97 | Me.PerformLayout()
98 |
99 | End Sub
100 |
101 | Friend WithEvents TextName As TextBox
102 | Friend WithEvents TextData As TextBox
103 | Friend WithEvents ButtonOK As Button
104 | End Class
105 |
--------------------------------------------------------------------------------
/PolicyPlus/OpenSection.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class OpenSection
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.OptUser = New System.Windows.Forms.RadioButton()
26 | Me.OptComputer = New System.Windows.Forms.RadioButton()
27 | Me.ButtonOK = New System.Windows.Forms.Button()
28 | Me.ButtonCancel = New System.Windows.Forms.Button()
29 | Me.SuspendLayout()
30 | '
31 | 'OptUser
32 | '
33 | Me.OptUser.AutoSize = True
34 | Me.OptUser.Location = New System.Drawing.Point(12, 12)
35 | Me.OptUser.Name = "OptUser"
36 | Me.OptUser.Size = New System.Drawing.Size(47, 17)
37 | Me.OptUser.TabIndex = 0
38 | Me.OptUser.TabStop = True
39 | Me.OptUser.Text = "User"
40 | Me.OptUser.UseVisualStyleBackColor = True
41 | '
42 | 'OptComputer
43 | '
44 | Me.OptComputer.AutoSize = True
45 | Me.OptComputer.Location = New System.Drawing.Point(12, 35)
46 | Me.OptComputer.Name = "OptComputer"
47 | Me.OptComputer.Size = New System.Drawing.Size(70, 17)
48 | Me.OptComputer.TabIndex = 1
49 | Me.OptComputer.TabStop = True
50 | Me.OptComputer.Text = "Computer"
51 | Me.OptComputer.UseVisualStyleBackColor = True
52 | '
53 | 'ButtonOK
54 | '
55 | Me.ButtonOK.Location = New System.Drawing.Point(72, 58)
56 | Me.ButtonOK.Name = "ButtonOK"
57 | Me.ButtonOK.Size = New System.Drawing.Size(78, 23)
58 | Me.ButtonOK.TabIndex = 2
59 | Me.ButtonOK.Text = "OK"
60 | Me.ButtonOK.UseVisualStyleBackColor = True
61 | '
62 | 'ButtonCancel
63 | '
64 | Me.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
65 | Me.ButtonCancel.Location = New System.Drawing.Point(12, 58)
66 | Me.ButtonCancel.Name = "ButtonCancel"
67 | Me.ButtonCancel.Size = New System.Drawing.Size(54, 23)
68 | Me.ButtonCancel.TabIndex = 3
69 | Me.ButtonCancel.Text = "Cancel"
70 | Me.ButtonCancel.UseVisualStyleBackColor = True
71 | '
72 | 'OpenSection
73 | '
74 | Me.AcceptButton = Me.ButtonOK
75 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
76 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
77 | Me.CancelButton = Me.ButtonCancel
78 | Me.ClientSize = New System.Drawing.Size(162, 91)
79 | Me.Controls.Add(Me.ButtonCancel)
80 | Me.Controls.Add(Me.ButtonOK)
81 | Me.Controls.Add(Me.OptComputer)
82 | Me.Controls.Add(Me.OptUser)
83 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
84 | Me.KeyPreview = True
85 | Me.MaximizeBox = False
86 | Me.MinimizeBox = False
87 | Me.Name = "OpenSection"
88 | Me.ShowIcon = False
89 | Me.ShowInTaskbar = False
90 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
91 | Me.Text = "Select Section"
92 | Me.ResumeLayout(False)
93 | Me.PerformLayout()
94 |
95 | End Sub
96 |
97 | Friend WithEvents OptUser As RadioButton
98 | Friend WithEvents OptComputer As RadioButton
99 | Friend WithEvents ButtonOK As Button
100 | Friend WithEvents ButtonCancel As Button
101 | End Class
102 |
--------------------------------------------------------------------------------
/PolicyPlus/LanguageOptions.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class LanguageOptions
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.ButtonOK = New System.Windows.Forms.Button()
28 | Me.TextAdmlLanguage = New System.Windows.Forms.TextBox()
29 | Label1 = New System.Windows.Forms.Label()
30 | Label2 = New System.Windows.Forms.Label()
31 | Me.SuspendLayout()
32 | '
33 | 'ButtonOK
34 | '
35 | Me.ButtonOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
36 | Me.ButtonOK.Location = New System.Drawing.Point(213, 90)
37 | Me.ButtonOK.Name = "ButtonOK"
38 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
39 | Me.ButtonOK.TabIndex = 0
40 | Me.ButtonOK.Text = "OK"
41 | Me.ButtonOK.UseVisualStyleBackColor = True
42 | '
43 | 'Label1
44 | '
45 | Label1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
46 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
47 | Label1.AutoSize = True
48 | Label1.Location = New System.Drawing.Point(12, 9)
49 | Label1.MaximumSize = New System.Drawing.Size(276, 0)
50 | Label1.Name = "Label1"
51 | Label1.Size = New System.Drawing.Size(275, 52)
52 | Label1.TabIndex = 1
53 | Label1.Text = "Each ADMX policy definitions file may have multiple corresponding ADML language-s" &
54 | "pecific files. This setting controls which language's ADML file Policy Plus will" &
55 | " look for first."
56 | '
57 | 'TextAdmlLanguage
58 | '
59 | Me.TextAdmlLanguage.Location = New System.Drawing.Point(175, 64)
60 | Me.TextAdmlLanguage.Name = "TextAdmlLanguage"
61 | Me.TextAdmlLanguage.Size = New System.Drawing.Size(113, 20)
62 | Me.TextAdmlLanguage.TabIndex = 2
63 | '
64 | 'Label2
65 | '
66 | Label2.AutoSize = True
67 | Label2.Location = New System.Drawing.Point(12, 67)
68 | Label2.Name = "Label2"
69 | Label2.Size = New System.Drawing.Size(157, 13)
70 | Label2.TabIndex = 3
71 | Label2.Text = "Preferred ADML language code"
72 | '
73 | 'LanguageOptions
74 | '
75 | Me.AcceptButton = Me.ButtonOK
76 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
77 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
78 | Me.ClientSize = New System.Drawing.Size(300, 125)
79 | Me.Controls.Add(Label2)
80 | Me.Controls.Add(Me.TextAdmlLanguage)
81 | Me.Controls.Add(Label1)
82 | Me.Controls.Add(Me.ButtonOK)
83 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
84 | Me.MaximizeBox = False
85 | Me.MinimizeBox = False
86 | Me.Name = "LanguageOptions"
87 | Me.ShowIcon = False
88 | Me.ShowInTaskbar = False
89 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
90 | Me.Text = "Language Options"
91 | Me.ResumeLayout(False)
92 | Me.PerformLayout()
93 |
94 | End Sub
95 |
96 | Friend WithEvents ButtonOK As Button
97 | Friend WithEvents TextAdmlLanguage As TextBox
98 | End Class
99 |
--------------------------------------------------------------------------------
/PolicyPlus/FindByRegistry.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class FindByRegistry
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim KeyPathLabel As System.Windows.Forms.Label
26 | Dim ValueLabel As System.Windows.Forms.Label
27 | Me.KeyTextbox = New System.Windows.Forms.TextBox()
28 | Me.ValueTextbox = New System.Windows.Forms.TextBox()
29 | Me.SearchButton = New System.Windows.Forms.Button()
30 | KeyPathLabel = New System.Windows.Forms.Label()
31 | ValueLabel = New System.Windows.Forms.Label()
32 | Me.SuspendLayout()
33 | '
34 | 'KeyPathLabel
35 | '
36 | KeyPathLabel.AutoSize = True
37 | KeyPathLabel.Location = New System.Drawing.Point(12, 15)
38 | KeyPathLabel.Name = "KeyPathLabel"
39 | KeyPathLabel.Size = New System.Drawing.Size(90, 13)
40 | KeyPathLabel.TabIndex = 0
41 | KeyPathLabel.Text = "Key path or name"
42 | '
43 | 'ValueLabel
44 | '
45 | ValueLabel.AutoSize = True
46 | ValueLabel.Location = New System.Drawing.Point(12, 41)
47 | ValueLabel.Name = "ValueLabel"
48 | ValueLabel.Size = New System.Drawing.Size(63, 13)
49 | ValueLabel.TabIndex = 2
50 | ValueLabel.Text = "Value name"
51 | '
52 | 'KeyTextbox
53 | '
54 | Me.KeyTextbox.Location = New System.Drawing.Point(108, 12)
55 | Me.KeyTextbox.Name = "KeyTextbox"
56 | Me.KeyTextbox.Size = New System.Drawing.Size(260, 20)
57 | Me.KeyTextbox.TabIndex = 1
58 | '
59 | 'ValueTextbox
60 | '
61 | Me.ValueTextbox.Location = New System.Drawing.Point(108, 38)
62 | Me.ValueTextbox.Name = "ValueTextbox"
63 | Me.ValueTextbox.Size = New System.Drawing.Size(260, 20)
64 | Me.ValueTextbox.TabIndex = 2
65 | '
66 | 'SearchButton
67 | '
68 | Me.SearchButton.Location = New System.Drawing.Point(293, 64)
69 | Me.SearchButton.Name = "SearchButton"
70 | Me.SearchButton.Size = New System.Drawing.Size(75, 23)
71 | Me.SearchButton.TabIndex = 3
72 | Me.SearchButton.Text = "Search"
73 | Me.SearchButton.UseVisualStyleBackColor = True
74 | '
75 | 'FindByRegistry
76 | '
77 | Me.AcceptButton = Me.SearchButton
78 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
79 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
80 | Me.ClientSize = New System.Drawing.Size(380, 99)
81 | Me.Controls.Add(Me.SearchButton)
82 | Me.Controls.Add(ValueLabel)
83 | Me.Controls.Add(Me.ValueTextbox)
84 | Me.Controls.Add(Me.KeyTextbox)
85 | Me.Controls.Add(KeyPathLabel)
86 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
87 | Me.KeyPreview = True
88 | Me.MaximizeBox = False
89 | Me.MinimizeBox = False
90 | Me.Name = "FindByRegistry"
91 | Me.ShowIcon = False
92 | Me.ShowInTaskbar = False
93 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
94 | Me.Text = "Find by Registry"
95 | Me.ResumeLayout(False)
96 | Me.PerformLayout()
97 |
98 | End Sub
99 |
100 | Friend WithEvents KeyTextbox As TextBox
101 | Friend WithEvents ValueTextbox As TextBox
102 | Friend WithEvents SearchButton As Button
103 | End Class
104 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolMultiStringData.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolMultiStringData
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.TextName = New System.Windows.Forms.TextBox()
28 | Me.TextData = New System.Windows.Forms.TextBox()
29 | Me.ButtonOK = New System.Windows.Forms.Button()
30 | Label1 = New System.Windows.Forms.Label()
31 | Label2 = New System.Windows.Forms.Label()
32 | Me.SuspendLayout()
33 | '
34 | 'Label1
35 | '
36 | Label1.AutoSize = True
37 | Label1.Location = New System.Drawing.Point(12, 15)
38 | Label1.Name = "Label1"
39 | Label1.Size = New System.Drawing.Size(63, 13)
40 | Label1.TabIndex = 1
41 | Label1.Text = "Value name"
42 | '
43 | 'TextName
44 | '
45 | Me.TextName.Location = New System.Drawing.Point(81, 12)
46 | Me.TextName.Name = "TextName"
47 | Me.TextName.ReadOnly = True
48 | Me.TextName.Size = New System.Drawing.Size(262, 20)
49 | Me.TextName.TabIndex = 0
50 | '
51 | 'TextData
52 | '
53 | Me.TextData.Location = New System.Drawing.Point(81, 38)
54 | Me.TextData.Multiline = True
55 | Me.TextData.Name = "TextData"
56 | Me.TextData.ScrollBars = System.Windows.Forms.ScrollBars.Both
57 | Me.TextData.Size = New System.Drawing.Size(262, 128)
58 | Me.TextData.TabIndex = 2
59 | '
60 | 'Label2
61 | '
62 | Label2.AutoSize = True
63 | Label2.Location = New System.Drawing.Point(12, 41)
64 | Label2.Name = "Label2"
65 | Label2.Size = New System.Drawing.Size(39, 13)
66 | Label2.TabIndex = 3
67 | Label2.Text = "Entries"
68 | '
69 | 'ButtonOK
70 | '
71 | Me.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK
72 | Me.ButtonOK.Location = New System.Drawing.Point(268, 172)
73 | Me.ButtonOK.Name = "ButtonOK"
74 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
75 | Me.ButtonOK.TabIndex = 4
76 | Me.ButtonOK.Text = "OK"
77 | Me.ButtonOK.UseVisualStyleBackColor = True
78 | '
79 | 'EditPolMultiStringData
80 | '
81 | Me.AcceptButton = Me.ButtonOK
82 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
83 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
84 | Me.ClientSize = New System.Drawing.Size(355, 207)
85 | Me.Controls.Add(Me.ButtonOK)
86 | Me.Controls.Add(Label2)
87 | Me.Controls.Add(Me.TextData)
88 | Me.Controls.Add(Label1)
89 | Me.Controls.Add(Me.TextName)
90 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
91 | Me.MaximizeBox = False
92 | Me.MinimizeBox = False
93 | Me.Name = "EditPolMultiStringData"
94 | Me.ShowIcon = False
95 | Me.ShowInTaskbar = False
96 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
97 | Me.Text = "Edit String List"
98 | Me.ResumeLayout(False)
99 | Me.PerformLayout()
100 |
101 | End Sub
102 |
103 | Friend WithEvents TextName As TextBox
104 | Friend WithEvents TextData As TextBox
105 | Friend WithEvents ButtonOK As Button
106 | End Class
107 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolValue.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolValue
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.ComboKind = New System.Windows.Forms.ComboBox()
28 | Me.ButtonOK = New System.Windows.Forms.Button()
29 | Me.TextName = New System.Windows.Forms.TextBox()
30 | Label1 = New System.Windows.Forms.Label()
31 | Label2 = New System.Windows.Forms.Label()
32 | Me.SuspendLayout()
33 | '
34 | 'ComboKind
35 | '
36 | Me.ComboKind.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
37 | Me.ComboKind.FormattingEnabled = True
38 | Me.ComboKind.Items.AddRange(New Object() {"String", "Expandable string", "List of strings", "32-bit DWord", "64-bit QWord"})
39 | Me.ComboKind.Location = New System.Drawing.Point(115, 38)
40 | Me.ComboKind.Name = "ComboKind"
41 | Me.ComboKind.Size = New System.Drawing.Size(162, 21)
42 | Me.ComboKind.TabIndex = 2
43 | '
44 | 'Label1
45 | '
46 | Label1.AutoSize = True
47 | Label1.Location = New System.Drawing.Point(12, 41)
48 | Label1.Name = "Label1"
49 | Label1.Size = New System.Drawing.Size(97, 13)
50 | Label1.TabIndex = 1
51 | Label1.Text = "Registry value type"
52 | '
53 | 'ButtonOK
54 | '
55 | Me.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK
56 | Me.ButtonOK.Location = New System.Drawing.Point(202, 65)
57 | Me.ButtonOK.Name = "ButtonOK"
58 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
59 | Me.ButtonOK.TabIndex = 3
60 | Me.ButtonOK.Text = "OK"
61 | Me.ButtonOK.UseVisualStyleBackColor = True
62 | '
63 | 'TextName
64 | '
65 | Me.TextName.Location = New System.Drawing.Point(115, 12)
66 | Me.TextName.Name = "TextName"
67 | Me.TextName.Size = New System.Drawing.Size(162, 20)
68 | Me.TextName.TabIndex = 1
69 | '
70 | 'Label2
71 | '
72 | Label2.AutoSize = True
73 | Label2.Location = New System.Drawing.Point(12, 15)
74 | Label2.Name = "Label2"
75 | Label2.Size = New System.Drawing.Size(63, 13)
76 | Label2.TabIndex = 4
77 | Label2.Text = "Value name"
78 | '
79 | 'EditPolValue
80 | '
81 | Me.AcceptButton = Me.ButtonOK
82 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
83 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
84 | Me.ClientSize = New System.Drawing.Size(289, 100)
85 | Me.Controls.Add(Label2)
86 | Me.Controls.Add(Me.TextName)
87 | Me.Controls.Add(Me.ButtonOK)
88 | Me.Controls.Add(Label1)
89 | Me.Controls.Add(Me.ComboKind)
90 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
91 | Me.MaximizeBox = False
92 | Me.MinimizeBox = False
93 | Me.Name = "EditPolValue"
94 | Me.ShowIcon = False
95 | Me.ShowInTaskbar = False
96 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
97 | Me.Text = "New Value"
98 | Me.ResumeLayout(False)
99 | Me.PerformLayout()
100 |
101 | End Sub
102 |
103 | Friend WithEvents ComboKind As ComboBox
104 | Friend WithEvents ButtonOK As Button
105 | Friend WithEvents TextName As TextBox
106 | End Class
107 |
--------------------------------------------------------------------------------
/PolicyPlus/LoadedAdmx.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class LoadedAdmx
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.LsvAdmx = New System.Windows.Forms.ListView()
26 | Me.ChFileTitle = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
27 | Me.ChFolder = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
28 | Me.ChNamespace = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
29 | Me.ButtonClose = New System.Windows.Forms.Button()
30 | Me.SuspendLayout()
31 | '
32 | 'LsvAdmx
33 | '
34 | Me.LsvAdmx.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
35 | Or System.Windows.Forms.AnchorStyles.Left) _
36 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
37 | Me.LsvAdmx.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ChFileTitle, Me.ChFolder, Me.ChNamespace})
38 | Me.LsvAdmx.FullRowSelect = True
39 | Me.LsvAdmx.HideSelection = False
40 | Me.LsvAdmx.Location = New System.Drawing.Point(12, 12)
41 | Me.LsvAdmx.MultiSelect = False
42 | Me.LsvAdmx.Name = "LsvAdmx"
43 | Me.LsvAdmx.ShowItemToolTips = True
44 | Me.LsvAdmx.Size = New System.Drawing.Size(487, 233)
45 | Me.LsvAdmx.TabIndex = 0
46 | Me.LsvAdmx.UseCompatibleStateImageBehavior = False
47 | Me.LsvAdmx.View = System.Windows.Forms.View.Details
48 | '
49 | 'ChFileTitle
50 | '
51 | Me.ChFileTitle.Text = "File"
52 | Me.ChFileTitle.Width = 88
53 | '
54 | 'ChFolder
55 | '
56 | Me.ChFolder.Text = "Folder"
57 | Me.ChFolder.Width = 203
58 | '
59 | 'ChNamespace
60 | '
61 | Me.ChNamespace.Text = "Namespace"
62 | Me.ChNamespace.Width = 172
63 | '
64 | 'ButtonClose
65 | '
66 | Me.ButtonClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
67 | Me.ButtonClose.DialogResult = System.Windows.Forms.DialogResult.OK
68 | Me.ButtonClose.Location = New System.Drawing.Point(424, 251)
69 | Me.ButtonClose.Name = "ButtonClose"
70 | Me.ButtonClose.Size = New System.Drawing.Size(75, 23)
71 | Me.ButtonClose.TabIndex = 1
72 | Me.ButtonClose.Text = "Close"
73 | Me.ButtonClose.UseVisualStyleBackColor = True
74 | '
75 | 'LoadedAdmx
76 | '
77 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
78 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
79 | Me.CancelButton = Me.ButtonClose
80 | Me.ClientSize = New System.Drawing.Size(511, 286)
81 | Me.Controls.Add(Me.ButtonClose)
82 | Me.Controls.Add(Me.LsvAdmx)
83 | Me.MaximizeBox = False
84 | Me.MinimizeBox = False
85 | Me.Name = "LoadedAdmx"
86 | Me.ShowIcon = False
87 | Me.ShowInTaskbar = False
88 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
89 | Me.Text = "Loaded ADMX Files"
90 | Me.ResumeLayout(False)
91 |
92 | End Sub
93 |
94 | Friend WithEvents LsvAdmx As ListView
95 | Friend WithEvents ChFileTitle As ColumnHeader
96 | Friend WithEvents ChFolder As ColumnHeader
97 | Friend WithEvents ChNamespace As ColumnHeader
98 | Friend WithEvents ButtonClose As Button
99 | End Class
100 |
--------------------------------------------------------------------------------
/PolicyPlus/ImportReg.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class ImportReg
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.TextReg = New System.Windows.Forms.TextBox()
28 | Me.TextRoot = New System.Windows.Forms.TextBox()
29 | Me.ButtonBrowse = New System.Windows.Forms.Button()
30 | Me.ButtonImport = New System.Windows.Forms.Button()
31 | Label1 = New System.Windows.Forms.Label()
32 | Label2 = New System.Windows.Forms.Label()
33 | Me.SuspendLayout()
34 | '
35 | 'Label1
36 | '
37 | Label1.AutoSize = True
38 | Label1.Location = New System.Drawing.Point(12, 15)
39 | Label1.Name = "Label1"
40 | Label1.Size = New System.Drawing.Size(46, 13)
41 | Label1.TabIndex = 0
42 | Label1.Text = "REG file"
43 | '
44 | 'Label2
45 | '
46 | Label2.AutoSize = True
47 | Label2.Location = New System.Drawing.Point(12, 41)
48 | Label2.Name = "Label2"
49 | Label2.Size = New System.Drawing.Size(33, 13)
50 | Label2.TabIndex = 3
51 | Label2.Text = "Prefix"
52 | '
53 | 'TextReg
54 | '
55 | Me.TextReg.Location = New System.Drawing.Point(64, 12)
56 | Me.TextReg.Name = "TextReg"
57 | Me.TextReg.Size = New System.Drawing.Size(195, 20)
58 | Me.TextReg.TabIndex = 1
59 | '
60 | 'TextRoot
61 | '
62 | Me.TextRoot.Location = New System.Drawing.Point(64, 38)
63 | Me.TextRoot.Name = "TextRoot"
64 | Me.TextRoot.Size = New System.Drawing.Size(276, 20)
65 | Me.TextRoot.TabIndex = 3
66 | '
67 | 'ButtonBrowse
68 | '
69 | Me.ButtonBrowse.Location = New System.Drawing.Point(265, 10)
70 | Me.ButtonBrowse.Name = "ButtonBrowse"
71 | Me.ButtonBrowse.Size = New System.Drawing.Size(75, 23)
72 | Me.ButtonBrowse.TabIndex = 2
73 | Me.ButtonBrowse.Text = "Browse"
74 | Me.ButtonBrowse.UseVisualStyleBackColor = True
75 | '
76 | 'ButtonImport
77 | '
78 | Me.ButtonImport.Location = New System.Drawing.Point(265, 64)
79 | Me.ButtonImport.Name = "ButtonImport"
80 | Me.ButtonImport.Size = New System.Drawing.Size(75, 23)
81 | Me.ButtonImport.TabIndex = 4
82 | Me.ButtonImport.Text = "Import"
83 | Me.ButtonImport.UseVisualStyleBackColor = True
84 | '
85 | 'ImportReg
86 | '
87 | Me.AcceptButton = Me.ButtonImport
88 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
89 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
90 | Me.ClientSize = New System.Drawing.Size(352, 99)
91 | Me.Controls.Add(Me.ButtonImport)
92 | Me.Controls.Add(Me.ButtonBrowse)
93 | Me.Controls.Add(Label2)
94 | Me.Controls.Add(Me.TextRoot)
95 | Me.Controls.Add(Me.TextReg)
96 | Me.Controls.Add(Label1)
97 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
98 | Me.KeyPreview = True
99 | Me.MaximizeBox = False
100 | Me.MinimizeBox = False
101 | Me.Name = "ImportReg"
102 | Me.ShowIcon = False
103 | Me.ShowInTaskbar = False
104 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
105 | Me.Text = "Import REG"
106 | Me.ResumeLayout(False)
107 | Me.PerformLayout()
108 |
109 | End Sub
110 |
111 | Friend WithEvents TextReg As TextBox
112 | Friend WithEvents TextRoot As TextBox
113 | Friend WithEvents ButtonBrowse As Button
114 | Friend WithEvents ButtonImport As Button
115 | End Class
116 |
--------------------------------------------------------------------------------
/PolicyPlus/OpenUserGpo.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class OpenUserGpo
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.UsernameTextbox = New System.Windows.Forms.TextBox()
28 | Me.SearchButton = New System.Windows.Forms.Button()
29 | Me.SidTextbox = New System.Windows.Forms.TextBox()
30 | Me.OkButton = New System.Windows.Forms.Button()
31 | Label1 = New System.Windows.Forms.Label()
32 | Label2 = New System.Windows.Forms.Label()
33 | Me.SuspendLayout()
34 | '
35 | 'Label1
36 | '
37 | Label1.AutoSize = True
38 | Label1.Location = New System.Drawing.Point(12, 15)
39 | Label1.Name = "Label1"
40 | Label1.Size = New System.Drawing.Size(95, 13)
41 | Label1.TabIndex = 0
42 | Label1.Text = "Look up username"
43 | '
44 | 'Label2
45 | '
46 | Label2.AutoSize = True
47 | Label2.Location = New System.Drawing.Point(12, 41)
48 | Label2.Name = "Label2"
49 | Label2.Size = New System.Drawing.Size(25, 13)
50 | Label2.TabIndex = 3
51 | Label2.Text = "SID"
52 | '
53 | 'UsernameTextbox
54 | '
55 | Me.UsernameTextbox.Location = New System.Drawing.Point(113, 12)
56 | Me.UsernameTextbox.Name = "UsernameTextbox"
57 | Me.UsernameTextbox.Size = New System.Drawing.Size(153, 20)
58 | Me.UsernameTextbox.TabIndex = 1
59 | '
60 | 'SearchButton
61 | '
62 | Me.SearchButton.Location = New System.Drawing.Point(272, 10)
63 | Me.SearchButton.Name = "SearchButton"
64 | Me.SearchButton.Size = New System.Drawing.Size(57, 23)
65 | Me.SearchButton.TabIndex = 2
66 | Me.SearchButton.Text = "Search"
67 | Me.SearchButton.UseVisualStyleBackColor = True
68 | '
69 | 'SidTextbox
70 | '
71 | Me.SidTextbox.Location = New System.Drawing.Point(43, 38)
72 | Me.SidTextbox.Name = "SidTextbox"
73 | Me.SidTextbox.Size = New System.Drawing.Size(286, 20)
74 | Me.SidTextbox.TabIndex = 3
75 | '
76 | 'OkButton
77 | '
78 | Me.OkButton.Location = New System.Drawing.Point(254, 64)
79 | Me.OkButton.Name = "OkButton"
80 | Me.OkButton.Size = New System.Drawing.Size(75, 23)
81 | Me.OkButton.TabIndex = 4
82 | Me.OkButton.Text = "OK"
83 | Me.OkButton.UseVisualStyleBackColor = True
84 | '
85 | 'OpenUserGpo
86 | '
87 | Me.AcceptButton = Me.OkButton
88 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
89 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
90 | Me.ClientSize = New System.Drawing.Size(341, 99)
91 | Me.Controls.Add(Me.OkButton)
92 | Me.Controls.Add(Me.SidTextbox)
93 | Me.Controls.Add(Label2)
94 | Me.Controls.Add(Me.SearchButton)
95 | Me.Controls.Add(Me.UsernameTextbox)
96 | Me.Controls.Add(Label1)
97 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
98 | Me.KeyPreview = True
99 | Me.MaximizeBox = False
100 | Me.MinimizeBox = False
101 | Me.Name = "OpenUserGpo"
102 | Me.ShowIcon = False
103 | Me.ShowInTaskbar = False
104 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
105 | Me.Text = "Select User SID"
106 | Me.ResumeLayout(False)
107 | Me.PerformLayout()
108 |
109 | End Sub
110 |
111 | Friend WithEvents UsernameTextbox As TextBox
112 | Friend WithEvents SearchButton As Button
113 | Friend WithEvents SidTextbox As TextBox
114 | Friend WithEvents OkButton As Button
115 | End Class
116 |
--------------------------------------------------------------------------------
/PolicyPlus/FindByText.vb:
--------------------------------------------------------------------------------
1 | Public Class FindByText
2 | Dim CommentSources() As Dictionary(Of String, String)
3 | Public Searcher As Func(Of PolicyPlusPolicy, Boolean)
4 | Public Function PresentDialog(ParamArray CommentDicts() As Dictionary(Of String, String)) As DialogResult
5 | CommentSources = CommentDicts.Where(Function(d) d IsNot Nothing).ToArray
6 | Return ShowDialog()
7 | End Function
8 | Private Sub FindByText_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
9 | If e.KeyCode = Keys.Escape Then DialogResult = DialogResult.Cancel
10 | End Sub
11 | Private Sub SearchButton_Click(sender As Object, e As EventArgs) Handles SearchButton.Click
12 | Dim text = StringTextbox.Text
13 | If text = "" Then
14 | MsgBox("Please enter search terms.", MsgBoxStyle.Exclamation)
15 | Exit Sub
16 | End If
17 | Dim checkTitle = TitleCheckbox.Checked
18 | Dim checkDesc = DescriptionCheckbox.Checked
19 | Dim checkComment = CommentCheckbox.Checked
20 | If Not (checkTitle Or checkDesc Or checkComment) Then
21 | MsgBox("At least one attribute must be searched. Check one of the boxes and try again.", MsgBoxStyle.Exclamation)
22 | Exit Sub
23 | End If
24 | Searcher = Function(Policy As PolicyPlusPolicy) As Boolean
25 | Dim cleanupStr = Function(RawText As String) As String
26 | Return New String(Trim(RawText.ToLowerInvariant).Where(Function(c) Not ".,'"";/!(){}[]".Contains(c)).ToArray)
27 | End Function
28 | ' Parse the query string for wildcards or quoted strings
29 | Dim rawSplitted = Split(text)
30 | Dim simpleWords As New List(Of String)
31 | Dim wildcards As New List(Of String)
32 | Dim quotedStrings As New List(Of String)
33 | Dim partialQuotedString As String = ""
34 | For n = 0 To rawSplitted.Length - 1
35 | Dim curString = rawSplitted(n)
36 | If partialQuotedString <> "" Then
37 | partialQuotedString &= curString & " "
38 | If curString.EndsWith("""") Then
39 | quotedStrings.Add(cleanupStr(partialQuotedString))
40 | partialQuotedString = ""
41 | End If
42 | ElseIf curString.StartsWith("""") Then
43 | partialQuotedString = curString & " "
44 | ElseIf curString.Contains("*") Or curString.Contains("?") Then
45 | wildcards.Add(cleanupStr(curString))
46 | Else
47 | simpleWords.Add(cleanupStr(curString))
48 | End If
49 | Next
50 | ' Do the searching
51 | Dim isStringAHit = Function(SearchedText As String) As Boolean
52 | Dim cleanText = cleanupStr(SearchedText)
53 | Dim wordsInText = Split(cleanText)
54 | Return simpleWords.All(Function(w) wordsInText.Contains(w)) And ' Plain search terms
55 | wildcards.All(Function(w) wordsInText.Any(Function(wit) wit Like w)) And ' Wildcards
56 | quotedStrings.All(Function(w) cleanText.Contains(" " & w & " ") Or cleanText.StartsWith(w & " ") Or ' Quoted strings
57 | cleanText.EndsWith(" " & w) Or cleanText = w)
58 | End Function
59 | If checkTitle Then
60 | If isStringAHit(Policy.DisplayName) Then Return True
61 | End If
62 | If checkDesc Then
63 | If isStringAHit(Policy.DisplayExplanation) Then Return True
64 | End If
65 | If checkComment Then
66 | If CommentSources.Any(Function(Source As Dictionary(Of String, String))
67 | Return Source.ContainsKey(Policy.UniqueID) AndAlso isStringAHit(Source(Policy.UniqueID))
68 | End Function) Then Return True
69 | End If
70 | Return False
71 | End Function
72 | DialogResult = DialogResult.OK
73 | End Sub
74 | End Class
--------------------------------------------------------------------------------
/PolicyPlus/LoadedSupportDefinitions.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class LoadedSupportDefinitions
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Me.LsvSupport = New System.Windows.Forms.ListView()
27 | Me.ChName = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
28 | Me.ChDefinedIn = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
29 | Me.ButtonClose = New System.Windows.Forms.Button()
30 | Me.TextFilter = New System.Windows.Forms.TextBox()
31 | Label1 = New System.Windows.Forms.Label()
32 | Me.SuspendLayout()
33 | '
34 | 'Label1
35 | '
36 | Label1.AutoSize = True
37 | Label1.Location = New System.Drawing.Point(12, 15)
38 | Label1.Name = "Label1"
39 | Label1.Size = New System.Drawing.Size(79, 13)
40 | Label1.TabIndex = 3
41 | Label1.Text = "Substring (filter)"
42 | '
43 | 'LsvSupport
44 | '
45 | Me.LsvSupport.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ChName, Me.ChDefinedIn})
46 | Me.LsvSupport.FullRowSelect = True
47 | Me.LsvSupport.Location = New System.Drawing.Point(12, 38)
48 | Me.LsvSupport.MultiSelect = False
49 | Me.LsvSupport.Name = "LsvSupport"
50 | Me.LsvSupport.ShowItemToolTips = True
51 | Me.LsvSupport.Size = New System.Drawing.Size(435, 190)
52 | Me.LsvSupport.TabIndex = 2
53 | Me.LsvSupport.UseCompatibleStateImageBehavior = False
54 | Me.LsvSupport.View = System.Windows.Forms.View.Details
55 | '
56 | 'ChName
57 | '
58 | Me.ChName.Text = "Name"
59 | Me.ChName.Width = 317
60 | '
61 | 'ChDefinedIn
62 | '
63 | Me.ChDefinedIn.Text = "ADMX File"
64 | Me.ChDefinedIn.Width = 97
65 | '
66 | 'ButtonClose
67 | '
68 | Me.ButtonClose.DialogResult = System.Windows.Forms.DialogResult.OK
69 | Me.ButtonClose.Location = New System.Drawing.Point(372, 234)
70 | Me.ButtonClose.Name = "ButtonClose"
71 | Me.ButtonClose.Size = New System.Drawing.Size(75, 23)
72 | Me.ButtonClose.TabIndex = 3
73 | Me.ButtonClose.Text = "Close"
74 | Me.ButtonClose.UseVisualStyleBackColor = True
75 | '
76 | 'TextFilter
77 | '
78 | Me.TextFilter.Location = New System.Drawing.Point(97, 12)
79 | Me.TextFilter.Name = "TextFilter"
80 | Me.TextFilter.Size = New System.Drawing.Size(350, 20)
81 | Me.TextFilter.TabIndex = 1
82 | '
83 | 'LoadedSupportDefinitions
84 | '
85 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
86 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
87 | Me.CancelButton = Me.ButtonClose
88 | Me.ClientSize = New System.Drawing.Size(459, 269)
89 | Me.Controls.Add(Label1)
90 | Me.Controls.Add(Me.TextFilter)
91 | Me.Controls.Add(Me.ButtonClose)
92 | Me.Controls.Add(Me.LsvSupport)
93 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
94 | Me.MaximizeBox = False
95 | Me.MinimizeBox = False
96 | Me.Name = "LoadedSupportDefinitions"
97 | Me.ShowIcon = False
98 | Me.ShowInTaskbar = False
99 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
100 | Me.Text = "All Support Definitions"
101 | Me.ResumeLayout(False)
102 | Me.PerformLayout()
103 |
104 | End Sub
105 |
106 | Friend WithEvents LsvSupport As ListView
107 | Friend WithEvents ChName As ColumnHeader
108 | Friend WithEvents ChDefinedIn As ColumnHeader
109 | Friend WithEvents ButtonClose As Button
110 | Friend WithEvents TextFilter As TextBox
111 | End Class
112 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Policy Plus
2 | Local Group Policy Editor plus more, for all Windows editions.
3 |
4 | [](https://github.com/Fleex255/PolicyPlus/actions/workflows/latest.yml)
5 |
6 | ## Goals
7 | Policy Plus is intended to make the power of Group Policy settings available to everyone.
8 |
9 | * Run and work on all Windows editions, not just Pro and Enterprise
10 | * Comply fully with licensing (i.e. transplant no components across Windows installations)
11 | * View and edit Registry-based policies in local GPOs, per-user GPOs, individual POL files, offline Registry user hives, and the live Registry
12 | * Navigate to policies by ID, text, or affected Registry entries
13 | * Show additional technical information about objects (policies, categories, products)
14 | * Provide convenient ways to share and import policy settings
15 |
16 | Non-Registry-based policies (i.e. items outside the Administrative Templates branch of the Group Policy Editor) currently have no priority,
17 | but they may be reconsidered at a later date.
18 |
19 | ## Quick intro
20 | At startup, Policy Plus opens the last saved policy source, or the local Group Policy Object (Local GPO) by default.
21 | To open a different policy source (like a Registry branch or a per-user GPO), use *File | Open Policy Resources*.
22 |
23 | Much like the official Group Policy editor, categories are shown in the left tree.
24 | Information on the selected object is shown in the middle.
25 | Policies and subcategories in the selected category are shown in the right list.
26 | By default, both user and computer policies are displayed, but you can focus on just one policy source using the drop-down in the upper left.
27 |
28 | To edit a policy, double-click it. If the selected setting applies to both users and computers,
29 | you can switch sections with the "Editing for" drop-down. Click OK to keep the changes to the setting.
30 | **Notice:** If a policy source is backed by a POL file (like Local GPO),
31 | changes to it will not be committed to disk until you use *File | Save Policies* (Ctrl+S).
32 |
33 | ## System requirements
34 | Policy Plus requires .NET Framework 4.5.2 or newer. That can be installed on Windows Vista or newer,
35 | and comes preinstalled on Windows 10 or newer.
36 | Policy Plus should also work on the corresponding server OSes: Windows Server 2008 (SP2) or newer.
37 | The standard [.NET Framework hardware requirements](https://docs.microsoft.com/en-us/dotnet/framework/get-started/system-requirements)
38 | are sufficient for Policy Plus.
39 |
40 | ## Special considerations for use on Home editions
41 | Some administrative templates are present by default on these editions, but many are missing.
42 | The newest full package can be downloaded from Microsoft and installed with *Help | Acquire ADMX Files*.
43 |
44 | The `RefreshPolicyEx` native function has reduced functionality on editions without full Group Policy infrastructure,
45 | so while Policy Plus can edit the local GPO and apply the changes to the Registry,
46 | a reboot or logon/logoff cycle is required for some policy changes to take effect.
47 |
48 | When saving User policies, the simulated policy refresh from the local GPO to the Registry is done only for the current user.
49 | Similarly, editing per-user local GPOs (a fairly arcane Windows feature not to be confused with the User section),
50 | has no effect on these limited editions of Windows.
51 | To change a policy for a different user, modify their Registry directly by opening a "user hive" or "local Registry" source.
52 |
53 | ## Status
54 | Policy Plus is usable on all editions. It can load and save all policy sources successfully. More features may be still to come, though.
55 |
56 | ## Download
57 | [Download a release build from the Releases page.](https://github.com/Fleex255/PolicyPlus/releases)
58 | Updates are published as GitHub releases after it is verified that they are fit for public use.
59 | Note that Policy Plus is still pre-release software, so there may be bugs; please submit any problems to the issue tracker.
60 |
61 | [Download the latest build.](https://s3-us-west-2.amazonaws.com/policy-plus/PolicyPlusLatest.exe)
62 | This link is updated automatically by GitHub Actions after *every commit*.
63 | It may include more features, but those features will be less tested and could have unintended effects.
64 | Please be careful.
65 |
66 | **N.B.** A few antivirus programs incorrectly flag Policy Plus as malware.
67 | Policy Plus is a powerful tool and so may cause problems if used recklessly, but it is not malicious.
68 | If you would prefer to not trust binaries, feel free to read the code and [compile Policy Plus from source](https://github.com/Fleex255/PolicyPlus/blob/master/COMPILE.md).
69 | You can also verify that a build was created from the published code by examining the output of a GitHub Actions run:
70 | the input commit hash can be found under "checkout master" and the output executable hash can be found under "compute hash."
71 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolNumericData.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolNumericData
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Me.TextName = New System.Windows.Forms.TextBox()
28 | Me.CheckHexadecimal = New System.Windows.Forms.CheckBox()
29 | Me.NumData = New PolicyPlus.WideRangeNumericUpDown()
30 | Me.ButtonOK = New System.Windows.Forms.Button()
31 | Label1 = New System.Windows.Forms.Label()
32 | Label2 = New System.Windows.Forms.Label()
33 | CType(Me.NumData, System.ComponentModel.ISupportInitialize).BeginInit()
34 | Me.SuspendLayout()
35 | '
36 | 'Label1
37 | '
38 | Label1.AutoSize = True
39 | Label1.Location = New System.Drawing.Point(12, 15)
40 | Label1.Name = "Label1"
41 | Label1.Size = New System.Drawing.Size(63, 13)
42 | Label1.TabIndex = 1
43 | Label1.Text = "Value name"
44 | '
45 | 'Label2
46 | '
47 | Label2.AutoSize = True
48 | Label2.Location = New System.Drawing.Point(12, 41)
49 | Label2.Name = "Label2"
50 | Label2.Size = New System.Drawing.Size(44, 13)
51 | Label2.TabIndex = 3
52 | Label2.Text = "Number"
53 | '
54 | 'TextName
55 | '
56 | Me.TextName.Location = New System.Drawing.Point(81, 12)
57 | Me.TextName.Name = "TextName"
58 | Me.TextName.ReadOnly = True
59 | Me.TextName.Size = New System.Drawing.Size(230, 20)
60 | Me.TextName.TabIndex = 0
61 | '
62 | 'CheckHexadecimal
63 | '
64 | Me.CheckHexadecimal.AutoSize = True
65 | Me.CheckHexadecimal.Location = New System.Drawing.Point(224, 40)
66 | Me.CheckHexadecimal.Name = "CheckHexadecimal"
67 | Me.CheckHexadecimal.Size = New System.Drawing.Size(87, 17)
68 | Me.CheckHexadecimal.TabIndex = 2
69 | Me.CheckHexadecimal.Text = "Hexadecimal"
70 | Me.CheckHexadecimal.UseVisualStyleBackColor = True
71 | '
72 | 'NumData
73 | '
74 | Me.NumData.Location = New System.Drawing.Point(81, 37)
75 | Me.NumData.Name = "NumData"
76 | Me.NumData.Size = New System.Drawing.Size(137, 20)
77 | Me.NumData.TabIndex = 1
78 | '
79 | 'ButtonOK
80 | '
81 | Me.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK
82 | Me.ButtonOK.Location = New System.Drawing.Point(236, 63)
83 | Me.ButtonOK.Name = "ButtonOK"
84 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
85 | Me.ButtonOK.TabIndex = 3
86 | Me.ButtonOK.Text = "OK"
87 | Me.ButtonOK.UseVisualStyleBackColor = True
88 | '
89 | 'EditPolNumericData
90 | '
91 | Me.AcceptButton = Me.ButtonOK
92 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
93 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
94 | Me.ClientSize = New System.Drawing.Size(323, 98)
95 | Me.Controls.Add(Me.ButtonOK)
96 | Me.Controls.Add(Me.NumData)
97 | Me.Controls.Add(Me.CheckHexadecimal)
98 | Me.Controls.Add(Label2)
99 | Me.Controls.Add(Label1)
100 | Me.Controls.Add(Me.TextName)
101 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
102 | Me.MaximizeBox = False
103 | Me.MinimizeBox = False
104 | Me.Name = "EditPolNumericData"
105 | Me.ShowIcon = False
106 | Me.ShowInTaskbar = False
107 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
108 | Me.Text = "Edit Number"
109 | CType(Me.NumData, System.ComponentModel.ISupportInitialize).EndInit()
110 | Me.ResumeLayout(False)
111 | Me.PerformLayout()
112 |
113 | End Sub
114 |
115 | Friend WithEvents TextName As TextBox
116 | Friend WithEvents CheckHexadecimal As CheckBox
117 | Friend WithEvents ButtonOK As Button
118 | Friend WithEvents NumData As WideRangeNumericUpDown
119 | End Class
120 |
--------------------------------------------------------------------------------
/PolicyPlus/FindByText.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class FindByText
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.StringTextbox = New System.Windows.Forms.TextBox()
26 | Me.TitleCheckbox = New System.Windows.Forms.CheckBox()
27 | Me.DescriptionCheckbox = New System.Windows.Forms.CheckBox()
28 | Me.CommentCheckbox = New System.Windows.Forms.CheckBox()
29 | Me.SearchButton = New System.Windows.Forms.Button()
30 | Me.SuspendLayout()
31 | '
32 | 'StringTextbox
33 | '
34 | Me.StringTextbox.Location = New System.Drawing.Point(12, 12)
35 | Me.StringTextbox.Name = "StringTextbox"
36 | Me.StringTextbox.Size = New System.Drawing.Size(352, 20)
37 | Me.StringTextbox.TabIndex = 0
38 | '
39 | 'TitleCheckbox
40 | '
41 | Me.TitleCheckbox.AutoSize = True
42 | Me.TitleCheckbox.Checked = True
43 | Me.TitleCheckbox.CheckState = System.Windows.Forms.CheckState.Checked
44 | Me.TitleCheckbox.Location = New System.Drawing.Point(12, 38)
45 | Me.TitleCheckbox.Name = "TitleCheckbox"
46 | Me.TitleCheckbox.Size = New System.Drawing.Size(54, 17)
47 | Me.TitleCheckbox.TabIndex = 1
48 | Me.TitleCheckbox.Text = "In title"
49 | Me.TitleCheckbox.UseVisualStyleBackColor = True
50 | '
51 | 'DescriptionCheckbox
52 | '
53 | Me.DescriptionCheckbox.AutoSize = True
54 | Me.DescriptionCheckbox.Checked = True
55 | Me.DescriptionCheckbox.CheckState = System.Windows.Forms.CheckState.Checked
56 | Me.DescriptionCheckbox.Location = New System.Drawing.Point(72, 38)
57 | Me.DescriptionCheckbox.Name = "DescriptionCheckbox"
58 | Me.DescriptionCheckbox.Size = New System.Drawing.Size(89, 17)
59 | Me.DescriptionCheckbox.TabIndex = 2
60 | Me.DescriptionCheckbox.Text = "In description"
61 | Me.DescriptionCheckbox.UseVisualStyleBackColor = True
62 | '
63 | 'CommentCheckbox
64 | '
65 | Me.CommentCheckbox.AutoSize = True
66 | Me.CommentCheckbox.Checked = True
67 | Me.CommentCheckbox.CheckState = System.Windows.Forms.CheckState.Checked
68 | Me.CommentCheckbox.Location = New System.Drawing.Point(167, 38)
69 | Me.CommentCheckbox.Name = "CommentCheckbox"
70 | Me.CommentCheckbox.Size = New System.Drawing.Size(81, 17)
71 | Me.CommentCheckbox.TabIndex = 3
72 | Me.CommentCheckbox.Text = "In comment"
73 | Me.CommentCheckbox.UseVisualStyleBackColor = True
74 | '
75 | 'SearchButton
76 | '
77 | Me.SearchButton.Location = New System.Drawing.Point(289, 61)
78 | Me.SearchButton.Name = "SearchButton"
79 | Me.SearchButton.Size = New System.Drawing.Size(75, 23)
80 | Me.SearchButton.TabIndex = 4
81 | Me.SearchButton.Text = "Search"
82 | Me.SearchButton.UseVisualStyleBackColor = True
83 | '
84 | 'FindByText
85 | '
86 | Me.AcceptButton = Me.SearchButton
87 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
88 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
89 | Me.ClientSize = New System.Drawing.Size(376, 96)
90 | Me.Controls.Add(Me.SearchButton)
91 | Me.Controls.Add(Me.CommentCheckbox)
92 | Me.Controls.Add(Me.DescriptionCheckbox)
93 | Me.Controls.Add(Me.TitleCheckbox)
94 | Me.Controls.Add(Me.StringTextbox)
95 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
96 | Me.KeyPreview = True
97 | Me.MaximizeBox = False
98 | Me.MinimizeBox = False
99 | Me.Name = "FindByText"
100 | Me.ShowIcon = False
101 | Me.ShowInTaskbar = False
102 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
103 | Me.Text = "Find by Text"
104 | Me.ResumeLayout(False)
105 | Me.PerformLayout()
106 |
107 | End Sub
108 |
109 | Friend WithEvents StringTextbox As TextBox
110 | Friend WithEvents TitleCheckbox As CheckBox
111 | Friend WithEvents DescriptionCheckbox As CheckBox
112 | Friend WithEvents CommentCheckbox As CheckBox
113 | Friend WithEvents SearchButton As Button
114 | End Class
115 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Autogenerated version file
2 | Version.vb
3 |
4 | ## Ignore Visual Studio temporary files, build results, and
5 | ## files generated by popular Visual Studio add-ons.
6 |
7 | # User-specific files
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # DNX
47 | project.lock.json
48 | artifacts/
49 |
50 | *_i.c
51 | *_p.c
52 | *_i.h
53 | *.ilk
54 | *.meta
55 | *.obj
56 | *.pch
57 | *.pdb
58 | *.pgc
59 | *.pgd
60 | *.rsp
61 | *.sbr
62 | *.tlb
63 | *.tli
64 | *.tlh
65 | *.tmp
66 | *.tmp_proj
67 | *.log
68 | *.vspscc
69 | *.vssscc
70 | .builds
71 | *.pidb
72 | *.svclog
73 | *.scc
74 |
75 | # Chutzpah Test files
76 | _Chutzpah*
77 |
78 | # Visual C++ cache files
79 | ipch/
80 | *.aps
81 | *.ncb
82 | *.opendb
83 | *.opensdf
84 | *.sdf
85 | *.cachefile
86 | *.VC.db
87 | *.VC.VC.opendb
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 | *.sap
94 |
95 | # TFS 2012 Local Workspace
96 | $tf/
97 |
98 | # Guidance Automation Toolkit
99 | *.gpState
100 |
101 | # ReSharper is a .NET coding add-in
102 | _ReSharper*/
103 | *.[Rr]e[Ss]harper
104 | *.DotSettings.user
105 |
106 | # JustCode is a .NET coding add-in
107 | .JustCode
108 |
109 | # TeamCity is a build add-in
110 | _TeamCity*
111 |
112 | # DotCover is a Code Coverage Tool
113 | *.dotCover
114 |
115 | # NCrunch
116 | _NCrunch_*
117 | .*crunch*.local.xml
118 | nCrunchTemp_*
119 |
120 | # MightyMoose
121 | *.mm.*
122 | AutoTest.Net/
123 |
124 | # Web workbench (sass)
125 | .sass-cache/
126 |
127 | # Installshield output folder
128 | [Ee]xpress/
129 |
130 | # DocProject is a documentation generator add-in
131 | DocProject/buildhelp/
132 | DocProject/Help/*.HxT
133 | DocProject/Help/*.HxC
134 | DocProject/Help/*.hhc
135 | DocProject/Help/*.hhk
136 | DocProject/Help/*.hhp
137 | DocProject/Help/Html2
138 | DocProject/Help/html
139 |
140 | # Click-Once directory
141 | publish/
142 |
143 | # Publish Web Output
144 | *.[Pp]ublish.xml
145 | *.azurePubxml
146 | # TODO: Comment the next line if you want to checkin your web deploy settings
147 | # but database connection strings (with potential passwords) will be unencrypted
148 | *.pubxml
149 | *.publishproj
150 |
151 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
152 | # checkin your Azure Web App publish settings, but sensitive information contained
153 | # in these scripts will be unencrypted
154 | PublishScripts/
155 |
156 | # NuGet Packages
157 | *.nupkg
158 | # The packages folder can be ignored because of Package Restore
159 | **/packages/*
160 | # except build/, which is used as an MSBuild target.
161 | !**/packages/build/
162 | # Uncomment if necessary however generally it will be regenerated when needed
163 | #!**/packages/repositories.config
164 | # NuGet v3's project.json files produces more ignoreable files
165 | *.nuget.props
166 | *.nuget.targets
167 |
168 | # Microsoft Azure Build Output
169 | csx/
170 | *.build.csdef
171 |
172 | # Microsoft Azure Emulator
173 | ecf/
174 | rcf/
175 |
176 | # Windows Store app package directories and files
177 | AppPackages/
178 | BundleArtifacts/
179 | Package.StoreAssociation.xml
180 | _pkginfo.txt
181 |
182 | # Visual Studio cache files
183 | # files ending in .cache can be ignored
184 | *.[Cc]ache
185 | # but keep track of directories ending in .cache
186 | !*.[Cc]ache/
187 |
188 | # Others
189 | ClientBin/
190 | ~$*
191 | *~
192 | *.dbmdl
193 | *.dbproj.schemaview
194 | *.pfx
195 | *.publishsettings
196 | node_modules/
197 | orleans.codegen.cs
198 |
199 | # Since there are multiple workflows, uncomment next line to ignore bower_components
200 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
201 | #bower_components/
202 |
203 | # RIA/Silverlight projects
204 | Generated_Code/
205 |
206 | # Backup & report files from converting an old project file
207 | # to a newer Visual Studio version. Backup files are not needed,
208 | # because we have git ;-)
209 | _UpgradeReport_Files/
210 | Backup*/
211 | UpgradeLog*.XML
212 | UpgradeLog*.htm
213 |
214 | # SQL Server files
215 | *.mdf
216 | *.ldf
217 |
218 | # Business Intelligence projects
219 | *.rdl.data
220 | *.bim.layout
221 | *.bim_*.settings
222 |
223 | # Microsoft Fakes
224 | FakesAssemblies/
225 |
226 | # GhostDoc plugin setting file
227 | *.GhostDoc.xml
228 |
229 | # Node.js Tools for Visual Studio
230 | .ntvs_analysis.dat
231 |
232 | # Visual Studio 6 build log
233 | *.plg
234 |
235 | # Visual Studio 6 workspace options file
236 | *.opt
237 |
238 | # Visual Studio LightSwitch build output
239 | **/*.HTMLClient/GeneratedArtifacts
240 | **/*.DesktopClient/GeneratedArtifacts
241 | **/*.DesktopClient/ModelManifest.xml
242 | **/*.Server/GeneratedArtifacts
243 | **/*.Server/ModelManifest.xml
244 | _Pvt_Extensions
245 |
246 | # Paket dependency manager
247 | .paket/paket.exe
248 | paket-files/
249 |
250 | # FAKE - F# Make
251 | .fake/
252 |
253 | # JetBrains Rider
254 | .idea/
255 | *.sln.iml
256 |
--------------------------------------------------------------------------------
/PolicyPlus/InspectPolicyElements.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class InspectPolicyElements
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim PolicyNameLabel As System.Windows.Forms.Label
26 | Me.PolicyNameTextbox = New System.Windows.Forms.TextBox()
27 | Me.PolicyDetailsButton = New System.Windows.Forms.Button()
28 | Me.InfoTreeview = New System.Windows.Forms.TreeView()
29 | Me.CloseButton = New System.Windows.Forms.Button()
30 | PolicyNameLabel = New System.Windows.Forms.Label()
31 | Me.SuspendLayout()
32 | '
33 | 'PolicyNameTextbox
34 | '
35 | Me.PolicyNameTextbox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
36 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
37 | Me.PolicyNameTextbox.Location = New System.Drawing.Point(53, 12)
38 | Me.PolicyNameTextbox.Name = "PolicyNameTextbox"
39 | Me.PolicyNameTextbox.ReadOnly = True
40 | Me.PolicyNameTextbox.Size = New System.Drawing.Size(248, 20)
41 | Me.PolicyNameTextbox.TabIndex = 0
42 | '
43 | 'PolicyDetailsButton
44 | '
45 | Me.PolicyDetailsButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
46 | Me.PolicyDetailsButton.Location = New System.Drawing.Point(307, 10)
47 | Me.PolicyDetailsButton.Name = "PolicyDetailsButton"
48 | Me.PolicyDetailsButton.Size = New System.Drawing.Size(75, 23)
49 | Me.PolicyDetailsButton.TabIndex = 1
50 | Me.PolicyDetailsButton.Text = "Details"
51 | Me.PolicyDetailsButton.UseVisualStyleBackColor = True
52 | '
53 | 'PolicyNameLabel
54 | '
55 | PolicyNameLabel.AutoSize = True
56 | PolicyNameLabel.Location = New System.Drawing.Point(12, 15)
57 | PolicyNameLabel.Name = "PolicyNameLabel"
58 | PolicyNameLabel.Size = New System.Drawing.Size(35, 13)
59 | PolicyNameLabel.TabIndex = 2
60 | PolicyNameLabel.Text = "Policy"
61 | '
62 | 'InfoTreeview
63 | '
64 | Me.InfoTreeview.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
65 | Or System.Windows.Forms.AnchorStyles.Left) _
66 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
67 | Me.InfoTreeview.HideSelection = False
68 | Me.InfoTreeview.Location = New System.Drawing.Point(15, 38)
69 | Me.InfoTreeview.Name = "InfoTreeview"
70 | Me.InfoTreeview.ShowNodeToolTips = True
71 | Me.InfoTreeview.Size = New System.Drawing.Size(367, 193)
72 | Me.InfoTreeview.TabIndex = 3
73 | '
74 | 'CloseButton
75 | '
76 | Me.CloseButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
77 | Me.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
78 | Me.CloseButton.Location = New System.Drawing.Point(307, 237)
79 | Me.CloseButton.Name = "CloseButton"
80 | Me.CloseButton.Size = New System.Drawing.Size(75, 23)
81 | Me.CloseButton.TabIndex = 4
82 | Me.CloseButton.Text = "Close"
83 | Me.CloseButton.UseVisualStyleBackColor = True
84 | '
85 | 'InspectPolicyElements
86 | '
87 | Me.AcceptButton = Me.CloseButton
88 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
89 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
90 | Me.CancelButton = Me.CloseButton
91 | Me.ClientSize = New System.Drawing.Size(394, 272)
92 | Me.Controls.Add(Me.CloseButton)
93 | Me.Controls.Add(Me.InfoTreeview)
94 | Me.Controls.Add(PolicyNameLabel)
95 | Me.Controls.Add(Me.PolicyDetailsButton)
96 | Me.Controls.Add(Me.PolicyNameTextbox)
97 | Me.MaximizeBox = False
98 | Me.MinimizeBox = False
99 | Me.MinimumSize = New System.Drawing.Size(305, 219)
100 | Me.Name = "InspectPolicyElements"
101 | Me.ShowIcon = False
102 | Me.ShowInTaskbar = False
103 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
104 | Me.Text = "Element Inspector"
105 | Me.ResumeLayout(False)
106 | Me.PerformLayout()
107 |
108 | End Sub
109 |
110 | Friend WithEvents PolicyNameTextbox As TextBox
111 | Friend WithEvents PolicyDetailsButton As Button
112 | Friend WithEvents InfoTreeview As TreeView
113 | Friend WithEvents CloseButton As Button
114 | End Class
115 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPolDelete.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class EditPolDelete
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Me.TextKey = New System.Windows.Forms.TextBox()
27 | Me.OptPurge = New System.Windows.Forms.RadioButton()
28 | Me.OptClearFirst = New System.Windows.Forms.RadioButton()
29 | Me.OptDeleteOne = New System.Windows.Forms.RadioButton()
30 | Me.TextValueName = New System.Windows.Forms.TextBox()
31 | Me.ButtonOK = New System.Windows.Forms.Button()
32 | Label1 = New System.Windows.Forms.Label()
33 | Me.SuspendLayout()
34 | '
35 | 'Label1
36 | '
37 | Label1.AutoSize = True
38 | Label1.Location = New System.Drawing.Point(12, 15)
39 | Label1.Name = "Label1"
40 | Label1.Size = New System.Drawing.Size(72, 13)
41 | Label1.TabIndex = 1
42 | Label1.Text = "Container key"
43 | '
44 | 'TextKey
45 | '
46 | Me.TextKey.Location = New System.Drawing.Point(90, 12)
47 | Me.TextKey.Name = "TextKey"
48 | Me.TextKey.ReadOnly = True
49 | Me.TextKey.Size = New System.Drawing.Size(179, 20)
50 | Me.TextKey.TabIndex = 0
51 | '
52 | 'OptPurge
53 | '
54 | Me.OptPurge.AutoSize = True
55 | Me.OptPurge.Location = New System.Drawing.Point(15, 38)
56 | Me.OptPurge.Name = "OptPurge"
57 | Me.OptPurge.Size = New System.Drawing.Size(189, 17)
58 | Me.OptPurge.TabIndex = 2
59 | Me.OptPurge.TabStop = True
60 | Me.OptPurge.Text = "Delete all the values under the key"
61 | Me.OptPurge.UseVisualStyleBackColor = True
62 | '
63 | 'OptClearFirst
64 | '
65 | Me.OptClearFirst.AutoSize = True
66 | Me.OptClearFirst.Location = New System.Drawing.Point(15, 61)
67 | Me.OptClearFirst.Name = "OptClearFirst"
68 | Me.OptClearFirst.Size = New System.Drawing.Size(189, 17)
69 | Me.OptClearFirst.TabIndex = 3
70 | Me.OptClearFirst.TabStop = True
71 | Me.OptClearFirst.Text = "Clear the key before adding values"
72 | Me.OptClearFirst.UseVisualStyleBackColor = True
73 | '
74 | 'OptDeleteOne
75 | '
76 | Me.OptDeleteOne.AutoSize = True
77 | Me.OptDeleteOne.Location = New System.Drawing.Point(15, 84)
78 | Me.OptDeleteOne.Name = "OptDeleteOne"
79 | Me.OptDeleteOne.Size = New System.Drawing.Size(107, 17)
80 | Me.OptDeleteOne.TabIndex = 4
81 | Me.OptDeleteOne.TabStop = True
82 | Me.OptDeleteOne.Text = "Delete this value:"
83 | Me.OptDeleteOne.UseVisualStyleBackColor = True
84 | '
85 | 'TextValueName
86 | '
87 | Me.TextValueName.Enabled = False
88 | Me.TextValueName.Location = New System.Drawing.Point(128, 83)
89 | Me.TextValueName.Name = "TextValueName"
90 | Me.TextValueName.Size = New System.Drawing.Size(141, 20)
91 | Me.TextValueName.TabIndex = 5
92 | '
93 | 'ButtonOK
94 | '
95 | Me.ButtonOK.Location = New System.Drawing.Point(194, 109)
96 | Me.ButtonOK.Name = "ButtonOK"
97 | Me.ButtonOK.Size = New System.Drawing.Size(75, 23)
98 | Me.ButtonOK.TabIndex = 6
99 | Me.ButtonOK.Text = "OK"
100 | Me.ButtonOK.UseVisualStyleBackColor = True
101 | '
102 | 'EditPolDelete
103 | '
104 | Me.AcceptButton = Me.ButtonOK
105 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
106 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
107 | Me.ClientSize = New System.Drawing.Size(281, 144)
108 | Me.Controls.Add(Me.ButtonOK)
109 | Me.Controls.Add(Me.TextValueName)
110 | Me.Controls.Add(Me.OptDeleteOne)
111 | Me.Controls.Add(Me.OptClearFirst)
112 | Me.Controls.Add(Me.OptPurge)
113 | Me.Controls.Add(Label1)
114 | Me.Controls.Add(Me.TextKey)
115 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
116 | Me.MaximizeBox = False
117 | Me.MinimizeBox = False
118 | Me.Name = "EditPolDelete"
119 | Me.ShowIcon = False
120 | Me.ShowInTaskbar = False
121 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
122 | Me.Text = "Delete Value(s)"
123 | Me.ResumeLayout(False)
124 | Me.PerformLayout()
125 |
126 | End Sub
127 |
128 | Friend WithEvents TextKey As TextBox
129 | Friend WithEvents OptPurge As RadioButton
130 | Friend WithEvents OptClearFirst As RadioButton
131 | Friend WithEvents OptDeleteOne As RadioButton
132 | Friend WithEvents TextValueName As TextBox
133 | Friend WithEvents ButtonOK As Button
134 | End Class
135 |
--------------------------------------------------------------------------------
/PolicyPlus/ListEditor.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class ListEditor
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.EntriesDatagrid = New System.Windows.Forms.DataGridView()
26 | Me.NameColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
27 | Me.ValueColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
28 | Me.ElementNameLabel = New System.Windows.Forms.Label()
29 | Me.CloseButton = New System.Windows.Forms.Button()
30 | Me.OkButton = New System.Windows.Forms.Button()
31 | CType(Me.EntriesDatagrid, System.ComponentModel.ISupportInitialize).BeginInit()
32 | Me.SuspendLayout()
33 | '
34 | 'EntriesDatagrid
35 | '
36 | Me.EntriesDatagrid.AllowUserToResizeRows = False
37 | Me.EntriesDatagrid.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
38 | Or System.Windows.Forms.AnchorStyles.Left) _
39 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
40 | Me.EntriesDatagrid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
41 | Me.EntriesDatagrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
42 | Me.EntriesDatagrid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.NameColumn, Me.ValueColumn})
43 | Me.EntriesDatagrid.Location = New System.Drawing.Point(12, 25)
44 | Me.EntriesDatagrid.Name = "EntriesDatagrid"
45 | Me.EntriesDatagrid.Size = New System.Drawing.Size(404, 170)
46 | Me.EntriesDatagrid.TabIndex = 0
47 | '
48 | 'NameColumn
49 | '
50 | Me.NameColumn.HeaderText = "Name"
51 | Me.NameColumn.Name = "NameColumn"
52 | '
53 | 'ValueColumn
54 | '
55 | Me.ValueColumn.HeaderText = "Value"
56 | Me.ValueColumn.Name = "ValueColumn"
57 | '
58 | 'ElementNameLabel
59 | '
60 | Me.ElementNameLabel.AutoEllipsis = True
61 | Me.ElementNameLabel.AutoSize = True
62 | Me.ElementNameLabel.Location = New System.Drawing.Point(12, 9)
63 | Me.ElementNameLabel.MaximumSize = New System.Drawing.Size(400, 0)
64 | Me.ElementNameLabel.Name = "ElementNameLabel"
65 | Me.ElementNameLabel.Size = New System.Drawing.Size(92, 13)
66 | Me.ElementNameLabel.TabIndex = 1
67 | Me.ElementNameLabel.Text = "List element name"
68 | '
69 | 'CloseButton
70 | '
71 | Me.CloseButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
72 | Me.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
73 | Me.CloseButton.Location = New System.Drawing.Point(341, 201)
74 | Me.CloseButton.Name = "CloseButton"
75 | Me.CloseButton.Size = New System.Drawing.Size(75, 23)
76 | Me.CloseButton.TabIndex = 2
77 | Me.CloseButton.Text = "Cancel"
78 | Me.CloseButton.UseVisualStyleBackColor = True
79 | '
80 | 'OkButton
81 | '
82 | Me.OkButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
83 | Me.OkButton.Location = New System.Drawing.Point(260, 201)
84 | Me.OkButton.Name = "OkButton"
85 | Me.OkButton.Size = New System.Drawing.Size(75, 23)
86 | Me.OkButton.TabIndex = 1
87 | Me.OkButton.Text = "OK"
88 | Me.OkButton.UseVisualStyleBackColor = True
89 | '
90 | 'ListEditor
91 | '
92 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
93 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
94 | Me.CancelButton = Me.CloseButton
95 | Me.ClientSize = New System.Drawing.Size(428, 236)
96 | Me.Controls.Add(Me.OkButton)
97 | Me.Controls.Add(Me.CloseButton)
98 | Me.Controls.Add(Me.ElementNameLabel)
99 | Me.Controls.Add(Me.EntriesDatagrid)
100 | Me.MaximizeBox = False
101 | Me.MinimizeBox = False
102 | Me.MinimumSize = New System.Drawing.Size(444, 275)
103 | Me.Name = "ListEditor"
104 | Me.ShowIcon = False
105 | Me.ShowInTaskbar = False
106 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
107 | Me.Text = "Edit List"
108 | CType(Me.EntriesDatagrid, System.ComponentModel.ISupportInitialize).EndInit()
109 | Me.ResumeLayout(False)
110 | Me.PerformLayout()
111 |
112 | End Sub
113 |
114 | Friend WithEvents EntriesDatagrid As DataGridView
115 | Friend WithEvents NameColumn As DataGridViewTextBoxColumn
116 | Friend WithEvents ValueColumn As DataGridViewTextBoxColumn
117 | Friend WithEvents ElementNameLabel As Label
118 | Friend WithEvents CloseButton As Button
119 | Friend WithEvents OkButton As Button
120 | End Class
121 |
--------------------------------------------------------------------------------
/PolicyPlus/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/PolicyPlus/ExportReg.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class ExportReg
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim Label1 As System.Windows.Forms.Label
26 | Dim Label2 As System.Windows.Forms.Label
27 | Dim Label3 As System.Windows.Forms.Label
28 | Dim Label4 As System.Windows.Forms.Label
29 | Me.TextReg = New System.Windows.Forms.TextBox()
30 | Me.TextBranch = New System.Windows.Forms.TextBox()
31 | Me.TextRoot = New System.Windows.Forms.TextBox()
32 | Me.ButtonBrowse = New System.Windows.Forms.Button()
33 | Me.ButtonExport = New System.Windows.Forms.Button()
34 | Label1 = New System.Windows.Forms.Label()
35 | Label2 = New System.Windows.Forms.Label()
36 | Label3 = New System.Windows.Forms.Label()
37 | Label4 = New System.Windows.Forms.Label()
38 | Me.SuspendLayout()
39 | '
40 | 'Label1
41 | '
42 | Label1.AutoSize = True
43 | Label1.Location = New System.Drawing.Point(12, 15)
44 | Label1.Name = "Label1"
45 | Label1.Size = New System.Drawing.Size(77, 13)
46 | Label1.TabIndex = 0
47 | Label1.Text = "Source branch"
48 | '
49 | 'Label2
50 | '
51 | Label2.AutoSize = True
52 | Label2.Location = New System.Drawing.Point(12, 67)
53 | Label2.Name = "Label2"
54 | Label2.Size = New System.Drawing.Size(73, 13)
55 | Label2.TabIndex = 3
56 | Label2.Text = "Registry prefix"
57 | '
58 | 'Label3
59 | '
60 | Label3.AutoSize = True
61 | Label3.Location = New System.Drawing.Point(12, 41)
62 | Label3.Name = "Label3"
63 | Label3.Size = New System.Drawing.Size(46, 13)
64 | Label3.TabIndex = 4
65 | Label3.Text = "REG file"
66 | '
67 | 'Label4
68 | '
69 | Label4.AutoSize = True
70 | Label4.Location = New System.Drawing.Point(275, 15)
71 | Label4.Name = "Label4"
72 | Label4.Size = New System.Drawing.Size(96, 13)
73 | Label4.TabIndex = 8
74 | Label4.Text = "(blank to export all)"
75 | '
76 | 'TextReg
77 | '
78 | Me.TextReg.Location = New System.Drawing.Point(95, 38)
79 | Me.TextReg.Name = "TextReg"
80 | Me.TextReg.Size = New System.Drawing.Size(195, 20)
81 | Me.TextReg.TabIndex = 2
82 | '
83 | 'TextBranch
84 | '
85 | Me.TextBranch.Location = New System.Drawing.Point(95, 12)
86 | Me.TextBranch.Name = "TextBranch"
87 | Me.TextBranch.Size = New System.Drawing.Size(174, 20)
88 | Me.TextBranch.TabIndex = 1
89 | '
90 | 'TextRoot
91 | '
92 | Me.TextRoot.Location = New System.Drawing.Point(95, 64)
93 | Me.TextRoot.Name = "TextRoot"
94 | Me.TextRoot.Size = New System.Drawing.Size(276, 20)
95 | Me.TextRoot.TabIndex = 4
96 | '
97 | 'ButtonBrowse
98 | '
99 | Me.ButtonBrowse.Location = New System.Drawing.Point(296, 36)
100 | Me.ButtonBrowse.Name = "ButtonBrowse"
101 | Me.ButtonBrowse.Size = New System.Drawing.Size(75, 23)
102 | Me.ButtonBrowse.TabIndex = 3
103 | Me.ButtonBrowse.Text = "Browse"
104 | Me.ButtonBrowse.UseVisualStyleBackColor = True
105 | '
106 | 'ButtonExport
107 | '
108 | Me.ButtonExport.Location = New System.Drawing.Point(296, 90)
109 | Me.ButtonExport.Name = "ButtonExport"
110 | Me.ButtonExport.Size = New System.Drawing.Size(75, 23)
111 | Me.ButtonExport.TabIndex = 5
112 | Me.ButtonExport.Text = "Export"
113 | Me.ButtonExport.UseVisualStyleBackColor = True
114 | '
115 | 'ExportReg
116 | '
117 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
118 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
119 | Me.ClientSize = New System.Drawing.Size(383, 125)
120 | Me.Controls.Add(Label4)
121 | Me.Controls.Add(Me.ButtonExport)
122 | Me.Controls.Add(Me.ButtonBrowse)
123 | Me.Controls.Add(Me.TextRoot)
124 | Me.Controls.Add(Label3)
125 | Me.Controls.Add(Label2)
126 | Me.Controls.Add(Me.TextBranch)
127 | Me.Controls.Add(Me.TextReg)
128 | Me.Controls.Add(Label1)
129 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
130 | Me.KeyPreview = True
131 | Me.MaximizeBox = False
132 | Me.MinimizeBox = False
133 | Me.Name = "ExportReg"
134 | Me.ShowIcon = False
135 | Me.ShowInTaskbar = False
136 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
137 | Me.Text = "Export REG"
138 | Me.ResumeLayout(False)
139 | Me.PerformLayout()
140 |
141 | End Sub
142 |
143 | Friend WithEvents TextReg As TextBox
144 | Friend WithEvents TextBranch As TextBox
145 | Friend WithEvents TextRoot As TextBox
146 | Friend WithEvents ButtonBrowse As Button
147 | Friend WithEvents ButtonExport As Button
148 | End Class
149 |
--------------------------------------------------------------------------------
/PolicyPlus/ImportSpol.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class ImportSpol
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.ButtonOpenFile = New System.Windows.Forms.Button()
26 | Me.Label1 = New System.Windows.Forms.Label()
27 | Me.ButtonApply = New System.Windows.Forms.Button()
28 | Me.TextSpol = New System.Windows.Forms.TextBox()
29 | Me.ButtonVerify = New System.Windows.Forms.Button()
30 | Me.ButtonReset = New System.Windows.Forms.Button()
31 | Me.SuspendLayout()
32 | '
33 | 'ButtonOpenFile
34 | '
35 | Me.ButtonOpenFile.Location = New System.Drawing.Point(157, 12)
36 | Me.ButtonOpenFile.Name = "ButtonOpenFile"
37 | Me.ButtonOpenFile.Size = New System.Drawing.Size(75, 23)
38 | Me.ButtonOpenFile.TabIndex = 0
39 | Me.ButtonOpenFile.Text = "Open File"
40 | Me.ButtonOpenFile.UseVisualStyleBackColor = True
41 | '
42 | 'Label1
43 | '
44 | Me.Label1.AutoSize = True
45 | Me.Label1.Location = New System.Drawing.Point(12, 17)
46 | Me.Label1.Name = "Label1"
47 | Me.Label1.Size = New System.Drawing.Size(139, 13)
48 | Me.Label1.TabIndex = 1
49 | Me.Label1.Text = "Semantic Policy (SPOL) text"
50 | '
51 | 'ButtonApply
52 | '
53 | Me.ButtonApply.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
54 | Me.ButtonApply.Location = New System.Drawing.Point(303, 219)
55 | Me.ButtonApply.Name = "ButtonApply"
56 | Me.ButtonApply.Size = New System.Drawing.Size(75, 23)
57 | Me.ButtonApply.TabIndex = 4
58 | Me.ButtonApply.Text = "Apply"
59 | Me.ButtonApply.UseVisualStyleBackColor = True
60 | '
61 | 'TextSpol
62 | '
63 | Me.TextSpol.AcceptsReturn = True
64 | Me.TextSpol.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
65 | Or System.Windows.Forms.AnchorStyles.Left) _
66 | Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
67 | Me.TextSpol.Font = New System.Drawing.Font("Consolas", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
68 | Me.TextSpol.Location = New System.Drawing.Point(12, 41)
69 | Me.TextSpol.Multiline = True
70 | Me.TextSpol.Name = "TextSpol"
71 | Me.TextSpol.ScrollBars = System.Windows.Forms.ScrollBars.Both
72 | Me.TextSpol.Size = New System.Drawing.Size(366, 172)
73 | Me.TextSpol.TabIndex = 2
74 | Me.TextSpol.Text = "Policy Plus Semantic Policy" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
75 | Me.TextSpol.WordWrap = False
76 | '
77 | 'ButtonVerify
78 | '
79 | Me.ButtonVerify.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
80 | Me.ButtonVerify.Location = New System.Drawing.Point(222, 219)
81 | Me.ButtonVerify.Name = "ButtonVerify"
82 | Me.ButtonVerify.Size = New System.Drawing.Size(75, 23)
83 | Me.ButtonVerify.TabIndex = 3
84 | Me.ButtonVerify.Text = "Verify"
85 | Me.ButtonVerify.UseVisualStyleBackColor = True
86 | '
87 | 'ButtonReset
88 | '
89 | Me.ButtonReset.Location = New System.Drawing.Point(238, 12)
90 | Me.ButtonReset.Name = "ButtonReset"
91 | Me.ButtonReset.Size = New System.Drawing.Size(75, 23)
92 | Me.ButtonReset.TabIndex = 1
93 | Me.ButtonReset.Text = "Reset"
94 | Me.ButtonReset.UseVisualStyleBackColor = True
95 | '
96 | 'ImportSpol
97 | '
98 | Me.AcceptButton = Me.ButtonApply
99 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
100 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
101 | Me.ClientSize = New System.Drawing.Size(390, 254)
102 | Me.Controls.Add(Me.ButtonReset)
103 | Me.Controls.Add(Me.ButtonVerify)
104 | Me.Controls.Add(Me.TextSpol)
105 | Me.Controls.Add(Me.ButtonApply)
106 | Me.Controls.Add(Me.Label1)
107 | Me.Controls.Add(Me.ButtonOpenFile)
108 | Me.KeyPreview = True
109 | Me.MinimizeBox = False
110 | Me.MinimumSize = New System.Drawing.Size(373, 266)
111 | Me.Name = "ImportSpol"
112 | Me.ShowIcon = False
113 | Me.ShowInTaskbar = False
114 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
115 | Me.Text = "Import Semantic Policy"
116 | Me.ResumeLayout(False)
117 | Me.PerformLayout()
118 |
119 | End Sub
120 |
121 | Friend WithEvents ButtonOpenFile As Button
122 | Friend WithEvents Label1 As Label
123 | Friend WithEvents ButtonApply As Button
124 | Friend WithEvents TextSpol As TextBox
125 | Friend WithEvents ButtonVerify As Button
126 | Friend WithEvents ButtonReset As Button
127 | End Class
128 |
--------------------------------------------------------------------------------
/PolicyPlus/EditPol.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/PolicyPlus/FindById.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/PolicyPlus/FindByText.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------