Skip to content

Commit

Permalink
Merge pull request #27 from bcwilhite/master
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelcolas authored Jun 8, 2021
2 parents 5d1a5bf + 74eb631 commit c827c54
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- GPRegistryPolicyDsc
- Fixed REG_MULTI_SZ double null termination issue ([issue #25](https://github.com/dsccommunity/GPRegistryPolicyDsc/issues/25)).

## [1.2.0] - 2020-03-13

### Added
Expand Down
8 changes: 5 additions & 3 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
}
}

invokeBuild = 'latest'
InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
pester = 'latest'
Pester = '4.10.1'
Plaster = 'latest'
ModuleBuilder = '1.0.0'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
MarkdownLinkCheck = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
'DscResource.DocGenerator' = 'latest'
}
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stages:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'win1803'
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
Expand Down
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
####################################################
# ModuleBuilder Configuration #
####################################################
CopyDirectories:
CopyPaths:
- en-US
- DSCResources
- Modules
Expand Down Expand Up @@ -36,7 +36,7 @@ BuildWorkflow:

publish:
- Publish_release_to_GitHub
- publish_module_to_gallery # runs if nuget is not available
- publish_module_to_gallery


####################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,25 @@ function New-GPRegistrySettingsEntry
# get data bytes then compute byte size based on data and type
switch ($RegistryPolicy.ValueType)
{
{ @([RegType]::REG_SZ, [RegType]::REG_EXPAND_SZ, [RegType]::REG_MULTI_SZ) -contains $_ }
{ @([RegType]::REG_SZ, [RegType]::REG_EXPAND_SZ) -contains $_ }
{
$dataBytes = [System.Text.Encoding]::Unicode.GetBytes($RegistryPolicy.ValueData + "`0")
$dataSize = $dataBytes.Count
}

([RegType]::REG_MULTI_SZ)
{
<#
When REG_MULTI_SZ ValueData contains an array, we need to null terminate each item. Furthermore
"Data in the Data field to be interpreted as a sequence of characters terminated by two null Unicode
characters, and within that sequence zero or more null-terminated Unicode strings can exist."
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-gpreg/5c092c22-bf6b-4e7f-b180-b20743d368f5
#>
$valueDataNullTermJoin = $RegistryPolicy.ValueData -join "`0"
$dataBytes = [System.Text.Encoding]::Unicode.GetBytes($valueDataNullTermJoin + "`0`0")
$dataSize = $dataBytes.Count
}

([RegType]::REG_BINARY)
{
$dataBytes = [System.Text.Encoding]::Unicode.GetBytes($RegistryPolicy.ValueData)
Expand Down

0 comments on commit c827c54

Please sign in to comment.