mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 12:54:51 +00:00
[COMCTL32]
- When installing dll copy manifest to winsxs\manifests directory as comctl32 before sync did. Fixes Firefox 10 regression. See issue #6910 for more details. svn path=/trunk/; revision=56132
This commit is contained in:
parent
d2b625c52f
commit
236256055e
|
@ -71,6 +71,19 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
||||||
|
|
||||||
|
#define NAME L"microsoft.windows.common-controls"
|
||||||
|
#define VERSION L"6.0.2600.2982"
|
||||||
|
#define PUBLIC_KEY L"6595b64144ccf1df"
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
#define ARCH L"x86"
|
||||||
|
#elif defined __x86_64__
|
||||||
|
#define ARCH L"amd64"
|
||||||
|
#else
|
||||||
|
#define ARCH L"none"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const WCHAR manifest_filename[] = ARCH L"_" NAME L"_" PUBLIC_KEY L"_" VERSION L"_none_deadbeef.manifest";
|
||||||
|
|
||||||
static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
@ -92,6 +105,67 @@ static const WCHAR strCC32SubclassInfo[] = {
|
||||||
'C','C','3','2','S','u','b','c','l','a','s','s','I','n','f','o',0
|
'C','C','3','2','S','u','b','c','l','a','s','s','I','n','f','o',0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static BOOL create_manifest(BOOL install)
|
||||||
|
{
|
||||||
|
WCHAR *pwszBuf;
|
||||||
|
HRSRC hResInfo;
|
||||||
|
HGLOBAL hResData;
|
||||||
|
PVOID pManifest;
|
||||||
|
DWORD cchBuf, cbManifest, cbWritten;
|
||||||
|
HANDLE hFile;
|
||||||
|
BOOL bRet = FALSE;
|
||||||
|
|
||||||
|
hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", 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;
|
||||||
|
|
||||||
|
cchBuf = GetWindowsDirectoryW(NULL, 0) * sizeof(WCHAR) + sizeof(L"\\winsxs\\manifests\\") + sizeof(manifest_filename);
|
||||||
|
pwszBuf = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchBuf * sizeof(WCHAR));
|
||||||
|
if (!pwszBuf)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
GetWindowsDirectoryW(pwszBuf, cchBuf);
|
||||||
|
lstrcatW(pwszBuf, L"\\winsxs");
|
||||||
|
CreateDirectoryW(pwszBuf, NULL);
|
||||||
|
lstrcatW(pwszBuf, L"\\manifests\\");
|
||||||
|
CreateDirectoryW(pwszBuf, NULL);
|
||||||
|
lstrcatW(pwszBuf, manifest_filename);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DllMain [Internal]
|
* DllMain [Internal]
|
||||||
|
@ -930,6 +1004,12 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||||
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||||
{
|
{
|
||||||
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
|
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
|
||||||
|
if (!create_manifest(bInstall))
|
||||||
|
{
|
||||||
|
ERR("create_manifest failed!\n");
|
||||||
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue