the warnings could be observed with MSVC 2010SP1 (16.0.40219.1) x86 target in dbg configuration:
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(682) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(689) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(692) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(707) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(715) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(722) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(731) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(779) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(782) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(797) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(817) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(1026) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(1153) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\0410rls\reactos\boot\freeldr\freeldr\lib\fs\btrfs.c(1194) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
Fix picked from 0.4.11-dev-170-g d0e29db1cb
All those bugs were introduced by 0.4.10-dev-595-g 3b69eee7a6
The main motivation to port all that back is to get rid of Win32K-BSODs 0x50 like CORE-13907
that could be triggered by user-mode-applications.
Technical reason was CORE-14857 "RtlImageNtHeaderEx needs SEH" and issues with hooks+callbacks.
All other tickets mentioned in here were regressions that we experienced on the long
journey towards perfecting the fixes on master head, and those were not happening yet in the older builds,
so they are mentioned in here only to allow tracking where that code went into.
Thanks to Jim Tabor, Mark Jansen & Thomas Faber
By squashed backmerge of the following commits:
0.4.15-dev-3440-g a89844f740
0.4.15-dev-3430-g 9cff384c22
0.4.14-dev-1287-g 568b6d0558
0.4.14-dev-1255-g 177ae91bf6
0.4.14-dev-1241-g 915a5764a9
0.4.14-dev-1240-g d8add40e89
0.4.14-dev-1002-g feb7df42b4
JIRA-tickets: CORE-13907, CORE-16769, CORE-14857, CORE-17856, CORE-17857, partially CORE-13019.
We also had some more dupes of CORE-13907 in JIRA, but I linked all of them (transitively)
towards the initial report, and resolved them without setting a fixVer for them.
In more detail:
--------------
[USER32] Fix BSOD 0x50 in 'WineVDM + Castle Of Winds' CORE-17856 CORE-17857
CORE-17856 BSOD 0x50 when starting Castle of the Winds second time, with WineVDM
CORE-17857 BSOD 0x50 on shutdown after closing Castle of the Winds with WineVDM
0.4.15-dev-3430-g 9cff384c22
0.4.15-dev-3440-g a89844f740
--------------
[NTUSER] Fix Strings and Format to Hooks
Allocate heap instead of data segment to be used for callbacks on user side.
Move and correct initial hook call out setup. Use it in more than one hook call.
This fixes issues with strings out of alignment and use of kernel pointers.
See CORE-13907 (HXD-portable BSOD) and CORE-16769 (HXD-portable exception)
Small wow update.
cherry picked from commit 0.4.14-dev-1287-g 568b6d0558
--------------
[RTL] Introduce RtlpImageNtHeader,
which implements the required functionality.
ntdll and ntoskrnl now have a wrapper for this, with SEH.
This protects the function against malformed / bad images,
whilst still being able to use the code in freeldr et al.
Idea from Thomas.
CORE-14857
cherry picked from commit 0.4.14-dev-1255-g 177ae91bf6
--------------
[WIN32SS] Form Sanity to Hook Callbacks
Fix WH_CALLWNDPROC/RET data to user hook calls.
Helps with CORE-13907 "(HXD-portable BSOD)"
Fixes the logging of "(win32ss/user/ntuser/callback.c:748) err: Failure to make Callback! Status 0xc00000fd" within CORE-13019, but not the whole ticket.
cherry picked from commit 0.4.14-dev-1241-g 915a5764a9
--------------
[USER32] Fix null return.
See CORE-16769 "HxD 1.7.7.0 portable unhandled exception"
cherry picked from commit 0.4.14-dev-1240-g d8add40e89
--------------
[WIN32SS] Fix a typo in dbg print
cherry picked from commit 0.4.14-dev-1002-g feb7df42b4
Volume boot record is also implemented, it supports reading BTRFS tree structures with upto 64k node size.
This support required to change all path in Free Loader to lowercase for better performance.
CORE-13769
This happened for the livecd, where the cdfs driver was inserted twice - once since it is the driver for the boot device, and the 2nd time, because it was specified in the registry - which was then initialized twice by the kernel, leading to a name conflict when trying to create another device object, which resulted in the newly created device object to be dereferenced again and the driver unloaded. This can be seen from the debug message "(ntoskrnl\mm\ARM3\sysldr.c:955) Leaking driver: cdfs.sys"
On x64 we only map 1GB of pages, so adjust MM_MAX_PAGE accordingly and also respect that value when searching for the best location of the page lookup table.
CORE-11048 #resolve
GAS uses ".double" symbol for declaring floating-point constants and
".quad" symbol for declaring 64-bit numbers.
This is not compatible with our macro for MASM and introduces bugs.
Now 64-bit constants are supposed to be declared using ".quad" macro.
- Plus: Add missing email address in 74f92c3d86.
- Remove superfluous blank lines.
- Add 2 TRACE("FunctionName()\n").
- Use "0x%llx", not "%lu", for BaseAddress and Length. (Copypasta in my recent commits.)
- Add "0x" to 1 "%p" and 1 "%lx".
[FREELDR] Update ACPI (Extended Attributes) support in PcMemGetBiosMemoryMap()
CORE-13332
* PcMemGetBiosMemoryMap(): Add Extended Attributes set and check for entry validity and default handling of unexpected case.
* pcbios.h: Rename superceded BIOS_MEMORY_MAP.Reserved. Adapt existing code to new ACPI 6.2-A definitions.
* pcbios.h: Update BIOS_MEMORY_TYPE and BIOS_MEMORY_MAP to ACPI 6.2-A from 1.0+.
* PcMemGetBiosMemoryMap(): Misc fixes, no functional changes.
*Create PcMemCheckUsableMemorySize(), to split unrelated code out.
*Fix a copypasta in 2 output strings from ba9a1c3abb.
*Improve output readability of TRACE("ECX ...", ...).
*Move a TRACE("\n").
*Improve code style a bit.
- We use this as a chance to also update the CMake file in terms of consistency.
- The clang-cl build applies the /Os flag on all the source files that are now using the PCH too.
Cast MAX_BIOS_DESCRIPTORS to explicit ULONG from implicit int.
Comment/Add checks for PcMemoryMap/PcBiosMemoryMap arrays being full and bare handling of error cases.