This is used with Clang, which does have native SEH, but it's broken and can cause the compiler to crash. Previously some code was not handling this and instead used native SEH for clang. Fix this by always using _SEH2_* macros instead of relying on __USE_PSEH2__ to be defined.
Improve consistency of code management.
JIRA issue: CORE-19278
- Move SHOpenPropSheetA from
utils.cpp into propsheet.cpp that
contains SHOpenPropSheetW.
PAGE_ROUND_DOWN macro seems to not work correctly with LONGLONG values. It creates some random freezes in the 1st-stage setup after commit 69bf140506.
It's fixed by creating PAGE_ROUND_UP_64 and PAGE_ROUND_DOWN_64 macros for 64-bit only data types.
---------
Co-authored-by: Thamatip Chitpong <thamatip.chitpong@reactos.org>
This is used with Clang, which does have native SEH, but it's broken and can cause the compiler to crash. Previously some code was not handling this and instead used native SEH for clang. Fix this by always using _SEH2_* macros instead of relying on __USE_PSEH2__ to be defined.
Try to improve things
For some unknow reason some intrinsics fail to get inlined. Using extern inline results in a linker error. Change it to static inline, so that there is a static implementation in case it doesn't get inlined
#pragma function(llabs) causes an error: "error: no_builtin attribute has no effect on defaulted or deleted functions"
This is probably a bug in clang, see https://github.com/llvm/llvm-project/issues/116256
- Declare CMBATT_DISCHARGE_TIME and CMBATT_CAPACITY_BOGUS constructs
- Determine if the battery was already discharging and if not, update the time when it's being discharged
- Fix the condition where it checks if the battery has been discharging for quite some time
- Default the time to BATTERY_UNKNOWN_TIME if querying the estimated battery time request fails or if the battery has just started discharging not over 15 seconds
CORE-18969
CORE-19452
Addendum to commit dbc7eeb47e (PR #4303).
The argument to get_temp_buffer() should specify the length of the
string being buffered + 1 (for the NUL-terminator).
The original code wrongly interverted this with specifying the buffer
shifted by one character.
Get rid from bogus SearchPathW() call, which is marked as most likely not needed in the comment above (by Wine). Simply get a length of the file name and use the file name directly instead, with checking for its validity too. Similarly as it's done for other cases.
That call seems actually not needed because it is already done using SearchPathW() in another parts of the code in this file, before calling SHELL_ArgifyW().
Fixes another heap corruption when trying to login via OAuth menthod in SpotifyXP 2.0.3 Beta (nightly build). The previous commit did not fix the bug fully, as I discovered it later.
CORE-19953
Windows SDKs define this constant to 0xFFFFFFFF but we define it to 0x80000000.
As a result, when our COMPBATT driver is being tested on Windows (namely XP, Vista and 7), BATTERY_UNKNOWN_TIME is not interpreted as UNKNOWN TIME but entirely something else.
CORE-18969
CORE-19452
IoInitializeRemoveLock expects an allocation tag to be provided when it allocates debug data in the kernel.
Passing 0 leads to a bunch of ASSERTs in the kernel as such data is allocated by ExAllocatePoolWithTag of which a tag has to be supplied, it's not optional.
- Introduce some new constructs
- Annotate the function prototypes with SAL2
- Re-structure & remove some useless fields in COMPBATT_DEVICE_EXTENSION and COMPBATT_BATTERY_DATA