- Implement CopyImage(LR_SHARED) case.
CORE-7575

svn path=/trunk/; revision=64919
This commit is contained in:
Jérôme Gardou 2014-10-23 11:45:55 +00:00
parent 796aebbf35
commit f20e2e7a8f

View file

@ -1684,6 +1684,7 @@ CURSORICON_CopyImage(
{
HICON ret = NULL;
ICONINFO ii;
CURSORDATA CursorData;
if (fuFlags & LR_COPYFROMRESOURCE)
{
@ -1769,7 +1770,13 @@ CURSORICON_CopyImage(
}
/* Call the relevant function */
ret = CURSORICON_LoadImageW(hModule, ustrRsrc.Buffer, cxDesired, cyDesired, fuFlags & LR_DEFAULTSIZE, bIcon);
ret = CURSORICON_LoadImageW(
hModule,
ustrRsrc.Buffer,
cxDesired,
cyDesired,
fuFlags & (LR_DEFAULTSIZE | LR_SHARED),
bIcon);
FreeLibrary(hModule);
@ -1784,7 +1791,7 @@ CURSORICON_CopyImage(
}
/* This is a regular copy */
if(fuFlags & ~LR_COPYDELETEORG)
if (fuFlags & ~(LR_COPYDELETEORG | LR_SHARED))
FIXME("Unimplemented flags: 0x%08x\n", fuFlags);
if (!GetIconInfo(hicon, &ii))
@ -1793,8 +1800,24 @@ CURSORICON_CopyImage(
return NULL;
}
ret = CreateIconIndirect(&ii);
/* This is CreateIconIndirect with the LR_SHARED coat added */
if (!CURSORICON_GetCursorDataFromIconInfo(&CursorData, &ii))
goto Leave;
if (fuFlags & LR_SHARED)
CursorData.CURSORF_flags |= CURSORF_LRSHARED;
ret = NtUserxCreateEmptyCurObject(FALSE);
if (!ret)
goto Leave;
if (!NtUserSetCursorIconData(ret, NULL, NULL, &CursorData))
{
NtUserDestroyCursor(ret, TRUE);
goto Leave;
}
Leave:
DeleteObject(ii.hbmMask);
if (ii.hbmColor) DeleteObject(ii.hbmColor);