mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SHELL32] Sync HCR_RegGetIconW() function to Wine 9.1 (#6418)
Import the following fixes:
- Use the number of bytes instead of the number of characters in the length
passed to RegQueryValueExW. Calculate this by multiplying the number of
characters on the size of one wide character in bytes, since only length
of characters is passed to the function. This fixes ERROR_MORE_DATA
returned from RegQueryValueExW, because the passed number of bytes was
less than the actual length of the output buffer, since it was calculated
incorrectly, so the function failed even when it received the correct
number of wide characters.
This partially imports Wine commit:
32584bb521
.
- Limit the number of characters in registry icon index buffer from 7 to 5,
as it done in ANSI version of this function, since registry index number
can contain up to 4 digits + space for the null-terminator.
This fixes problems when loading custom (user-defined) icons from registry,
like icons defined by the current user or for all users, instead of just
default icons from the root classes.
CORE-14758
Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
This commit is contained in:
parent
913235952c
commit
290221ef5b
1 changed files with 3 additions and 3 deletions
|
@ -239,11 +239,11 @@ BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
|
|||
|
||||
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
|
||||
{
|
||||
DWORD dwType;
|
||||
DWORD dwType, size = len * sizeof(WCHAR);
|
||||
WCHAR sTemp[MAX_PATH];
|
||||
WCHAR sNum[7];
|
||||
WCHAR sNum[5];
|
||||
|
||||
if (!RegQueryValueExW(hkey, szName, 0, &dwType, (LPBYTE)szDest, &len))
|
||||
if (!RegQueryValueExW(hkey, szName, 0, &dwType, (LPBYTE)szDest, &size))
|
||||
{
|
||||
if (dwType == REG_EXPAND_SZ)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue