Skip to content
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

Remove FindFirstFile, FindNextFile and FindClose from PAL #110797

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

janvorli
Copy link
Member

This change removes these functions from PAL. It also removes all the related PAL tests.
The superpmi was the last user of those functions, so I've modified it to use Unix APIs directly when building for Unix.

@janvorli janvorli added this to the 10.0.0 milestone Dec 18, 2024
@janvorli janvorli self-assigned this Dec 18, 2024
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM

cc @jakobbotsch

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

<3

@huoyaoyuan
Copy link
Member

huoyaoyuan commented Dec 18, 2024

It should be the last usage of CreateDirectoryW in tests of these functions.

Not really, still one more test using them.

@huoyaoyuan
Copy link
Member

The superpmi was the last user of those functions, so I've modified it to use Unix APIs directly when building for Unix.

corehost has pal abstraction for the searching functionality, but not shared with other components yet.

unsigned int codePage = CP_UTF8;
int sizeNeeded = MultiByteToWideChar(codePage, 0, str, -1, NULL, 0);
WCHAR* encodedStr = new WCHAR[sizeNeeded];
MultiByteToWideChar(codePage, 0, str, -1, encodedStr, sizeNeeded);
Copy link
Member

Choose a reason for hiding this comment

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

As follow-up, could we convert these two methods (ConvertMultiByteToWideChar and ConvertWideCharToMultiByte) to use the minipal as they're both UTF8-only? It would allow us to further reduce the usage of the CoreCLR PAL within superpmi.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense

@janvorli janvorli merged commit 3e5b44a into dotnet:main Dec 18, 2024
95 checks passed
@janvorli janvorli deleted the remove-findfirstfile-from-pal branch December 18, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants