Skip to content

Remove GetCommandLineW from PAL#125386

Open
huoyaoyuan wants to merge 5 commits intodotnet:mainfrom
huoyaoyuan:pal/commandline
Open

Remove GetCommandLineW from PAL#125386
huoyaoyuan wants to merge 5 commits intodotnet:mainfrom
huoyaoyuan:pal/commandline

Conversation

@huoyaoyuan
Copy link
Member

No description provided.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 10, 2026
Comment on lines +3742 to +3744
// exePath contains the full path to the executable.
MAKE_WIDEPTR_FROMUTF8(exePath, minipal_getexepath());
SIZE_T commandLineLen = (u16_strlen(exePath) + 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a potential behavioral change. Now it will always use the executable path of current process, instead of exePath from coreclr_initialize. This is only used through ep_rt_diagnostics_command_line_get.

Comment on lines +3690 to +3693
#ifdef TARGET_WINDOWS
// Use the result from GetCommandLineW() instead
pCmdLine = GetCommandLineW();
#endif // HOST_WINDOWS
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could affect ep for hosted dll. In nativeaot /proc/self/cmdline is used.

What's the desired semantic here?

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

Labels

area-PAL-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant