mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed loading icons with flag LR_LOADFROMFILE.
svn path=/trunk/; revision=6329
This commit is contained in:
parent
f09774d1ba
commit
2233f43d06
1 changed files with 10 additions and 7 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: bitmap.c,v 1.17 2003/10/06 18:49:49 navaraf Exp $
|
||||
/* $Id: bitmap.c,v 1.18 2003/10/15 19:39:08 navaraf Exp $
|
||||
*
|
||||
* PROJECT: ReactOS user32.dll
|
||||
* FILE: lib/user32/windows/input.c
|
||||
|
@ -329,9 +329,9 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
0,
|
||||
NULL);
|
||||
|
||||
CloseHandle(hFile);
|
||||
if (hSection == NULL)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return(NULL);
|
||||
}
|
||||
IconDIR = MapViewOfFile(hSection,
|
||||
|
@ -340,9 +340,10 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
0,
|
||||
0);
|
||||
|
||||
CloseHandle(hSection);
|
||||
if (IconDIR == NULL)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
CloseHandle(hSection);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
@ -352,16 +353,18 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
|
||||
if (!dirEntry)
|
||||
{
|
||||
if (fuLoad & LR_LOADFROMFILE)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
CloseHandle(hSection);
|
||||
UnmapViewOfFile(IconDIR);
|
||||
}
|
||||
return(NULL);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
SafeIconImage = RtlAllocateHeap(RtlGetProcessHeap(), 0, dirEntry->dwBytesInRes);
|
||||
|
||||
memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes);
|
||||
|
||||
CloseHandle(hFile);
|
||||
CloseHandle(hSection);
|
||||
}
|
||||
|
||||
//at this point we have a copy of the icon image to play with
|
||||
|
|
Loading…
Reference in a new issue