https://git.reactos.org/?p=reactos.git;a=commitdiff;h=383ea7d92bf1e38a042f7…
commit 383ea7d92bf1e38a042f7b130f9f4ee00c1a827e
Author: Adam Słaboń <asaillen456esx(a)gmail.com>
AuthorDate: Tue Oct 6 16:39:14 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Oct 6 23:39:14 2020 +0900
[BOOTDATA][FONTS] Add vgaoem.fon font (#3272)
Converted from the XFree vga.bdf font.
This is needed for Vista+ x64 Winload. ReactOS x64 now boots with Vista x64 Winload out of the box (like Windows Server 2003 x64).
Tested with winload.exe from Vista x64 RTM (6.0.6000.16386) and winload.efi from Server 2008 x64 Beta 3 (6.0.6001.16497).
---
boot/bootdata/hivesys.inf | 1 +
media/fonts/CMakeLists.txt | 1 +
media/fonts/doc/vgaoem/LICENSE.txt | 23 +++++++++++++++++++++++
media/fonts/vgaoem.fon | Bin 0 -> 5728 bytes
4 files changed, 25 insertions(+)
diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf
index eea43abf7a1..5e201a59a71 100644
--- a/boot/bootdata/hivesys.inf
+++ b/boot/bootdata/hivesys.inf
@@ -992,6 +992,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","28606",0x00000000,"c_28606
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","ACP",0x00000000,"1252"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","OEMCP",0x00000000,"437"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","MACCP",0x00000000,"10000"
+HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","OEMHAL",0x00000000,"vgaoem.fon"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage\EUDCCodeRange","932",2,"F040-F9FC"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage\EUDCCodeRange","936",2,"AAA1-AFFE,F8A1-FEFE,A140-A7A0"
diff --git a/media/fonts/CMakeLists.txt b/media/fonts/CMakeLists.txt
index ef0284283c6..2bb1a844709 100644
--- a/media/fonts/CMakeLists.txt
+++ b/media/fonts/CMakeLists.txt
@@ -65,6 +65,7 @@ list(APPEND FONT_FILES
verdanaz.ttf
verdanai.ttf
verdana.ttf
+ vgaoem.fon
wingding.ttf)
foreach(item ${FONT_FILES})
diff --git a/media/fonts/doc/vgaoem/LICENSE.txt b/media/fonts/doc/vgaoem/LICENSE.txt
new file mode 100644
index 00000000000..23fa07a5fe1
--- /dev/null
+++ b/media/fonts/doc/vgaoem/LICENSE.txt
@@ -0,0 +1,23 @@
+Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is fur-
+nished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from the XFree86
+Project.
\ No newline at end of file
diff --git a/media/fonts/vgaoem.fon b/media/fonts/vgaoem.fon
new file mode 100644
index 00000000000..25c7544dd18
Binary files /dev/null and b/media/fonts/vgaoem.fon differ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d86301f72bb562b89c8df…
commit d86301f72bb562b89c8dfa63781b764742317f8b
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Oct 5 02:15:14 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Oct 5 02:22:45 2020 +0200
[NTDLL:CSR] Perform more thorough validation of the parameters in CsrAllocateCaptureBuffer().
Complements commit 7e2db773.
- Validate the argument count.
- Validate the total buffer size: the total size of the header plus
the pointer-offset array and the provided buffer, together with
the alignment padding for each argument, must be less than MAXLONG
aligned to 4-byte boundary.
---
dll/ntdll/csr/capture.c | 35 ++++++++++++++++++++++++++++-------
dll/ntdll/csr/connect.c | 2 +-
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c
index 759f74bcdf9..1a388d467a4 100644
--- a/dll/ntdll/csr/capture.c
+++ b/dll/ntdll/csr/capture.c
@@ -91,13 +91,35 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
IN ULONG BufferSize)
{
PCSR_CAPTURE_BUFFER CaptureBuffer;
+ ULONG OffsetsArraySize;
+ ULONG MaximumSize;
- /* Validate size */
- if (BufferSize >= MAXLONG) return NULL;
+ /* Validate the argument count. Note that on server side, CSRSRV
+ * limits the count to MAXUSHORT; here we are a bit more lenient. */
+ if (ArgumentCount > (MAXLONG / sizeof(ULONG_PTR)))
+ return NULL;
+
+ OffsetsArraySize = ArgumentCount * sizeof(ULONG_PTR);
+
+ /*
+ * Validate the total buffer size.
+ * The total size of the header plus the pointer-offset array and the
+ * provided buffer, together with the alignment padding for each argument,
+ * must be less than MAXLONG aligned to 4-byte boundary.
+ */
+ MaximumSize = (MAXLONG & ~3) - FIELD_OFFSET(CSR_CAPTURE_BUFFER, PointerOffsetsArray);
+ if (OffsetsArraySize >= MaximumSize)
+ return NULL;
+ MaximumSize -= OffsetsArraySize;
+ if (BufferSize >= MaximumSize)
+ return NULL;
+ MaximumSize -= BufferSize;
+ if ((ArgumentCount * 3) + 3 >= MaximumSize)
+ return NULL;
/* Add the size of the header and of the pointer-offset array */
BufferSize += FIELD_OFFSET(CSR_CAPTURE_BUFFER, PointerOffsetsArray) +
- (ArgumentCount * sizeof(ULONG_PTR));
+ OffsetsArraySize;
/* Add the size of the alignment padding for each argument */
BufferSize += ArgumentCount * 3;
@@ -113,13 +135,12 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
CaptureBuffer->Size = BufferSize;
CaptureBuffer->PointerCount = 0;
- /* Initialize all the offsets */
- RtlZeroMemory(CaptureBuffer->PointerOffsetsArray,
- ArgumentCount * sizeof(ULONG_PTR));
+ /* Initialize the pointer-offset array */
+ RtlZeroMemory(CaptureBuffer->PointerOffsetsArray, OffsetsArraySize);
/* Point to the start of the free buffer */
CaptureBuffer->BufferEnd = (PVOID)((ULONG_PTR)CaptureBuffer->PointerOffsetsArray +
- ArgumentCount * sizeof(ULONG_PTR));
+ OffsetsArraySize);
/* Return the address of the buffer */
return CaptureBuffer;
diff --git a/dll/ntdll/csr/connect.c b/dll/ntdll/csr/connect.c
index 213b48b9457..f9d007b701f 100644
--- a/dll/ntdll/csr/connect.c
+++ b/dll/ntdll/csr/connect.c
@@ -407,7 +407,7 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
ApiMessage->CsrCaptureData = (PCSR_CAPTURE_BUFFER)
((ULONG_PTR)CaptureBuffer + CsrPortMemoryDelta);
- /* Lock the buffer. */
+ /* Lock the buffer */
CaptureBuffer->BufferEnd = NULL;
/*
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b3fa53f818639ef765cde…
commit b3fa53f818639ef765cde4d294215d558433cc38
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Oct 5 02:01:52 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Oct 5 02:22:43 2020 +0200
[NTDLL:CSR] Fix a bug in the calculation of the capture buffer size in CsrAllocateCaptureBuffer().
Take the alignment padding for each argument into account, **BEFORE**
doing the final size alignment on a 4-byte boundary. Thus, the capture
buffer size value is properly aligned, and passes the validation tests
on the server side (in CSRSRV!CsrCaptureArguments), see commit 7e2db773.
This bug was put in evidence in x64 builds where the memory alignments
were more tight than in the x86 builds.
---
dll/ntdll/csr/capture.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c
index 1f1e6956e55..759f74bcdf9 100644
--- a/dll/ntdll/csr/capture.c
+++ b/dll/ntdll/csr/capture.c
@@ -95,16 +95,16 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
/* Validate size */
if (BufferSize >= MAXLONG) return NULL;
- /* Add the size of the header and for each offset to the pointers */
+ /* Add the size of the header and of the pointer-offset array */
BufferSize += FIELD_OFFSET(CSR_CAPTURE_BUFFER, PointerOffsetsArray) +
(ArgumentCount * sizeof(ULONG_PTR));
- /* Align it to a 4-byte boundary */
- BufferSize = (BufferSize + 3) & ~3;
-
/* Add the size of the alignment padding for each argument */
BufferSize += ArgumentCount * 3;
+ /* Align it to a 4-byte boundary */
+ BufferSize = (BufferSize + 3) & ~3;
+
/* Allocate memory from the port heap */
CaptureBuffer = RtlAllocateHeap(CsrPortHeap, HEAP_ZERO_MEMORY, BufferSize);
if (CaptureBuffer == NULL) return NULL;