ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2005
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
40 participants
704 discussions
Start a n
N
ew thread
[gvg] 20126: oleacc has a DllRegisterServer entry point
by gvg@svn.reactos.com
oleacc has a DllRegisterServer entry point Modified: trunk/reactos/lib/oleacc/oleacc.xml _____ Modified: trunk/reactos/lib/oleacc/oleacc.xml --- trunk/reactos/lib/oleacc/oleacc.xml 2005-12-12 21:55:36 UTC (rev 20125) +++ trunk/reactos/lib/oleacc/oleacc.xml 2005-12-12 22:00:16 UTC (rev 20126) @@ -1,4 +1,5 @@ <module name="oleacc" type="win32dll" baseaddress="${BASEADDRESS_OLEACC}" installbase="system32" installname="oleacc.dll"> + <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <importlibrary definition="oleacc.spec.def" /> <include base="oleacc">.</include> <include base="ReactOS">include/wine</include>
18 years, 9 months
1
0
0
0
[navaraf] 20125: - Minimize the code differences between LoadIconImage and LoadCursorImage.
by navaraf@svn.reactos.com
- Minimize the code differences between LoadIconImage and LoadCursorImage. - Use ICs instead of DCs. - Fix a DC leak. Modified: trunk/reactos/lib/user32/windows/bitmap.c _____ Modified: trunk/reactos/lib/user32/windows/bitmap.c --- trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 21:42:18 UTC (rev 20124) +++ trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 21:55:36 UTC (rev 20125) @@ -81,7 +81,7 @@ HANDLE hSection; CURSORICONDIR *IconDIR; HDC hScreenDc; - HANDLE hIcon; + HICON hIcon; ULONG HeaderSize; ULONG ColorCount; PVOID Data; @@ -104,7 +104,7 @@ if (fuLoad & LR_SHARED) { /* FIXME - pass size! */ - hIcon = (HANDLE)NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, 0, 0); + hIcon = NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, 0, 0); if (hIcon) return hIcon; } @@ -117,13 +117,15 @@ if (IconResDir == NULL) return NULL; - /* Find the best fitting in the IconResDir for this resolution. */ - id = LookupIconIdFromDirectoryEx((PBYTE)IconResDir, TRUE, - 32, 32, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + /* + * Find the best fitting in the IconResDir for this resolution + */ - h2Resource = FindResourceW(hinst, MAKEINTRESOURCEW(id), - MAKEINTRESOURCEW(RT_CURSOR)); + id = LookupIconIdFromDirectoryEx((PBYTE)IconResDir, TRUE, 32, 32, + fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + h2Resource = FindResourceW(hinst, MAKEINTRESOURCEW(id), MAKEINTRESOURCEW(RT_CURSOR)); + hResource = LoadResource(hinst, h2Resource); if (hResource == NULL) return NULL; @@ -132,9 +134,10 @@ if (ResIcon == NULL) return NULL; - hIcon = (HANDLE)CreateIconFromResourceEx((PBYTE)ResIcon, - SizeofResource(hinst, h2Resource), FALSE, 0x00030000, - 32, 32, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + hIcon = CreateIconFromResourceEx((PBYTE)ResIcon, + SizeofResource(hinst, h2Resource), + FALSE, 0x00030000, 32, 32, + fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); if (hIcon && 0 != (fuLoad & LR_SHARED)) { NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes, @@ -146,7 +149,7 @@ if (fuLoad & LR_SHARED) { - DbgPrint("FIXME: need LR_SHARED support loading cursor images from files\n"); + DbgPrint("FIXME: need LR_SHARED support for loading cursor images from files\n"); } hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -175,7 +178,7 @@ * Get a handle to the screen dc, the icon we create is going to be * compatable with it. */ - hScreenDc = CreateCompatibleDC(NULL); + hScreenDc = CreateICW(NULL, NULL, NULL, NULL); if (hScreenDc == NULL) { UnmapViewOfFile(IconDIR); @@ -214,7 +217,7 @@ memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); UnmapViewOfFile(IconDIR); - /* at this point we have a copy of the icon image to play with */ + /* At this point we have a copy of the icon image to play with. */ SafeIconImage->icHeader.biHeight = SafeIconImage->icHeader.biHeight /2; @@ -232,7 +235,7 @@ HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD); } - /* make data point to the start of the XOR image data */ + /* Make data point to the start of the XOR image data. */ Data = (PBYTE)SafeIconImage + HeaderSize; hIcon = ICON_CreateCursorFromData(hScreenDc, Data, SafeIconImage, 32, 32, dirEntry->Info.cursor.wXHotspot, dirEntry->Info.cursor.wYHotspot); @@ -251,7 +254,7 @@ HANDLE hfRes; HANDLE hFile; HANDLE hSection; - CURSORICONDIR* IconDIR; + CURSORICONDIR *IconDIR; HDC hScreenDc; HICON hIcon; ULONG HeaderSize; @@ -327,44 +330,44 @@ if (fuLoad & LR_SHARED) { - DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n"); + DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n"); } hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hFile == NULL) - return NULL; + return NULL; hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (hSection == NULL) - return NULL; + return NULL; IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); CloseHandle(hSection); if (IconDIR == NULL) - return NULL; - + return NULL; + if (0 != IconDIR->idReserved || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) { - UnmapViewOfFile(IconDIR); - return NULL; + UnmapViewOfFile(IconDIR); + return NULL; } /* Pick the best size. */ dirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestIcon(IconDIR, width, height, 1); if (!dirEntry) { - UnmapViewOfFile(IconDIR); - return NULL; + UnmapViewOfFile(IconDIR); + return NULL; } SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); if (SafeIconImage == NULL) { - UnmapViewOfFile(IconDIR); - return NULL; + UnmapViewOfFile(IconDIR); + return NULL; } memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); @@ -393,7 +396,7 @@ /* Get a handle to the screen dc, the icon we create is going to be * compatable with this. */ - hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL); + hScreenDc = CreateICW(NULL, NULL, NULL, NULL); if (hScreenDc == NULL) { if (fuLoad & LR_LOADFROMFILE) @@ -403,6 +406,7 @@ hIcon = ICON_CreateIconFromData(hScreenDc, Data, SafeIconImage, width, height, width/2, height/2); RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); + DeleteDC(hScreenDc); return hIcon; }
18 years, 9 months
1
0
0
0
[gvg] 20124: Add oleacc to build
by gvg@svn.reactos.com
Add oleacc to build Modified: trunk/reactos/lib/directory.xml _____ Modified: trunk/reactos/lib/directory.xml --- trunk/reactos/lib/directory.xml 2005-12-12 21:36:50 UTC (rev 20123) +++ trunk/reactos/lib/directory.xml 2005-12-12 21:42:18 UTC (rev 20124) @@ -209,6 +209,9 @@ <directory name="ole32"> <xi:include href="ole32/ole32.xml" /> </directory> +<directory name="oleacc"> + <xi:include href="oleacc/oleacc.xml" /> +</directory> <directory name="oleaut32"> <xi:include href="oleaut32/oleaut32.xml" /> </directory>
18 years, 9 months
1
0
0
0
[navaraf] 20123: Replace GetModuleHandle("user32.dll") with User32Instance.
by navaraf@svn.reactos.com
Replace GetModuleHandle("user32.dll") with User32Instance. Modified: trunk/reactos/lib/user32/controls/edit.c _____ Modified: trunk/reactos/lib/user32/controls/edit.c --- trunk/reactos/lib/user32/controls/edit.c 2005-12-12 21:34:32 UTC (rev 20122) +++ trunk/reactos/lib/user32/controls/edit.c 2005-12-12 21:36:50 UTC (rev 20123) @@ -4060,7 +4060,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) { #ifdef __REACTOS__ - HMENU menu = LoadMenuA(GetModuleHandleA("USER32"), "EDITMENU"); + HMENU menu = LoadMenuA(User32Instance, "EDITMENU"); #else HMENU menu = LoadMenuA(user32_module, "EDITMENU"); #endif
18 years, 9 months
1
0
0
0
[navaraf] 20122: Replace GetModuleHandle("user32.dll") with User32Instance.
by navaraf@svn.reactos.com
Replace GetModuleHandle("user32.dll") with User32Instance. Modified: trunk/reactos/lib/user32/windows/mdi.c Modified: trunk/reactos/lib/user32/windows/menu.c Modified: trunk/reactos/lib/user32/windows/messagebox.c _____ Modified: trunk/reactos/lib/user32/windows/mdi.c --- trunk/reactos/lib/user32/windows/mdi.c 2005-12-12 21:31:19 UTC (rev 20121) +++ trunk/reactos/lib/user32/windows/mdi.c 2005-12-12 21:34:32 UTC (rev 20122) @@ -349,7 +349,7 @@ if (clientInfo->nActiveChildren - 1 > MDI_MOREWINDOWSLIMIT) { WCHAR szTmp[50]; - LoadStringW(GetModuleHandleA("USER32"), IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0])); + LoadStringW(User32Instance, IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0])); AppendMenuW(clientInfo->hWindowMenu, MF_STRING, clientInfo->idFirstChild + MDI_MOREWINDOWSLIMIT, szTmp); } return TRUE; @@ -680,7 +680,7 @@ if (ci->nActiveChildren == MDI_MOREWINDOWSLIMIT + 1) { WCHAR szTmp[50]; - LoadStringW(GetModuleHandleA("USER32"), IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0])); + LoadStringW(User32Instance, IDS_MDI_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0])); ModifyMenuW(ci->hWindowMenu, ci->idFirstChild + MDI_MOREWINDOWSLIMIT, @@ -2391,12 +2391,12 @@ HRSRC hRes; HANDLE hDlgTmpl; - hRes = FindResourceA(GetModuleHandleA("USER32"), "MDI_MOREWINDOWS", (LPSTR)RT_DIALOG); + hRes = FindResourceA(User32Instance, "MDI_MOREWINDOWS", (LPSTR)RT_DIALOG); if (hRes == 0) return 0; - hDlgTmpl = LoadResource(GetModuleHandleA("USER32"), hRes ); + hDlgTmpl = LoadResource(User32Instance, hRes); if (hDlgTmpl == 0) return 0; @@ -2406,7 +2406,7 @@ if (template == 0) return 0; - return (HWND) DialogBoxIndirectParamA(GetModuleHandleA("USER32"), + return (HWND) DialogBoxIndirectParamA(User32Instance, (LPDLGTEMPLATE) template, hwnd, MDI_MoreWindowsDlgProc, (LPARAM) hwnd); } _____ Modified: trunk/reactos/lib/user32/windows/menu.c --- trunk/reactos/lib/user32/windows/menu.c 2005-12-12 21:31:19 UTC (rev 20121) +++ trunk/reactos/lib/user32/windows/menu.c 2005-12-12 21:34:32 UTC (rev 20122) @@ -1043,9 +1043,7 @@ User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength) { LRESULT Result; - HMODULE hUser32; - hUser32 = GetModuleHandleW(L"USER32"); - Result = (LRESULT)LoadMenuW(hUser32, L"SYSMENU"); + Result = (LRESULT)LoadMenuW(User32Instance, L"SYSMENU"); return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS)); } _____ Modified: trunk/reactos/lib/user32/windows/messagebox.c --- trunk/reactos/lib/user32/windows/messagebox.c 2005-12-12 21:31:19 UTC (rev 20121) +++ trunk/reactos/lib/user32/windows/messagebox.c 2005-12-12 21:34:32 UTC (rev 20122) @@ -196,7 +196,6 @@ DLGITEMTEMPLATE *iico, *itxt; NONCLIENTMETRICSW nclm; WCHAR capbuf[32]; - HMODULE hUser32; LPVOID buf; BYTE *dest; LPCWSTR caption, text; @@ -213,11 +212,9 @@ BOOL defbtn = FALSE; DWORD units = GetDialogBaseUnits(); - hUser32 = GetModuleHandleW(L"USER32"); - if(!lpMsgBoxParams->lpszCaption || !HIWORD((LPWSTR)lpMsgBoxParams->lpszCaption)) { - LoadStringW(hUser32, IDS_ERROR, &capbuf[0], 32); + LoadStringW(User32Instance, IDS_ERROR, &capbuf[0], 32); caption = &capbuf[0]; } else @@ -335,34 +332,34 @@ switch(Buttons[i]) { case IDOK: - LoadStringW(hUser32, IDS_OK, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_OK, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDCANCEL: - LoadStringW(hUser32, IDS_CANCEL, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_CANCEL, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDYES: - LoadStringW(hUser32, IDS_YES, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_YES, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDNO: - LoadStringW(hUser32, IDS_NO, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_NO, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDTRYAGAIN: - LoadStringW(hUser32, IDS_TRYAGAIN, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_TRYAGAIN, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDCONTINUE: - LoadStringW(hUser32, IDS_CONTINUE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_CONTINUE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDABORT: - LoadStringW(hUser32, IDS_ABORT, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_ABORT, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDRETRY: - LoadStringW(hUser32, IDS_RETRY, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_RETRY, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDIGNORE: - LoadStringW(hUser32, IDS_IGNORE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_IGNORE, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; case IDHELP: - LoadStringW(hUser32, IDS_HELP, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); + LoadStringW(User32Instance, IDS_HELP, ButtonText[i], MSGBOXEX_MAXBTNSTR - 1); break; default: ButtonText[i][0] = (WCHAR)0;
18 years, 9 months
1
0
0
0
[navaraf] 20121: - Make the file at least slightly readable (the mixed TABs and spaces were way too annoying).
by navaraf@svn.reactos.com
- Make the file at least slightly readable (the mixed TABs and spaces were way too annoying). - Replace GetModuleHandleW(L"user32.dll") with User32Instance. - Fix one more allocation check. Modified: trunk/reactos/lib/user32/windows/bitmap.c _____ Modified: trunk/reactos/lib/user32/windows/bitmap.c --- trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 20:59:55 UTC (rev 20120) +++ trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 21:31:19 UTC (rev 20121) @@ -49,24 +49,25 @@ int cyDesired, UINT fuLoad) { - LPWSTR lpszWName; - HANDLE Handle; - UNICODE_STRING NameString; + LPWSTR lpszWName; + HANDLE Handle; + UNICODE_STRING NameString; - if (HIWORD(lpszName)) - { + if (HIWORD(lpszName)) + { RtlCreateUnicodeStringFromAsciiz(&NameString, (LPSTR)lpszName); lpszWName = NameString.Buffer; Handle = LoadImageW(hinst, lpszWName, uType, cxDesired, cyDesired, fuLoad); RtlFreeUnicodeString(&NameString); - } - else - { + } + else + { Handle = LoadImageW(hinst, (LPCWSTR)lpszName, uType, cxDesired, cyDesired, fuLoad); - } - return(Handle); + } + + return Handle; } @@ -94,35 +95,27 @@ if (!(fuLoad & LR_LOADFROMFILE)) { if (hinst == NULL) - { - hinst = GetModuleHandleW(L"USER32"); - } + hinst = User32Instance; + hResource = hfRes = FindResourceW(hinst, lpszName, RT_GROUP_CURSOR); if (hResource == NULL) - { return NULL; - } if (fuLoad & LR_SHARED) { /* FIXME - pass size! */ hIcon = (HANDLE)NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, 0, 0); if (hIcon) - { return hIcon; - } } hResource = LoadResource(hinst, hResource); if (hResource == NULL) - { return NULL; - } + IconResDir = LockResource(hResource); if (IconResDir == NULL) - { return NULL; - } /* Find the best fitting in the IconResDir for this resolution. */ id = LookupIconIdFromDirectoryEx((PBYTE)IconResDir, TRUE, @@ -133,15 +126,11 @@ hResource = LoadResource(hinst, h2Resource); if (hResource == NULL) - { return NULL; - } ResIcon = LockResource(hResource); if (ResIcon == NULL) - { return NULL; - } hIcon = (HANDLE)CreateIconFromResourceEx((PBYTE)ResIcon, SizeofResource(hinst, h2Resource), FALSE, 0x00030000, @@ -161,25 +150,19 @@ } hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, 0, NULL); + OPEN_EXISTING, 0, NULL); if (hFile == NULL) - { return NULL; - } hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (hSection == NULL) - { return NULL; - } IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); CloseHandle(hSection); if (IconDIR == NULL) - { return NULL; - } if (0 != IconDIR->idReserved || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) @@ -192,7 +175,7 @@ * Get a handle to the screen dc, the icon we create is going to be * compatable with it. */ - hScreenDc = CreateCompatibleDC(0); + hScreenDc = CreateCompatibleDC(NULL); if (hScreenDc == NULL) { UnmapViewOfFile(IconDIR); @@ -245,9 +228,7 @@ { ColorCount = SafeIconImage->icHeader.biClrUsed; if (ColorCount == 0 && SafeIconImage->icHeader.biBitCount <= 8) - { - ColorCount = 1 << SafeIconImage->icHeader.biBitCount; - } + ColorCount = 1 << SafeIconImage->icHeader.biBitCount; HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD); } @@ -257,6 +238,7 @@ hIcon = ICON_CreateCursorFromData(hScreenDc, Data, SafeIconImage, 32, 32, dirEntry->Info.cursor.wXHotspot, dirEntry->Info.cursor.wYHotspot); DeleteDC(hScreenDc); RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); + return hIcon; } @@ -264,390 +246,316 @@ static HANDLE LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuLoad) { - HANDLE hResource; - HANDLE h2Resource; - HANDLE hfRes; - HANDLE hFile; - HANDLE hSection; - CURSORICONDIR* IconDIR; - HDC hScreenDc; - HANDLE hIcon; - ULONG HeaderSize; - ULONG ColorCount; - PVOID Data; - CURSORICONDIRENTRY* dirEntry; - ICONIMAGE* SafeIconImage; - GRPCURSORICONDIR* IconResDir; - INT id; - ICONIMAGE *ResIcon; + HANDLE hResource; + HANDLE h2Resource; + HANDLE hfRes; + HANDLE hFile; + HANDLE hSection; + CURSORICONDIR* IconDIR; + HDC hScreenDc; + HICON hIcon; + ULONG HeaderSize; + ULONG ColorCount; + PVOID Data; + CURSORICONDIRENTRY* dirEntry; + ICONIMAGE* SafeIconImage; + GRPCURSORICONDIR* IconResDir; + INT id; + ICONIMAGE *ResIcon; - if (!(fuLoad & LR_LOADFROMFILE)) - { + if (!(fuLoad & LR_LOADFROMFILE)) + { if (hinst == NULL) - { - hinst = GetModuleHandleW(L"USER32"); - } + hinst = User32Instance; + hResource = hfRes = FindResourceW(hinst, lpszName, RT_GROUP_ICON); if (hResource == NULL) - { - return(NULL); - } + return NULL; if (fuLoad & LR_SHARED) - { - hIcon = NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, width, height); - if(hIcon) - return hIcon; - } + { + hIcon = NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, width, height); + if (hIcon) + return hIcon; + } hResource = LoadResource(hinst, hResource); if (hResource == NULL) - { - return(NULL); - } + return NULL; + IconResDir = LockResource(hResource); if (IconResDir == NULL) - { - return(NULL); - } + return NULL; - //find the best fitting in the IconResDir for this resolution - id = LookupIconIdFromDirectoryEx((PBYTE) IconResDir, TRUE, - width, height, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + /* + * Find the best fitting in the IconResDir for this resolution + */ - h2Resource = FindResourceW(hinst, - MAKEINTRESOURCEW(id), - MAKEINTRESOURCEW(RT_ICON)); + id = LookupIconIdFromDirectoryEx((PBYTE)IconResDir, TRUE, width, height, + fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + h2Resource = FindResourceW(hinst, MAKEINTRESOURCEW(id), MAKEINTRESOURCEW(RT_ICON)); + hResource = LoadResource(hinst, h2Resource); if (hResource == NULL) - { - return(NULL); - } + return NULL; ResIcon = LockResource(hResource); if (ResIcon == NULL) - { - return(NULL); - } - hIcon = (HANDLE)CreateIconFromResourceEx((PBYTE) ResIcon, - SizeofResource(hinst, h2Resource), TRUE, 0x00030000, - width, height, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); + return NULL; + + hIcon = CreateIconFromResourceEx((PBYTE)ResIcon, + SizeofResource(hinst, h2Resource), + TRUE, 0x00030000, width, height, + fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); if (hIcon && 0 != (fuLoad & LR_SHARED)) { - NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes, - (HRSRC)NULL); + NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes, + (HRSRC)NULL); } + return hIcon; - } - else - { - /* - * FIXME: This code is incorrect and is likely to crash in many cases. - * In the file the cursor/icon directory records are stored like - * CURSORICONFILEDIR, but we treat them like CURSORICONDIR. In Wine - * this is solved by creating a fake cursor/icon directory in memory - * and passing that to CURSORICON_FindBestIcon. - */ + } - if (fuLoad & LR_SHARED) - { - DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n"); - } + /* + * FIXME: This code is incorrect and is likely to crash in many cases. + * In the file the cursor/icon directory records are stored like + * CURSORICONFILEDIR, but we treat them like CURSORICONDIR. In Wine + * this is solved by creating a fake cursor/icon directory in memory + * and passing that to CURSORICON_FindBestIcon. + */ - hFile = CreateFileW(lpszName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - 0, - NULL); - if (hFile == NULL) - { - return NULL; - } + if (fuLoad & LR_SHARED) + { + DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n"); + } - hSection = CreateFileMappingW(hFile, - NULL, - PAGE_READONLY, - 0, - 0, - NULL); + hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); + if (hFile == NULL) + return NULL; - CloseHandle(hFile); - if (hSection == NULL) - { - return NULL; - } + hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(hFile); + if (hSection == NULL) + return NULL; - IconDIR = MapViewOfFile(hSection, - FILE_MAP_READ, - 0, - 0, - 0); - CloseHandle(hSection); - if (IconDIR == NULL) - { - return NULL; - } - - if (0 != IconDIR->idReserved || - (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) - { - UnmapViewOfFile(IconDIR); - return NULL; - } + IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); + CloseHandle(hSection); + if (IconDIR == NULL) + return NULL; + + if (0 != IconDIR->idReserved || + (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) + { + UnmapViewOfFile(IconDIR); + return NULL; + } - //pick the best size. - dirEntry = (CURSORICONDIRENTRY *) CURSORICON_FindBestIcon( IconDIR, width, height, 1); - if (!dirEntry) - { - UnmapViewOfFile(IconDIR); - return NULL; - } + /* Pick the best size. */ + dirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestIcon(IconDIR, width, height, 1); + if (!dirEntry) + { + UnmapViewOfFile(IconDIR); + return NULL; + } - SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); + SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); + if (SafeIconImage == NULL) + { + UnmapViewOfFile(IconDIR); + return NULL; + } - memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); - UnmapViewOfFile(IconDIR); - } + memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); + UnmapViewOfFile(IconDIR); - //at this point we have a copy of the icon image to play with + /* At this point we have a copy of the icon image to play with. */ - SafeIconImage->icHeader.biHeight = SafeIconImage->icHeader.biHeight /2; + SafeIconImage->icHeader.biHeight = SafeIconImage->icHeader.biHeight /2; - if (SafeIconImage->icHeader.biSize == sizeof(BITMAPCOREHEADER)) - { + if (SafeIconImage->icHeader.biSize == sizeof(BITMAPCOREHEADER)) + { BITMAPCOREHEADER* Core = (BITMAPCOREHEADER*)SafeIconImage; ColorCount = (Core->bcBitCount <= 8) ? (1 << Core->bcBitCount) : 0; HeaderSize = sizeof(BITMAPCOREHEADER) + ColorCount * sizeof(RGBTRIPLE); - } - else - { + } + else + { ColorCount = SafeIconImage->icHeader.biClrUsed; if (ColorCount == 0 && SafeIconImage->icHeader.biBitCount <= 8) - { - ColorCount = 1 << SafeIconImage->icHeader.biBitCount; - } + ColorCount = 1 << SafeIconImage->icHeader.biBitCount; HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD); - } + } - //make data point to the start of the XOR image data - Data = (PBYTE)SafeIconImage + HeaderSize; + /* Make data point to the start of the XOR image data. */ + Data = (PBYTE)SafeIconImage + HeaderSize; - - //get a handle to the screen dc, the icon we create is going to be compatable with this - hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL); - if (hScreenDc == NULL) - { + /* Get a handle to the screen dc, the icon we create is going to be + * compatable with this. */ + hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL); + if (hScreenDc == NULL) + { if (fuLoad & LR_LOADFROMFILE) - { RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); - } - return(NULL); - } + return NULL; + } - hIcon = ICON_CreateIconFromData(hScreenDc, Data, SafeIconImage, width, height, width/2, height/2); - RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); - return hIcon; + hIcon = ICON_CreateIconFromData(hScreenDc, Data, SafeIconImage, width, height, width/2, height/2); + RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); + + return hIcon; } static HANDLE LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad) { - HANDLE hResource; - HANDLE hFile; - HANDLE hSection; - BITMAPINFO* BitmapInfo; - BITMAPINFO* PrivateInfo; - HDC hScreenDc; - HANDLE hBitmap; - ULONG HeaderSize; - ULONG ColorCount; - PVOID Data; + HANDLE hResource; + HANDLE hFile; + HANDLE hSection; + LPBITMAPINFO BitmapInfo; + LPBITMAPINFO PrivateInfo; + HDC hScreenDc; + HANDLE hBitmap; + ULONG HeaderSize; + ULONG ColorCount; + PVOID Data; - if (!(fuLoad & LR_LOADFROMFILE)) - { + if (!(fuLoad & LR_LOADFROMFILE)) + { if (hInstance == NULL) - { - hInstance = GetModuleHandleW(L"USER32"); - } + hInstance = User32Instance; + hResource = FindResourceW(hInstance, lpszName, RT_BITMAP); if (hResource == NULL) - { - return(NULL); - } + return NULL; hResource = LoadResource(hInstance, hResource); if (hResource == NULL) - { - return(NULL); - } + return NULL; BitmapInfo = LockResource(hResource); if (BitmapInfo == NULL) - { - return(NULL); - } - } - else - { - hFile = CreateFileW(lpszName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - 0, - NULL); + return NULL; + } + else + { + hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); if (hFile == NULL) - { - return(NULL); - } - hSection = CreateFileMappingW(hFile, - NULL, - PAGE_READONLY, - 0, - 0, - NULL); + return NULL; + + hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (hSection == NULL) - { - return(NULL); - } - BitmapInfo = MapViewOfFile(hSection, - FILE_MAP_READ, - 0, - 0, - 0); + return NULL; + + BitmapInfo = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); CloseHandle(hSection); if (BitmapInfo == NULL) - { - return(NULL); - } - /* offset BitmapInfo by 14 bytes to acount for the size of BITMAPFILEHEADER - unfortunatly sizeof(BITMAPFILEHEADER) = 16, but the acutal size should be 14! - */ - BitmapInfo = (BITMAPINFO*)(((PBYTE)BitmapInfo) + 14); - } + return NULL; - if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) - { + BitmapInfo = (LPBITMAPINFO)((ULONG_PTR)BitmapInfo + sizeof(BITMAPFILEHEADER)); + } + + if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) + { BITMAPCOREHEADER* Core = (BITMAPCOREHEADER*)BitmapInfo; ColorCount = (Core->bcBitCount <= 8) ? (1 << Core->bcBitCount) : 0; HeaderSize = sizeof(BITMAPCOREHEADER) + ColorCount * sizeof(RGBTRIPLE); - } - else - { + } + else + { ColorCount = BitmapInfo->bmiHeader.biClrUsed; if (ColorCount == 0 && BitmapInfo->bmiHeader.biBitCount <= 8) - { - ColorCount = 1 << BitmapInfo->bmiHeader.biBitCount; - } + ColorCount = 1 << BitmapInfo->bmiHeader.biBitCount; HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD); - } - Data = (PVOID)((ULONG_PTR)BitmapInfo + HeaderSize); + } + Data = (PVOID)((ULONG_PTR)BitmapInfo + HeaderSize); - PrivateInfo = RtlAllocateHeap(GetProcessHeap(), 0, HeaderSize); - if (PrivateInfo == NULL) - { + PrivateInfo = RtlAllocateHeap(GetProcessHeap(), 0, HeaderSize); + if (PrivateInfo == NULL) + { if (fuLoad & LR_LOADFROMFILE) - { - UnmapViewOfFile(BitmapInfo); - } - return(NULL); - } - memcpy(PrivateInfo, BitmapInfo, HeaderSize); + UnmapViewOfFile(BitmapInfo); + return NULL; + } + memcpy(PrivateInfo, BitmapInfo, HeaderSize); - /* FIXME: Handle color conversion and transparency. */ + /* FIXME: Handle color conversion and transparency. */ - hScreenDc = CreateCompatibleDC(NULL); - if (hScreenDc == NULL) - { + hScreenDc = CreateCompatibleDC(NULL); + if (hScreenDc == NULL) + { RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); if (fuLoad & LR_LOADFROMFILE) - { - UnmapViewOfFile(BitmapInfo); - } - return(NULL); - } + UnmapViewOfFile(BitmapInfo); + return NULL; + } - if (fuLoad & LR_CREATEDIBSECTION) - { + if (fuLoad & LR_CREATEDIBSECTION) + { DIBSECTION Dib; hBitmap = CreateDIBSection(hScreenDc, PrivateInfo, DIB_RGB_COLORS, NULL, - 0, 0); + 0, 0); GetObjectA(hBitmap, sizeof(DIBSECTION), &Dib); SetDIBits(hScreenDc, hBitmap, 0, Dib.dsBm.bmHeight, Data, BitmapInfo, - DIB_RGB_COLORS); - } - else - { + DIB_RGB_COLORS); + } + else + { hBitmap = CreateDIBitmap(hScreenDc, &PrivateInfo->bmiHeader, CBM_INIT, - Data, PrivateInfo, DIB_RGB_COLORS); - } + Data, PrivateInfo, DIB_RGB_COLORS); + } - RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); - DeleteDC(hScreenDc); - if (fuLoad & LR_LOADFROMFILE) - { + RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); + DeleteDC(hScreenDc); + if (fuLoad & LR_LOADFROMFILE) UnmapViewOfFile(BitmapInfo); - } - return(hBitmap); + + return hBitmap; } HANDLE STDCALL -LoadImageW(HINSTANCE hinst, - LPCWSTR lpszName, - UINT uType, - int cxDesired, - int cyDesired, - UINT fuLoad) +LoadImageW( + IN HINSTANCE hinst, + IN LPCWSTR lpszName, + IN UINT uType, + IN INT cxDesired, + IN INT cyDesired, + IN UINT fuLoad) { - if (fuLoad & LR_DEFAULTSIZE) - { + if (fuLoad & LR_DEFAULTSIZE) + { if (uType == IMAGE_ICON) - { - if (cxDesired == 0) - { - cxDesired = GetSystemMetrics(SM_CXICON); - } - if (cyDesired == 0) - { - cyDesired = GetSystemMetrics(SM_CYICON); - } - } - else if (uType == IMAGE_CURSOR) - { - if (cxDesired == 0) - { - cxDesired = GetSystemMetrics(SM_CXCURSOR); - } - if (cyDesired == 0) - { - cyDesired = GetSystemMetrics(SM_CYCURSOR); - } - } - } - - switch (uType) - { - case IMAGE_BITMAP: { - return(LoadBitmapImage(hinst, lpszName, fuLoad)); + if (cxDesired == 0) + cxDesired = GetSystemMetrics(SM_CXICON); + if (cyDesired == 0) + cyDesired = GetSystemMetrics(SM_CYICON); } - case IMAGE_CURSOR: + else if (uType == IMAGE_CURSOR) { - return(LoadCursorImage(hinst, lpszName, fuLoad)); + if (cxDesired == 0) + cxDesired = GetSystemMetrics(SM_CXCURSOR); + if (cyDesired == 0) + cyDesired = GetSystemMetrics(SM_CYCURSOR); } - case IMAGE_ICON: - { - return(LoadIconImage(hinst, lpszName, cxDesired, cyDesired, fuLoad)); - } - default: - DbgBreakPoint(); - break; - } - return(NULL); + } + + switch (uType) + { + case IMAGE_BITMAP: + return LoadBitmapImage(hinst, lpszName, fuLoad); + case IMAGE_CURSOR: + return LoadCursorImage(hinst, lpszName, fuLoad); + case IMAGE_ICON: + return LoadIconImage(hinst, lpszName, cxDesired, cyDesired, fuLoad); + default: + break; + } + + return NULL; } @@ -657,7 +565,7 @@ HBITMAP STDCALL LoadBitmapA(HINSTANCE hInstance, LPCSTR lpBitmapName) { - return(LoadImageA(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0)); + return LoadImageA(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0); } @@ -667,7 +575,7 @@ HBITMAP STDCALL LoadBitmapW(HINSTANCE hInstance, LPCWSTR lpBitmapName) { - return(LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0)); + return LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0); } @@ -675,56 +583,67 @@ * @unimplemented */ HANDLE WINAPI -CopyImage(HANDLE hnd, UINT type, INT desiredx, INT desiredy, UINT flags) +CopyImage( + IN HANDLE hnd, + IN UINT type, + IN INT desiredx, + IN INT desiredy, + IN UINT flags) { - HBITMAP res; - BITMAP bm; + HBITMAP res; + BITMAP bm; - switch (type) - { - case IMAGE_BITMAP: - { - DbgPrint("WARNING: Incomplete implementation of CopyImage!\n"); - /* FIXME: support flags LR_COPYDELETEORG, LR_COPYFROMRESOURCE, - LR_COPYRETURNORG, LR_CREATEDIBSECTION, - and LR_MONOCHROME; */ + switch (type) + { + case IMAGE_BITMAP: + { + DbgPrint("WARNING: Incomplete implementation of CopyImage!\n"); + /* + * FIXME: Support flags LR_COPYDELETEORG, LR_COPYFROMRESOURCE, + * LR_COPYRETURNORG, LR_CREATEDIBSECTION and LR_MONOCHROME. + */ + if (!GetObjectW(hnd, sizeof(bm), &bm)) + return NULL; + bm.bmBits = NULL; + if ((res = CreateBitmapIndirect(&bm))) + { + char *buf = HeapAlloc(GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight); + if (buf == NULL) + { + DeleteObject(res); + return NULL; + } + GetBitmapBits(hnd, bm.bmWidthBytes * bm.bmHeight, buf); + SetBitmapBits(res, bm.bmWidthBytes * bm.bmHeight, buf); + HeapFree(GetProcessHeap(), 0, buf); + } + return res; + } - if (!GetObjectW(hnd, sizeof(bm), &bm)) return 0; - bm.bmBits = NULL; - if ((res = CreateBitmapIndirect(&bm))) - { - char *buf = HeapAlloc(GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight); - if (buf == NULL) - { - DeleteObject(res); - return NULL; - } - GetBitmapBits(hnd, bm.bmWidthBytes * bm.bmHeight, buf); - SetBitmapBits(res, bm.bmWidthBytes * bm.bmHeight, buf); - HeapFree(GetProcessHeap(), 0, buf); - } - return res; - } - case IMAGE_ICON: - { - static BOOL IconMsgDisplayed = FALSE; - /* FIXME: support loading the image as shared from an instance */ - if (!IconMsgDisplayed) { - DbgPrint("FIXME: CopyImage doesn't support IMAGE_ICON correctly!\n"); - IconMsgDisplayed = TRUE; - } - return CopyIcon(hnd); - } - case IMAGE_CURSOR: - { - static BOOL IconMsgDisplayed = FALSE; - /* FIXME: support loading the image as shared from an instance */ - if (!IconMsgDisplayed) { - DbgPrint("FIXME: CopyImage doesn't support IMAGE_CURSOR correctly!\n"); - IconMsgDisplayed = TRUE; - } - return CopyCursor(hnd); - } - } - return 0; + case IMAGE_ICON: + { + static BOOL IconMsgDisplayed = FALSE; + /* FIXME: support loading the image as shared from an instance */ + if (!IconMsgDisplayed) + { + DbgPrint("FIXME: CopyImage doesn't support IMAGE_ICON correctly!\n"); + IconMsgDisplayed = TRUE; + } + return CopyIcon(hnd); + } + + case IMAGE_CURSOR: + { + static BOOL IconMsgDisplayed = FALSE; + /* FIXME: support loading the image as shared from an instance */ + if (!IconMsgDisplayed) + { + DbgPrint("FIXME: CopyImage doesn't support IMAGE_CURSOR correctly!\n"); + IconMsgDisplayed = TRUE; + } + return CopyCursor(hnd); + } + } + + return NULL; }
18 years, 9 months
1
0
0
0
[gvg] 20120: Re-import imm32 from Wine
by gvg@svn.reactos.com
Re-import imm32 from Wine Added: trunk/reactos/lib/imm32/ Deleted: trunk/reactos/lib/imm32/Makefile.in Deleted: trunk/reactos/lib/imm32/imm.spec Added: trunk/reactos/lib/imm32/imm32.xml Modified: trunk/reactos/w32api/include/imm.h _____ Copied: trunk/reactos/lib/imm32 (from rev 20119, vendor/wine/dlls/imm32/current) Property changes on: trunk/reactos/lib/imm32 ___________________________________________________________________ Name: svn:ignore + GNUmakefile _____ Deleted: trunk/reactos/lib/imm32/Makefile.in --- vendor/wine/dlls/imm32/current/Makefile.in 2005-12-12 20:57:16 UTC (rev 20119) +++ trunk/reactos/lib/imm32/Makefile.in 2005-12-12 20:59:55 UTC (rev 20120) @@ -1,16 +0,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = imm32.dll -IMPORTLIB = libimm32.$(IMPLIBEXT) -IMPORTS = user32 gdi32 kernel32 - -C_SRCS = \ - imm.c - -SPEC_SRCS16 = imm.spec - -@MAKE_DLL_RULES@ - -### Dependencies: _____ Deleted: trunk/reactos/lib/imm32/imm.spec --- vendor/wine/dlls/imm32/current/imm.spec 2005-12-12 20:57:16 UTC (rev 20119) +++ trunk/reactos/lib/imm32/imm.spec 2005-12-12 20:59:55 UTC (rev 20120) @@ -1,54 +0,0 @@ -4 stub IMMGETDEFAULTIMEWND -7 stub IMMGETDESCRIPTIONA -8 stub IMMGETIMEFILENAMEA -9 stub IMMGETPROPERTY -11 stub IMMINSTALLIMEA -#15 stub ___EXPORTEDSTUB -17 stub IMMISIME -25 stub IMMGETHOTKEY -26 stub IMMSETHOTKEY -27 stub IMMSIMULATEHOTKEY -35 stub IMMCREATECONTEXT -36 stub IMMDESTROYCONTEXT -37 stub IMMGETCONTEXT -38 stub IMMRELEASECONTEXT -39 stub IMMASSOCIATECONTEXT -41 stub IMMASSOCIATECONTEXTEX -43 stub IMMGETCOMPOSITIONSTRINGA -44 stub IMMSETCOMPOSITIONSTRINGA -45 stub IMMGETCANDIDATELISTCOUNTA -46 stub IMMGETCANDIDATELISTA -47 stub IMMGETGUIDELINEA -51 stub IMMGETCONVERSIONSTATUS -52 stub IMMSETCONVERSIONSTATUS -53 stub IMMGETOPENSTATUS -54 stub IMMSETOPENSTATUS -55 stub IMMGETCOMPOSITIONFONTA -56 stub IMMSETCOMPOSITIONFONTA -61 stub IMMCONFIGUREIMEA -63 stub IMMESCAPEA -64 stub IMMGETCONVERSIONLISTA -65 stub IMMNOTIFYIME -71 stub IMMISUIMESSAGEA -72 stub IMMGENERATEMESSAGE -73 stub IMMGETVIRTUALKEY -87 stub IMMGETSTATUSWINDOWPOS -88 stub IMMSETSTATUSWINDOWPOS -89 stub IMMGETCOMPOSITIONWINDOW -90 stub IMMSETCOMPOSITIONWINDOW -91 stub IMMGETCANDIDATEWINDOW -92 stub IMMSETCANDIDATEWINDOW -95 stub IMMUNINSTALLIMEA -110 stub IMMLOCKIMC -111 stub IMMUNLOCKIMC -112 stub IMMGETIMCLOCKCOUNT -116 stub IMMCREATEIMCC -117 stub IMMDESTROYIMCC -118 stub IMMLOCKIMCC -119 stub IMMUNLOCKIMCC -120 stub IMMGETIMCCLOCKCOUNT -121 stub IMMRESIZEIMCC -122 stub IMMGETIMCCSIZE -#160 stub FT_IMMFTHKTHKCONNECTIONDATA -#161 stub IMM32THKCONNECTIONDATASL -180 stub IMMSYNCCONVERSION _____ Added: trunk/reactos/lib/imm32/imm32.xml --- vendor/wine/dlls/imm32/current/imm32.xml 2005-12-12 20:57:16 UTC (rev 20119) +++ trunk/reactos/lib/imm32/imm32.xml 2005-12-12 20:59:55 UTC (rev 20120) @@ -0,0 +1,13 @@ +<module name="imm32" type="win32dll" baseaddress="${BASEADDRESS_IMM32}" installbase="system32" installname="imm32.dll"> + <importlibrary definition="imm32.spec.def" /> + <include base="imm32">.</include> + <define name="_DISABLE_TIDENTS" /> + <define name="__USE_W32API" /> + <library>wine</library> + <library>ntdll</library> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <file>imm.c</file> + <file>imm32.spec</file> +</module> Property changes on: trunk/reactos/lib/imm32/imm32.xml ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/imm.h --- trunk/reactos/w32api/include/imm.h 2005-12-12 20:57:16 UTC (rev 20119) +++ trunk/reactos/w32api/include/imm.h 2005-12-12 20:59:55 UTC (rev 20120) @@ -241,8 +241,8 @@ #define VK_PROCESSKEY 0x0E5 #endif #define STYLE_DESCRIPTION_SIZE 32 -typedef DWORD HIMC; -typedef DWORD HIMCC; +typedef HANDLE HIMC; +typedef HANDLE HIMCC; typedef HKL *LPHKL; typedef struct tagCOMPOSITIONFORM { DWORD dwStyle;
18 years, 9 months
1
0
0
0
[gvg] 20119: Remove old imm32 in preparation of new import
by gvg@svn.reactos.com
Remove old imm32 in preparation of new import Deleted: trunk/reactos/lib/imm32/
18 years, 9 months
1
0
0
0
[navaraf] 20118: Check for failed allocations. Spotted by Martin Bealby.
by navaraf@svn.reactos.com
Check for failed allocations. Spotted by Martin Bealby. Modified: trunk/reactos/lib/user32/misc/winhelp.c _____ Modified: trunk/reactos/lib/user32/misc/winhelp.c --- trunk/reactos/lib/user32/misc/winhelp.c 2005-12-12 20:46:26 UTC (rev 20117) +++ trunk/reactos/lib/user32/misc/winhelp.c 2005-12-12 20:49:35 UTC (rev 20118) @@ -107,6 +107,8 @@ nlen = 0; size = sizeof(WINHELP) + nlen + dsize; hwh = GlobalAlloc(0,size); + if (hwh == NULL) + return FALSE; lpwh = GlobalLock(hwh); lpwh->size = size; lpwh->command = uCommand;
18 years, 9 months
1
0
0
0
[navaraf] 20117: Check for failed allocations and fix some resource leaks.
by navaraf@svn.reactos.com
Check for failed allocations and fix some resource leaks. Modified: trunk/reactos/lib/user32/windows/bitmap.c _____ Modified: trunk/reactos/lib/user32/windows/bitmap.c --- trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 20:41:27 UTC (rev 20116) +++ trunk/reactos/lib/user32/windows/bitmap.c 2005-12-12 20:46:26 UTC (rev 20117) @@ -176,12 +176,18 @@ IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); CloseHandle(hSection); - if (IconDIR == NULL || 0 != IconDIR->idReserved - || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) + if (IconDIR == NULL) { return NULL; } + if (0 != IconDIR->idReserved || + (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) + { + UnmapViewOfFile(IconDIR); + return NULL; + } + /* * Get a handle to the screen dc, the icon we create is going to be * compatable with it. @@ -213,11 +219,17 @@ if (!dirEntry) { UnmapViewOfFile(IconDIR); - return(NULL); + return NULL; } SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); + if (SafeIconImage == NULL) + { + UnmapViewOfFile(IconDIR); + return NULL; + } memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); + UnmapViewOfFile(IconDIR); /* at this point we have a copy of the icon image to play with */ @@ -351,9 +363,9 @@ 0, NULL); if (hFile == NULL) - { - return(NULL); - } + { + return NULL; + } hSection = CreateFileMappingW(hFile, NULL, @@ -362,43 +374,42 @@ 0, NULL); + CloseHandle(hFile); if (hSection == NULL) - { - CloseHandle(hFile); - return(NULL); - } + { + return NULL; + } + IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); + CloseHandle(hSection); + if (IconDIR == NULL) + { + return NULL; + } + + if (0 != IconDIR->idReserved || + (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) + { + UnmapViewOfFile(IconDIR); + return NULL; + } - if (IconDIR == NULL || 0 != IconDIR->idReserved - || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) - { - CloseHandle(hFile); - CloseHandle(hSection); - return(NULL); - } - //pick the best size. dirEntry = (CURSORICONDIRENTRY *) CURSORICON_FindBestIcon( IconDIR, width, height, 1); - - if (!dirEntry) - { - CloseHandle(hFile); - CloseHandle(hSection); - UnmapViewOfFile(IconDIR); - return(NULL); - } + { + UnmapViewOfFile(IconDIR); + return NULL; + } SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); - - CloseHandle(hFile); - CloseHandle(hSection); + UnmapViewOfFile(IconDIR); } //at this point we have a copy of the icon image to play with @@ -430,10 +441,9 @@ if (hScreenDc == NULL) { if (fuLoad & LR_LOADFROMFILE) - { - RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); - UnmapViewOfFile(IconDIR); - } + { + RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); + } return(NULL); } @@ -684,6 +694,11 @@ if ((res = CreateBitmapIndirect(&bm))) { char *buf = HeapAlloc(GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight); + if (buf == NULL) + { + DeleteObject(res); + return NULL; + } GetBitmapBits(hnd, bm.bmWidthBytes * bm.bmHeight, buf); SetBitmapBits(res, bm.bmWidthBytes * bm.bmHeight, buf); HeapFree(GetProcessHeap(), 0, buf);
18 years, 9 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200