Skip to content

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();

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
@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