You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The callf.exe utility has a specific Windows 7+ issue, after it does execute in the elevated context with the reattachment to the parent not elevated process console.
Warning
The console window must be reopened on each test, otherwise the issue may not reproduce.
@echooffrem NOTE:rem Repro in: Windows 7, 8.1rem ISSUE:rem Depending on quantity of statements and standard handle address allocation/randomizationrem inside a console Windows process it has several variants:remrem * Does not print, but await the input (stdin is not broken, stdout is broken).rem * Does wait the input and print each line without line returns (stdin is not broken, stdout is partially broken).rem * Does not wait the input and print all together without line returns (stdin is broken, stdout is partially broken).remrem All of these above is because of a not fully accurate standard handle address sanitizer (remapper) after admin-to-user console reattachment in the `callf`.rem The standard handle address table is different for an elevated and a not elevated process andrem CRT/WIN32 standard handles table must be remapped after the console reattachment.setlocalif%IMPL_MODE%0 NEQ0goto IMPL
rem NOTE:rem `/elevate` and `/attach-parent-console` is a mandatory."%~dp0_externals\contools--utils\bin\contools\callf.exe"^
/promote-parent{ /pause-on-exit } /elevate{ /no-window }{ /attach-parent-console } ^
/v IMPL_MODE 1"""cmd.exe /c @%0%*"exit /b
:IMPLrem all input can be ignored hereset /P X=AAA
set /P X=BBB
set /P X=CCC
set /P X=DDD
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The
callf.exeutility has a specificWindows 7+issue, after it does execute in the elevated context with the reattachment to the parent not elevated process console.Warning
The console window must be reopened on each test, otherwise the issue may not reproduce.
Tests:
https://github.com/andry81/contools--debug/tree/HEAD/test_stdio_break_on_callf_elevate.bat
Result:
AAABBBCCCDDDPress any key to continue . . .Beta Was this translation helpful? Give feedback.
All reactions