Browse Source

fixed buffer overflooding in ShowMenu function

pull/469/head
Dmitry Nefedov 1 year ago
parent
commit
220f6814ba
  1. 9
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 9
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  3. 9
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  4. 9
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  5. 9
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  6. 9
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

9
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -6929,18 +6929,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData $Title -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

9
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -5616,18 +5616,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData $Title -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

9
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -6003,18 +6003,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData $Title -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

9
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -6938,18 +6938,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData $Title -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

9
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -6498,18 +6498,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData "" -InformationAction Continue
Write-Information -MessageData $Title -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

9
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -6505,18 +6505,13 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
$Default
)
# There's a bug in Windows Terminal with double text in console
# https://github.com/microsoft/terminal/issues/14992
if ($env:WT_SESSION)
{
Clear-Host
}
Write-Information -MessageData $Title -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Skip" string from shell32.dll
$Menu += [WinAPI.GetStr]::GetString(16956)
# https://github.com/microsoft/terminal/issues/14992
[System.Console]::BufferHeight += $Menu.Count
$minY = [Console]::CursorTop
$y = [Math]::Max([Math]::Min($Default, $Menu.Count), 0)

Loading…
Cancel
Save