Skip to content

Commit

Permalink
fix get state & add disable emoticon (#2554)
Browse files Browse the repository at this point in the history
  • Loading branch information
MyDrift-user authored Aug 12, 2024
1 parent 0919e78 commit 5d7d121
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions/private/Get-WinUtilToggleStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ Function Get-WinUtilToggleStatus {
}
}
if ($ToggleSwitch -eq "WPFToggleDetailedBSoD") {
$DetailedBSoD = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
if($DetailedBSoD -eq 0) {
$DetailedBSoD1 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
$DetailedBSoD2 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisableEmoticon
if (($DetailedBSoD1 -eq 0) -or ($DetailedBSoD2 -eq 0) -or !$DetailedBSoD1 -or !$DetailedBSoD2) {
return $false
} else {
return $true
Expand Down
4 changes: 4 additions & 0 deletions functions/private/Invoke-WinUtilDetailedBSoD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Function Invoke-WinUtilDetailedBSoD {
}

$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
$dwords = ("DisplayParameters", "DisableEmoticon")
foreach ($name in $dwords) {
Set-ItemProperty -Path $Path -Name $name -Value $value
}
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
} catch [System.Security.SecurityException] {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
Expand Down

0 comments on commit 5d7d121

Please sign in to comment.