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 strtok, strtok_s, wcstok_s PAL APIs #98008

Merged
merged 11 commits into from
Feb 7, 2024

Conversation

jkoritzinsky
Copy link
Member

These APIs were used extremely rarely throughout CoreCLR (one usage each), so replace the usages with platform-native APIs (strtok_r for strtok and strtok_s) or use SString to hand-roll the one usage (for wcstok_s).


PathString path{profilerList, sectionStart, pathEnd};
StackSString clsidString{profilerList, clsidStart, sectionEnd};
NewArrayHolder<WCHAR> clsidStringRaw = clsidString.GetCopyOfUnicodeString();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NewArrayHolder<WCHAR> clsidStringRaw = clsidString.GetCopyOfUnicodeString();

CLSID clsid;
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(currentGuid, &clsid);
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidStringRaw, &clsid);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidStringRaw, &clsid);
hr = ProfilingAPIUtility::ProfilerCLSIDFromString(clsidString.GetUnicode(), &clsid);

?

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@jkoritzinsky
Copy link
Member Author

@dotnet-policy-service rerun

@jkoritzinsky jkoritzinsky merged commit f4fa259 into dotnet:main Feb 7, 2024
109 of 111 checks passed
@jkoritzinsky jkoritzinsky deleted the crt-pal-cleanup branch February 7, 2024 00:05
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants