Commit graph

558 commits

Author SHA1 Message Date
Jérôme Gardou 162f51e6b8 [OLDNAMES] Add missing isascii 2021-03-17 18:52:58 +01:00
Jérôme Gardou 7e5c1872ee [RTL] Improve performance by introducing a hint array for free entries
The array is there for the entries smaller than the decommit threshold, the rationale
being that entries which are larger will likely be split for honoring other allocations
or be coalesced and eventually decommitted.

This with the previous commits make a huge perf boost to memory-intensive applications like cmake

CORE-15793
2021-03-16 13:23:21 +01:00
Jérôme Gardou 325737f855 [SDK:RTL] Track the end of uncommitted ranges thanks to a "Guard" entry that we put at the end of each committed page
This avoids busy loop to get the last valid entry of the previous committed range when committing a new one.

CORE-15793
2021-03-16 13:23:21 +01:00
Katayama Hirofumi MZ e076e0576f [ATL] Add NULL-check in CWindowImplBaseT::WindowProc assertions
CORE-17505
2021-03-11 21:20:40 +09:00
Katayama Hirofumi MZ 9259ded8ae
[ATL][SHELL32][EXPLORER] Disable ATLASSERT (#3527)
We are not ready for enabling ATLASSERT. Enabling ATL assertions takes time to realize. CORE-17505
- Disable ATLASSERT by undefining _DEBUG.
- Revert currently non-fixable codes.
2021-03-11 20:26:45 +09:00
Katayama Hirofumi MZ 4f83032a12 [ATL] Split CWindowImplBaseT::WindowProc asserion
CORE-9281
2021-03-11 17:18:43 +09:00
Serge Gautherie 0975c5ef40
[ATL] CMakeLists.txt: Use a bare endif() (#3523)
Addendum to 98203ce.
2021-03-11 08:38:04 +09:00
Victor Perevertkin df35c8d05e
[SDK:KMDF] Populate OsVersionInfo in our static linking hack 2021-03-10 18:41:46 +03:00
Victor Perevertkin 6d1ca3553e
[SDK:KMDF] Fix calling convention for the kernel function pointers 2021-03-10 18:41:03 +03:00
Katayama Hirofumi MZ 98203cea23
[CMAKE] Define _DEBUG for better ATL debugging (Retry) (#3519)
CORE-17505
2021-03-10 22:59:13 +09:00
Victor Perevertkin 0a26c7c5d2
[SDK:DDK] Implement the Auxiliary Kernel-Mode Library
And uncomment the code in KMDF which uses it
2021-03-10 16:43:59 +03:00
Jérôme Gardou 0c34c067c4 [CRT] Add CFI annotatiions to memmove function 2021-03-09 19:42:49 +01:00
Jérôme Gardou 65b6af58f9 [SDK:RTL] Statically initialize RtlCriticalSectionList
This might be used before RtlpInitDeferedCriticalSection gets called
2021-03-03 14:10:47 +01:00
Jérôme Gardou 2306c83e5c [CMAKE] Explicitly declare libcntpr as a static lib 2021-03-03 08:34:32 +01:00
Serge Gautherie 55b93aecdc
[CMAKE] target_compile_definitions() calls: Remove (now) useless '-D' (#3490)
Documented as automatically removed, since CMake 3.12.4 at least.
https://cmake.org/cmake/help/v3.12/command/target_compile_definitions.html
2021-03-03 04:16:02 +01:00
Serge Gautherie e898c9e0df
[RTL_VISTA] CMakeLists.txt: Fix 'rtl' copypasta (#3489)
Addendum to 6119239.
2021-03-02 19:06:17 +01:00
Katayama Hirofumi MZ e24d3cc952
[SDK][ATL] Fix CWindow::GetWindowText method of BSTR (#3498)
- Fix generic text mapping for GetWindowText and GetWindowTextLength functions.
- Fix the position.
- Fix the length.
- Fail elegantly if necessary.

CORE-9281
2021-03-02 17:50:00 +09:00
Katayama Hirofumi MZ ef3e7a3717
[SDK][ATL] Implement UnsubclassWindow methods (#3492)
I want UnsubclassWindow methods.
- Implement CWindowImpl::UnsubclassWindow method.
- Implement CContainedWindowT::UnsubclassWindow method.
- Add SubclassWindow testcase to atl_apitest test program.
- Fix generic text mapping of <atlwin.h>.
CORE-9281
2021-02-28 12:45:16 +09:00
Hervé Poussineau bbf7b5b72a [CRT/x64] Correctly implement fabs for GCC
Note that MSVC does not recognize 'fabs' as a valid label name.
See fee844b6ff and 2f7cf157d8
2021-02-01 19:57:12 +01:00
Hervé Poussineau 349e0ddde8 [PSEH] Fix test on non-existent variable, so GCC x64 now always uses native SEH instead of PSEH 2021-02-01 19:57:12 +01:00
Jérôme Gardou d712c895fd [RTL] Fix a typo & remove useless cast 2021-02-01 09:09:19 +01:00
Jérôme Gardou 6a4c6ea5d0 [RTL] Implement RtlTryAcquireSRWLockExclusive & RtlTryAcquireSRWLockShared 2021-01-29 18:42:54 +01:00
Jérôme Gardou 2486558ae1 [RTL] Do not mess with critical section lock when there is no reason to.
- When process is shutting down.
 - When the caller is so drunk that they leave twice the pub altough they entered it only once.
2021-01-29 18:18:09 +01:00
Jérôme Gardou 6d697561f0 [RTL] Fix heap usage flags
- Use Heap->ForceFlags where needed
 - Use passed-in flags instead of the heap flags in some places
 - Do not recursively acquire the heap lock
2021-01-29 09:42:13 +01:00
Hervé Poussineau 457b83f76a [PSEH] When using GCC x64, use native SEH support instead of PSEH 2021-01-28 20:44:21 +01:00
Hervé Poussineau c345f7f137 [ASM x64] Make UNIMPLEMENTED macro self-suffisant
This fixes link errors with MsgUnimplemented not defined on binaries not linking to CRT.
2021-01-28 20:31:16 +01:00
Jérôme Gardou af3527d4d2 [MSVCRTEX] Do not include _CI* math functions
They are exported by msvcrt
CORE-17423
2021-01-21 09:43:43 +01:00
Mark Jansen 69dffed3f7 [CMAKE] Fix MSVC configuring 2021-01-15 20:43:10 +01:00
Hervé Poussineau 0cce1348c6 [CRT/x64] Make _fpreset/_logb public, as they are exported using the .spec file 2021-01-07 21:12:11 +01:00
Hervé Poussineau a644e7f5fd [CRT/x64] Disable MSVCRT__setjmp function, which references non-existent function __wine_setjmpex
_setjmp is already defined in sdk/lib/crt/setjmp/amd64/setjmp.s
2021-01-07 21:12:11 +01:00
Hervé Poussineau 80b1b0b294 [CRT] Fix hack for GCC x64, when CRT is linking against RosBE libstdc++ 2021-01-05 19:24:23 +01:00
Jérôme Gardou c8d07514c8 [CMAKE] Fix GCC -fstack-protector usage 2021-01-05 13:38:57 +01:00
Jérôme Gardou 8a6d653044 [CRT] Fix _onexit
Avoid calling malloc in CR initialisation code.
Have executables call msvcrt implementation, while the DLLs keep their own function tables

CORE-17362
2020-12-30 19:03:52 +01:00
Jérôme Gardou 6c6d9bee68 [CRT] Do not call atexit at process initialization
There is no guarantee that the underlying APIs are initialized at this point

CORE-17362
2020-12-30 19:03:52 +01:00
Jérôme Gardou 26863538a4 [CRT] Format source a bit.
This is horrendous.
2020-12-30 19:03:52 +01:00
Jérôme Gardou b96e88894a [CMAKE] Turn import libs into regular C static libs
Embed msvcrtex into libmsvcrt

Idea taken from Thomas Faber
2020-12-28 12:13:30 +01:00
Joachim Henze b0d136ffcf [RTL] Fix build on MSVC bots part 2
Then stick with your stupid PCH on master already.
Addendum to 0.4.15-dev-1453-g 4ad7b6d
2020-12-17 15:01:50 +01:00
Joachim Henze dd3c540928 [RDBSSLIB][RTL] Fix build on MSVC bots
Addendum to 0.4.15-dev-1453-g 4ad7b6d
Looks like CMake on master does not longer understand the syntax of
replace_compile_flags().
Will investigate that later again, when other issues have been
solved that do currently prevent me from testing that locally at all.
Most likely remove_target_compile_option() has to be used instead now.
2020-12-17 14:33:26 +01:00
Joachim Henze 4ad7b6d634 [APISETS][RDBSSLIB][RTL] Fix some build issues for MSVC Rls-config CORE-17402
A subset of the patch that is intended to fix all build issues in releases/0.4.14
for compiler MSVC 2010SP1 16.0.40219.1 with RosBE 2.1.6
I left out the changes for disk_new in master because the drivers sources
were replaced since the branching.

Thanks to Mark Jansen for providing the apisets part.

VBox https://reactos.org/testman/compare.php?ids=75522,75524
KVM https://reactos.org/testman/compare.php?ids=75521,75523
2020-12-17 13:31:43 +01:00
Timo Kreuzer 883ae6d93b [RTL] Fix RtlImageDirectoryEntryToData to support both 32 and 64 bit images 2020-12-06 16:37:57 +01:00
Hermès Bélusca-Maïto 8d3e80e437
[FSLIB][FMIFS][AUTOCHK][SETUPLIB] Use more Windows-compatible (but not fully compatible yet) Format() and Chkdsk() ULIB functions.
[AUTOCHK] Add also support for scanning FATX volumes.

The Format(), FormatEx(), Chkdsk(), ChkdskEx() functions exposed by the
U*.DLL user-mode FS library dlls are different (and have different
prototypes) than the similarly-named functions exported by FMIFS.DLL .

In particular, what we used to call "xxxChkdskEx()" and "xxxFormatEx()"
in our U*.DLL libraries actually correspond more, from their arguments,
to the "Chkdsk()" and "Format()" functions in Windows' U*.DLL . Their
*Ex() counterparts instead take most of the parameters through a
structure passed by pointer.

On FMIFS.DLL side, while FMIFS!Chkdsk() calls U*.DLL!Chkdsk() and
FMIFS!ChkdskEx() calls U*.DLL!ChkdskEx() (and we do not implement these
*Ex() functions at the moment), both FMIFS!Format() and FMIFS!FormatEx()
call U*.DLL!Format() instead, while FMIFS!FormatEx2() calls
U*.DLL!FormatEx() (that we do not implement yet either) !!

To improve that, refactor the calls to these U*.DLL functions so as to
respect the more compatible prototypes: They contain the correct number
of parameters in a compatible order. However, some of the parameters do
not have the same types yet: the strings are kept here in PUNICODE_STRINGS,
while on Windows they are passed via an undocumented DSTRING struct, and
the FMIFS callback is instead a MESSAGE struct/class on Windows.
Finally, the MEDIA_TYPE parameter in U*.DLL!Format() is equivalent, yet
not fully 100% in 1-to-1 correspondence, with the FMIFS_MEDIA_FLAG used
in the corresponding FMIFS.DLL functions.

One thing to notice is that the U*.DLL!Format() (and the Ex) functions
support a BOOLEAN (a flag resp.) for telling that a backwards-compatible
FS version should be used instead of the (default) latest FS version.
This is used e.g. by the FAT FS, where by default FAT32 is selected
(depending also on other constraints like, the disk and the partition
sizes), unless that bit is set in which case, FAT16 (or 12) is used.
2020-11-22 21:57:07 +01:00
Hermès Bélusca-Maïto cdaa5d5fc7
[BTRFSLIB] Reduce the diff with upstream, and fix a memory leak.
- Reduce the diff with upstream by aliasing malloc() and free()
  with RtlAllocateHeap() and RtlFreeHeap() respectively.

- Fix a memory leak in the failure code path of the do-while
  memory reallocation loop for IOCTL_BTRFS_QUERY_FILESYSTEMS
  in is_mounted_multi_device().
2020-11-22 21:34:13 +01:00
Jérôme Gardou b0abd14b03 [ATL] Declare pointer as return type for functions returning pointers 2020-11-16 16:58:10 +01:00
Jérôme Gardou 281389b7e7 [CRT] Use ASM aliases for CLang builds 2020-11-16 16:58:10 +01:00
Jérôme Gardou 15c9f63b65 [MSVCRTEX] Add some floating point functions for CLang build
Clang makes optimisations requiring functions not present in msvcrt
2020-11-16 16:58:10 +01:00
Victor Perevertkin 7c734db034
[WDF] Enable Resource and Interrupt APIs 2020-11-04 19:34:14 +03:00
Victor Perevertkin 1f377076d7
[WDF] Fix KMDF so it can compile with ReactOS SDK
Not all files are included, but these are necessary to compile cdrom driver.
So far it can only be statically linked with drivers, a proper
implementation requires wdfldr helper driver
2020-11-03 00:06:27 +03:00
Victor Perevertkin 8a978a179f
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9

Licensed under MIT
2020-11-03 00:06:26 +03:00
Timo Kreuzer 2c791cdde7 [CRT] Remove duplicated atexit/onexit code
This removes the broken wine version of atexit and onexit. It keeps only dllonexit, which is implemented properly. The previous __call_atexit is moved to where the mingw onexit/atexit code is and adjusts it to work with the existing code. A call to __call_atexit is added in __tmainCRTStartup after the main function was called.
2020-11-01 09:33:14 +01:00
Jérôme Gardou 23e04ae1ee [CMAKE] Use an INTERFACE library to perform the msvcrt <-> msvcrtex binding 2020-10-22 18:07:27 +02:00
Jérôme Gardou ab825334dd Apply suggestions from code review
Beautification and clarity

Co-authored-by: Victor Perevertkin <victor@perevertkin.ru>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-10-20 21:44:54 +02:00
Jérôme Gardou 00ed72d7e8 [CMAKE] Get rid of add_compile_flags
Use add_compile_options and the like instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou 7e116f0ef3 [CMAKE] Get rid of replace_compile_flags
Introduce a finer-grained remove_target_compile_option instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou 907025a018 [CMAKE] Introduce the atl_classes interface library
This takes care of adding the relvant include directory and the _ATL_NO_EXCEPTIONS define, if needed
2020-10-20 21:44:54 +02:00
Jérôme Gardou d6ea8659c8 [CMAKE] Get rid of the set_cpp macro
Instead of messing with global variables and the like, we introduce two target properties:
 - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
 - WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
 - cpprt: for C++ runtime routines
 - cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
2020-10-20 21:44:54 +02:00
Victor Perevertkin bb94e711ef
[NTOSKRNL_VISTA] Add stubs for functions needed in KMDF 2020-09-25 01:28:55 +03:00
Victor Perevertkin be276dde28
[XDK][NTOSKRNL_VISTA] Put NTKRNLVISTAAPI to XDK headers
for vista+ APIs implemented in ntoskrnl_vista.
Now if you statically link ntoskrnl_vista into a driver,
NTKERNELAPI will automatically be removed from an API definition
2020-09-24 21:51:57 +03:00
Timo Kreuzer cb22d5f697 [NTOS:PS] On x64 don't fail in NtSetInformationProcess with ProcessUserModeIOPL information class, instead just don't do anything.
For NT6+ appcompat setting return STATUS_NOT_IMPLEMENTED
2020-09-20 23:08:17 +02:00
Timo Kreuzer 64d7db506c [CRT] Return from fpreset() 2020-09-20 23:08:17 +02:00
Timo Kreuzer aff33c855d [CRT] Use chkstk_ms.s on x64 builds 2020-09-20 23:08:17 +02:00
William Kent 427ea67b9c
[RTL] Add code to SxS manifest parser to parse XML namespaces (#2512)
* [XDK] Typo fix
* [XDK] Add missing ACTIVATION_CONTEXT_SECTION values
* [RTL] Merge changes from Wine
* [ROSTESTS] Fix typo
* [NTDLL] Typo fix
* Add test for new functionality
* [ROSTESTS] Fix path
* [ROSTESTS] Add test to testlist.c
2020-09-20 22:56:42 +02:00
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Jérôme Gardou a84b0dbe6b [LIBWINE] make wine_get_dos_file_name available
And complain loudly when we get a *real* unix file name
2020-09-16 10:35:30 +02:00
Joachim Henze a27f0debca [MMIXER] Fix NULL dereference CORE-17276
This lead to a crash of winmm:mixer
during "GCCLin_x86 on Test VBox".

The crash was exposed when new code paths
were activated by 0.4.15-dev-791-g
6d7ebc2048

I do intend to port this commit back into 0.4.14RC.
2020-09-15 20:54:50 +02:00
Serge Gautherie a04831677e
[PROGMAN][CRT][USER32] Do not use LoadLibraryEx() NT6+ flags (#3152)
CORE-12004
2020-09-13 23:42:09 +02:00
Timo Kreuzer 3c1f6631e6 [MSVCRT] Add vista exports 2020-09-13 15:37:29 +02:00
Timo Kreuzer dfaba507dc [MSVCRT] Fix some architecture specific exports 2020-09-13 15:37:29 +02:00
Timo Kreuzer 61192390cf
[KERNEL32_VISTA][NTDLL_VISTA][RTL_VISTA] Move Vista Rtl functions from kernel32_vista and ntdll_vista to rtl_vista (#3149)
* Move RtlRunOnce functions from kernel32_vista to rtl_vista and export them from ntdll_vista
* Move condvar.c and srw.c from ntdll_vista to rtl_vista
* Move ntdll_vista build script to a subfolder of ntdll

The RtlRunOnce functions are taken from wine, completely unmodified.
The code that was in kernel32_vista had change that used a global keyed_event handle, but was never initialized, so we were still passing NULL thus using the global ExpCritSecOutOfMemoryEvent.
2020-09-12 15:04:02 +02:00
Timo Kreuzer 2aca4b2795 [ASM] Fix boot with VS 16.7.3 / MSVC 19.27
See https://developercommunity.visualstudio.com/content/problem/1180800/ml-x86-assume-directive-causes-invalid-code-genera.html
2020-09-12 15:01:04 +02:00
Mark Jansen 58092fb4da [ATL][ATL_APITEST] Add CString::Tokenize + testcase 2020-09-07 22:13:43 +02:00
He Yang e44c9b6630
[RAPPS] application-view refactor (#3003)
* [RAPPS] separate application-view from gui.cpp
* [RAPPS] make the code looks more clear
* [RAPPS] fix &  improve tab-order handle
* [RAPPS] now double-click / right-click & install an item will install exactly this app
* [RAPPS] add handling for DWORD timestamp for InstallDate
* [RAPPS] make the code setting column style more clear
* [RAPPS] change the owner of popup-menu
* [RAPPS] now the popup menu (the one when right-click listview) now belongs to application-view
2020-09-06 17:09:21 +02:00
Victor Perevertkin d9864ca6c5
[NTOSKRNL_VISTA][XDK] Implement IoSetMasterIrpStatus 2020-08-29 05:44:34 +03:00
Victor Perevertkin 5e242c5566
[NTOSKRNL_VISTA] Implement/stubplement more Etw, Io, Ke, Po functions
CORE-17129
2020-08-28 15:28:45 +03:00
Hermès Bélusca-Maïto 4aaf54e0a4
[CONUTILS] Use const string pointers for strings that are not modified by the functions. 2020-08-23 19:11:40 +02:00
Thomas Faber 2fb2f1e4c5
[RTL] Allow RtlGetNextRange to be called on a finished iterator. CORE-6372
Fixes crash in kmtest:RtlRangeList.
2020-08-16 16:18:29 +02:00
Hervé Poussineau c4055c455f [HIDPARSER] Remove HIDPARSER specific error codes, and remplace them by HIDP_* NTSTATUS codes
Remove now useless TranslateHidParserStatus() function.
2020-07-31 14:32:08 +02:00
Hervé Poussineau c151f8a1c7 [HIDPARSER] Remove HID_PARSER class, and directly use functions 2020-07-31 14:31:27 +02:00
Serge Gautherie 0b9cbc5179
[CRT] _onexit(): Fix 'memcpy()' size
Cherry-pick
70bff7377d
2020-06-27 14:38:21 +02:00
Serge Gautherie 4213c70e2e
[CRTDLL][CRT] Remove remnant declaration, silence cppcheck false positive.
* _atexit_cleanup is no longer used
* Fix cppcheck 'pointerSize' warning
2020-06-27 14:35:32 +02:00
Thomas Faber aa811c00e3
[MPG123] Update to version 1.26.1. CORE-17098 2020-06-14 09:19:05 +02:00
Thomas Faber 52f103c85b
[RTL] Use LastEntryInSegment to speed up RtlpFindAndCommitPages. CORE-14588 2020-06-14 09:10:31 +02:00
Thomas Faber c4f736e8f4
[RTL] Add and populate LastEntryInSegment. CORE-14588 2020-06-14 09:10:31 +02:00
Thomas Faber dd83bcd6ad
[RTL] Create a define for the common members of HEAP and HEAP_SEGMENT. CORE-14588
The code relies on these members matching up, so it's confusing for them
to be duplicated.
2020-06-14 09:10:27 +02:00
Amine Khaldi 139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Serge Gautherie 3051eb0e48
[NTOSKRNL] Add 'DECLSPEC_NORETURN' to a few 'KeBugCheck*()' (#2896) 2020-06-06 17:50:14 +02:00
Thomas Faber 4dedc8ff52
[RTL] Add FPO information to RtlpExecuteHandler. CORE-15723 2020-06-06 08:40:20 +02:00
Serge Gautherie 6808e40b3b
[SDK:RTL] RtlValidAcl(): Improve ACL error messages (#2833)
CORE-11506
2020-06-05 00:20:20 +03:00
Thomas Faber e4066536c2
[CPPRT][CRT] Avoid extern assembly declarations with no type. CORE-17088
Fixes build with ML 14.26.
2020-05-28 14:26:48 +02:00
Victor Perevertkin 5349f49cfe
[SDK][FREETYPE] Fix GCC8.4 -O2 build 2020-05-21 01:07:26 +03:00
Dmitry Borisov 3fd6dbd943 [CPORTLIB] Fix MSVC build for PC-98 target 2020-05-16 15:23:00 +03:00
Thomas Faber 8523913a58
[RTLVER] Add missing bugcodes dependency. 2020-05-09 11:22:07 +02:00
Bișoc George d8eeb31b8a [SDK][STDLIB][STRING] Wine-sync wcsrtombs_l and _mbstowcs_l
This is a partial sync of the CRT library with wcsrtombs_l and _mbstowcs_l functions from WINE. The _wctomb_s_l implementation of WINE which is used by _wctomb_s, _wctomb_l and wctomb brings failed results of the wctomb unit testcase and at the same time it crashes the whole testcase after.

Therefore I will not address the wctomb function for the moment being.
2020-05-03 15:35:11 +02:00
Mark Jansen 6c37a7255e
[ATL] Add CAtlArray::GetData 2020-04-30 20:38:43 +02:00
Bișoc George 8266f62ff6
[CRT][STDLIB] Wine-sync _mbtowc_l function code
The current _mbtowc_l code directly passes the string count size argument to cbMultiByte argument parameter to MultiByteToWideChar(). As the size of lpMultiByteStr expressed in bytes by cbMultiByte is dependent of the actual given string, the size of lpWideCharStr expressed in characters by cchWideChar is always 1.

The resulting parameters to MultiByteToWideChar() will lead to a failure as lpWideCharStr cannot accommodate the converted string if the size pointed by lpMultiByteStr is larger than the buffer wide string to receive the converted output, a Win32 error code of ERROR_INSUFFICIENT_BUFFER in other words. The fact that _mbtowc_l never fails without WINE Gecko package installed is because the codepage pointed by lc_codepage is CP_ACP and the converted output is directly given to the destination wide string parameter thus never calling MultiByteToWideChar(). Installing WINE Gecko merely unhides this problem.

As _mbtowc_l is imported from WINE and that they have updated their code (which at the same time this fixes the aforementioned problem), the following commit syncs the updated code from WINE.

CORE-16885
2020-04-28 22:41:57 +02:00
Mohamed Mediouni fec11747bb [CRT] Implement __chkstk function for ARM (#1595)
Incoming r4 contains the number of dwords to allocate, converting to bytes then return.
This makes ReactOS applications compiled for ARM running on true ARM Windows.

Reference: 2b095beace
2020-04-26 19:58:53 +03:00
Mohamed Mediouni f2f97f9f4c [CRT] ARM & ARM64 Windows do not have initenv in their CRTs (#1597)
Native CRT on ARM & ARM64 Windows doesn't have these functions.
For compatibility, it's mandatory to not have it at all. Otherwise,
ARM executables built for ReactOS do not run on true ARM Windows.

Consider doing full sync with mingw-w64 CRT in future.
2020-04-26 19:56:34 +03:00
Sylvain Deverre 666bac44c0
[LWIP] Use tcp_close when both shut_rx and shut_tx are set. Fixes CORE-16868 (#2582) 2020-04-26 18:40:47 +02:00
Mark Jansen d5f0b2b160
[RTL] Implement LdrpRecordUnloadEvent 2020-04-26 14:35:51 +02:00
Mark Jansen f26b670b38
[RTL] Partially implement RtlCreateQueryDebugBuffer and RtlDestroyQueryDebugBuffer 2020-04-26 13:44:02 +02:00
Thomas Faber f22fa382fe
[LIBXML2] Update to version 2.9.10. CORE-16952 2020-04-24 14:44:52 +02:00
Katayama Hirofumi MZ 774ef4e80e
[SDK][RTL][NTDLL_APITEST] Add RtlMultipleAllocateHeap and RtlMultipleFreeHeap (#2641)
- Add RtlMultipleAllocateHeap and RtlMultipleFreeHeap functions (2k3+).
- Add a testcase for two functions.
CORE-12026
2020-04-24 17:45:43 +09:00
Victor Perevertkin 194ea909fd
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.2
CORE-16679
2020-04-23 07:07:36 +03:00
Hermès Bélusca-Maïto bbdb0ab6a8
[TZLIB] QueryTimeZoneData(): Don't fail if the optional values "Display", "Std", "Dlt" are missing (or too long to be captured). However fail if the timezone information is missing. 2020-04-22 00:58:32 +02:00
Hermès Bélusca-Maïto 7c3e96a26a
[TIMEDATE.CPL][SYSSETUP][TZLIB] Introduce a small static library "tzlib": "TimeZone Utilities Library", and use it in timedate.cpl and syssetup.dll.
This small win32 library provides time-zone utility wrappers around
Win32 functions, that are used by different ReactOS modules such as
timedate.cpl, syssetup.dll, and a possible future 'tzutil' tool.

The code has been extracted from the common code found in both
timedate.cpl and syssetup.dll.
2020-04-22 00:58:32 +02:00
Victor Perevertkin 7e069ccdb2
[CMAKE] Replace custom functions to built-in ones
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories
2020-04-16 15:59:38 +03:00
Hervé Poussineau 033102fdb1 [NTOS] Add a #define __ROS_ROSSYM__ when using rossym
Use it where needed.
2020-04-09 23:00:57 +02:00
Hermès Bélusca-Maïto 6f67132686
[LIB:ARBITER] Addendum to 374f2b4d: Fix build.
- No need to use a PCH when compiling a 1-file library.
- Add the _NTSYSTEM_ definition.

- Since the arbiter.h file is to be included by the users of this
  library, namely only kernel-mode NT components (incl. NTOS), there
  is no need to include the standard kernel-mode headers in it.
  Include these headers instead in the private implementation of the
  library, arbiter.c.
2020-04-09 20:41:17 +02:00
Vadim Galyant 374f2b4d98
[NTOS][SDK:LIB] Add a Resources Arbiter library, to be used by bus drivers (acpi, pci), kernel and legacy hal (PIC HAL). (#2471) 2020-04-09 19:41:11 +02:00
Victor Perevertkin 167fa2c26a [TCPIP] Remove duplicate declarations from ticonsts.h 2020-04-07 05:32:40 +03:00
Victor Perevertkin d5ad2057d7 [SDK][IP] Pass IP options to ReceiveDatagramHandler 2020-04-07 05:32:40 +03:00
Victor Perevertkin 740a859e92 [TCPIP] Implement IOCTL_ICMP_ECHO_REQUEST in tcpip.sys
Also clean up ICMP handling code in sdk/lib/drivers/ip
CORE-10760
2020-04-07 05:32:40 +03:00
Victor Perevertkin cf3ab9d15a [SDK][IP] Fix formatting 2020-04-07 05:32:40 +03:00
Mark Jansen 1437433039
[ATL] Add some hacks for gcc,
since parsing templates is not something it can do
2020-04-04 19:55:31 +02:00
Mark Jansen a37b5b2f39
[ATL] Fix an ATLASSERT expression 2020-04-04 19:55:31 +02:00
Mark Jansen 62c1bb6448
[CRT] Implement _CrtDbgReport and _CrtDbgReportW
Most functionality is working, except output to file
CORE-11835
2020-04-04 19:55:24 +02:00
Joachim Henze 45b5ec8e7b [RDBSS] Avoid CORE-13938
Pierre recommended this workaround for 0.4.8rls before.
Avoids "GetVolumeInformation now fails on NFS volume"

This workaround was recurrently applied for all releases
0.4.8, 0.4.9, 0.4.10, 0.4.11, 0.4.12, 0.4.13.

I never got any reply in the regression-ticket and recurrently
applying this over and over again is a waste of time.
So I decided to commit to master today, but will leave
the ticket unresolved, so when a proper fix will arrive in the future,
the existing ticket will remind us to undo this workaround.

Please note that I replaced #if 0 with #if 1
as discussed with Pierre. That's different to the patch in ticket.
2020-04-02 15:09:46 +02:00
Mark Jansen 177ae91bf6
[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
2020-03-29 21:27:38 +02:00
Hervé Poussineau 796c1ac993 [TCPIP] Add some static specifiers, to prevent exporting FORCEINLINE function outside compilation unit 2020-03-26 16:39:16 +01:00
Mark Jansen 315765ed8b
[MSVCRT] Add _snwscanf 2020-03-15 13:12:20 +01:00
Dmitry Borisov 222e79232c
[CPORTLIB][NTOS:INBV][KDCOM][FREELDR] Add ComPort library for NEC PC-98 series (#2407)
There are 2 known serial ports:
    COM1 - based on Intel 8251A
    COM2 - National Semiconductor 16550
2020-03-06 19:50:31 +01:00
Thomas Faber 80296be1eb
[CMAKE] When disabling C4101, explicitly remove the error flag.
Fixes VC2010 build.
Addendum to 11ecf5c969.
2020-02-24 22:29:33 +01:00
Timo Kreuzer 9efafd640f [CRT] Import wine exception handling code
The code is mostly unchanged. This includes the following changes:
* Move all wine code to crt/wine to keep it separated from our own code
* Add a minimal winternl.h
* Remove the asm macros from wine/config.h
* Include wine/asm.h where required
* Fix the names of the exported functions (GCC uses thiscall now and no wrappers are used anymore)
2020-02-09 15:56:30 +01:00
Thomas Faber d528e63477
[CRT] Only write to the output buffer when necessary in _strlwr. CORE-16667
Like e884290d29, this is also a hack and is missing locale awareness.
2020-02-09 10:23:01 +01:00
Oleg Dubinskiy 6f232770d3
[NDK][RTL] Implement RtlGetUnloadEventTrace. CORE-16671 2020-02-09 08:37:58 +01:00
Mark Jansen 008745d951
[ATL][ATL_APITEST] Test + implement CHeapPtrList 2020-02-08 22:09:14 +01:00
Mark Jansen 45d33582e7
[ATL] Rename CHeapPtr data member, since it is public 2020-02-08 22:09:14 +01:00
Thomas Faber 2bbc94c6ac
[MMIXER] Fix overzealous asserts. CORE-16611
MAXPNAMELEN is the size of the array, so if wcslen returns MAXPNAMELEN-1,
the null terminator fits and everything is okay.
2020-02-08 13:08:27 +01:00
Thomas Faber 355700f45a
[MMIXER] Safely handle MMixerGetDeviceNameWithComponentId failure in MMixerInitializeFilter. CORE-16611 2020-02-08 13:08:27 +01:00
Thomas Faber 756aa270b1
[MMIXER] Fix memory leak in MMixerGetDeviceNameWithComponentId. CORE-16611 2020-02-08 13:08:27 +01:00
Thomas Faber e884290d29
[CRT] Only write to the output buffer when necessary in _strupr. CORE-16667
Fixes crash in msvcrt_winetest:string.

This is a hack and is supposed to be specific to the C locale.
2020-02-08 13:04:12 +01:00
Mark Jansen db55933b0c
[CMLIB] Use UNIMPLEMENTED_ONCE in HvHiveWillShrink 2020-01-29 22:58:43 +01:00
Katayama Hirofumi MZ 4c0426ec44 [SDK][ATL] Make ThrowMemoryException protected 2020-01-29 22:29:11 +09:00
Katayama Hirofumi MZ eaa3692f7d
[SDK][ATL] Implement CStringT::FormatMessage (#2286)
CStringT::FormatMessage in ATL is a method to build a formatted string.
CORE-16666
2020-01-29 22:16:58 +09:00
Timo Kreuzer 42d2d5ec9c [ROSTESTS] fix x64 build and fix/disable warnings 2020-01-26 11:50:37 +01:00
Hervé Poussineau 698e1a3782 [SDK] Use HEX macro, like elsewhere in the file 2020-01-22 20:57:04 +01:00
Hermès Bélusca-Maïto 1a231e1e70
[SDK:ATL] Fix the size of the ATL_WNDCLASSINFOW::m_szAutoName member according to the actual MS-compatible auto-generated window class name.
The autogenerated name has the format:
    "ATL:<hexadecimal_digits_of_pointer><NULL-terminator>"

and the number of hex digits in 0xABCD1234 (for 32-bit == 4-byte)
pointers (without the '0x') is 8 == 4*2, and for 64-bit == 8-byte
pointers (e.g. 0xABCDEF0123456789) is 16 == 8*2.
2020-01-15 01:14:03 +01:00
Oleg Dubinskiy 83c07f4e4c [SDK][USB] Delete old USB drivers and libusb 2020-01-06 21:16:08 +02:00
Timo Kreuzer 5fa4fd7bef [RTL][NTDLL] Add some function stubs
- LdrSetAppCompatDllRedirectionCallback
- RtlCancelTimer
- RtlCreateServiceSid
- RtlQueryProcessHeapInformation
- RtlQueueApcWow64Thread
- RtlSetTimer
- RtlUnhandledExceptionFilter2
- RtlpNotOwnerCriticalSection
2020-01-03 13:00:45 +01:00
Timo Kreuzer fb0ebac349 [NDK][XDK][RTL] Fix definition of RtlFillMemoryUlong on x64 2020-01-03 13:00:45 +01:00
Hermès Bélusca-Maïto 127fa1afc6
[RTL] Fix RtlValidateUnicodeString() regarding the tests and add some SAL annotations. 2020-01-02 21:11:28 +01:00
Victor Perevertkin e92ab76d0d [REACTOS] Exclude some modules from clang-format 2019-12-28 01:23:49 +02:00
Katayama Hirofumi MZ 03854056a2 [SDK][ATL] Use CStringW in CImage 2019-12-23 20:19:48 +09:00
Thomas Faber e85f436a50
[LIBMPG123] Update to version 1.25.13. CORE-16550 2019-12-08 16:50:00 +01:00
Victor Martinez 9420daee3d [RDBSSLIB] RxFirstCanonicalize(): Fix pointer arithmetic
CORE-13383
2019-11-18 08:20:49 +01:00
Hermès Bélusca-Maïto a4b6e0d929
[SDK:RTL] Add one validity check + comment documentation for RtlDispatchException().
- RtlDispatchException(): Check for invalid stack in ExceptionContinueSearch handler
  and bail out if so.
- Update few comments and fix a typo.
- Add a documenting comment about SafeSEH functionality support.
  See e.g. the following articles:
  https://www.optiv.com/blog/old-meets-new-microsoft-windows-safeseh-incompatibility
  https://msrc-blog.microsoft.com/2012/01/10/more-information-on-the-impact-of-ms12-001/
2019-11-17 23:21:47 +01:00
Jérôme Gardou 493ceb7ade [CMAKE] Fix host tools build on x86-64 mingw
Dynamically check for sys/types.h and pid_t in wine config.h
Use TARGET_xxx defines instead of _X86_ as this is undefined by GCC
Add some sense in include directories management by using interface
libraries
2019-11-15 16:22:06 +01:00
Pierre Schweitzer 86ee9b0cc2
[UBTRFS] Upgrade to 1.5
CORE-16494
2019-11-12 19:35:43 +01:00
Victor Perevertkin 2f15e2f743
[ATL] Suppress GCC8 warning in RelocateElements, fix build. 2019-10-31 02:44:20 +03:00
Amine Khaldi c73a46af9c [PSDK][UUID] Import natupnp.idl from Wine Staging 4.18. CORE-16441 2019-10-20 20:01:58 +01:00
Thomas Faber e02cdcce68
[MPG123] Update to version 1.25.12. CORE-16440 2019-10-20 12:46:09 +02:00
Thomas Faber 983f57b6e0
[BZIP2] Remove unused library. CORE-16440
This was once used by the "ramdrv" driver, removed in r37739 (c47ab26e82).
2019-10-20 12:45:59 +02:00
Victor Perevertkin fdd1d7d60c [MSVCRT] Export __acrt_iob_func to fix GCC build with latest RosBE 2.2 (#1835)
This adds an evil hack to persuade libstdc++, which tries to import __acrt_iob_func from a DLL.
This can only be solved cleanly by adding a GCC-compatible C++ standard library to our tree later.
2019-10-20 12:44:17 +02:00
Hermès Bélusca-Maïto 97f31ac396
[SDK:NT] Remove Win32-isms. 2019-09-19 02:39:59 +02:00
Pierre Schweitzer 255ef2c332
[UBTRFS] Upgrade to 1.4
CORE-16354
2019-09-02 08:19:49 +02:00
Timo Kreuzer 99fe069ce6 [CRT][MSVCRT] Add __DestructExceptionObject from wine 2019-09-01 16:29:26 +02:00
maharmstone e6a9aafe58 [CMLIB] Clean volatile registry entries in the same manner as Windows (#1883)
This fixes the crashes in HvpGetCellMapped on Windows Server 2003 when booting from Freeloader, as mentioned in maharmstone/btrfs#16.

When the bootloader loads the system hive, it cleans the data pertaining to any volatile keys. The Windows bootloader does this by setting SubKeyCounts[Volatile] to 0. After boot, the kernel marks any cell where this is 0 but SubKeyLists[Volatile] isn't HCELL_NIL as dirty, meaning that the sanitized version will then get flushed to the disk.

Because Freeloader sets SubKeyLists[Volatile] to HCELL_NIL straightaway, Windows thinks the cell is clean, and can unload it without flushing. If it then reads it from the disk, it will crash in HvpGetCellMapped due to the stale volatile pointers.

If you break on nt!CmpInitializeSystemHive on Windows and "gu" to the let the function run, you'll see that DirtyVector of the HHIVE has only the first 8 bits set. If you run it using the official bootloader, it'll have a lot more than that.
2019-08-27 02:39:27 +02:00
Mark Jansen 029b8f2cf9
[NTDLL] Use the embedded manifest from the process to check compatibility. 2019-08-21 18:57:52 +02:00
Mark Jansen 35aeaa2397
[RUNTMCHK] Provide fallback memset for arm builds 2019-08-20 22:28:11 +02:00
Pierre Schweitzer 2faee11672
[SDK] As sole author of the file, relicense it as LPGL
It allows third party developers (such as Mark Harmstone :-)) to use it
2019-08-16 19:54:44 +02:00
Timo Kreuzer 58588b76e2 [REACTOS] Fix MSVC printf format warnings 2019-08-15 15:24:12 +02:00
Timo Kreuzer 7611cc2b12 [REACTOS] Fix SIZE_T related warnings 2019-08-15 14:20:00 +02:00
Mark Jansen 610b852451
[ATL] Add a minimal CAtlArray implementation 2019-08-11 21:46:07 +02:00
Mark Jansen ae69b1fda2
[ATL][ATL_APITEST] Add CAtlList::InsertBefore/After + test 2019-08-11 21:45:56 +02:00
Hermès Bélusca-Maïto effdb6f232
[KERNEL32][RTL] Diverse fixes/improvements for thread stack creation code. (#802)
- kernel32!BaseCreateStack() is compatible with ntdll!RtlpCreateUserStack().
- When checking whether a stack guard page can be added, its size has to
  be accounted for in the checking logic.
- We have to satisfy the PEB::MinimumStackCommit constraint.
- We cannot use PEB::GuaranteedStackBytes in BaseCreateStack() since it is
  nowhere initialized (default is 0). It gets initialized to a non-zero
  value when the user manually calls SetThreadStackGuarantee().
  https://www.installsetupconfig.com/win32programming/windowsthreadsprocessapis7_6.html

- RtlpCreateUserStack(): Fix memory leak in failure case.
- RtlpFreeUserStack() doesn't need to return anything.

See also commit 1bc59379 (r59868).

CORE-11319
2019-08-01 19:04:13 +02:00
Katayama Hirofumi MZ 87279857bb
[FREETYPE] Improve font rendering with font hinting workaround (#1771)
CORE-15762, CORE-16232
It seems some fonts are blurry or in bad rendering because of FreeType Font Hinting implementation.
This PR is subpixel2.patch from CORE-16232, based on the following comment:
https://bugs.launchpad.net/ubuntu/+source/freetype/+bug/1722508/comments/29
2019-07-31 21:57:42 +09:00
Timo Kreuzer 08c6d21e1f [REACTOS] Fix warning C4146: unary minus operator applied to unsigned type, result still unsigned 2019-07-27 11:21:28 +02:00
Timo Kreuzer 95b3eebf71 [CRT] Use sprintf_s instead of sprintf
Fixes GCC 8 warning:
sdk/lib/crt/misc/i10output.c:83:25: error: '%d' directive writing between 1 and 11 bytes into a region of size 6 [-Werror=format-overflow=]
     sprintf(format, "%%.%dle", prec);
                         ^~
sdk/lib/crt/misc/i10output.c:83:21: note: directive argument in the range [-2147483648, 2147483646]
     sprintf(format, "%%.%dle", prec);
                     ^~~~~~~~~
sdk/lib/crt/misc/i10output.c:83:5: note: 'sprintf' output between 6 and 16 bytes into a destination of size 8
     sprintf(format, "%%.%dle", prec);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-07-20 13:56:18 +02:00
Timo Kreuzer b275f24406 [VFATLIB] Use RtlStringCbPrintfA instead of sprintf
Fixes GCC 8 warning:
sdk/lib/fslib/vfatlib/check/boot.c:173:27: error: '%02x' directive writing between 2 and 8 bytes into a region of size between 0 and 15 [-Werror=format-overflow=]
   sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
                           ^~~~
sdk/lib/fslib/vfatlib/check/boot.c:173:16: note: directive argument in the range [0, 2147483647]
   sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
                ^~~~~~~~~~~~~~~~
sdk/lib/fslib/vfatlib/check/boot.c:173:3: note: 'sprintf' output between 8 and 31 bytes into a destination of size 20
   sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    (unsigned)(p - (uint8_t *) b), *p, *q);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-07-20 13:56:18 +02:00
Timo Kreuzer 48f3efa254 [PSDK][CRT] Add some casts to make GCC 8 happy 2019-07-20 13:56:18 +02:00
Mark Jansen 28a0aa9ae8
[CRT] Remove mingwm10.dll usage in tls support code
CORE-15491
2019-07-06 11:37:30 +02:00
Mark Jansen 58362b229b
[ATL] Add CRect::PtInRect 2019-06-26 21:20:43 +02:00
Thomas Faber 0e6581440e
[RTL] Fix failure check in RtlpCreateCriticalSectionSem. 2019-06-25 09:26:05 +02:00
Timo Kreuzer 99fa38809f [STDUNK][PORTCLS][CMIDriver] Fix issue with operator new/delete
Fix for MSVC warning "C2323: 'operator new': non-member operator new or delete functions may not be declared static or in a namespace other than the global namespace."

See https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-what-s-new-2003-through-2015?view=vs-2019 section "Overloaded operator new and operator delete"
2019-06-24 21:17:00 +02:00
Timo Kreuzer a75e4db855
[INFLIB] Fix INFCONTEXT structure to be compatible with the official definition (#1603)
* [INFLIB] Fix INFCONTEXT structure to be compatible with the official definition.

This makes inflib work on x64.
2019-06-23 22:35:19 +02:00
Eric Kohl c6bc82b6e0 [UUID] Add some missing NetCfg IIDs. 2019-06-17 13:48:34 +02:00
Serge Gautherie 3a98d96eac [LWIP] Fix src/core/init.c a bit (#1620)
Cherry-pick
http://git.savannah.nongnu.org/cgit/lwip.git/commit/src/core/init.c?id=c0b534e5318baf870e2152c70d4d11a3a86181f3
2019-06-06 01:51:46 +02:00
Timo Kreuzer 1ac9e48465 [MINIZIP] Add curly braces to if-statement and fix indentation
Fixes GCC 8 warning:
sdk/lib/3rdparty/zlib/contrib/minizip/zip.c:521:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
     for (i=(int)uReadSize-3; (i--)>0;)
     ^~~
sdk/lib/3rdparty/zlib/contrib/minizip/zip.c:529:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
       if (uPosFound!=0)
       ^~
2019-05-27 13:22:40 +02:00
Timo Kreuzer 81bdf4e360 [CRT] Add missing posix error codes
These are required by latest mingw-w64 stl and we are mixing this with our crt headers.
Define _CRT_NO_POSIX_ERROR_CODES in all modules that define their own constants.
2019-05-27 13:22:40 +02:00
Pierre Schweitzer 52550485e2
[UBTRFS] Upgrade to 1.2.1
CORE-16004
2019-05-11 11:25:13 +02:00
Hervé Poussineau 927e1d0968 [HIDPARSER] Implement HidP_GetValueCaps 2019-05-10 11:35:01 +02:00
jimtabor b3b40b35c9 [HIDParser] Fix MSVC build
Attempt to fix build for MSVC.
This effected local build GCC system with newer Ninja version. Not sure
if this has an effect.
2019-05-02 14:33:07 -05:00
Hervé Poussineau 7033ab18df [HID] Use hidparser static library for HidP_* functions
hid.dll and hidparse.sys must understand the same HID preparsed data,
so use the same code in hid.dll and in hidparse.sys

At the same time, this permis implementation of some HidP_* functions.
2019-05-02 20:06:47 +02:00
Hervé Poussineau 2978d4b61b [HIDPARSE/HIDPARSER] Move HidP_* functions from hidparse.sys to hidparser library
Interface between both is not anymore the HidParser_* functions, but
the HidP_* functions and the AllocFunction/FreeFunction/DebugFunctions/
ZeroFunction/CopyFunction.
2019-05-02 20:06:47 +02:00
Timo Kreuzer f47f45dbdd
[TOOLS] Fix/suppress all MSVC/x64 warnings (#1525) 2019-04-28 23:21:48 +02:00
Katayama Hirofumi MZ c714b7fd67
[ATL][ATLTEST] Adapt to RATL and improvements (#1501)
- Modify atldef.h for non-ReactOS environments.
- Update ATL testcase project files (from v120_xp to v140_xp).
- #define HAVE_APITEST and use it.
- s/NULL/0/
2019-04-20 08:35:39 +09:00
Mark Jansen 9824a0154e
[ATL] Retire atlnew 2019-04-18 19:21:37 +02:00
Mark Jansen 9853cc4d7e
[ATL][ATL_APITEST] Add test + implementation for CAtlFileMapping 2019-04-18 19:21:37 +02:00
Timo Kreuzer 146096cd2e [3RDPARTY] Make some warnings non-fatal 2019-04-13 14:07:50 +02:00
Jérôme Gardou aa91628b0e [ZLIB] use correct dependency for minizip library 2019-04-06 17:43:38 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Katayama Hirofumi MZ 572e028de1
[SDK][ATL] Independence day of ReactOS ATL (#1473)
Today is the Independence Day of ReactOS ATL (RATL). CORE-12935
https://github.com/katahiromz/RATL
2019-04-05 19:45:45 +09:00
Katayama Hirofumi MZ 6388b91a4d
[CRT][USER32] fix wsprintf additional argument (%*s) (#1470)
Reduce wsprintf function failures ("%*s"). CORE-13955
2019-04-05 16:33:18 +09:00
Hervé Poussineau c8719ee865 [CRT] Correctly share get_ioinfo()/release_ioinfo() functions between code units
This fixes the following compiler errors:

../sdk/lib/crt/stdio/stat64.c:7:13: error: inline function 'release_ioinfo' declared but never defined [-Werror]
 inline void release_ioinfo(ioinfo *info);
             ^~~~~~~~~~~~~~
../sdk/lib/crt/stdio/stat64.c:6:16: error: inline function 'get_ioinfo' declared but never defined [-Werror]
 inline ioinfo* get_ioinfo(int fd);
                ^~~~~~~~~~
../sdk/lib/crt/stdio/file.c:186:5: error: 'init_ioinfo_cs' is static but used in inline function 'get_ioinfo' which is not static [-Werror]
     init_ioinfo_cs(ret);
     ^~~~~~~~~~~~~~
../sdk/lib/crt/stdio/file.c:183:19: error: 'get_ioinfo_nolock' is static but used in inline function 'get_ioinfo' which is not static [-Werror]
     ioinfo *ret = get_ioinfo_nolock(fd);
2019-04-01 11:38:32 +02:00
Thomas Faber 1fe58c4058
[LIBXML2] Update to version 2.9.9. CORE-15854 2019-03-26 10:14:49 +01:00
Mark Jansen a672665911
[ZLIB] Restore 'uncrypt' functionality in minizip 2019-03-06 23:09:35 +01:00
Timo Kreuzer f5f6ea2965 [REACTOS] Fix 64 bit issues 2019-03-04 21:58:42 +01:00
Colin Finck bd0a28d1e4 Fix the MSVC version of ldexp filling up the FPU stack and bailing out with #IND after a few calls. Additionally, add it back to libcntpr.
MSVC was previously given a "result" variable to copy the fscale result from st(0). This led to another "fld" FPU stack push at the very end without popping the source value from the FPU stack.
Moreover, this copy isn't even needed: A simple "fstp st(1)" at the end pops an element from the FPU stack while effectively storing the result in st(0), the register used for returning a double value.
This problem didn't affect GCC, as it is only given the "fscale" instruction and does all necessary stack operations itself.

However, looking into the CRT sources, I found many other i386 implementations with inline assembly suffering from the same problem.
Fortunately, they have been replaced by pure assembly implementations a while ago, so it's time to finally remove them.
ldexp would have also been a candidate for a pure assembly implementation, but the required check for NaN and setting errno (verified on Win2003) already outweighs the benefits.
And we cannot just do a NaN check with FUCOMI as this is an i686/pentiumpro instruction while we're still targeting i586/pentium.

I'm also using this opportunity to clean up the ldexp.c header and only put in the remaining contributors as returned by "git blame".

Thanks to NightWolve1975 for reporting the problem! (https://twitter.com/nightwolve1975/status/1099042477531643912)
2019-03-03 16:11:27 +01:00
Thomas Faber a951d66002
[RTL] Fix GCC build. 2019-02-17 09:59:49 +01:00
Thomas Faber 7246909a80
[RTL] Protect pointer validity check in RtlFreeHeap with SEH.
Fixes crash in kernel32_winetest:heap.
2019-02-17 09:51:12 +01:00
Hermès Bélusca-Maïto 3ddf59e1ed
[CMLIB] Assign a signature to the in-memory HHIVE registry hive structure. CORE-15753
Makes the `!reg hivelist` WinDbg command working in ReactOS.

Dedicated to Mark Jansen.

See for more details:
https://webcache.googleusercontent.com/search?q=cache:fmHJX9eFGkkJ:https://blogs.technet.microsoft.com/ganand/archive/2008/01/05/internal-structures-of-the-windows-registry.aspx
and
http://moyix.blogspot.com/2008/02/enumerating-registry-hives.html
2019-02-17 01:21:37 +01:00
Hermès Bélusca-Maïto 70180ee06a
[CMLIB] Minor code style changes only: Use slightly more explicit signature #define names so that we know to which hive structure they correspond. 2019-02-17 01:21:36 +01:00
Pierre Schweitzer c9c3622ef1
[VFATLIB] Don't forcibly delete LFN when not in RW mode 2019-02-14 10:13:32 +01:00
Timo Kreuzer 2a5bf96891 [CRT] Implement thread/fiber safe support for MSVC and Clang-CL
This is the most trivial (but also most efficient) implementation possible. Should be good enough for now.
2019-02-12 19:31:33 +01:00
Timo Kreuzer dc77e7d379 [CRT] Use alias names for rot functions when compiling with Clang-CL
Clang-CL does not support #pragma function like CL. The alternative to this approach is to disable all intrinsics for this single source file, but that is not trivial to do, as it can only be done by removing a compiler switch, which we have no CMake support for. Therefore this solution is simpler and as good.
2019-02-12 19:31:33 +01:00
Timo Kreuzer cf5926c207 [CPPRT] Implement __std_terminate wrapper for Clang-CL 2019-02-12 19:31:33 +01:00
Mark Jansen e1aae1c620
[RTL] Implement RtlComputePrivatizedDllName_U 2019-02-07 18:48:49 +01:00
Thomas Faber 64d48843d7
[FREETYPE] Handle allocation failures in our stack-saving hacks. CORE-15642
Running out of pool is likely at least during kmtest:ExPools.
There is a chance of crashing when dereferencing these null pointers -- but
worse, there's also a chance of overwriting the IVT or BDA if a VDM BIOS
call is in progress, which can lead to crashes in non-obvious places later.
2019-01-28 14:31:49 +01:00
Thomas Faber 5bb277a54b
[LIBXML2] Update to version 2.9.8. CORE-15280 2019-01-16 09:27:22 +01:00
Mark Jansen f9e50f5471 [ATL] Add GET_X_LPARAM and GET_Y_LPARAM to atlwin.h
Remove all local definitions
2019-01-15 14:34:53 +02:00
Mark Jansen db8488e5ca
[SDK] Reset InDbgPrint state when an exception occurs
Previously this would not get reset, and all debug prints from the
current thread would be muted.
2019-01-05 15:21:40 +01:00
Andrew Boyarshin 04c851194c [NTDLL][RTL] Implement RtlGetFullPathName_UEx 2019-01-05 13:33:28 +01:00
Timo Kreuzer cfd1647914
[REACTOS] Fix misc 64 bit issues (#783)
* [WIN32K] Fix handle calculation in DbgGdiHTIntegrityCheck
* [NOTEPAD] Fix MSVC warnings
* [PSDK] Simplify *PROC definitions in windef.h
* [VIDEOPRT] Don't try to use NtVdmControl on x64
* [FREELDR] Fix some macros
* [CRT] Make qsort 64 bit compatible
* [NTOS] Use #ifndef _WIN64 instead of #ifdef _M_IX86 around C_ASSERTs
* [FAST486] Fix 64 bit warnings and change DWORD to ULONG, so it can be used in kernel mode
* [APPHELP_APITEST] Fix 64 bit issue
2019-01-05 10:50:11 +01:00
Thomas Faber d67156fa98
[MPG123] Update to version 1.25.10. CORE-15280 2019-01-05 09:20:40 +01:00
Pierre Schweitzer 44fdf3fc30 [RXCE] Fix leftover 2019-01-03 16:59:45 +01:00
Hermès Bélusca-Maïto 8d878f4bfa
[RDBSS] Fix pointer value assignation. 2019-01-03 15:49:07 +01:00
Timo Kreuzer cdee669619 [RXCE] Fix 64 bit build 2019-01-03 14:27:15 +01:00
Pierre Schweitzer a9124b412d
[RDBSS][RXCE] Implement IRP cancellation
CORE-15441
2019-01-02 15:02:15 +01:00
Hervé Poussineau a179012563
[ZLIB] Import upstream commit 38e8ce32afbaa82f67d992b9f3056f281fe69259:
Fix CLEAR_HASH macro to be usable as a single statement.
As it is used in deflateParams().
2018-12-31 14:23:59 +01:00
Hervé Poussineau c4d25d27f6
[RTL] Fix RtlNewSecurityGrantedAccess improperly zeroing output buffer 2018-12-31 11:19:36 +01:00
Pierre Schweitzer f75ea083e3
[NTOSKRNL_VISTA] Implement FsRtlGetEcpListFromIrp and FsRtlGetNextExtraCreateParameter
CORE-15452
2018-12-25 13:50:41 +01:00
Pierre Schweitzer a76b8843a8
[NTOSKRNL_VISTA] Implement IoGetIrpExtraCreateParameter
CORE-15452
2018-12-25 13:50:40 +01:00
Pierre Schweitzer cdf47d5254
[VFATLIB] Drop a hack no longer needed after f87d9ca 2018-11-25 10:41:22 +01:00
Pierre Schweitzer aac38dfed8
[RDBSS] Fix a typo
Spotted by Hermès
2018-11-24 22:00:09 +01:00
Pierre Schweitzer 738f327668
[IP] Add a TCPGetSocketStatus() wrapper around LibTCPGetSocketStatus() 2018-11-23 22:51:35 +01:00
Pierre Schweitzer 29c1510423
[LWIP] Implement a LibTCPGetSocketStatus() function in our LwIP glue
It is used to query a socket state (established, closed, and so on).
2018-11-23 22:51:35 +01:00
Stanislav Motylkov baf2c0cc2d [DRWTSN32] Add SMBIOS data to the system information (#1017)
[DMILIB][UDMIHELP] Allow functions to be linked with C++ code.
2018-11-21 21:49:15 +01:00
Pierre Schweitzer 7c0a8eb555
[TDILIB] Make tdiGetSetOfThings() return useful status 2018-11-18 16:30:45 +01:00
Pierre Schweitzer c5983e302d
[VFATLIB] Don't attempt to fix volume if not allowed 2018-10-21 11:12:10 +02:00
Hermès Bélusca-Maïto bf8a7d2db0
[CMLIB] Adjust parameter types and annotations. Add diagnostic assertions. 2018-10-14 15:59:31 +02:00
Mark Jansen 2d47c3be29
[CRT] spawn: define a unicode environment when needed
CORE-9182
2018-10-13 20:30:07 +02:00
Hermès Bélusca-Maïto 47d539e6e0
[RTL] Make a RtlQueryEnvironmentVariable_U() DPRINT a little bit more useful. 2018-10-13 19:44:13 +02:00
Eric Kohl bb7292b287 [CRT] Fix two obvious typos in _mbbtype().
Patch by Kudratov Olimjon.

CORE-8545
2018-10-07 22:56:14 +02:00
Mark Jansen 57ed670b5a
[RTL] actctx: When probing a dll for a manifest, use the first manifest id present,
instead of always searching for CREATEPROCESS_MANIFEST_RESOURCE_ID.
CORE-9519
2018-10-01 20:16:10 +02:00
Stanislav Motylkov bae6e075e0
[UDMIHELP] Initialize output buffer if DMI string is NULL 2018-09-29 17:11:08 +03:00
Stanislav Motylkov c356804550
[DMILIB] Process SKU and Family strings 2018-09-29 17:10:48 +03:00
Serge Gautherie cb072fd0fe [CMLIB] Fix compiling as NT6+ (#840)
Addendum to r70582 (734bc291).
CORE-12596
2018-09-05 20:18:14 +02:00
Hermès Bélusca-Maïto cb979bb293
[REACTOS] Introduce a "DEBUGFORMAT" environment variable that allows to select different debug trace formats.
CORE-12671

- The default format is used when no format name is specified: this is
  the one we use so far in ReactOS:

    <debug_class>:(<file>:<line>) <message>

  with "debug_class" being "trace", "warn", "err".

- The "wine" format is the one used by Wine. It can be used when trying
  to diff-compare traces for a module with the corresponding one
  obtained from a Wine run. It can also be useful because the logging of
  Wine-synced code assumes that the function names are automatically
  added by the helper macros "FIXME()", "TRACE()", "WARN()" or "ERR()",
  and not manually inside the logging string given to these macros:
  for example:

    FIXME("(%params) message\n", params);

  displays:

    fixme:<module>:SomeFunc(params) message

- The "extended" (or "ext") format is very noisy and tries to output a
  lot of information; it is a hybrid of the previous two formats:

    <debug_class>:(<file>:<line>):<channel>:SomeFunc <message>

Support for displaying the current process ID is added in
addition to the already existing support for thread ID.
2018-08-30 22:42:50 +02:00
Katayama Hirofumi MZ 0a8ade5dd4
[SDK][CRT] Fix _ismbblead undefined error on MSVC 2018-08-27 11:09:28 +02:00
Hermès Bélusca-Maïto b277cbdf22
[CONUTILS] In ConWrite(), emit an \r when a \n is encountered but not already preceded by \r.
And, don't emit \r\n when an \r alone is encountered.
This fixes the problem of extra newlines appearing when redirecting
"more" output to a file.

CORE-14592
2018-08-23 17:04:53 +02:00
Mark Jansen 69893ccf38 [ATL] Improve the order of operations in CComPtr and CComQIIDPtr 2018-08-19 17:35:18 +02:00
Mike Swanson 3c7e9bb332 Remove unnecessary executable bits 2018-08-15 18:29:09 +02:00
Mark Jansen 9b6fb9f2f8
[RTL][KERNEL32] Add a comment indicating we need SEH in RtlImageNtHeaderEx
CORE-14532
CORE-14857
2018-08-13 13:24:12 +02:00
Stanislav Motylkov 4259aab7b0 [SDK] Add user-mode DMI/SMBIOS helper library
CORE-5961
2018-08-12 14:21:56 +02:00
Serge Gautherie 7d6bda16c6
[REACTOS] Improve how some ASSERTMSG() message values are printed: enforce ending "\n".
NB: Not touching calls in "third-party" code: class and classpnp.
2018-08-08 22:03:45 +02:00
Serge Gautherie fb48381cb4
[CMLIB] Simplify an ASSERTMSG() as an ASSERT(). 2018-08-08 21:45:46 +02:00
Serge Gautherie 97d3b3ce33
[REACTOS] RtlAssert(): use "%lu" as LineNumber format. 2018-08-08 21:24:07 +02:00
Mark Jansen 09719d25c4
[ATL] Fix the CComQIIDPtr template. 2018-08-05 11:54:56 +02:00
Timo Kreuzer cf77354dce [REACTOS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Timo Kreuzer 9e066abe2a [DRIVERS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Stanislav Motylkov 0854c69a75 [I8042PRT] Move DMI/SMBIOS parsing functions into library 2018-08-02 21:29:57 +02:00