Skip to content

How to obtain a protocol interface #921

@scholzp

Description

@scholzp

Hi all,
in my current use case I try to obtain a protocol interface pointer, not for the purpose of using it, but rather to uninstall the protocol from an handle. This is necessary as one is required to call Bootservices::uninstall_protocol_interface. Normally for such functionality I would use EFI_BOOT_SERVICES.HandleProtocol() (see spec 7.3.7), which would return the interface pointer. This function is not implemented in the crate and Bootservices::test_protocol, which would conceptually achieve the same result as HandleProtocol, doesn't return a pointer to the interface either.

For me the only possible way to do this seems to be by using open_protocol, dereferenceing the ScopedProtocol, somehow create a pointer from it and then use this to uninstall the protocol, after I closed it of course. This feels a bit hacky to me and I would prefer a more intuitive way for obtaining an interface pointer. Is there any better way to do this, of which I'm unaware? If not, would you be interested in such a feature?

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions