From what I can conclude from multiple sources, installation media for Windows 7 x64 is not guaranteed to be bootable in pure UEFI for all hardware configurations (it was released at a time before UEFI systems are commonplace - mostly just BIOS or some early version of EFI). For the cases that worked, the vendors have implemented some kind of explicit support in the form of hybrid mode (UEFI+legacy) or CSM to allow the media to boot in "impure" UEFI/EFI mode.
In other cases, Windows 7 was installed during BIOS/legacy mode to MBR partitions, and the partitions are converted to GPT later using disk imaging tools (this is also known as converting a working Windows 7 BIOS installation to UEFI - this worked for me). This approach is addressed in: How to move an existing installation of Window 7 64bit to UEFI (from legacy)
There is also a third approach to bypass the UEFI boot issue, by booting into some other environment (WinPE, or even another version of Windows that is already installed and running in UEFI), where Windows 7 installation to UEFI can be initiated without having to boot the installation media itself.
You need to have Windows 7 x64 installed using UEFI, but Windows 7 can't install in a pure UEFI environment. If you can't boot into the
UEFI installer with your legacy BIOS (CSM) enabled you need to use an
EFI shell and start the installer from the EFI command line. It's not
as difficult as it sounds. There are also guides around for converting
an in place Windows 7 system from BIOS to UEFI, and while that should
also fix it, none of those guides worked for me.
Source: https://www.reddit.com/r/Windows10/comments/3l6110/windows_7_upgrade_and_0xc000000f_device_not/
A bug report on 'UEFI Win 7 USB fails to boot'. I encountered a
similar error and verified that the installation media can boot in
UEFI with other hardware, just not the hardware that it cannot work
with.
Source: https://github.com/pbatard/rufus/issues/254
On some Acer, Gateway, P. Bell, Windows 7 x64 will not install in UEFI
mode, you need to use Legacy mode.
Source:
https://www.eightforums.com/installation-setup/29993-trying-install-win7-uefi-mode.html
FAQ from a motherboard vendor that explains their UEFI support for Windows 7:
In order to install Windows 7 on 1762/16F3 with a Windows 8 BIOS, be sure to go to
BIOS -> Boot -> Boot Mode, change UEFI to LEGACY. Failure to do so
will cause the OS to hang at “Starting Windows” and will not proceed
further. Once you switches to Legacy mode then the issue disappears.
Why I can’t use UEFI mode to load Windows 7?
It is impossible to
install Win7 OS (using WinPE3.0 environment) in our Win8 NB UEFI mode
(pure UEFI) setting, that’s why you need to switch to legacy mode.
Win8 BIOS’ UEFI mode only supports WinPE 4.0 protocols. On desktop
motherboards, Win7 OS can be installed via UEFI mode because this UEFI
mode is Hybrid therefore it supports such installation. This is not a
pure UEFI mode but a mixture of Legacy and UEFI environment. This
pure UEFI mode in NB BIOS is same as enabling UEFI Win8 features under
motherboard BIOS.
Source:
https://service.msicomputer.com/msi_user/support/techfaqdetail.aspx?formid=3061
Related:
Windows 7 Ultimate 64-bit cannot boot in UEFI
Can only install Windows 7 in UEFI-Legacy Mode
Installing Win 7 To GPT and Why My UEFI Mobo Won't Boot From CD Unless In Legacy Mode
Best Answer
It's theoretically possible, and may be semi-practical on some computers. What you'd need to do is to merge CoreBoot with a TianoCore UEFI payload. I've never tried it, but I've heard of this being done. Computer manufacturers could of course do this or something similar themselves, although I don't expect many will do so. Aside from the simple technical knowledge required to do this, the major obstacle is one of the size of the EEPROM chips on most motherboards. UEFI is pretty big, and although I don't know the details offhand, my understanding is that it's big enough that motherboard manufacturers wanting to support UEFI have had to increase the size of their EEPROMs to hold UEFI implementations. Thus, such an upgrade would work only on computers that had unusually large EEPROMs to begin with, or on computers on which you could swap out the EEPROM for a bigger one.
Another approach is to put TianoCore UEFI on your hard disk and boot it like a boot loader or OS. This is possible with a TianoCore build called DUET, which I wrote about here. This works only on some computers and is awkward to get running. I also don't know offhand if it supports Secure Boot. Even if it did, Secure Boot on such a configuration would be rather pointless, since it would still rely on a BIOS-mode boot loader to get started, so malware could theoretically still creep in though that unsecured foundation. (OTOH, I'm a bit skeptical that malware would survive the odd journey from BIOS through DUET to a booted OS.)