Skip to content

InstallConfigurationTable sample is incorrect #5

@idigdoug

Description

@idigdoug

In https://tianocore-docs.github.io/edk2-UefiDriverWritersGuide/draft/5_uefi_services/52_services_that_uefi_drivers_rarely_use/5210_installconfigurationtable.html

The sample code is WRONG.

Status = gBS->InstallConfigurationTable (
                &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
                &UndiConfigTable
                );

The & in &UndiConfigTable is wrong. The result is that the installed pointer points at the stack (the location of the UndiConfigTable pointer), not the allocation (the memory that UndiConfigTable references). There is no compiler error or warning for this problem.

When people use this code as their sample, they're likely to make a mistake that wastes a lot of time to debug.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions