Sorry this is something I had to do, I should have investigated deeper
before approving it and that's on me so ill take this over and get this
done. and credit you once again. Thank you @ILauncherDev
This reverts commit 185225a5fc.
Follow-up of #7795. This affects
boot condition of es-CR, rm-CH,
ur-PK, fa-IR, vi-VN, ka-GE, bn-IN
and my-MM users.
EDIT: These languages are not
supported in
base/setup/usetup/
muilanguages.h yet.
JIRA issue: CORE-19496
Modify boot/bootdata/hivesys.inf t
o change the values of
HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\Control\Nls\
Language and HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\Control\Nls\
Locale registry keys.
JIRA issue: CORE-19496
Modify boot/bootdata/hivesys.inf to change
the values of registry key HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\Control\Nls\Locale.
Use a `[Shell]` section with `DefaultThemesOff` and `CustomDefaultThemeFile`
values, specifying respectively whether to use the classic theme or a
custom one, and the complete path to the custom .theme (or .msstyles) file.
These values are compatible with those documented in the
"MS Windows Preinstallation Reference" help file
of the Windows installation CD (DEPLOY.CAB\ref.chm)
[BOOTDATA] bootcd/unattend.inf: Use the Shell/CustomDefaultThemeFile value to specify which theme to use
[DDK] Update IDENTIFY data and other ATA definitions.
Based on the MinGW header.
[FREELDR] Refactor and optimize the IDE driver.
Fix long-standing bugs, which have a negative impact on the boot stability.
- Make the driver more ATA specification compliant.
- Improve the speed of device detection.
- Remove inconsistent delays.
- Support modern hard drives with sector size greater than 512 bytes.
- Add basic error recovery.
- Move private definitions to a separate private header.
- Remove the useless AtaFree API method.
Rewrite the Ext bootsector because the older one was broken and had no compatibility with Ext4 extents.
Introduce a 3rd-stage bootsector for complex code.
CORE-14235
- Why was the previous bootsector broken?
Because of hardcoded inode size, hardcoded freeldr base address, etc.
- Why is there a extldr.sys?
The extldr.sys was introduced because the limited code space in the bootsector
prevents adding new features, such as Ext4 full extents support.
- What is extldr.sys and What does it do?
It is the helper file for the Ext bootsector and that is necessary for adding
Ext4 support. It locates the freeldr.sys file, loads it into memory and runs it.
When drawing the menu, the boot options should not be overwritten, but when clearing the screen, everything needs to be drawn, otherwise there will be uninitialized characters at the bottom. See CORE-20014.
* [FREELDR] Mark noreturn functions
* [FREELDR] Compile hw debugging support code only in debug builds
- Make BREAKPOINT() portable
* [FREELDR] Consolidate identical names into a single string
* [FREELDR] Use intrinsics for string I/O operations on x86 and x64
Stop them being pulled in from a static minihal library
* [MINIHAL] Exclude unnecessary portio dependency
This removes a dependency of UI code to boot options code by getting rid of a call to DisplayBootTimeOptions() from within the menu code.
Instead this is now handled by MainBootMenuKeyPressFilter.
URLs are getting old. We have to
update URLs for documentation
purpose.
JIRA issue: CORE-19963
- Refresh old URLs.
- Add " (DEAD_LINK)" labels
to dead links.
- Use MS Learn links rather
than MSDN ones.
- Some dead links revived by
Web Archive.
- Don't change Wine Tests
and Wine Sync.
- Don't change 3rd party libraries.
- Don't append "redirected" labels.
PeLdrCheckForLoadedDll():
- Use a for-loop to iterate over the linked list.
- Adjust few comments.
- Use SAL2 annotations.
PeLdrpCompareDllName():
- Make its input paramters const.
- Use SAL2 annotations.
Use the PE import table's OriginalFirstThunk array when scanning and
resolving imports during DLL binding.
It points to an array of pointer-sized IMAGE_THUNK_DATA structures
which describe the functions being imported. On the other hand, the
FirstThunk points to an array of pointers, whose initial values are
a copy of those pointed to by OriginalFirstThunk, but are replaced
by the actual function pointers determined at runtime, when a DLL
is loaded (see PeLdrpBindImportName() function).
If we were to use the FirstThunk array to find again later the imports
by name or ordinal, we would fail because these are replaced by the
addresses of the corresponding functions.
This fixes loading kdcom.dll from Windows XP x64 with FreeLDR when
testing on ReactOS x64.
```diff
(freeldr\freeldr\lib\peloader.c:498) trace: PeLdrpScanImportAddressTable() ---- Calling PeLdrpBindImportName() in a loop
(freeldr\freeldr\lib\peloader.c:501) trace: *** ThunkName->u1.AddressOfData = 00000000000070F0
(freeldr\freeldr\lib\peloader.c:502) trace: *** ThunkData->u1.AddressOfData = 0000000000573780
(freeldr\freeldr\lib\peloader.c:209) trace: !!! ExportDirectory->NumberOfNames 1504
-(freeldr\freeldr\lib\peloader.c:210) trace: !!! ImportHint 0 - ExportName 'CcCanIWrite' - ImportDataName ''
+(freeldr\freeldr\lib\peloader.c:210) trace: !!! ImportHint 282 - ExportName 'HalPrivateDispatchTable' - ImportDataName 'HalPrivateDispatchTable'
....
-(freeldr\freeldr\lib\peloader.c:268) err: Did not find export ''!
-(freeldr\freeldr\lib\peloader.c:709) err: PeLdrpScanImportAddressTable() failed: ImportName = 'ntoskrnl.exe', DirectoryPath = 'multi(0)disk(0)rdisk(0)partition(2)\ReactOS\system32\'
```
('-': lines before the fix; '+': lines after the fix)
Code has been adapted based from the following functions:
ntdll/ldr/ldrpe.c!LdrpSnapThunk() and LdrpSnapIAT()
ntoskrnl/mm/ARM3/sysldr.c!MiSnapThunk() and MiResolveImageReferences()
References:
https://devblogs.microsoft.com/oldnewthing/20231129-00/?p=109077https://devblogs.microsoft.com/oldnewthing/20231130-00/?p=109084https://stackoverflow.com/questions/42413937/why-pe-need-original-first-thunkoft