On Tue, Jun 27, 2023 at 10:14:16AM +0200, Ard Biesheuvel wrote: > Not quite. It should only fail the first time if the memory map > changed since the last call to GetMemoryMap(), and normally, this will > only happen if some kind of asynchronous event was triggered after > GetMemoryMap() but before ExitBootServices(). (This is why calling > ExitBootServices() at most twice should always suffice: the first call > disables the timer interrupt, so the second time around, no events > will fire in the mean time) Can't driver shutdown code also end up altering it? I've certainly had extremely deterministic requirements to call it twice, which doesn't line up terribly well with it just being down to async events.