https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0bdae2114aa2300cee183…
commit 0bdae2114aa2300cee18319752f0b6acc22d93d5
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sat Dec 31 17:50:25 2022 +0100
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Tue Jan 3 16:48:03 2023 +0100
[NTOS:CM] Cleanup the hive in case linking it to master fails (#4969)
Currently the failure code path doesn't do any kind of cleanup against
the hive that was being linked to master. The cleanup is pretty
straightforward as you just simply close the hive file handles and free
the registry kernel structures.
CORE-5772
CORE-17263
CORE-13559
---
ntoskrnl/config/cmapi.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/ntoskrnl/config/cmapi.c b/ntoskrnl/config/cmapi.c
index 6555658435f..e21eea3b793 100644
--- a/ntoskrnl/config/cmapi.c
+++ b/ntoskrnl/config/cmapi.c
@@ -2121,18 +2121,24 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
/* Release the hive */
CmHive->Hive.HiveFlags &= ~HIVE_IS_UNLOADING;
CmHive->CreatorOwner = NULL;
-
- /* Allow loads */
- ExReleasePushLock(&CmpLoadHiveLock);
}
else
{
DPRINT1("CmpLinkHiveToMaster failed, Status %lx\n", Status);
- /* FIXME: TODO */
- // ASSERT(FALSE); see CORE-17263
- ExReleasePushLock(&CmpLoadHiveLock);
+
+ /* We're touching this hive, set the loading flag */
+ CmHive->HiveIsLoading = TRUE;
+
+ /* Close associated file handles */
+ CmpCloseHiveFiles(CmHive);
+
+ /* Cleanup its resources */
+ CmpDestroyHive(CmHive);
}
+ /* Allow loads */
+ ExReleasePushLock(&CmpLoadHiveLock);
+
/* Is this first profile load? */
if (!CmpProfileLoaded && !CmpWasSetupBoot)
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d395c3096752ef2b29718…
commit d395c3096752ef2b297189d1c016bc9c1d6b07e5
Author: Egor Ananyin <ananinegor(a)gmail.com>
AuthorDate: Sat Dec 31 18:08:14 2022 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Dec 31 16:08:14 2022 +0100
[MSPAINT] Don't allow to set image as wallpaper if it has the wrong format (#4924)
CORE-18661
Our Paint allows user to try to set a .ico file as a wallpaper, which isn't possible. Different Windows versions have different behaviour, so it was decided that the simplest fix would be to just grey out "Set as wallpaper" buttons as in 2K3 (See the Jira ticket).
---
base/applications/mspaint/winproc.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp
index 74e27a67661..640e596215b 100644
--- a/base/applications/mspaint/winproc.cpp
+++ b/base/applications/mspaint/winproc.cpp
@@ -280,14 +280,18 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO
BOOL trueSelection =
(::IsWindowVisible(selectionWindow) &&
((toolsModel.GetActiveTool() == TOOL_FREESEL) || (toolsModel.GetActiveTool() == TOOL_RECTSEL)));
+ BOOL isBMP;
switch (lParam)
{
case 0: /* File menu */
if ((HMENU)wParam != GetSubMenu(menu, 0))
break;
- EnableMenuItem(menu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(isAFile));
- EnableMenuItem(menu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(isAFile));
- EnableMenuItem(menu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(isAFile));
+
+ isBMP = _wcsicmp(PathFindExtensionW(filepathname), L".bmp") == 0;
+ EnableMenuItem(menu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(isAFile && isBMP));
+ EnableMenuItem(menu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(isAFile && isBMP));
+ EnableMenuItem(menu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(isAFile && isBMP));
+
RemoveMenu(menu, IDM_FILE1, MF_BYCOMMAND);
RemoveMenu(menu, IDM_FILE2, MF_BYCOMMAND);
RemoveMenu(menu, IDM_FILE3, MF_BYCOMMAND);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bfe06cbfca79ba0275ce2…
commit bfe06cbfca79ba0275ce2eea3a328e26fd1598a2
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Fri Dec 30 19:47:21 2022 +0100
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Fri Dec 30 19:58:37 2022 +0100
[SDK][CMLIB] Properly check for failure if hive free list creation fails
HvpCreateHiveFreeCellList returns a NTSTATUS code yet the way the code path checks
checks for failure is just wrong. This was spotted whilst working on #4571 PR.
---
sdk/lib/cmlib/hiveinit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/lib/cmlib/hiveinit.c b/sdk/lib/cmlib/hiveinit.c
index 2b070fb4f7e..3eee62d149e 100644
--- a/sdk/lib/cmlib/hiveinit.c
+++ b/sdk/lib/cmlib/hiveinit.c
@@ -306,7 +306,7 @@ HvpInitializeMemoryHive(
BlockIndex += Bin->Size / HBLOCK_SIZE;
}
- if (HvpCreateHiveFreeCellList(Hive))
+ if (!NT_SUCCESS(HvpCreateHiveFreeCellList(Hive)))
{
HvpFreeHiveBins(Hive);
Hive->Free(Hive->BaseBlock, Hive->BaseBlockAlloc);