Commit graph

80086 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto eb29a33169
[PEFIXUP] Section names are case-sensitive, so we can just use strncmp() instead of the non-standard strncasecmp() for names comparisons. (#3598) 2021-05-05 19:15:02 +02:00
Hermès Bélusca-Maïto ea26767353
[PEFIXUP] Avoid multi-level nesting of code with the error handling done at the very end. Use size_t variables for file sizes. (#3598) 2021-05-05 19:15:01 +02:00
Hermès Bélusca-Maïto 88b933330d
[PEFIXUP] Only recalculate the PE checksum if the image is not from a reproducible build (original checksum == 0). (#3598) 2021-05-05 19:15:01 +02:00
Hermès Bélusca-Maïto 7ad33940c2
[PEFIXUP] Use vfprintf() with the va_args list. (#3598) 2021-05-05 19:14:57 +02:00
Hermès Bélusca-Maïto abd4c818dc
[CSRSRV] Fix uninitialized variable warning detected by Clang. (#3619)
CORE-17545

subsystems/win32/csrsrv/api.c:63:9: warning: variable 'ServerDll' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
    if ((ServerId >= CSR_SERVER_DLL_MAX) ||
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subsystems/win32/csrsrv/api.c:67:76: note: uninitialized use occurs here
        DPRINT1("CSRSS: %lx is invalid ServerDllIndex (%08x)\n", ServerId, ServerDll);
                                                                           ^~~~~~~~~
2021-05-05 17:24:14 +02:00
Hermès Bélusca-Maïto c5b87ac6ac
[CSRSRV] Display some other DPRINTs only when CSRSRV is compiled in debugging mode.
Addendum to 835f3ef1.
2021-05-05 17:24:13 +02:00
Hermès Bélusca-Maïto f9aca9f7d2
[CONSRV] wcwidth.c: Fix out-of-range comparisons Clang warnings for wchar_t's, that are only 2 bytes long on NT. (#3619)
CORE-17545

win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:30: warning: result of comparison of constant 262141 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x30000 && ucs <= 0x3fffd)));
                         ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:203:12: warning: result of comparison of constant 196608 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x30000 && ucs <= 0x3fffd)));
       ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:30: warning: result of comparison of constant 196605 with expression of type 'wchar_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x20000 && ucs <= 0x2fffd) ||
                         ~~~ ^  ~~~~~~~
win32ss/user/winsrv/consrv/frontends/wcwidth.c:202:12: warning: result of comparison of constant 131072 with expression of type 'wchar_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
      (ucs >= 0x20000 && ucs <= 0x2fffd) ||
       ~~~ ^  ~~~~~~~
2021-05-05 17:24:13 +02:00
Hermès Bélusca-Maïto db089c517e
[PSDK] Remove a buggy GNU-specific "PACKED" attribute in KEY_EVENT_RECORD structure declaration. (#3619)
CORE-17545

No other public header out there (in MS PSDK, MinGW, Wine, etc...) does have
this hack (that was introduced back in the days in r15141 / commit 01df92bc).

Add static assert on KEY_EVENT_RECORD's uChar member to ensure it's properly aligned.

May fix Clang warning:

win32ss/user/winsrv/consrv/lineinput.c:457:62: warning: taking address of packed member 'uChar' of class or structure '_KEY_EVENT_RECORD' may result in an unaligned pointer value [-Waddress-of-packed-member]
            LineInputEdit(Console, (Overstrike ? 1 : 0), 1, &KeyEvent->uChar.UnicodeChar);
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
and whatnot...
2021-05-05 17:24:12 +02:00
Hermès Bélusca-Maïto 9a93d2fe3a
[CONSRV] Fix uninitialized variables warnings detected by Clang. (#3619)
CORE-17545

Fix 3 warnings:

win32ss/user/winsrv/consrv/alias.c:648:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (CurEntry)
               ^~~~~~~~
win32ss/user/winsrv/consrv/alias.c:693:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:715:9: warning: variable 'Status' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (Header)
        ^~~~~~
win32ss/user/winsrv/consrv/alias.c:727:12: note: uninitialized use occurs here
    return Status;
           ^~~~~~

win32ss/user/winsrv/consrv/alias.c:771:16: warning: variable 'Status' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (RootHeader)
               ^~~~~~~~~~
win32ss/user/winsrv/consrv/alias.c:807:12: note: uninitialized use occurs here
    return Status;
2021-05-05 17:24:12 +02:00
Hermès Bélusca-Maïto ab8d7f2548
[SYSDM] Fix uninitialized variables warnings detected by Clang. (#3619)
CORE-17545

Addendum to commit d635ce0c.

dll/cpl/sysdm/general.c:156:25: warning: variable 'hCreditsDC' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                    if (hDC == NULL)
                        ^~~~~~~~~~~
dll/cpl/sysdm/general.c:216:25: note: uninitialized use occurs here
                    if (hCreditsDC != NULL) DeleteDC(hCreditsDC);
                        ^~~~~~~~~~

and the same for hLogoDC:

dll/cpl/sysdm/general.c:215:25: note: uninitialized use occurs here
                    if (hLogoDC != NULL) DeleteDC(hLogoDC);
                        ^~~~~~~
2021-05-05 17:24:11 +02:00
Hermès Bélusca-Maïto cba0d64645
[SYSDM][USERINIT] Fix uninitialized variables warnings detected by Clang. (#3619)
CORE-17545

Addendum to commit d635ce0c.

- Move the HDC variables initialization via function calls, out of
  the variables declaration block.

- Fix warnings (and identical for base/system/userinit/livecd.c):

dll/cpl/sysdm/general.c:72:9: warning: variable 'hLogo' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dll/cpl/sysdm/general.c:130:9: note: uninitialized use occurs here
    if (hLogo != NULL) DeleteObject(hLogo);
        ^~~~~

and similar for hMask too:

dll/cpl/sysdm/general.c:129:9: note: uninitialized use occurs here
    if (hMask != NULL) DeleteObject(hMask);
        ^~~~~
2021-05-05 17:24:10 +02:00
Hermès Bélusca-Maïto 89860ab543
[SYSDM][USERINIT] Rewrite a if-condition in order to fail early, and save one level of code indentation. 2021-05-05 17:24:10 +02:00
Hermès Bélusca-Maïto 33c210da37
[USETUP] Fix letter encoding in translation. (#3619)
CORE-17545

Fix Clang warning:

base/setup/usetup/lang/de-DE.h:1099:24: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
        "die Partition <E4>ndern, die derzeit als aktiv markiert ist.",
                       ^~~~
2021-05-05 17:23:57 +02:00
Mas Ahmad Muhammad fd4d8f550c [TRANSLATION] indonesian add and update apps/shell translation 2021-05-05 11:34:28 +02:00
Katayama Hirofumi MZ 7b27e7c4ff
[CMDUTILS][FC] Implement FC wildcard handling (#3640)
Implement wildcard handling on FC (file comparison) command. And fix the bugs on zero-sized files. CORE-17500
2021-05-05 12:23:16 +09:00
Jérôme Gardou 3644f3efca [GITHUB] Improve logic to cache RosBE build
+ Minor implrovements:
  Use cmake args instead of forcing command working directory
  Give specific names to artifacts - bootcd/livecd
2021-05-04 16:26:20 +02:00
Jérôme Gardou f421bccbcc [NTOS:MM] First shot for Working Set list support
- Initialize
- Add private page (no shared page support yet)
- Remove pages
- Trim

Yes, this is C++ in the kernel.
2021-05-04 12:02:41 +02:00
Jérôme Gardou 5466fc13a3 [NDK] Make kefuncs.h C++ aware 2021-05-04 12:02:41 +02:00
Jérôme Gardou 31afbf1054 [NTOS] Make some internal headers C++ aware 2021-05-04 12:02:41 +02:00
Jérôme Gardou 8df48f9876 [NTOS:MM] Introduce MI_IS_PROCESS_WORKING_SET helper function 2021-05-04 12:02:41 +02:00
Jérôme Gardou 6b2f05f9dd [NTOS:MM] Implement turning working set shared lock to exclusive 2021-05-04 12:02:41 +02:00
Jérôme Gardou cd085ac12f [NTOS/MM] Implement Mi(Un)lockWorkingSetShared
Also fix checks when exclusively locking
2021-05-04 12:02:41 +02:00
Katayama Hirofumi MZ d2c47132ad
[CMDUTILS][FC] Implement text file comparison (#3625)
Implement text file comparison by using file mappings (both Unicode and ANSI). CORE-17500
2021-05-04 18:05:57 +09:00
George Bișoc 5dd93a8a5b
[NTOS:SE] Get the session ID and assign it to the new token
SeExchangePrimaryToken doesn't assign the session ID to the new token, which could lead to incorrect behaviour in the long run. Let's fix that.
2021-05-04 10:08:26 +02:00
Justin Miller 0d9020634a
[HALX86] Disable Lazy IRQL in APIC HAL (#3609)
Lazy IRQL feature has issues with interrupt delivery on VirtualBox, so disable it for now.
For the feature description, see commit d28eae967a

Meanwhile, merge and clean up APIC headers a bit
2021-05-04 04:29:50 +03:00
Victor Perevertkin 239266640f
[GITHUB] Use full paths on build-linux, as RosBE.sh overwrites them
Addendum to 167c60a5c8 and 823ddc3d82
2021-05-04 01:32:21 +03:00
Victor Perevertkin 823ddc3d82
[GITHUB] Remove working-directory for configure
Addendum to 167c60a5c8
2021-05-04 01:21:40 +03:00
Victor Perevertkin 167c60a5c8
[GITHUB] Use cmake's -S and -B options explicitly 2021-05-04 01:10:22 +03:00
Jérôme Gardou e9cef3f216 [GITHUB] Add clang-cl amd64 build to CI
As before, use a matrix for Ninja+Msvc build
2021-05-03 22:00:57 +02:00
Jérôme Gardou bc92234ea4 [FDEBUG] Use VK_ identifiers with VIRTKEY 2021-05-03 22:00:57 +02:00
Jérôme Gardou d312ef234b [PSEH] Fix use of dummy implementation in C++ 2021-05-03 22:00:57 +02:00
Jérôme Gardou 07dcec0325 [PSEH] Use dummy PSEH for clang(-cl) amd64 build 2021-05-03 22:00:57 +02:00
Jérôme Gardou d0bb775774 [NOTEPAD] Fix resource file
VIRTKEY can't be preceded with ^
and is useless anyway
2021-05-03 22:00:57 +02:00
Jérôme Gardou aa51bcfbcb [CMAKE] Do not use a flag which clang doesn't know 2021-05-03 22:00:57 +02:00
Jérôme Gardou 523912536e [KERNEL32] Sync NLS RC files with wine 6.7
Mostly for having them UTF-8 encoded
2021-05-03 22:00:57 +02:00
Jérôme Gardou 802665a4ac [CRT] Also use alias _rot functions for clang-cl amd64 build 2021-05-03 22:00:57 +02:00
Jérôme Gardou 4ae4590b66 [CMAKE] Do not define _M_AMD64 when using amd64 clang-cl 2021-05-03 22:00:57 +02:00
Jérôme Gardou 8aea84dab7 [CRT] Do not define builtin functions if not needed 2021-05-03 22:00:57 +02:00
Jérôme Gardou 7197620b89 [CMAKE] Always use cl to build host tools 2021-05-03 22:00:57 +02:00
Jérôme Gardou a66214c020 [GITHUB] Enable GCC+clang amd64 build
Use github cache to build & retrieve RosBE on linux,
for now using a custom build script until Next RosBE is out

Use a matrix to manage linux gcc + clang build
2021-05-03 22:00:57 +02:00
Jérôme Gardou 061c7ecb1a [FRAMEDYN] Fix the whole situation with regards to wchar_t
Alias CHSTRING_WCHAR to unsigned short and use inline wrappers
to be able to use the thing with modern compilers

Put the GCC aliases into the public header.

Enable build with clang-cl
2021-05-03 22:00:57 +02:00
Jérôme Gardou a8255233f8 [SPEC2DEF] Fix imports of C++ stdcall exports
Too much mangling mangles it too much
2021-05-03 22:00:57 +02:00
Jérôme Gardou ec68a3311f [CMAKE] Use SEH exceptions for c++ in clang amd64 build 2021-05-03 22:00:57 +02:00
Jérôme Gardou 976c4c10aa [CRT] Fix SEH macros for clang x64 2021-05-03 22:00:57 +02:00
Jérôme Gardou b52ab2493b Revert "[CMAKE] Disable SSE instruction on GCC amd64 builds"
The right fix is to ensure that the stack is properly 16-bit aligned
This reverts commit 63944988a2.
2021-05-03 22:00:57 +02:00
Oleg Dubinskiy 58daf942fe
[GDI32] Fix wrong ordering of parameters in NtGdiDdGetDC call (#3637)
It allows to properly pass the surface handle (and palette entry pointer) from MS ddraw into win32k.
Otherwise, they are passing into the wrong parameters of actual NtGdi* function, and due to this,
since they're detected as invalid, they become NULL, and that function does not work correctly.

See https://docs.microsoft.com/en-us/windows/win32/devnotes/-dxgkernel-ntgdiddgetdc for the reference
(and confirmed by our headers).

Required by MS DirectDraw stack (ddraw.dll & dxg.sys).
CORE-17561
2021-05-03 18:11:18 +02:00
George Bișoc 11a60cebea
[NTOS:PS] Add some data structures
These are needed for API tests. The following structures are taken from Process Hacker.
2021-05-02 21:03:09 +02:00
George Bișoc 207543429b
[NTOSKRNL] Use IQS_SAME instead of ICI_SQ_SAME
And remove the redundant ICI_SQ_SAME macro as it's no longer needed in the codebase.
2021-05-02 21:00:51 +02:00
George Bișoc efaa7b6a24
[NTDLL_APITEST] Add alignment probing tests for Query/Set information thread related routines 2021-05-02 20:58:40 +02:00
George Bișoc 3b53b3d07f
[NTDLL_APITEST] Add alignment probing tests for Query/Set information process related routines 2021-05-02 20:56:14 +02:00