Commit graph

728 commits

Author SHA1 Message Date
James Tabor a02b3da183 Update Header
Add missing structure.
2019-08-29 15:47:56 -05:00
Colin Finck c8681feee9
Fix the ntstrsafe.h tests to make sense, actually succeed using ntstrsafe.h from Win10 (10.0.15063), and fix ReactOS' ntstrsafe.h to also pass these tests. (#1859) 2019-08-28 22:42:52 +02:00
Colin Finck 46ed46c73f
Fix and unify function prototypes for ntstrsafe functions taking variadic arguments. 2019-08-28 22:35:01 +02:00
Colin Finck 331e331209
[FORMATTING] Restore some kind of style to ntstrsafe.h, considering all comments in PR #522 and #523. 2019-08-28 22:32:49 +02:00
Hernán Di Pietro 99818568ed
[DDK] RtlUnicodeStringPrintf(Ex) implementations and ntstrsafe.h tests (#522, #523)
[KMTESTS:RTL] (CORE-14565)

+ Added buffer overrun tests.
+ New style header.
+ ISO C90 compatibility

[DDK] (CORE-9819): RtlUnicodeStringPrintf(Ex) and RtlUnicodeStringValidate(Ex) fixes plus formatting.

[DDK]: Cosmetic changes  (NTSTATUS variable naming and tabs)

[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)

+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
  - an intermediate "Len" postfixed function was added with optional
    argument to return the _vsnwprintf character count.
  - Wide Printf(Ex) functions already existent work now call new Rtlp
    private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565

NOTES:

+ MSDN says they won't insert NULL characters on formatted strings. But
  seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
  We return zero-terminated strings, and MS functions seems to do the same.
  (XP DDK 7.1)

[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)

+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
  - an intermediate "Len" postfixed function was added with optional
    argument to return the _vsnwprintf character count.
  - Wide Printf(Ex) functions already existent work now call new Rtlp
    private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565

NOTES:

+ MSDN says they won't insert NULL characters on formatted strings. But
  seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
  We return zero-terminated strings, and MS functions seems to do the same.
  (XP DDK 7.1)

[DDK] Fixed bad NtStrSafe.h va_start call (CORE-9819)

Update on RtlUnicodeStringPrintfEx plus cosmetic changes.

[DDK] First implementation of Unicode functions for NtStrSafe (CORE-9819)

+ This implementation does not modify the interface of previous functions.
+ Since we need length returned for the destination UNICODE_STRING.Length field:
  - an intermediate "Len" postfixed function was added with optional
    argument to return the _vsnwprintf character count.
  - Wide Printf(Ex) functions already existent work now call new Rtlp
    private worker functions.
+ For several UnicodeStringPrintf(Ex) tests, see work going on CORE-14565

NOTES:

+ MSDN says they won't insert NULL characters on formatted strings. But
  seems this is incorrect at MSDN (interpret this as DONT ASSUME NULL-termination).
  We return zero-terminated strings, and MS functions seems to do the same.
  (XP DDK 7.1)

[KMTESTS:RTL] Tests for new RtlUnicodePrintf(Ex) functions (CORE-14565)

+ 45 Tests working.
+ Lacks remaining non-Unicode functions in NtStrSafe.h for now.
+ Used for first tests on CORE-9819

[KMTESTS/RTL] Fixed test not taking care of null (CORE-14565)

[DDK] Fixed bad NtStrSafe.h va_start call (CORE-9819)

[KMTESTS:RTL] First Test.

Update on RtlUnicodeStringPrintfEx plus cosmetic changes.

[KMTESTS] Added NtStrSafe to test lists (CORE-14565)

First commit: Skeleton for test implementation + Addition to COMMON SOURCES in kmtests Cmake lists.

WIP.
+Implementation of RtlStringVPrintfWorkerLenW, RtlStringVPrintfExWorkerLenW to avoid changing existing public functions. This is required as existent functions did not return vsnprintf result, so we didn't have any return info to update UNICODE_STRING.Length.
+Additional implementation of RtlUnicodeStringValidate for checking purposes.
+Former RtlStringVPrintfWorker(ex) refactored to RtlInternalStringVPrintf(Ex)WorkerW.
+No ANSI functions affected as we didn't need them for Unicode printf's.

WIP: RtlUnicodeStringPrintf
2019-08-28 22:28:13 +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
Ioannis Adamopoulos e419195d37 [HEADERS] Move some helpers from undocshell.h to shellutils.h as they didn't cover anything undocumented. Merge traycmd.h in undocshell.h as both contain just undocumented shell definitions. 2019-08-25 12:20:52 +03:00
Timo Kreuzer 767d424b0a [CMAKE] Turn C4715: "'function': not all control paths return a value" into an error on MSVC builds 2019-08-23 14:47:39 +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 b445fef904
[SDK] Update Int32x32To64 macro for arm 2019-08-20 22:28:11 +02:00
Mark Jansen 35aeaa2397
[RUNTMCHK] Provide fallback memset for arm builds 2019-08-20 22:28:11 +02:00
Mark Jansen 8a86264f14
[NDK][ARM] Stub a few required types for bootlib 2019-08-20 22:28:11 +02:00
Mark Jansen b5dc79c963
[CMAKE] Some arm cmake fixes 2019-08-20 22:27:59 +02:00
Victor Perevertkin bda22774a7 [PSDK] Fix GCC8 complaining on duplicate and wrong declarations 2019-08-20 15:05:47 +02:00
Victor Perevertkin e90b6bb1e9 [CMAKE] Define GCC and CLANG cmake variables 2019-08-20 15:05:47 +02:00
Giannis Adamopoulos 9411269841
[ROSCTRLS.H] Add CListView::SetItemText and CListView::SetCheckState 2019-08-20 00:43:37 +02:00
Stanislav Motylkov 5f6faec2ff [DDK][PSDK] Add missing definitions for WPA/WPA2 authentication
Part of it was already added in 3da616a. CORE-11924
2019-08-19 13:12:13 +02:00
Mark Jansen 343442cc3f
[LDR][APPHELP] Add a shim that disables manifest compatibility version parsing 2019-08-19 12:08:06 +02:00
Andrew Cook 0341ea5e7b
Search for host-tools path
Allows source-relative paths
2019-08-17 17:39:44 +02:00
Andrew Cook f67345320f
Add WITH_HOST_TOOLS option
Required for cross-compiling with msvc as only one target
architecture is available at a time in the dev prompt
2019-08-17 17:39:43 +02:00
Andrew Cook ce531a28ec
Rework host tools
Now configured at the same time as reactos and only
one list of targets to maintain

Correctly rebuilds when a tool changes (tested widl)
2019-08-17 17:39:31 +02:00
Thomas Faber e51f4db7d0
[RSYM] When determining the current function, always prefer COFF symbols if they're closer. 2019-08-17 10:22:36 +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
Oleg Dubinskiy 5f7575909f [AUDIOSRV][BOOTDATA][INCLUDE][MMSYS] Rename RosAudioSrv to AudioSrv (#1826)
Rename RosAudioSrv to AudioSrv in audio service itself and in all system components which are related to this, same as it done in Win2k3.
It allows MS DxDiag to detect the system audio service correctly, so it becomes possible to run DirectSound test properly with MS dsound.dll, although it works with some minor errors and only in older VirtualBox versions, ~ up to 5.1.38 (and in other emulators as well).

CORE-16307
2019-08-16 19:11:04 +02:00
James Tabor d48345a0ee Update Headers for Printing and Other
Add missing flags and function types. Fix typos.
2019-08-15 21:39:26 -05:00
Timo Kreuzer 05b37f63ea [BROWSEUI] Try to "fix" IEThreadParamBlock structure for x64 2019-08-15 18:04:57 +02:00
Timo Kreuzer ede5ec65c2 [PSDK] dbghelp.h: Fix 64 bit version of LOADED_IMAGE 2019-08-15 18:04:57 +02:00
Timo Kreuzer 94e5e79e3b [PSDK] Fix #ifdef in winuser.h 2019-08-15 18:04:57 +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
Timo Kreuzer f18958ffa2 [NDK] Add BIOS call API for amd64 2019-08-15 14:13:54 +02:00
Andrew Boyarshin b607e0119f [NTOSKRNL][PS] Implement NtQueueApcThreadEx and use it in NtQueueApcThread
Actually rename NtQueueApcThread to NtQueueApcThreadEx and ignore one additional parameter for now.
2019-08-15 12:32:09 +02:00
Katayama Hirofumi MZ d3dc5f2a73 [SDK][INCLUDE] Update msgdump.h and winxx.h 2019-08-12 19:31:44 +09: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
Eric Kohl 878db26378 [IDL][WINLOGON] Rename locally used functions of the winreg rpc interface
- Function 14 is named BaseRegNotifyChangeKeyValue
- Function 28 is named OpenDynData
2019-08-10 14:04:58 +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
Stanislav Motylkov 06b77b8572 [FREELDR] Implement proper partition type detection and handling (#1762)
- This allows to detect and dynamically handle different partitioning schemes.
- Implemented detection of MBR, GPT, Xbox-BRFR, and partitionless disks.
- Currently only MBR and Xbox-BRFR partitions are handled and tested.

CORE-9841 CORE-15768 CORE-16216 CORE-16248
2019-07-29 14:25:54 +02:00
Hermès Bélusca-Maïto bdb60afc86
[NDK] Use the correct __REACTOS__ define. 2019-07-29 00:33:19 +02:00
Hermès Bélusca-Maïto 5064f3c47e
[PSDK] ks.h : Fix some IOCTL values, caught by Ben Nottelling. 2019-07-29 00:20:07 +02:00
Hermès Bélusca-Maïto 2becb000c8
[SPEC2DEF] Check whether OLE-specific exports do not have assigned ordinals, as they should be.
The check is done at the same time as when we check also that these
exports are marked PRIVATE or not.

This permits us to check for the same conditions as MS' LINK.EXE, but
here on GCC builds as well.

See the following pages for more details:
https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-warning-lnk4104
https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-warning-lnk4222

In this last page (LNK4222), the specified list of exports is incomplete.
Manual tests showed that the very same list as for LNK4104 is checked.
2019-07-28 15:50:30 +02:00
Eric Kohl 294af4a774 [PSDK] Add missing UnregisterDeviceNotification() to winuser.h. 2019-07-27 19:59:32 +02: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
Katayama Hirofumi MZ 782160bbc0
[USER32_APITEST][INCLUDE] Add MessageStateAnalyzer testcase (#1732)
I want to visualize the message stream and verify the states of each message. ROSTESTS-328

- Add a testcase named MessageStateAnalyzer into user32_apitest.
- Also fix type casts in <windowsx.h>.
2019-07-25 01:45:55 +09:00
Timo Kreuzer 9efeefd506 [GEN_BASEADDRESS] Add framebuf.dll and framebuf_new.dll to exclude ist in gen_baseaddress.py 2019-07-20 13:56:18 +02:00
Timo Kreuzer 599843ac8e [TOOLS] Make gen_baseaddress.py python 3 compatible 2019-07-20 13:56:18 +02:00
Timo Kreuzer 5aab1831f7 [CMAKE] Update base addresses 2019-07-20 13:56:18 +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