Skip to content

Remove FindFirstFile, FindNextFile and FindClose from PAL - #110797

Merged
janvorli merged 3 commits into
dotnet:mainfrom
janvorli:remove-findfirstfile-from-pal
Dec 18, 2024
Merged

janvorli merged 3 commits into
dotnet:mainfrom
janvorli:remove-findfirstfile-from-pal

Conversation

@janvorli

Copy link
Copy Markdown
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 the area-PAL-coreclr only for closed issues label Dec 18, 2024
@janvorli janvorli added this to the 10.0.0 milestone Dec 18, 2024
@janvorli janvorli self-assigned this Dec 18, 2024

@BruceForstall BruceForstall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

cc @jakobbotsch

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

<3

@huoyaoyuan

huoyaoyuan commented Dec 18, 2024 •

Copy link
Copy Markdown
Member

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

Not really, still one more test using them.

@huoyaoyuan

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@janvorli
janvorli deleted the remove-findfirstfile-from-pal branch December 18, 2024 20:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-PAL-coreclr only for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants