[SYSSETUP] Don't load ISOLATIONAWARE_MANIFEST_RESOURCE_ID manually

Such a manifest is meant to be activated by the caller of the exports of the dll.
This means that the user of syssetup which is setup.exe is the one that should do the proper handling of the manifests.
Since setup.exe is the one that needs to do the right thing, add a CREATEPROCESS_MANIFEST_RESOURCE_ID to it and avoid
dealing with ISOLATIONAWARE_MANIFEST_RESOURCE_ID altogether (which is supposed to be used by activating the activation context
before calling the exports of the dll that has it). We don't really use ISOLATIONAWARE_MANIFEST_RESOURCE_ID correctly in any
place in the tree so let's rely on CREATEPROCESS_MANIFEST_RESOURCE_ID for now.

This fixes one part of CORE-14228 where no image was shown in the theme selector buttons. This happened because comctl32 was
statically linked and calling ImageList_LoadImage ended up creating an image list with comctl32 v5. Then we passed this image
list to a button created with comctl32 v6 and as a result the image list was unusable. This is yet another issue that needs
to be addressed in the future. Namely, it seems that in windows comctl32 v6 can use image lists created by comctl32 v5 whereas
we cannot.

This fix is not a hack but cleverly works around these two bugs that need to be addressed some time in the future.
CORE-14228
This commit is contained in:
Giannis Adamopoulos 2018-02-07 01:15:49 +02:00
parent 579e1e6b24
commit 218b8eda92
3 changed files with 3 additions and 35 deletions

View file

@ -1,4 +1,7 @@
#include <winuser.h>
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Setup"
#define REACTOS_STR_INTERNAL_NAME "setup"
#define REACTOS_STR_ORIGINAL_FILENAME "setup.exe"
#include <reactos/manifest_exe.rc>
#include <reactos/version.rc>

View file

@ -24,8 +24,6 @@ IDI_ICON3 ICON "resources/3.ico"
IDI_ICON4 ICON "resources/4.ico"
IDI_ICON5 ICON "resources/5.ico"
#include <reactos/manifest_dll.rc>
STRINGTABLE
BEGIN
IDS_ACKPROJECTS "Wine - http://www.winehq.org\nFreeType - http://www.freetype.org\nSYSLINUX - http://syslinux.zytor.com\nMinGW - http://www.mingw.org\nBochs - http://bochs.sourceforge.net\nQEMU - http://fabrice.bellard.free.fr/qemu\nMesa3D - http://www.mesa3d.org\nadns - http://www.gnu.org/software/adns\nICU - http://www.icu-project.org/\nGraphApp - http://enchantia.com/software/graphapp/\nExt2 - http://www.ext2fsd.com/\nGNU FreeFont - http://savannah.gnu.org/projects/freefont/\nDejaVu Fonts - http://dejavu.sourceforge.net\nLiberation(tm) Fonts - https://fedorahosted.org/liberation-fonts/\nBtrfs - https://github.com/maharmstone/btrfs"

View file

@ -2491,25 +2491,6 @@ ProcessUnattendSetup(
typedef DWORD(WINAPI *PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA);
BOOL ActivateComctl32v6ActCtx(ULONG_PTR *cookie, HANDLE* hActCtx)
{
ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
WCHAR fileBuffer[MAX_PATH];
*hActCtx = INVALID_HANDLE_VALUE;
if (!GetModuleFileName(hDllInstance, fileBuffer, MAX_PATH))
return FALSE;
ActCtx.lpSource = fileBuffer;
ActCtx.lpResourceName = ISOLATIONAWARE_MANIFEST_RESOURCE_ID;
*hActCtx = CreateActCtx(&ActCtx);
if (*hActCtx == INVALID_HANDLE_VALUE)
return FALSE;
return ActivateActCtx(*hActCtx, cookie);
}
VOID
InstallWizard(VOID)
{
@ -2523,9 +2504,6 @@ InstallWizard(VOID)
HMODULE hNetShell = NULL;
PFNREQUESTWIZARDPAGES pfn = NULL;
DWORD dwPageCount = 8, dwNetworkPageCount = 0;
BOOL bActCtxActivated;
ULONG_PTR cookie;
HANDLE hActCtx;
LogItem(L"BEGIN_SECTION", L"InstallWizard");
@ -2543,11 +2521,6 @@ InstallWizard(VOID)
goto done;
}
/* Load and activate the act ctx for comctl32v6 now manually.
* Even if the exe of the process had a manifest, at the point of its launch
* the manifest of comctl32 wouldn't be installed so it wouldn't be loaded at all */
bActCtxActivated = ActivateComctl32v6ActCtx(&cookie, &hActCtx);
hNetShell = LoadLibraryW(L"netshell.dll");
if (hNetShell != NULL)
{
@ -2701,12 +2674,6 @@ done:
if (hNetShell != NULL)
FreeLibrary(hNetShell);
if (bActCtxActivated)
{
DeactivateActCtx(0, cookie);
ReleaseActCtx(hActCtx);
}
if (pSetupData != NULL)
{
DeleteObject(pSetupData->hBoldFont);