Skip to content

mingit includes undocumented API call to ntdll.dll!NtAssignProcessToJobObject (and a few others) due to dependency in msys2.0.dll #5358

Not planned
@veronicagg

Description

@veronicagg

Our team has identified msys2.0.dll calling undocumented Windows APIs like ntdll.dll!NtAssignProcessToJobObject - which is included in mingit/Git for Windows.
Code pointer in cygwin: https://github.com/search?q=repo%3Acygwin%2Fcygwin+NtAssignProcessToJobObject&type=code with a caller: cygwin/winsup/cygwin/resource.cc at 21a2c9db6952954608cdf92638b411b15e7606c6 · cygwin/cygwin

We believe the undocumented call should get replaced by the following documented API - AssignProcessToJobObject function (jobapi2.h) - Win32 apps | Microsoft Learn

Here are some other undocumented API calls also identified:

  • NtOpenJobObject
  • NtCreateJobObject
  • NtOpenMutant
  • NtQueryInformationJobObject
  • NtSetInformationJobObject

Could a change be driven to update the above? We will investigate further to try to propose a change. Thanks!

Activity

Asask-sized

Asask-sized commented on Jan 23, 2025

@Asask-sized
dscho

dscho commented on Mar 14, 2025

@dscho
Member

The discussion on the Cygwin mailing list stalled, mainly because the approach does not work (the handles need to be created in Cygwin's private NT directory and the Win32 API calls do not allow for that). In any case, this needs to be discussed on the Cygwin mailing list if this should go any further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      mingit includes undocumented API call to ntdll.dll!NtAssignProcessToJobObject (and a few others) due to dependency in msys2.0.dll · Issue #5358 · git-for-windows/git