https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a6719230378fd49e61059…
commit a6719230378fd49e610593c2b7e45ac331017c86
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Fri Jan 5 11:53:35 2018 +0200
[SHELL32] CMenuToolbarBase: Use COLOR_MENUTEXT color for the text color in normal menu items. CORE-13855
---
dll/win32/shell32/shellmenu/CMenuToolbars.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
index 40dd12fc9a..909c5fb21f 100644
--- a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
+++ b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
@@ -206,6 +206,9 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResu
}
else
{
+ // Set the text color, will be used by the internal drawing code
+ cdraw->clrText = GetSysColor(COLOR_MENUTEXT);
+
// Remove HOT and CHECKED flags (will restore HOT if necessary)
cdraw->nmcd.uItemState &= ~CDIS_HOT;
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82f44a2107d7eb79f1e3a…
commit 82f44a2107d7eb79f1e3a4af196e2e007a166e57
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Thu Jan 4 21:47:59 2018 +0100
[USETUP] When overwriting a file, if open fails, it might be because the file is readonly.
In such situation, try to drop the readonly attribute before overwritting the file.
This fixes setup not being able to overwrite FAT bootcode when reusing a FAT partition
already installed without reformatting.
CORE-14158
---
base/setup/usetup/filesup.c | 68 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/base/setup/usetup/filesup.c b/base/setup/usetup/filesup.c
index bed30c418d..65a372a337 100644
--- a/base/setup/usetup/filesup.c
+++ b/base/setup/usetup/filesup.c
@@ -348,8 +348,72 @@ SetupCopyFile(
0);
if (!NT_SUCCESS(Status))
{
- DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
- goto unmapsrcsec;
+ /* Open may have failed because the file to overwrite
+ * is in readonly mode
+ */
+ if (Status == STATUS_ACCESS_DENIED)
+ {
+ FILE_BASIC_INFORMATION FileBasicInfo;
+
+ /* Reattempt to open it */
+ Status = NtCreateFile(&FileHandleDest,
+ GENERIC_WRITE | SYNCHRONIZE,
+ &ObjectAttributes,
+ &IoStatusBlock,
+ NULL,
+ FILE_ATTRIBUTE_NORMAL,
+ 0,
+ FILE_OPEN,
+ FILE_NO_INTERMEDIATE_BUFFERING |
+ FILE_SEQUENTIAL_ONLY |
+ FILE_SYNCHRONOUS_IO_NONALERT,
+ NULL,
+ 0);
+ /* Fail for real if we cannot open it that way
+ * XXX: actually, we should try to refine access rights
+ * to only have write_attributes, should be enough
+ */
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
+ goto unmapsrcsec;
+ }
+
+ /* Zero our basic info, just to set attributes */
+ RtlZeroMemory(&FileBasicInfo, sizeof(FileBasicInfo));
+ /* Reset attributes to normal, no read-only */
+ FileBasicInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;
+ /* We basically don't care about whether it succeed:
+ * if it didn't, later open will fail
+ */
+ NtSetInformationFile(FileHandleDest, &IoStatusBlock, &FileBasicInfo,
+ sizeof(FileBasicInfo), FileBasicInformation);
+
+ /* Close file */
+ NtClose(FileHandleDest);
+
+ /* And re-attempt overwrite */
+ Status = NtCreateFile(&FileHandleDest,
+ GENERIC_WRITE | SYNCHRONIZE,
+ &ObjectAttributes,
+ &IoStatusBlock,
+ NULL,
+ FILE_ATTRIBUTE_NORMAL,
+ 0,
+ FILE_OVERWRITE_IF,
+ FILE_NO_INTERMEDIATE_BUFFERING |
+ FILE_SEQUENTIAL_ONLY |
+ FILE_SYNCHRONOUS_IO_NONALERT,
+ NULL,
+ 0);
+ }
+
+ /* We failed */
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
+ goto unmapsrcsec;
+ }
}
RegionSize = (ULONG)PAGE_ROUND_UP(FileStandard.EndOfFile.u.LowPart);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4765fe3666e32cbf2536…
commit d4765fe3666e32cbf25363520e010421bd2ef307
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Wed Dec 27 17:18:00 2017 +0100
[NTOS:MM] Implement resolving PXE/PPE page table demand zero faults
---
ntoskrnl/mm/ARM3/pagfault.c | 67 ++++++++++++++++++++++++++++++++-------------
1 file changed, 48 insertions(+), 19 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/pagfault.c b/ntoskrnl/mm/ARM3/pagfault.c
index f37fa458d2..69d70cc80b 100644
--- a/ntoskrnl/mm/ARM3/pagfault.c
+++ b/ntoskrnl/mm/ARM3/pagfault.c
@@ -2025,43 +2025,67 @@ UserFault:
/* Lock the working set */
MiLockProcessWorkingSet(CurrentProcess, CurrentThread);
+ ProtectionCode = MM_INVALID_PROTECTION;
+
#if (_MI_PAGING_LEVELS == 4)
-// Note to Timo: You should call MiCheckVirtualAddress and also check if it's zero pte
-// also this is missing the page count increment
/* Check if the PXE is valid */
if (PointerPxe->u.Hard.Valid == 0)
{
/* Right now, we only handle scenarios where the PXE is totally empty */
ASSERT(PointerPxe->u.Long == 0);
-#if 0
+
+ /* This is only possible for user mode addresses! */
+ ASSERT(PointerPte <= MiHighestUserPte);
+
+ /* Check if we have a VAD */
+ MiCheckVirtualAddress(Address, &ProtectionCode, &Vad);
+ if (ProtectionCode == MM_NOACCESS)
+ {
+ MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread);
+ return STATUS_ACCESS_VIOLATION;
+ }
+
/* Resolve a demand zero fault */
- Status = MiResolveDemandZeroFault(PointerPpe,
- PointerPxe,
- MM_READWRITE,
- CurrentProcess,
- MM_NOIRQL);
-#endif
+ MiResolveDemandZeroFault(PointerPpe,
+ PointerPxe,
+ MM_READWRITE,
+ CurrentProcess,
+ MM_NOIRQL);
+
/* We should come back with a valid PXE */
ASSERT(PointerPxe->u.Hard.Valid == 1);
}
#endif
#if (_MI_PAGING_LEVELS >= 3)
-// Note to Timo: You should call MiCheckVirtualAddress and also check if it's zero pte
-// also this is missing the page count increment
/* Check if the PPE is valid */
if (PointerPpe->u.Hard.Valid == 0)
{
/* Right now, we only handle scenarios where the PPE is totally empty */
ASSERT(PointerPpe->u.Long == 0);
-#if 0
+
+ /* This is only possible for user mode addresses! */
+ ASSERT(PointerPte <= MiHighestUserPte);
+
+ /* Check if we have a VAD, unless we did this already */
+ if (ProtectionCode == MM_INVALID_PROTECTION)
+ {
+ MiCheckVirtualAddress(Address, &ProtectionCode, &Vad);
+ }
+
+ if (ProtectionCode == MM_NOACCESS)
+ {
+ MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread);
+ return STATUS_ACCESS_VIOLATION;
+ }
+
/* Resolve a demand zero fault */
- Status = MiResolveDemandZeroFault(PointerPde,
- PointerPpe,
- MM_READWRITE,
- CurrentProcess,
- MM_NOIRQL);
-#endif
+ MiResolveDemandZeroFault(PointerPde,
+ PointerPpe,
+ MM_READWRITE,
+ CurrentProcess,
+ MM_NOIRQL);
+
/* We should come back with a valid PPE */
ASSERT(PointerPpe->u.Hard.Valid == 1);
}
@@ -2077,7 +2101,12 @@ UserFault:
#if MI_TRACE_PFNS
UserPdeFault = TRUE;
#endif
- MiCheckVirtualAddress(Address, &ProtectionCode, &Vad);
+ /* Check if we have a VAD, unless we did this already */
+ if (ProtectionCode == MM_INVALID_PROTECTION)
+ {
+ MiCheckVirtualAddress(Address, &ProtectionCode, &Vad);
+ }
+
if (ProtectionCode == MM_NOACCESS)
{
#if (_MI_PAGING_LEVELS == 2)