https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a999c4374607861cdc557…
commit a999c4374607861cdc5576e8a9255958e15273f6
Author: Julio Carchi <julcar(a)informaticos.com>
AuthorDate: Wed Jan 18 13:24:40 2023 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Jan 18 21:24:40 2023 +0300
[NTGDI] Check if face->charmap is not zero before accessing its encoding (#4390)
This allows DevExpress Ribbon Notepad sample to start.
Also add a fat DPRINT1 suggested by Timo Kreuzer,
because there is a lot wrong in the code.
CORE-18091 CORE-18558
---
win32ss/gdi/ntgdi/freetype.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index ca1285a4ae7..fcf6f2dfcc7 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -4490,6 +4490,12 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
DWORD num_ranges = 0;
FT_Face face = Font->SharedFace->Face;
+ if (face->charmap == NULL)
+ {
+ DPRINT1("FIXME: No charmap selected! This is a BUG!\n");
+ return 0;
+ }
+
if (face->charmap->encoding == FT_ENCODING_UNICODE)
{
FT_UInt glyph_code = 0;
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=346477fb3c98246b03ec3…
commit 346477fb3c98246b03ec3fcb60b50b562aa7ab85
Author: Wu Haotian <RigoLigo03(a)gmail.com>
AuthorDate: Mon Jan 9 22:55:29 2023 +0800
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Wed Jan 18 02:35:19 2023 +0300
[NTOS:MM] Use image prefix in MmLoadSystemImage
MmLoadSystemImage has a PUNICODE_STRING NamePrefix parameter which is
currently unused in ReactOS. When the kernel loads the crash dump
storage stack drivers, the drivers will be loaded with MmLoadSystemImage
with a "dump_" or "hiber_" (for hibernation, which uses crash dump
stack too) prefix. This change adds in the prefix support, and is
supposed to push crash dump support forward.
CORE-376
---
ntoskrnl/mm/ARM3/sysldr.c | 53 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 49 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c
index 35b538259f3..3ea6662cc28 100644
--- a/ntoskrnl/mm/ARM3/sysldr.c
+++ b/ntoskrnl/mm/ARM3/sysldr.c
@@ -2900,7 +2900,7 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName,
ULONG EntrySize, DriverSize;
PLOAD_IMPORTS LoadedImports = MM_SYSLDR_NO_IMPORTS;
PCHAR MissingApiName, Buffer;
- PWCHAR MissingDriverName;
+ PWCHAR MissingDriverName, PrefixedBuffer = NULL;
HANDLE SectionHandle;
ACCESS_MASK DesiredAccess;
PSECTION Section = NULL;
@@ -2964,7 +2964,52 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName,
PrefixName = *FileName;
/* Check if we have a prefix */
- if (NamePrefix) DPRINT1("Prefixed images are not yet supported!\n");
+ if (NamePrefix)
+ {
+ /* Check if "directory + prefix" is too long for the string */
+ Status = RtlUShortAdd(BaseDirectory.Length,
+ NamePrefix->Length,
+ &PrefixName.MaximumLength);
+ if (!NT_SUCCESS(Status))
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ goto Quickie;
+ }
+
+ /* Check if "directory + prefix + basename" is too long for the string */
+ Status = RtlUShortAdd(PrefixName.MaximumLength,
+ BaseName.Length,
+ &PrefixName.MaximumLength);
+ if (!NT_SUCCESS(Status))
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ goto Quickie;
+ }
+
+ /* Allocate the buffer exclusively used for prefixed name */
+ PrefixedBuffer = ExAllocatePoolWithTag(PagedPool,
+ PrefixName.MaximumLength,
+ TAG_LDR_WSTR);
+ if (!PrefixedBuffer)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Clear out the prefixed name string */
+ PrefixName.Buffer = PrefixedBuffer;
+ PrefixName.Length = 0;
+
+ /* Concatenate the strings */
+ RtlAppendUnicodeStringToString(&PrefixName, &BaseDirectory);
+ RtlAppendUnicodeStringToString(&PrefixName, NamePrefix);
+ RtlAppendUnicodeStringToString(&PrefixName, &BaseName);
+
+ /* Now the base name of the image becomes the prefixed version */
+ BaseName.Buffer = &(PrefixName.Buffer[BaseDirectory.Length / sizeof(WCHAR)]);
+ BaseName.Length += NamePrefix->Length;
+ BaseName.MaximumLength = (PrefixName.MaximumLength - BaseDirectory.Length);
+ }
/* Check if we already have a name, use it instead */
if (LoadedName) BaseName = *LoadedName;
@@ -3406,8 +3451,8 @@ Quickie:
/* If we have a file handle, close it */
if (FileHandle) ZwClose(FileHandle);
- /* Check if we had a prefix (not supported yet - PrefixName == *FileName now) */
- /* if (NamePrefix) ExFreePool(PrefixName.Buffer); */
+ /* If we have allocated a prefixed name buffer, free it */
+ if (PrefixedBuffer) ExFreePoolWithTag(PrefixedBuffer, TAG_LDR_WSTR);
/* Free the name buffer and return status */
ExFreePoolWithTag(Buffer, TAG_LDR_WSTR);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6c06760547d093268d9d9…
commit 6c06760547d093268d9d9d778b1d91f24b63269e
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Jan 14 15:24:51 2023 -0500
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Jan 14 15:33:30 2023 -0500
[HIVESYS] Move ndis to the "NDIS Wrapper" group. CORE-18790
Miniport drivers import from NDIS, but NDIS does not support being
loaded as a dependent driver (it does not have DllInitialize).
Instead, NDIS needs to load before all possible miniport drivers,
even boot-start ones. We achieve this by placing it in its own service
order group, which loads before the NDIS group.
All our miniport drivers are demand-start, so would automatically start
later. The ndisprot driver from the ticket is likely the first boot-start
miniport we've encountered. Since DriverEntry did not run,
AdapterListHead was NULL, resulting in the crash.
---
boot/bootdata/hivesys.inf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf
index 45c3d6e6446..b22c8a7abba 100644
--- a/boot/bootdata/hivesys.inf
+++ b/boot/bootdata/hivesys.inf
@@ -1694,9 +1694,9 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Mup","ImagePath",0x00020000,"system32\dr
HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Type",0x00010001,0x00000002
-; NDIS driver - the only boot-start network driver
+; NDIS driver - needs to load before any drivers in the NDIS group
HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","ErrorControl",0x00010001,0x00000001
-HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Group",0x00000000,"NDIS"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Group",0x00000000,"NDIS Wrapper"
HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","ImagePath",0x00020000,"system32\drivers\ndis.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Type",0x00010001,0x00000001