From 435b0b19d25b533a03bccd1eb1eedc918ff559ec Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Tue, 3 Oct 2017 22:28:12 +0300 Subject: [PATCH] [COMCTL32] Install comctl32 v6 and its manifest in first stage --- boot/bootdata/packages/reactos.dff.in | 4 + dll/win32/comctl32/CMakeLists.txt | 6 +- dll/win32/comctl32/commctrl.c | 73 ------------------- dll/win32/comctl32/rsrc.rc | 4 - ...1df_5.82.2600.2982_none_deadbeef.manifest} | 0 ...f1df_6.0.2600.2982_none_deadbeef.manifest} | 0 sdk/cmake/CMakeMacros.cmake | 8 ++ 7 files changed, 16 insertions(+), 79 deletions(-) rename dll/win32/comctl32/{comctl32v5.manifest => x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest} (100%) rename dll/win32/comctl32/{comctl32.manifest => x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest} (100%) diff --git a/boot/bootdata/packages/reactos.dff.in b/boot/bootdata/packages/reactos.dff.in index 283f32dad53..a365760608a 100644 --- a/boot/bootdata/packages/reactos.dff.in +++ b/boot/bootdata/packages/reactos.dff.in @@ -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 diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index 1b55c5dfdf4..92850014784 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -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) \ No newline at end of file +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) \ No newline at end of file diff --git a/dll/win32/comctl32/commctrl.c b/dll/win32/comctl32/commctrl.c index e091cccabdc..df063c03136 100644 --- a/dll/win32/comctl32/commctrl.c +++ b/dll/win32/comctl32/commctrl.c @@ -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; } diff --git a/dll/win32/comctl32/rsrc.rc b/dll/win32/comctl32/rsrc.rc index 0fb8289440b..e0a937685f8 100644 --- a/dll/win32/comctl32/rsrc.rc +++ b/dll/win32/comctl32/rsrc.rc @@ -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 diff --git a/dll/win32/comctl32/comctl32v5.manifest b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest similarity index 100% rename from dll/win32/comctl32/comctl32v5.manifest rename to dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest diff --git a/dll/win32/comctl32/comctl32.manifest b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest similarity index 100% rename from dll/win32/comctl32/comctl32.manifest rename to dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index 95f99f3af73..dc9a58e6310 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -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() -- 2.17.1