-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Add a project that produces conpty.dll #2611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| <ClCompile Include="precomp.cpp"> | ||
| <PrecompiledHeader>Create</PrecompiledHeader> | ||
| </ClCompile> | ||
| <ClCompile Include="../server/DeviceHandle.cpp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not great, but necessary to avoid duplicating code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, good enough.
|
This PR is great. Regarding the export function with the same name as |
|
If we are taking it out from Windows, will it be possible to backport ConPTY to earlier version of Windows? |
|
@driver1998 I think it depends on conhost.exe. In this code, we can see that this is essentially conhost running in PTY mode, so the porting of conpty to the old Windows is based on the premise that the new version of conhost.exe can be used on older Windows. run. Having said that, the problem of porting the new conhost.exe to the old Windows may need to consider factors such as graphics and kernel console handles. |
Also it depends on the
|
|
zadjii-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions. Additionally:
- should we also push the tests for this out?
src/winconpty/winconpty.cpp
Outdated
| #pragma warning(push) | ||
| #pragma warning(disable : 4273) // inconsistent dll linkage (we are exporting things kernel32 also exports) | ||
|
|
||
| extern "C" __declspec(dllexport) wchar_t* _ConsoleHostPath() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe needs a doc comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't mean to export it, but yes, a doc comment would be good
| // These functions are defined in the console l1 apiset, which is generated from | ||
| // the consoleapi.apx file in minkernel\apiset\libs\Console. | ||
|
|
||
| HRESULT CreatePseudoConsoleAsUser(_In_ HANDLE hToken, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we ever make this public before? I guess we're not __declspec(dllexport)ing it from this dll, so probably nbd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not public in win32, but also not harmful. 😄
|
|
@Biswa96 I don't really want to make any code changes in this PR. This PR should exists solely as a port from OS code to OSS code. We can handle feature requests for the conpty API in their own separate issues. |
|
| <ClCompile Include="precomp.cpp"> | ||
| <PrecompiledHeader>Create</PrecompiledHeader> | ||
| </ClCompile> | ||
| <ClCompile Include="../server/DeviceHandle.cpp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, good enough.
|
Will it be possible to add a option or flag not to append |
We're not planning on adding debugging options like that to the actual public-facing API or DLL. It is a valid debugging scenario to just launch the conhost yourself manually passing the PTY handles and without the flag if you want to see the hidden window for debugging. I believe the |
Summary of the Pull Request
This pull request introduces a copy of the code from kernel32.dll that implements
CreatePseudoConsole,ClosePseudoConsoleandResizePseudoConsole. Apart from some light modifications to fit into the infrastructure in this project and support launchingOpenConsole.exe, it is intended to be 1:1 with the code that ships in Windows.Any guideline violations in this code are likely intentional. Since this was built into kernel32, it used the STL only very sparingly.
kernel32is on the default link line, so we need to figure out how to get included before it. Either that, or we should export different function names.References
#1130
PR Checklist
Validation Steps Performed
Launched vtpipeterm.