- C4311: pointer truncation from '<pointer>' to '<integer>'
- C4312: conversion from '<integer>' to '<pointer>' of greater size
- C4133: incompatible types - from '<x> *' to '<y> *'
- C4028: formal parameter different from declaration
_IMPLICIT_LINK_DIRECTORIES
Othrewise, if you link a RC module with a static C library (as done for
fusion DLLs), you get the standard C libraries from GCC. This is not
what we want.
This might have to be done for MSVC builds. Check build.ninja to verify
this.
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.
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);
../sdk/include/reactos/rosctrls.h:283:59: error: no matching function for call to 'CToolbar<TItemData>::SendMessageW(int, HWND__*&, int)'
return SendMessageW(TB_SETTOOLTIPS, hWndTooltip, 0);
../sdk/include/psdk/winuser.h:5543:21: note: candidate: LRESULT ATL::CWindow::SendMessageW(UINT, WPARAM, LPARAM) <near match>
../sdk/include/psdk/winuser.h:5543:21: note: conversion of argument 2 would be ill-formed
ReactOS/Windows headers contain lots of structures whose last field is
fieldName[ANYSIZE] or fieldName[1].
Starting with GCC 4.8, gcc considers that accessing items [2], [3], ...
are undefined operation, and may optimize those accesses by removing them!
Add flag -fno-aggressive-loop-optimizations to prevent this unwanted behaviour.
- Assume that GetTextExtentExPointWPri() uses the same kind of
arguments as GetTextExtentExPointW().
- Add GetTextExtentExPointWPri() declaration to undocgdi.h.
Since ReactOS doesn't actually support non-local WinSTA/WTS capabilities, this seems to be a good way to reduce spam in the log while providing correct behaviour.
Also call Unicode version from ANSI one to reduce code duplication.
This is done by marking everything that is already loaded but not 'processed'.
After the shim engine is done initializing, the original state is restored,
with the exception of the shim engine itself.
CORE-15846
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)
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.
MSBuild, via the VS IDE, uses response files when calling CL or LINK.
We cannot specify a custom response file on the linker command-line,
since specifying response files from within response files is forbidden.
We therefore have to pre-process, at configuration time, the linker
script so as to retrieve the custom linker options to be appended
to the linker command-line.
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.
Modify the .code16 macro so that the 16-bit code segment can get a
chance to be correctly merged with other (possibly 32-bit) code
segments, without keeping generating multiple .text segments with
different attributes and generating the corresponding LNK4078 warning.
This fixes the warning when compiling NTOSKRNL on MSVC:
"v86.S.obj : warning LNK4078: multiple '.text' sections found with different attributes (C0520040)".
- Always use string pooling when building: this helps reducing the
size of the binaries due to string redundancy coming from the usage
of __FILE__ / __RELFILE__ in the debugging helper macros. Note also
that GCC builds use string pooling by default.
- Use suitable add_compile_flags() command.
- Add some explanative comments for some settings.
Some numbers (obtained with my local builds):
Before / After => Reduction
===========================
freeldr.sys : 443 KB ( 453.632 bytes) / 364 KB ( 372.736 bytes) => ~ 18%
win32k.sys : 1877 KB (1.922.048 bytes) / 1562 KB (1.599.488 bytes) => ~ 17%
ntoskrnl.exe : 2253 KB (2.307.072 bytes) / 1902 KB (1.947.136 bytes) => ~ 15.6%
kernel32.dll : 3008 KB (3.080.192 bytes) / 2906 KB (2.975.744 bytes) => ~ 3.4%
* [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
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
Fixes MSVC warnings:
sdk\include\crt\xmmintrin.h(33): warning C4162: '_mm_getcsr': no function with C linkage found
sdk\include\crt\xmmintrin.h(35): warning C4162: '_mm_setcsr': no function with C linkage found
Some initial work is done, all testcases pass now.
However a lot of the patch format is still unknown / not working,
so do not expect anything other than the apitest to work yet.
The next thing to do now, is to gather input, output and patch files,
and analyze how the compression and patching works on bigger /
more complex files.
CORE-15417
* Speed up the script by using the fallback by default
* Suggest what cmake file to edit
* Add support for x64 modules (addresses not updated yet)
CORE-14923
In the struct passed to SHCreateFromDesktop the fourth field is the parameter that later on will be passed to ShowWindow. Initialize it properly so that when we run filrbrowser.exe in win2k3 the main window won't be hidden.
Purpose:
When doing a PXE BootCD installation, you may be left without networking, usb and a cd drive.
This adds an easy way to include a few or more files to the installation which are then present on the disk after the installation and which does not require any change to ReactOS source code/build script files (and no manual editing of boot/bootdata/packages/reactos.dff.in).
Proposed changes:
Adds a new modules/3rdparty folder which lets the files end up in C:\ReactOS\3rdParty ready for use.
Following r75518, we use the $winnt$.inf file (created in System32
by the 1st-stage installer) as the setup information file for the
2nd-stage setup for:
- retrieving the installation source media path;
- retrieving the unattended information that was copied from the
unattend.inf file from the installation source media.
The installation source media path is converted from NT format to
Win32 format for usage with Win32 functions and storage in the registry:
this is done by GetInstallSourceWin32(), which replaces the hackish
GetRosInstallCD() function.
The $winnt$.inf file is also updated, and the registry values "SourcePath"
and "ServicePackSourcePath" are created / updated in:
HKLM\Software\Microsoft\Windows\CurrentVersion\Setup .
svn path=/branches/setup_improvements/; revision=75524
Fixes crashes when the tool is compiled with Run-Time Checks enabled.
And thus should fix the MSVC buildbots!
Thanks to Pierre for having brought this issue to me.
CORE-15201
- Fix a bug in RegpCreateOrOpenKey() when we attempt to open an
non-existing (sub-)key.
- Check failure of RegCreateKeyExW() in CreateSymLink().
- Remove unneeded includes.
- Update few comments.
- Fix parsing of the options.
- Only uppercase the file name part and NOT the full path!
And do it in a way GCC-Linux correctly understands, aka.:
*ptr = toupper(*ptr); ++ptr;
but NOT!:
*ptr++ = toupper(*ptr);
(that last one worked on GCC-Win and MSVC).
[CMAKE] Let's keep SETUPREG.HIV and BCD hive file names in uppercase
(use the '-u' switch) while keeping the other ones in lowercase.
Should definitively fix GCCLin builder!
- Add support for '/' switch characters.
- Add '-?' switch.
TEMPORARY:
- Add a '-u' switch to generate hive file names in uppercase (by default
we keep these in lowercase). Should help in fixing GCCLin builder.
[CMAKE] Fix expected file name case. Should help in fixing GCCLin builder.
This commit is needed for building a single bootcd registry hive. It will also enable 1-st stage setup to have a proper registry present as done on Windows.
CORE-13347
[CMAKE]
Note that the mkhive commands should really depend on the generated UTF16 INF files since the latter are those that are actually used as input for mkhive.
Otherwise, the mkhive calls & the UTF16 INF file conversion is not serialized and we can generate "corrupted" hives due to the fact that mkhive is using
INF files that are in the process of being (and therefore, only partially) generated.
svn path=/branches/setup_improvements/; revision=74741
svn path=/branches/setup_improvements/; revision=74749