[COMCTL32] Install comctl32 v6 and its manifest in first stage

This commit is contained in:
Giannis Adamopoulos 2017-10-03 22:28:12 +03:00
parent 7059421a23
commit 435b0b19d2
7 changed files with 16 additions and 79 deletions

View file

@ -71,6 +71,10 @@ Signature = "$ReactOS$"
51 = system32\CatRoot
52 = system32\CatRoot2
53 = AppPatch
54 = winsxs
55 = winsxs\manifests
56 = winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef
57 = winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef
.InfEnd

View file

@ -64,5 +64,7 @@ add_delay_importlibs(comctl32 winmm uxtheme)
add_importlibs(comctl32 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_pch(comctl32 comctl32.h SOURCE)
add_cd_file(TARGET comctl32 DESTINATION reactos/system32 FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/comctl32v5.manifest DESTINATION reactos/winsxs/manifests NAME_ON_CD x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest FOR livecd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/comctl32.manifest DESTINATION reactos/winsxs/manifests NAME_ON_CD x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest FOR livecd)
add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef FOR all)
add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all)

View file

@ -129,64 +129,6 @@ static WCHAR* GetManifestPath(BOOL create, BOOL bV6)
return pwszBuf;
}
static BOOL create_manifest(BOOL install, BOOL bV6)
{
WCHAR *pwszBuf;
HRSRC hResInfo;
HGLOBAL hResData;
PVOID pManifest;
DWORD cbManifest, cbWritten;
HANDLE hFile;
BOOL bRet = FALSE;
if (bV6)
hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", (LPWSTR)RT_MANIFEST);
else
hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFESTV5", (LPWSTR)RT_MANIFEST);
if (!hResInfo)
return FALSE;
cbManifest = SizeofResource(COMCTL32_hModule, hResInfo);
if (!cbManifest)
return FALSE;
hResData = LoadResource(COMCTL32_hModule, hResInfo);
if (!hResData)
return FALSE;
pManifest = LockResource(hResData);
if (!pManifest)
return FALSE;
pwszBuf = GetManifestPath(TRUE, bV6);
if (!pwszBuf)
return FALSE;
if (install)
{
hFile = CreateFileW(pwszBuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
if (WriteFile(hFile, pManifest, cbManifest, &cbWritten, NULL) && cbWritten == cbManifest)
bRet = TRUE;
CloseHandle(hFile);
if (!bRet)
DeleteFileW(pwszBuf);
else
TRACE("created %s\n", debugstr_w(pwszBuf));
}
}
else
bRet = DeleteFileW(pwszBuf);
HeapFree(GetProcessHeap(), 0, pwszBuf);
return bRet;
}
static HANDLE CreateComctl32ActCtx(BOOL bV6)
{
HANDLE ret;
@ -1179,21 +1121,6 @@ HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
{
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
#ifdef __REACTOS__
if (!create_manifest(bInstall, TRUE))
{
ERR("Failed to install comctl32 v6 manifest!\n");
return HRESULT_FROM_WIN32(GetLastError());
}
if (!create_manifest(bInstall, FALSE))
{
ERR("Failed to install comctl32 v5 manifest!\n");
return HRESULT_FROM_WIN32(GetLastError());
}
#endif
return S_OK;
}

View file

@ -36,10 +36,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "wine/wine_common_ver.rc"
/* @makedep: comctl32.manifest */
WINE_MANIFEST RT_MANIFEST comctl32.manifest
WINE_MANIFESTV5 RT_MANIFEST comctl32v5.manifest
/* @makedep: idt_check.bmp */
IDT_CHECK BITMAP idt_check.bmp

View file

@ -271,6 +271,14 @@ macro(dir_to_num dir var)
set(${var} 52)
elseif(${dir} STREQUAL reactos/AppPatch)
set(${var} 53)
elseif(${dir} STREQUAL reactos/winsxs)
set(${var} 54)
elseif(${dir} STREQUAL reactos/winsxs/manifests)
set(${var} 55)
elseif(${dir} STREQUAL reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef)
set(${var} 56)
elseif(${dir} STREQUAL reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef)
set(${var} 57)
else()
message(FATAL_ERROR "Wrong destination: ${dir}")
endif()