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

relicensing: Rewrite PR "DevicePathToText and DevicePathFromText Protocol" #1528

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicholasbishop
Copy link
Member

See #1521. This rewrites code from supdrewin that we do not have relicensing approval for.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

#[derive(Clone, Copy, Debug)]
pub struct AllowShortcuts(pub bool);

/// Wrapper for a string internally allocated from
/// UEFI boot services memory.
/// UCS-2 string allocated from UEFI pool memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

General question: Why do we have this type? I think, this can also be a CString16?

Do we at least want to write how it differs from CString16?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the docstring to clarify. Since this is allocated internally by UEFI, we'd have to do a second memory allocation to copy it to a CString16. (Or alternatively, the CString16 type could be modified to contain either a Vec or a pool allocation, and switch out how it's dropped at the end, but that's probably more complicated than it's worth.) I'm not necessarily opposed to doing something else here, like just accept an extra memory copy, but should probably think about that as part of #1303 since CString16 requires the alloc feature.

@nicholasbishop nicholasbishop force-pushed the bishop-rewrite-text branch 2 times, most recently from 6f92baa to eb0849f Compare January 26, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants