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
December
November
October
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
January 2014
----- 2024 -----
December 2024
November 2024
October 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
14 participants
426 discussions
Start a n
N
ew thread
[tfaber] 61675: [RAPPS] - Allow double-clicking to install programs. Based on patch by Edijs Kolesnikovičs and Yuntian Zhang. CORE-4357 #resolve #comment Thanks guys, this was a major annoyance.
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 14:11:19 2014 New Revision: 61675 URL:
http://svn.reactos.org/svn/reactos?rev=61675&view=rev
Log: [RAPPS] - Allow double-clicking to install programs. Based on patch by Edijs Kolesnikovičs and Yuntian Zhang. CORE-4357 #resolve #comment Thanks guys, this was a major annoyance. Modified: trunk/reactos/base/applications/rapps/listview.c trunk/reactos/base/applications/rapps/misc.c trunk/reactos/base/applications/rapps/rapps.h trunk/reactos/base/applications/rapps/richedit.c trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/li…
============================================================================== --- trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] Sat Jan 18 14:11:19 2014 @@ -105,7 +105,7 @@ WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS, 205, 28, 465, 250, hwnd, - NULL, + GetSubMenu(LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATIONMENU)), 0), hInst, NULL); Modified: trunk/reactos/base/applications/rapps/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
============================================================================== --- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Sat Jan 18 14:11:19 2014 @@ -149,17 +149,35 @@ } VOID -ShowPopupMenu(HWND hwnd, UINT MenuID) -{ - HMENU hPopupMenu = GetSubMenu(LoadMenuW(hInst, MAKEINTRESOURCEW(MenuID)), 0); +ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) +{ + HMENU hMenu = NULL; + HMENU hPopupMenu; + MENUITEMINFO mii; POINT pt; + + if (MenuID) + { + hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(MenuID)); + hPopupMenu = GetSubMenu(hMenu, 0); + } + else + hPopupMenu = GetMenu(hwnd); + + ZeroMemory(&mii, sizeof(mii)); + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_STATE; + GetMenuItemInfo(hPopupMenu, DefaultItem, FALSE, &mii); + if (!(mii.fState & MFS_GRAYED)) + SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE); GetCursorPos(&pt); SetForegroundWindow(hwnd); TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL); - DestroyMenu(hPopupMenu); + if (hMenu) + DestroyMenu(hMenu); } BOOL Modified: trunk/reactos/base/applications/rapps/rapps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Sat Jan 18 14:11:19 2014 @@ -149,7 +149,7 @@ int GetClientWindowHeight(HWND hwnd); VOID CopyTextToClipboard(LPCWSTR lpszText); VOID SetWelcomeText(VOID); -VOID ShowPopupMenu(HWND hwnd, UINT MenuID); +VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem); BOOL StartProcess(LPWSTR lpPath, BOOL Wait); BOOL GetStorageDirectory(PWCHAR lpDirectory, DWORD cch); BOOL ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath); Modified: trunk/reactos/base/applications/rapps/richedit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ri…
============================================================================== --- trunk/reactos/base/applications/rapps/richedit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/richedit.c [iso-8859-1] Sat Jan 18 14:11:19 2014 @@ -36,7 +36,7 @@ SendMessageW(hRichEdit, EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax); SendMessageW(hRichEdit, EM_GETSELTEXT, 0, (LPARAM)pLink); - ShowPopupMenu(hwnd, IDR_LINKMENU); + ShowPopupMenu(hwnd, IDR_LINKMENU, -1); } break; } Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 14:11:19 2014 @@ -588,6 +588,25 @@ EndDeferWindowPos(hdwp); } +BOOL IsSelectedNodeInstalled(void) +{ + HTREEITEM hSelectedItem = TreeView_GetSelection(hTreeView); + TV_ITEM tItem; + + tItem.mask = TVIF_PARAM | TVIF_HANDLE; + tItem.hItem = hSelectedItem; + TreeView_GetItem(hTreeView, &tItem); + switch (tItem.lParam) + { + case IDS_INSTALLED: + case IDS_APPLICATIONS: + case IDS_UPDATES: + return TRUE; + default: + return FALSE; + } +} + LRESULT CALLBACK MainWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) { @@ -691,6 +710,42 @@ UpdateApplicationsList(ENUM_CAT_VIDEO); break; } + } + + /* Disable/enable items based on treeview selection */ + if (IsSelectedNodeInstalled()) + { + EnableMenuItem(GetMenu(hwnd), ID_REGREMOVE, MF_ENABLED); + EnableMenuItem(GetMenu(hwnd), ID_INSTALL, MF_GRAYED); + EnableMenuItem(GetMenu(hwnd), ID_UNINSTALL, MF_ENABLED); + EnableMenuItem(GetMenu(hwnd), ID_MODIFY, MF_ENABLED); + + EnableMenuItem(GetMenu(hListView), ID_REGREMOVE, MF_ENABLED); + EnableMenuItem(GetMenu(hListView), ID_INSTALL, MF_GRAYED); + EnableMenuItem(GetMenu(hListView), ID_UNINSTALL, MF_ENABLED); + EnableMenuItem(GetMenu(hListView), ID_MODIFY, MF_ENABLED); + + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_REGREMOVE, TRUE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_INSTALL, FALSE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_UNINSTALL, TRUE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_MODIFY, TRUE); + } + else + { + EnableMenuItem(GetMenu(hwnd), ID_REGREMOVE, MF_GRAYED); + EnableMenuItem(GetMenu(hwnd), ID_INSTALL, MF_ENABLED); + EnableMenuItem(GetMenu(hwnd), ID_UNINSTALL, MF_GRAYED); + EnableMenuItem(GetMenu(hwnd), ID_MODIFY, MF_GRAYED); + + EnableMenuItem(GetMenu(hListView), ID_REGREMOVE, MF_GRAYED); + EnableMenuItem(GetMenu(hListView), ID_INSTALL, MF_ENABLED); + EnableMenuItem(GetMenu(hListView), ID_UNINSTALL, MF_GRAYED); + EnableMenuItem(GetMenu(hListView), ID_MODIFY, MF_GRAYED); + + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_REGREMOVE, FALSE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_INSTALL, TRUE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_UNINSTALL, FALSE); + SendMessage(hToolBar, TB_ENABLEBUTTON, ID_MODIFY, FALSE); } } break; @@ -734,19 +789,34 @@ break; case NM_CLICK: - if (data->hwndFrom == hListView) + { + if (data->hwndFrom == hListView && ((LPNMLISTVIEW)lParam)->iItem != -1) { if (IS_INSTALLED_ENUM(SelectedEnumType)) ShowInstalledAppInfo(-1); if (IS_AVAILABLE_ENUM(SelectedEnumType)) ShowAvailableAppInfo(-1); } - break; + } + break; + + case NM_DBLCLK: + { + if (data->hwndFrom == hListView && ((LPNMLISTVIEW)lParam)->iItem != -1) + { + SendMessage(hwnd, WM_COMMAND, ID_INSTALL, 0); //Won't do anything if the program is already installed + } + } + break; case NM_RCLICK: - if (data->hwndFrom == hListView) - ShowPopupMenu(hListView, IDR_APPLICATIONMENU); - break; + { + if (data->hwndFrom == hListView && ((LPNMLISTVIEW)lParam)->iItem != -1) + { + ShowPopupMenu(hListView, 0, ID_INSTALL); + } + } + break; case EN_LINK: RichEditOnLink(hwnd, (ENLINK*)lParam);
10 years, 11 months
1
0
0
0
[dreimer] 61674: XX.XXMB -> XX.XX MB Rename some files to make the naming style identical. Update to recent versions to test these for next release.
by dreimer@svn.reactos.org
Author: dreimer Date: Sat Jan 18 13:31:27 2014 New Revision: 61674 URL:
http://svn.reactos.org/svn/reactos?rev=61674&view=rev
Log: XX.XXMB -> XX.XX MB Rename some files to make the naming style identical. Update to recent versions to test these for next release. Added: trunk/reactos/base/applications/rapps/rapps/abiword.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/abiword28x.txt trunk/reactos/base/applications/rapps/rapps/abiword26.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/abiword.txt trunk/reactos/base/applications/rapps/rapps/firefox.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/firefox5.txt trunk/reactos/base/applications/rapps/rapps/openoffice.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/openoffice3.0.txt trunk/reactos/base/applications/rapps/rapps/photofiltre.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/photofiltre7.txt trunk/reactos/base/applications/rapps/rapps/pingus.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/Pingus.txt trunk/reactos/base/applications/rapps/rapps/python.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/python3.txt trunk/reactos/base/applications/rapps/rapps/python2.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/python.txt trunk/reactos/base/applications/rapps/rapps/thunderbird.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/thunderbird5.txt trunk/reactos/base/applications/rapps/rapps/thunderbird3.txt - copied, changed from r61669, trunk/reactos/base/applications/rapps/rapps/thunderbird.txt Removed: trunk/reactos/base/applications/rapps/rapps/Pingus.txt trunk/reactos/base/applications/rapps/rapps/abiword28x.txt trunk/reactos/base/applications/rapps/rapps/firefox5.txt trunk/reactos/base/applications/rapps/rapps/lautus.txt trunk/reactos/base/applications/rapps/rapps/openoffice3.0.txt trunk/reactos/base/applications/rapps/rapps/photofiltre7.txt trunk/reactos/base/applications/rapps/rapps/python3.txt trunk/reactos/base/applications/rapps/rapps/thunderbird5.txt Modified: trunk/reactos/base/applications/rapps/rapps/7zip.txt trunk/reactos/base/applications/rapps/rapps/abyss.txt trunk/reactos/base/applications/rapps/rapps/ac97forvirtualbox.txt trunk/reactos/base/applications/rapps/rapps/alreader.txt trunk/reactos/base/applications/rapps/rapps/ants.txt trunk/reactos/base/applications/rapps/rapps/audiograbber.txt trunk/reactos/base/applications/rapps/rapps/bittorrent.txt trunk/reactos/base/applications/rapps/rapps/boswars.txt trunk/reactos/base/applications/rapps/rapps/chromium.txt trunk/reactos/base/applications/rapps/rapps/cnt.txt trunk/reactos/base/applications/rapps/rapps/comctl32ocx.txt trunk/reactos/base/applications/rapps/rapps/diablo2.txt trunk/reactos/base/applications/rapps/rapps/dosblaster.txt trunk/reactos/base/applications/rapps/rapps/dosbox.txt trunk/reactos/base/applications/rapps/rapps/doublecommander.txt trunk/reactos/base/applications/rapps/rapps/dvdwritenow.txt trunk/reactos/base/applications/rapps/rapps/fap.txt trunk/reactos/base/applications/rapps/rapps/fira.txt trunk/reactos/base/applications/rapps/rapps/firefox2.txt trunk/reactos/base/applications/rapps/rapps/firefox3.txt trunk/reactos/base/applications/rapps/rapps/firefox36.txt trunk/reactos/base/applications/rapps/rapps/freebasic.txt trunk/reactos/base/applications/rapps/rapps/glidewrapzbag.txt trunk/reactos/base/applications/rapps/rapps/globulation2.txt trunk/reactos/base/applications/rapps/rapps/hover.txt trunk/reactos/base/applications/rapps/rapps/hxd.txt trunk/reactos/base/applications/rapps/rapps/indiftpd.txt trunk/reactos/base/applications/rapps/rapps/irfanview.txt trunk/reactos/base/applications/rapps/rapps/irfanviewplugins.txt trunk/reactos/base/applications/rapps/rapps/kdewin.txt trunk/reactos/base/applications/rapps/rapps/kyodai.txt trunk/reactos/base/applications/rapps/rapps/lazaruside.txt trunk/reactos/base/applications/rapps/rapps/lbreakout2.txt trunk/reactos/base/applications/rapps/rapps/lgeneral.txt trunk/reactos/base/applications/rapps/rapps/libreoffice.txt trunk/reactos/base/applications/rapps/rapps/lmarbles.txt trunk/reactos/base/applications/rapps/rapps/mfc40.txt trunk/reactos/base/applications/rapps/rapps/mirandaim.txt trunk/reactos/base/applications/rapps/rapps/mirc.txt trunk/reactos/base/applications/rapps/rapps/mirc6.txt trunk/reactos/base/applications/rapps/rapps/mono2.txt trunk/reactos/base/applications/rapps/rapps/mpc.txt trunk/reactos/base/applications/rapps/rapps/msxml3.txt trunk/reactos/base/applications/rapps/rapps/net11.txt trunk/reactos/base/applications/rapps/rapps/net20.txt trunk/reactos/base/applications/rapps/rapps/net20sp2.txt trunk/reactos/base/applications/rapps/rapps/npp.txt trunk/reactos/base/applications/rapps/rapps/offbyone.txt trunk/reactos/base/applications/rapps/rapps/opencodecs.txt trunk/reactos/base/applications/rapps/rapps/openoffice2.4.txt trunk/reactos/base/applications/rapps/rapps/openttd.txt trunk/reactos/base/applications/rapps/rapps/opera.txt trunk/reactos/base/applications/rapps/rapps/opera9.txt trunk/reactos/base/applications/rapps/rapps/pengupop.txt trunk/reactos/base/applications/rapps/rapps/pspad.txt trunk/reactos/base/applications/rapps/rapps/putty.txt trunk/reactos/base/applications/rapps/rapps/qmmp.txt trunk/reactos/base/applications/rapps/rapps/remood.txt trunk/reactos/base/applications/rapps/rapps/reshack.txt trunk/reactos/base/applications/rapps/rapps/rosbe.txt trunk/reactos/base/applications/rapps/rapps/rosbeamd64.txt trunk/reactos/base/applications/rapps/rapps/rosbearm.txt trunk/reactos/base/applications/rapps/rapps/sambatng.txt trunk/reactos/base/applications/rapps/rapps/sbforvmware.txt trunk/reactos/base/applications/rapps/rapps/scite.txt trunk/reactos/base/applications/rapps/rapps/scummvm.txt trunk/reactos/base/applications/rapps/rapps/sdl_mixer.txt trunk/reactos/base/applications/rapps/rapps/sdl_runtime.txt trunk/reactos/base/applications/rapps/rapps/seamonkey.txt trunk/reactos/base/applications/rapps/rapps/smplayer.txt trunk/reactos/base/applications/rapps/rapps/stamina.txt trunk/reactos/base/applications/rapps/rapps/steam.txt trunk/reactos/base/applications/rapps/rapps/sumatrapdf.txt trunk/reactos/base/applications/rapps/rapps/superfinder.txt trunk/reactos/base/applications/rapps/rapps/supertux.txt trunk/reactos/base/applications/rapps/rapps/tahoma.txt trunk/reactos/base/applications/rapps/rapps/tileworld.txt trunk/reactos/base/applications/rapps/rapps/totalcommander.txt trunk/reactos/base/applications/rapps/rapps/tuxpaint.txt trunk/reactos/base/applications/rapps/rapps/ultravnc.txt trunk/reactos/base/applications/rapps/rapps/utorrent.txt trunk/reactos/base/applications/rapps/rapps/vb5run.txt trunk/reactos/base/applications/rapps/rapps/vb6run.txt trunk/reactos/base/applications/rapps/rapps/vc2005sp1run.txt trunk/reactos/base/applications/rapps/rapps/vc2008sp1run.txt trunk/reactos/base/applications/rapps/rapps/vc2010run.txt trunk/reactos/base/applications/rapps/rapps/vc6run.txt trunk/reactos/base/applications/rapps/rapps/vlc.txt trunk/reactos/base/applications/rapps/rapps/winboard.txt trunk/reactos/base/applications/rapps/rapps/wme9.txt trunk/reactos/base/applications/rapps/rapps/zaz.txt [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/base/applications/rapps/rapps/7zip.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/Pingus.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/abiword.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/abiword28x.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/abiword26.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/abiword.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/abiword28x.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/abyss.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/ac97forvirtualbox.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/alreader.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/ants.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/audiograbber.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/bittorrent.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/boswars.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/chromium.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/cnt.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/comctl32ocx.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/diablo2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/dosblaster.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/dosbox.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/doublecommander.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/dvdwritenow.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/fap.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/fira.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/firefox.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/firefox5.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/firefox2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/firefox3.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/firefox36.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/firefox5.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/freebasic.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/glidewrapzbag.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/globulation2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/hover.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/hxd.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/indiftpd.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/irfanview.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/irfanviewplugins.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/kdewin.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/kyodai.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/lautus.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/lazaruside.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/lbreakout2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/lgeneral.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/libreoffice.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/lmarbles.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mfc40.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mirandaim.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mirc.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mirc6.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mono2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/mpc.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/msxml3.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/net11.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/net20.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/net20sp2.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/npp.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/offbyone.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/opencodecs.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/openoffice.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/openoffice3.0.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/openoffice2.4.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/openoffice3.0.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/openttd.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/opera.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/opera9.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/pengupop.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/photofiltre.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/photofiltre7.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/photofiltre7.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/pingus.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/Pingus.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/pspad.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/putty.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/python.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/python3.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/python2.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/python.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/python3.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/qmmp.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/remood.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/reshack.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/rosbe.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/rosbeamd64.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/rosbearm.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/sambatng.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/sbforvmware.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/scite.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/scummvm.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/sdl_mixer.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/sdl_runtime.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/seamonkey.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/smplayer.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/stamina.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/steam.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/sumatrapdf.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/superfinder.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/supertux.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/tahoma.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/thunderbird.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/thunderbird5.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Copied: trunk/reactos/base/applications/rapps/rapps/thunderbird3.txt (from r61669, trunk/reactos/base/applications/rapps/rapps/thunderbird.txt) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Removed: trunk/reactos/base/applications/rapps/rapps/thunderbird5.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/tileworld.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/totalcommander.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/tuxpaint.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/ultravnc.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/utorrent.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vb5run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vb6run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vc2005sp1run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vc2008sp1run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vc2010run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vc6run.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/vlc.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/winboard.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/wme9.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
Modified: trunk/reactos/base/applications/rapps/rapps/zaz.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
10 years, 11 months
1
0
0
0
[tfaber] 61673: [RAPPS] - Implement search feature. Based on patch by David Quintana. CORE-7268 #resolve CORE-7786 #comment rapps contains a hack to load StrStrIW using GetProcAddress. That should ...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 13:26:47 2014 New Revision: 61673 URL:
http://svn.reactos.org/svn/reactos?rev=61673&view=rev
Log: [RAPPS] - Implement search feature. Based on patch by David Quintana. CORE-7268 #resolve CORE-7786 #comment rapps contains a hack to load StrStrIW using GetProcAddress. That should be removed once this issue is fixed. Modified: trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 13:26:47 2014 @@ -10,11 +10,27 @@ #include <shellapi.h> +#define SEARCH_TIMER_ID 'SR' + HWND hMainWnd; HINSTANCE hInst; HIMAGELIST hImageTreeView = NULL; INT SelectedEnumType = ENUM_ALL_COMPONENTS; SETTINGS_INFO SettingsInfo; + +PCWSTR (WINAPI *pStrStrIW)(PCWSTR, PCWSTR); + +WCHAR szSearchPattern[MAX_STR_LEN] = L""; +BOOL SearchEnabled = TRUE; + +BOOL +SearchPatternMatch(PCWSTR szHaystack, PCWSTR szNeedle) +{ + if (!*szNeedle) + return TRUE; + /* TODO: Improve pattern search beyond a simple case-insensitive substring search. */ + return pStrStrIW(szHaystack, szNeedle) != NULL; +} VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo) @@ -107,6 +123,9 @@ WCHAR szText[MAX_PATH]; INT Index; + if (!SearchPatternMatch(lpName, szSearchPattern)) + return TRUE; + ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO)); if (!ItemInfo) return FALSE; @@ -145,6 +164,12 @@ { PAPPLICATION_INFO ItemInfo; INT Index; + + if (!SearchPatternMatch(Info.szName, szSearchPattern) && + !SearchPatternMatch(Info.szDesc, szSearchPattern)) + { + return TRUE; + } /* Only add a ListView entry if... - no RegName was supplied (so we cannot determine whether the application is installed or not) or @@ -344,6 +369,13 @@ return FALSE; } +VOID CALLBACK +SearchTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) +{ + KillTimer(hwnd, SEARCH_TIMER_ID); + UpdateApplicationsList(-1); +} + VOID MainWndOnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) { @@ -361,7 +393,11 @@ LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, sizeof(szBuf) / sizeof(WCHAR)); GetWindowTextW(hSearchBar, szWndText, MAX_STR_LEN); - if (wcscmp(szBuf, szWndText) == 0) SetWindowTextW(hSearchBar, L""); + if (wcscmp(szBuf, szWndText) == 0) + { + SearchEnabled = FALSE; + SetWindowTextW(hSearchBar, L""); + } } break; @@ -371,14 +407,37 @@ if (wcslen(szBuf) < 1) { LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, sizeof(szBuf) / sizeof(WCHAR)); + SearchEnabled = FALSE; SetWindowTextW(hSearchBar, szBuf); } } break; case EN_CHANGE: - /* TODO: Implement search */ - break; + { + WCHAR szWndText[MAX_STR_LEN]; + + if (!SearchEnabled) + { + SearchEnabled = TRUE; + break; + } + + LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, sizeof(szBuf) / sizeof(WCHAR)); + GetWindowTextW(hSearchBar, szWndText, MAX_STR_LEN); + if (wcscmp(szBuf, szWndText) != 0) + { + StringCbCopy(szSearchPattern, sizeof(szSearchPattern), + szWndText); + } + else + { + szSearchPattern[0] = UNICODE_NULL; + } + + SetTimer(hwnd, SEARCH_TIMER_ID, 250, SearchTimerProc); + } + break; } return; @@ -778,6 +837,10 @@ HANDLE hMutex = NULL; MSG Msg; + /* FIXME: CORE-7786 requires this to be loaded at runtime because we + * would get comctl32's version otherwise */ + pStrStrIW = (PVOID)GetProcAddress(GetModuleHandle(L"shlwapi"), "StrStrIW"); + switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
10 years, 11 months
1
0
0
0
[tfaber] 61672: [RAPPS] - Store settings in HKEY_CURRENT_USER - Correctly show the main window if UpdateAtStart is enabled - Improve error handling
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 13:07:59 2014 New Revision: 61672 URL:
http://svn.reactos.org/svn/reactos?rev=61672&view=rev
Log: [RAPPS] - Store settings in HKEY_CURRENT_USER - Correctly show the main window if UpdateAtStart is enabled - Improve error handling Modified: trunk/reactos/base/applications/rapps/available.c trunk/reactos/base/applications/rapps/misc.c trunk/reactos/base/applications/rapps/parser.c trunk/reactos/base/applications/rapps/richedit.c trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/available.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
============================================================================== --- trunk/reactos/base/applications/rapps/available.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/available.c [iso-8859-1] Sat Jan 18 13:07:59 2014 @@ -47,6 +47,7 @@ WCHAR szPath[MAX_PATH]; WCHAR szTmp[MAX_PATH]; HRESULT hr; + BOOL result = TRUE; if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) return FALSE; @@ -57,11 +58,7 @@ if (FAILED(hr)) return FALSE; - if (GetFileAttributesW(szCabPath) != INVALID_FILE_ATTRIBUTES) - { - if (!DeleteFileW(szCabPath)) - return FALSE; - } + result = result && DeleteFileW(szCabPath); hr = StringCbCatW(szPath, sizeof(szPath), L"\\rapps\\"); if (FAILED(hr)) @@ -75,24 +72,21 @@ hFind = FindFirstFileW(szSearchPath, &FindFileData); if (hFind == INVALID_HANDLE_VALUE) - return TRUE; + return result; do { hr = StringCbPrintfW(szTmp, sizeof(szTmp), L"%ls%ls", szPath, FindFileData.cFileName); - if (FAILED(hr) || !DeleteFileW(szTmp)) - { - FindClose(hFind); - return FALSE; - } - } - while (FindNextFileW(hFind, &FindFileData) != 0); + if (FAILED(hr)) + continue; + result = result && DeleteFileW(szTmp); + } while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); - return TRUE; + return result; } @@ -145,9 +139,7 @@ HRESULT hr; if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) - { - return FALSE; - } + return FALSE; hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), L"%ls\\rappmgr.cab", @@ -167,11 +159,6 @@ { return FALSE; } - - GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE, szLocale, sizeof(szLocale) / sizeof(WCHAR)); - hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale); - if (FAILED(hr)) - return FALSE; hr = StringCbCatW(szPath, sizeof(szPath), L"*.txt"); if (FAILED(hr)) @@ -188,6 +175,16 @@ if (hFind == INVALID_HANDLE_VALUE) return FALSE; } + + if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE, + szLocale, sizeof(szLocale) / sizeof(WCHAR))) + { + return FALSE; + } + + hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale); + if (FAILED(hr)) + return FALSE; #define GET_STRING1(a, b) \ if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \ @@ -223,8 +220,7 @@ GET_STRING2(L"CDPath", Info.szCDPath); if (!lpEnumProc(Info)) break; - } - while (FindNextFileW(hFind, &FindFileData) != 0); + } while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); Modified: trunk/reactos/base/applications/rapps/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
============================================================================== --- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Sat Jan 18 13:07:59 2014 @@ -113,7 +113,7 @@ { HRESULT hr; - if(OpenClipboard(NULL)) + if (OpenClipboard(NULL)) { HGLOBAL ClipBuffer; WCHAR *Buffer; @@ -122,7 +122,7 @@ EmptyClipboard(); cchBuffer = wcslen(lpszText) + 1; ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR)); - Buffer = (WCHAR*)GlobalLock(ClipBuffer); + Buffer = GlobalLock(ClipBuffer); hr = StringCchCopyW(Buffer, cchBuffer, lpszText); GlobalUnlock(ClipBuffer); Modified: trunk/reactos/base/applications/rapps/parser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/pa…
============================================================================== --- trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] Sat Jan 18 13:07:59 2014 @@ -489,7 +489,7 @@ if (!create) return NULL; cch = wcslen(section_name) + 1; *section = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(SECTION, name) + cch * sizeof(WCHAR)); - if(*section == NULL) return NULL; + if (*section == NULL) return NULL; StringCchCopyW((*section)->name, cch, section_name); (*section)->next = NULL; cch = wcslen(key_name) + 1; @@ -562,11 +562,15 @@ ItemsArray[i]->encoding = ENCODING_UTF8; } - GetStorageDirectory(szDir, sizeof(szDir) / sizeof(szDir[0])); - - StringCbPrintfW(buffer, sizeof(buffer), - L"%ls\\rapps\\%ls", - szDir, filename); + if (!GetStorageDirectory(szDir, sizeof(szDir) / sizeof(szDir[0]))) + return FALSE; + + if (FAILED(StringCbPrintfW(buffer, sizeof(buffer), + L"%ls\\rapps\\%ls", + szDir, filename))) + { + return FALSE; + } hFile = CreateFileW(buffer, GENERIC_READ | (write_access ? GENERIC_WRITE : 0), FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, Modified: trunk/reactos/base/applications/rapps/richedit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ri…
============================================================================== --- trunk/reactos/base/applications/rapps/richedit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/richedit.c [iso-8859-1] Sat Jan 18 13:07:59 2014 @@ -23,10 +23,10 @@ { if (pLink) HeapFree(GetProcessHeap(), 0, pLink); - pLink = (PWSTR) HeapAlloc(GetProcessHeap(), - 0, - (max(Link->chrg.cpMin, Link->chrg.cpMax) - - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); + pLink = HeapAlloc(GetProcessHeap(), + 0, + (max(Link->chrg.cpMin, Link->chrg.cpMax) - + min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); if (!pLink) { /* TODO: Error message */ Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 13:07:59 2014 @@ -40,7 +40,7 @@ HKEY hKey; DWORD dwSize; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { dwSize = sizeof(SETTINGS_INFO); if (RegQueryValueExW(hKey, L"Settings", NULL, NULL, (LPBYTE)&SettingsInfo, &dwSize) == ERROR_SUCCESS) @@ -73,7 +73,7 @@ SettingsInfo.Maximized = (IsZoomed(hwnd) || (wp.flags & WPF_RESTORETOMAXIMIZED)); } - if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0, NULL, + if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS) { RegSetValueExW(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO)); @@ -115,10 +115,10 @@ Index = ListViewAddItem(ItemIndex, 0, lpName, (LPARAM)ItemInfo); /* Get version info */ - GetApplicationString((HKEY)ItemInfo->hSubKey, L"DisplayVersion", szText); + GetApplicationString(ItemInfo->hSubKey, L"DisplayVersion", szText); ListView_SetItemText(hListView, Index, 1, szText); /* Get comments */ - GetApplicationString((HKEY)ItemInfo->hSubKey, L"Comments", szText); + GetApplicationString(ItemInfo->hSubKey, L"Comments", szText); ListView_SetItemText(hListView, Index, 2, szText); return TRUE; @@ -538,8 +538,6 @@ if (!InitControls(hwnd)) PostMessage(hwnd, WM_CLOSE, 0, 0); - if (SettingsInfo.bUpdateAtStart) - UpdateAppsDB(); break; case WM_COMMAND: @@ -843,8 +841,11 @@ if (!hMainWnd) goto Exit; /* Show it */ - ShowWindow(hMainWnd, SW_SHOW); + ShowWindow(hMainWnd, nShowCmd); UpdateWindow(hMainWnd); + + if (SettingsInfo.bUpdateAtStart) + UpdateAppsDB(); /* Message Loop */ while (GetMessage(&Msg, NULL, 0, 0))
10 years, 11 months
1
0
0
0
[tfaber] 61671: [RAPPS] - Use strsafe functions. Welcome to the 21st century...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 12:35:18 2014 New Revision: 61671 URL:
http://svn.reactos.org/svn/reactos?rev=61671&view=rev
Log: [RAPPS] - Use strsafe functions. Welcome to the 21st century... Modified: trunk/reactos/base/applications/rapps/available.c trunk/reactos/base/applications/rapps/installed.c trunk/reactos/base/applications/rapps/loaddlg.c trunk/reactos/base/applications/rapps/misc.c trunk/reactos/base/applications/rapps/parser.c trunk/reactos/base/applications/rapps/settingsdlg.c trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/available.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
============================================================================== --- trunk/reactos/base/applications/rapps/available.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/available.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -46,11 +46,16 @@ WCHAR szSearchPath[MAX_PATH]; WCHAR szPath[MAX_PATH]; WCHAR szTmp[MAX_PATH]; + HRESULT hr; if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) return FALSE; - swprintf(szCabPath, L"%s\\rappmgr.cab", szPath); + hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), + L"%ls\\rappmgr.cab", + szPath); + if (FAILED(hr)) + return FALSE; if (GetFileAttributesW(szCabPath) != INVALID_FILE_ATTRIBUTES) { @@ -58,8 +63,15 @@ return FALSE; } - wcscat(szPath, L"\\rapps\\"); - swprintf(szSearchPath, L"%s*.txt", szPath); + hr = StringCbCatW(szPath, sizeof(szPath), L"\\rapps\\"); + if (FAILED(hr)) + return FALSE; + + hr = StringCbPrintfW(szSearchPath, sizeof(szSearchPath), + L"%ls*.txt", + szPath); + if (FAILED(hr)) + return FALSE; hFind = FindFirstFileW(szSearchPath, &FindFileData); if (hFind == INVALID_HANDLE_VALUE) @@ -67,8 +79,10 @@ do { - swprintf(szTmp, L"%s%s", szPath, FindFileData.cFileName); - if (!DeleteFileW(szTmp)) + hr = StringCbPrintfW(szTmp, sizeof(szTmp), + L"%ls%ls", + szPath, FindFileData.cFileName); + if (FAILED(hr) || !DeleteFileW(szTmp)) { FindClose(hFind); return FALSE; @@ -97,10 +111,19 @@ if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) return FALSE; - swprintf(szCabPath, L"%s\\rappmgr.cab", szPath); - - wcscat(szPath, L"\\rapps\\"); - wcscpy(szAppsPath, szPath); + if (FAILED(StringCbPrintfW(szCabPath, sizeof(szCabPath), + L"%ls\\rappmgr.cab", + szPath))) + { + return FALSE; + } + + if (FAILED(StringCbPrintfW(szAppsPath, sizeof(szAppsPath), + L"%ls\\rapps\\", + szPath))) + { + return FALSE; + } ExtractFilesFromCab(szCabPath, szAppsPath); @@ -119,16 +142,25 @@ WCHAR szCabPath[MAX_PATH]; WCHAR szLocale[4 + 1]; APPLICATION_INFO Info; + HRESULT hr; if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) { return FALSE; } - swprintf(szCabPath, L"%s\\rappmgr.cab", szPath); - - wcscat(szPath, L"\\rapps\\"); - wcscpy(szAppsPath, szPath); + hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), + L"%ls\\rappmgr.cab", + szPath); + if (FAILED(hr)) + return FALSE; + + hr = StringCbCatW(szPath, sizeof(szPath), L"\\rapps\\"); + if (FAILED(hr)) + return FALSE; + hr = StringCbCopyW(szAppsPath, sizeof(szAppsPath), szPath); + if (FAILED(hr)) + return FALSE; if (!CreateDirectory(szPath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) @@ -137,9 +169,13 @@ } GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE, szLocale, sizeof(szLocale) / sizeof(WCHAR)); - wcscat(szSectionLocale, szLocale); - - wcscat(szPath, L"*.txt"); + hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale); + if (FAILED(hr)) + return FALSE; + + hr = StringCbCatW(szPath, sizeof(szPath), L"*.txt"); + if (FAILED(hr)) + return FALSE; hFind = FindFirstFileW(szPath, &FindFileData); if (hFind == INVALID_HANDLE_VALUE) Modified: trunk/reactos/base/applications/rapps/installed.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/in…
============================================================================== --- trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -23,7 +23,7 @@ return TRUE; } - wcscpy(lpString, L"---"); + (VOID)StringCchCopyW(lpString, MAX_PATH, L"---"); return FALSE; } Modified: trunk/reactos/base/applications/rapps/loaddlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/lo…
============================================================================== --- trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -232,7 +232,11 @@ } else { - wcscpy(path, SettingsInfo.szDownloadDir); + if (FAILED(StringCbCopyW(path, sizeof(path), + SettingsInfo.szDownloadDir))) + { + goto end; + } } } else goto end; @@ -243,8 +247,10 @@ goto end; } - wcscat(path, L"\\"); - wcscat(path, p + 1); + if (FAILED(StringCbCatW(path, sizeof(path), L"\\"))) + goto end; + if (FAILED(StringCbCatW(path, sizeof(path), p + 1))) + goto end; /* download it */ bTempfile = TRUE; @@ -353,7 +359,12 @@ APPLICATION_INFO IntInfo; ZeroMemory(&IntInfo, sizeof(APPLICATION_INFO)); - wcscpy(IntInfo.szUrlDownload, lpUrl); + if (FAILED(StringCbCopyW(IntInfo.szUrlDownload, + sizeof(IntInfo.szUrlDownload), + lpUrl))) + { + return; + } AppInfo = &IntInfo; Modified: trunk/reactos/base/applications/rapps/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
============================================================================== --- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -111,18 +111,23 @@ VOID CopyTextToClipboard(LPCWSTR lpszText) { + HRESULT hr; + if(OpenClipboard(NULL)) { HGLOBAL ClipBuffer; WCHAR *Buffer; + DWORD cchBuffer; EmptyClipboard(); - ClipBuffer = GlobalAlloc(GMEM_DDESHARE, (wcslen(lpszText) + 1) * sizeof(TCHAR)); + cchBuffer = wcslen(lpszText) + 1; + ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR)); Buffer = (WCHAR*)GlobalLock(ClipBuffer); - wcscpy(Buffer, lpszText); + hr = StringCchCopyW(Buffer, cchBuffer, lpszText); GlobalUnlock(ClipBuffer); - SetClipboardData(CF_UNICODETEXT, ClipBuffer); + if (SUCCEEDED(hr)) + SetClipboardData(CF_UNICODETEXT, ClipBuffer); CloseClipboard(); } Modified: trunk/reactos/base/applications/rapps/parser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/pa…
============================================================================== --- trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -176,7 +176,8 @@ for ( ; section; section = section->next) { - int len = 0; + size_t len = 0; + size_t remaining; if (section->name[0]) len += wcslen(section->name) + 4; @@ -190,28 +191,28 @@ if (!buffer) return; p = buffer; + remaining = len; if (section->name[0]) { - *p++ = '['; - wcscpy(p, section->name); - p += wcslen(p); - *p++ = ']'; - *p++ = '\r'; - *p++ = '\n'; + StringCchPrintfExW(p, remaining, &p, &remaining, 0, + L"[%ls]\r\n", + section->name); } for (key = section->key; key; key = key->next) { - wcscpy(p, key->name); - p += wcslen(p); if (key->value) { - *p++ = '='; - wcscpy(p, key->value); - p += wcslen(p); - } - *p++ = '\r'; - *p++ = '\n'; + StringCchPrintfExW(p, remaining, &p, &remaining, 0, + L"%ls=%ls\r\n", + key->name, key->value); + } + else + { + StringCchPrintfExW(p, remaining, &p, &remaining, 0, + L"%ls\r\n", + key->name); + } } ParserWriteLine(hFile, buffer, len, encoding); HeapFree(GetProcessHeap(), 0, buffer); @@ -434,6 +435,7 @@ *ParserFind(SECTION **section, LPCWSTR section_name, LPCWSTR key_name, BOOL create, BOOL create_always) { LPCWSTR p; + DWORD cch; int seclen, keylen; while (ParserIsSpace(*section_name)) section_name++; @@ -474,9 +476,10 @@ } if (!create) return NULL; - if (!(*key = HeapAlloc(GetProcessHeap(), 0, sizeof(SECTIONKEY) + wcslen(key_name) * sizeof(WCHAR)))) + cch = wcslen(key_name) + 1; + if (!(*key = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(SECTIONKEY, name) + cch * sizeof(WCHAR)))) return NULL; - wcscpy((*key)->name, key_name); + StringCchCopyW((*key)->name, cch, key_name); (*key)->value = NULL; (*key)->next = NULL; return *key; @@ -484,17 +487,19 @@ section = &(*section)->next; } if (!create) return NULL; - *section = HeapAlloc(GetProcessHeap(), 0, sizeof(SECTION) + wcslen(section_name) * sizeof(WCHAR)); + cch = wcslen(section_name) + 1; + *section = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(SECTION, name) + cch * sizeof(WCHAR)); if(*section == NULL) return NULL; - wcscpy((*section)->name, section_name); + StringCchCopyW((*section)->name, cch, section_name); (*section)->next = NULL; + cch = wcslen(key_name) + 1; if (!((*section)->key = HeapAlloc(GetProcessHeap(), 0, - sizeof(SECTIONKEY) + wcslen(key_name) * sizeof(WCHAR)))) + FIELD_OFFSET(SECTIONKEY, name) + cch * sizeof(WCHAR)))) { HeapFree(GetProcessHeap(), 0, *section); return NULL; } - wcscpy((*section)->key->name, key_name); + StringCchCopyW((*section)->key->name, cch, key_name); (*section)->key->value = NULL; (*section)->key->next = NULL; return (*section)->key; @@ -541,10 +546,10 @@ { WCHAR szDir[MAX_PATH]; WCHAR buffer[MAX_PATH]; + DWORD cch; HANDLE hFile = INVALID_HANDLE_VALUE; int i, j; ITEMS *tempProfile; - static const WCHAR wszSeparator[] = L"\\rapps\\"; if (!CurProfile) for (i = 0; i < N_CACHED_ITEMS; i++) @@ -559,9 +564,9 @@ GetStorageDirectory(szDir, sizeof(szDir) / sizeof(szDir[0])); - wcscpy(buffer, szDir); - wcscat(buffer, wszSeparator); - wcscat(buffer, filename); + StringCbPrintfW(buffer, sizeof(buffer), + L"%ls\\rapps\\%ls", + szDir, filename); hFile = CreateFileW(buffer, GENERIC_READ | (write_access ? GENERIC_WRITE : 0), FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, @@ -605,11 +610,12 @@ if (CurProfile->filename) ParserReleaseFile(); - CurProfile->filename = HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer) + 1) * sizeof(WCHAR)); + cch = wcslen(buffer) + 1; + CurProfile->filename = HeapAlloc(GetProcessHeap(), 0, cch * sizeof(WCHAR)); if (CurProfile->filename == NULL) return FALSE; - wcscpy(CurProfile->filename, buffer); + StringCchCopyW(CurProfile->filename, cch, buffer); if (hFile != INVALID_HANDLE_VALUE) { Modified: trunk/reactos/base/applications/rapps/settingsdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/se…
============================================================================== --- trunk/reactos/base/applications/rapps/settingsdlg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/settingsdlg.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -113,7 +113,9 @@ if (dwAttr != INVALID_FILE_ATTRIBUTES && (dwAttr & FILE_ATTRIBUTE_DIRECTORY)) { - wcscpy(NewSettingsInfo.szDownloadDir, szDir); + StringCbCopyW(NewSettingsInfo.szDownloadDir, + sizeof(NewSettingsInfo.szDownloadDir), + szDir); } else { Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 12:35:18 2014 @@ -22,7 +22,9 @@ pSettingsInfo->bSaveWndPos = TRUE; pSettingsInfo->bUpdateAtStart = FALSE; pSettingsInfo->bLogEnabled = TRUE; - wcscpy(pSettingsInfo->szDownloadDir, L"C:\\Downloads"); + StringCbCopyW(pSettingsInfo->szDownloadDir, + sizeof(pSettingsInfo->szDownloadDir), + L"C:\\Downloads"); pSettingsInfo->bDelInstaller = FALSE; pSettingsInfo->Maximized = FALSE; @@ -217,7 +219,9 @@ SelectedEnumType = EnumType; LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, sizeof(szBuffer2) / sizeof(WCHAR)); - swprintf(szBuffer1, szBuffer2, ListView_GetItemCount(hListView)); + StringCbPrintfW(szBuffer1, sizeof(szBuffer1), + szBuffer2, + ListView_GetItemCount(hListView)); SetStatusBarText(szBuffer1); SetWelcomeText(); @@ -330,7 +334,9 @@ InitCategoriesList(); LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, sizeof(szBuffer2) / sizeof(WCHAR)); - swprintf(szBuffer1, szBuffer2, ListView_GetItemCount(hListView)); + StringCbPrintfW(szBuffer1, sizeof(szBuffer1), + szBuffer2, + ListView_GetItemCount(hListView)); SetStatusBarText(szBuffer1); return TRUE; }
10 years, 11 months
1
0
0
0
[dreimer] 61670: [LOG2LINES] Improve Log2lines.exe help usage by Victor Martinez Calvo CORE-7427 #resolve
by dreimer@svn.reactos.org
Author: dreimer Date: Sat Jan 18 12:03:34 2014 New Revision: 61670 URL:
http://svn.reactos.org/svn/reactos?rev=61670&view=rev
Log: [LOG2LINES] Improve Log2lines.exe help usage by Victor Martinez Calvo CORE-7427 #resolve Modified: trunk/reactos/tools/log2lines/log2lines.c trunk/reactos/tools/log2lines/options.c Modified: trunk/reactos/tools/log2lines/log2lines.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/log2lines.…
============================================================================== --- trunk/reactos/tools/log2lines/log2lines.c [iso-8859-1] (original) +++ trunk/reactos/tools/log2lines/log2lines.c [iso-8859-1] Sat Jan 18 12:03:34 2014 @@ -566,6 +566,7 @@ main(int argc, const char **argv) { int res = 0; + int optInit = 0; int optCount = 0; dbgIn = stdin; @@ -579,9 +580,10 @@ memset(&revinfo, 0, sizeof(REVINFO)); clearLastLine(); - optionInit(argc, argv); + optInit = optionInit(argc, argv); optCount = optionParse(argc, argv); - if (optCount < 0) + + if (optCount < 0 || optInit < 0) { return optCount; } Modified: trunk/reactos/tools/log2lines/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/log2lines/options.c?…
============================================================================== --- trunk/reactos/tools/log2lines/options.c [iso-8859-1] (original) +++ trunk/reactos/tools/log2lines/options.c [iso-8859-1] Sat Jan 18 12:03:34 2014 @@ -46,6 +46,9 @@ char opt_scanned[LINESIZE]; // all scanned options char opt_SourcesPath[LINESIZE]; //sources path +/* optionInit returns 0 for normal operation, and -1 in case just "loglines.exe" was written. +In such case, the help is shown */ + int optionInit(int argc, const char **argv) { int i; @@ -64,8 +67,20 @@ l2l_dbg(1, "Trunk build revision: %d\n", revinfo.buildrev); strcpy(opt_scanned, ""); + + //The user introduced "log2lines.exe" or "log2lines.exe /?" + //Let's help the user + if ((argc == 1) || + ((argc == 2) && (argv[1][0] == '/') && (argv[1][1] == '?'))) + { + opt_help++; + usage(1); + return -1; + } + for (i = 1; i < argc; i++) { + if ((argv[i][0] == '-') && (i+1 < argc)) { //Because these arguments can contain spaces we cant use getopt(), a known bug: @@ -90,6 +105,7 @@ break; } } + strcat(opt_scanned, argv[i]); strcat(opt_scanned, " "); }
10 years, 11 months
1
0
0
0
[tfaber] 61669: [RAPPS] - Do not write to the application directory. Welcome to Windows NT...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 11:21:48 2014 New Revision: 61669 URL:
http://svn.reactos.org/svn/reactos?rev=61669&view=rev
Log: [RAPPS] - Do not write to the application directory. Welcome to Windows NT... Modified: trunk/reactos/base/applications/rapps/available.c trunk/reactos/base/applications/rapps/loaddlg.c trunk/reactos/base/applications/rapps/misc.c trunk/reactos/base/applications/rapps/parser.c trunk/reactos/base/applications/rapps/rapps.h Modified: trunk/reactos/base/applications/rapps/available.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
============================================================================== --- trunk/reactos/base/applications/rapps/available.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/available.c [iso-8859-1] Sat Jan 18 11:21:48 2014 @@ -47,7 +47,7 @@ WCHAR szPath[MAX_PATH]; WCHAR szTmp[MAX_PATH]; - if (!GetCurrentDirectoryW(MAX_PATH, szPath)) + if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) return FALSE; swprintf(szCabPath, L"%s\\rappmgr.cab", szPath); @@ -94,7 +94,7 @@ DownloadApplicationsDB(APPLICATION_DATEBASE_URL); - if (!GetCurrentDirectoryW(MAX_PATH, szPath)) + if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) return FALSE; swprintf(szCabPath, L"%s\\rappmgr.cab", szPath); @@ -120,7 +120,7 @@ WCHAR szLocale[4 + 1]; APPLICATION_INFO Info; - if (!GetCurrentDirectoryW(MAX_PATH, szPath)) + if (!GetStorageDirectory(szPath, sizeof(szPath) / sizeof(szPath[0]))) { return FALSE; } Modified: trunk/reactos/base/applications/rapps/loaddlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/lo…
============================================================================== --- trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] Sat Jan 18 11:21:48 2014 @@ -227,7 +227,7 @@ AppInfo->szUrlDownload[len - 1] == 'b') { bCab = TRUE; - if (!GetCurrentDirectoryW(MAX_PATH, path)) + if (!GetStorageDirectory(path, sizeof(path) / sizeof(path[0]))) goto end; } else Modified: trunk/reactos/base/applications/rapps/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
============================================================================== --- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Sat Jan 18 11:21:48 2014 @@ -208,6 +208,26 @@ return TRUE; } +BOOL +GetStorageDirectory(PWCHAR lpDirectory, DWORD cch) +{ + if (cch < MAX_PATH) + return FALSE; + + if (!SHGetSpecialFolderPathW(NULL, lpDirectory, CSIDL_LOCAL_APPDATA, TRUE)) + return FALSE; + + if (FAILED(StringCchCatW(lpDirectory, cch, L"\\rapps"))) + return FALSE; + + if (!CreateDirectoryW(lpDirectory, NULL) && + GetLastError() != ERROR_ALREADY_EXISTS) + { + return FALSE; + } + + return TRUE; +} BOOL ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath) @@ -261,13 +281,13 @@ if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szBuf, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS) - { - return; - } - - if (!GetCurrentDirectoryW(MAX_PATH, szPath)) return; - wcscat(szPath, L"\\rapps.exe"); + KEY_WRITE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS) + { + return; + } + + if (!GetModuleFileName(NULL, szPath, sizeof(szPath) / sizeof(szPath[0]))) + return; if (RegSetValueExW(hKey, L"EventMessageFile", @@ -276,13 +296,13 @@ (LPBYTE)szPath, (DWORD)(wcslen(szPath) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS) { - RegCloseKey(hKey); - return; - } - - dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | - EVENTLOG_INFORMATION_TYPE; - + RegCloseKey(hKey); + return; + } + + dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | + EVENTLOG_INFORMATION_TYPE; + if (RegSetValueExW(hKey, L"TypesSupported", 0, @@ -290,7 +310,7 @@ (LPBYTE)&dwData, sizeof(DWORD)) != ERROR_SUCCESS) { - RegCloseKey(hKey); + RegCloseKey(hKey); return; } @@ -301,7 +321,7 @@ (LPBYTE)szPath, (DWORD)(wcslen(szPath) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS) { - RegCloseKey(hKey); + RegCloseKey(hKey); return; } @@ -312,7 +332,7 @@ (LPBYTE)&dwCategoryNum, sizeof(DWORD)) != ERROR_SUCCESS) { - RegCloseKey(hKey); + RegCloseKey(hKey); return; } Modified: trunk/reactos/base/applications/rapps/parser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/pa…
============================================================================== --- trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/parser.c [iso-8859-1] Sat Jan 18 11:21:48 2014 @@ -557,7 +557,7 @@ ItemsArray[i]->encoding = ENCODING_UTF8; } - GetCurrentDirectoryW(MAX_PATH, szDir); + GetStorageDirectory(szDir, sizeof(szDir) / sizeof(szDir[0])); wcscpy(buffer, szDir); wcscat(buffer, wszSeparator); Modified: trunk/reactos/base/applications/rapps/rapps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Sat Jan 18 11:21:48 2014 @@ -15,6 +15,7 @@ #include <richedit.h> #include <shlobj.h> #include <stdio.h> +#include <strsafe.h> #include <rappsmsg.h> @@ -150,6 +151,7 @@ VOID SetWelcomeText(VOID); VOID ShowPopupMenu(HWND hwnd, UINT MenuID); BOOL StartProcess(LPWSTR lpPath, BOOL Wait); +BOOL GetStorageDirectory(PWCHAR lpDirectory, DWORD cch); BOOL ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath); VOID InitLogs(VOID); VOID FreeLogs(VOID);
10 years, 11 months
1
0
0
0
[tfaber] 61668: [RAPPS] - Don't break the build, Arch
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 10:45:39 2014 New Revision: 61668 URL:
http://svn.reactos.org/svn/reactos?rev=61668&view=rev
Log: [RAPPS] - Don't break the build, Arch Modified: trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 10:45:39 2014 @@ -771,7 +771,6 @@ WNDCLASSEXW WndClass = {0}; WCHAR szWindowClass[] = L"ROSAPPMGR"; WCHAR szWindowName[MAX_STR_LEN]; - WCHAR szErrorText[MAX_STR_LEN]; HANDLE hMutex = NULL; MSG Msg;
10 years, 11 months
1
0
0
0
[tfaber] 61667: [RAPPS] - Do not require Administrator privileges. It's annoying and completely unnecessary
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jan 18 10:44:27 2014 New Revision: 61667 URL:
http://svn.reactos.org/svn/reactos?rev=61667&view=rev
Log: [RAPPS] - Do not require Administrator privileges. It's annoying and completely unnecessary Modified: trunk/reactos/base/applications/rapps/lang/bg-BG.rc trunk/reactos/base/applications/rapps/lang/cs-CZ.rc trunk/reactos/base/applications/rapps/lang/de-DE.rc trunk/reactos/base/applications/rapps/lang/en-US.rc trunk/reactos/base/applications/rapps/lang/es-ES.rc trunk/reactos/base/applications/rapps/lang/fr-FR.rc trunk/reactos/base/applications/rapps/lang/he-IL.rc trunk/reactos/base/applications/rapps/lang/it-IT.rc trunk/reactos/base/applications/rapps/lang/ja-JP.rc trunk/reactos/base/applications/rapps/lang/no-NO.rc trunk/reactos/base/applications/rapps/lang/pl-PL.rc trunk/reactos/base/applications/rapps/lang/pt-BR.rc trunk/reactos/base/applications/rapps/lang/ro-RO.rc trunk/reactos/base/applications/rapps/lang/ru-RU.rc trunk/reactos/base/applications/rapps/lang/sk-SK.rc trunk/reactos/base/applications/rapps/lang/sq-AL.rc trunk/reactos/base/applications/rapps/lang/sv-SE.rc trunk/reactos/base/applications/rapps/lang/tr-TR.rc trunk/reactos/base/applications/rapps/lang/uk-UA.rc trunk/reactos/base/applications/rapps/lang/zh-CN.rc trunk/reactos/base/applications/rapps/lang/zh-TW.rc trunk/reactos/base/applications/rapps/resource.h trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -190,7 +190,6 @@ IDS_APPLICATIONS "ÐÑиложениÑ" IDS_CHOOSE_FOLDER_TEXT "ÐзбеÑеÑе папка, в коÑÑо да Ñе ÑвалÑÑ Ð¿ÑиложениÑÑа:" IDS_CHOOSE_FOLDER_ERROR "Указали ÑÑе неÑÑÑеÑÑвÑваÑа папка!" - IDS_USER_NOT_ADMIN "ТÑÑбва да имаÑе ÑпÑавниÑеÑки пÑава, за да запÑÑнеÑе âУпÑавиÑÐµÐ»Ñ Ð·Ð° пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð½Ð° РеакÑÐСâ!" IDS_APP_REG_REMOVE "УвеÑен ли ÑÑе, Ñе иÑкаÑе да изÑÑиеÑе данниÑе за ÑложеноÑо пÑиложение Ð¾Ñ ÑегиÑÑÑÑа?" IDS_INFORMATION "СведениÑ" IDS_UNABLE_TO_REMOVE "ÐÑÐµÐ¼Ð°Ñ Ð²Ð°Ð½ÐµÑо на данниÑе за пÑиложениеÑо Ð¾Ñ ÑегиÑÑÑÑа е невÑзможно!" Modified: trunk/reactos/base/applications/rapps/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -191,7 +191,6 @@ IDS_APPLICATIONS "Aplikace" IDS_CHOOSE_FOLDER_TEXT "Zvolte složku, do které se budou ukládat stažené soubory:" IDS_CHOOSE_FOLDER_ERROR "Zvolená složka neexistuje. VytvoÅit?" - IDS_USER_NOT_ADMIN "Ke spuÅ¡tÄnà ""ReactOS Manažera aplikacÃ"" je tÅeba být administrátor!" IDS_APP_REG_REMOVE "UrÄitÄ odstranit data instalovaného programu z registru?" IDS_INFORMATION "Informace" IDS_UNABLE_TO_REMOVE "NepodaÅilo se odstranit data programu z registru!" Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Anwendungen" IDS_CHOOSE_FOLDER_TEXT "Wählen Sie ein Verzeichnis aus, das zum Herunterladen verwendet werden soll:" IDS_CHOOSE_FOLDER_ERROR "Sie haben ein nicht existierendes Verzeichnis angegeben! Neu anlegen?" - IDS_USER_NOT_ADMIN "Sie müssen als Administrator angemeldet sein, um den Anwendungsmanager zu starten!" IDS_APP_REG_REMOVE "Sind Sie sich sicher, dass Sie die Daten dieses Programms aus der Registry entfernen möchten?" IDS_INFORMATION "Informationen" IDS_UNABLE_TO_REMOVE "Konnte die Daten nicht aus der Registry löschen!" Modified: trunk/reactos/base/applications/rapps/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Applications" IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will store Downloads:" IDS_CHOOSE_FOLDER_ERROR "The folder you have specified does not exist. Create it?" - IDS_USER_NOT_ADMIN "You must be an administrator to start ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed program from the registry?" IDS_INFORMATION "Information" IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Aplicaciones" IDS_CHOOSE_FOLDER_TEXT "Seleccione una carpeta donde se descargarán los programas:" IDS_CHOOSE_FOLDER_ERROR "¡La carpeta especificada no existe!" - IDS_USER_NOT_ADMIN "¡Debe tener privilegios de administrador para ejecutar ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "¿Esta seguro que quiere borrar los datos del programa instalado del registro?" IDS_INFORMATION "Información" IDS_UNABLE_TO_REMOVE "!Imposible eliminar los datos del programa del registro!" Modified: trunk/reactos/base/applications/rapps/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Applications" IDS_CHOOSE_FOLDER_TEXT "Choisissez un dossier dans lequel les programmes seront téléchargés :" IDS_CHOOSE_FOLDER_ERROR "Le dossier que vous avez spécifié n'existe pas. Le créer ?" - IDS_USER_NOT_ADMIN "Vous devez être un administrateur pour démarrer ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Etes-vous sûr de vouloir supprimer les données du programme installé du registre ?" IDS_INFORMATION "Information" IDS_UNABLE_TO_REMOVE "Impossible de supprimer les données du programme du registre !" Modified: trunk/reactos/base/applications/rapps/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -188,7 +188,6 @@ IDS_APPLICATIONS "××ש××××" IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will store Downloads:" IDS_CHOOSE_FOLDER_ERROR "The folder you have specified does not exist. Create it?" - IDS_USER_NOT_ADMIN "You must be an administrator to start ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed program from the registry?" IDS_INFORMATION "××××¢" IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" Modified: trunk/reactos/base/applications/rapps/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Applicazioni" IDS_CHOOSE_FOLDER_TEXT "Scegliere una cartella dove scaricare le applicazioni:" IDS_CHOOSE_FOLDER_ERROR "La cartella indicata non esiste. Vuoi crearla?" - IDS_USER_NOT_ADMIN "Dovete essere Amministratore per avviare ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Sicuro di voler cancellare dal registry i dati sui programmi installati?" IDS_INFORMATION "Informazioni" IDS_UNABLE_TO_REMOVE "Impossibile cancellare i dati dal registry!" Modified: trunk/reactos/base/applications/rapps/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "ã¢ããªã±ã¼ã·ã§ã³" IDS_CHOOSE_FOLDER_TEXT "ããã°ã©ã ã®ãã¦ã³ãã¼ãã«ä½¿ç¨ãããã©ã«ããé¸æãã¦ãã ãã:" IDS_CHOOSE_FOLDER_ERROR "æå®ããããã©ã«ãã¯åå¨ãã¾ãã!" - IDS_USER_NOT_ADMIN """ReactOS ã¢ããªã±ã¼ã·ã§ã³ ããã¼ã¸ã£"" ãèµ·åããã«ã¯ç®¡çè 権éã§ããå¿ è¦ãããã¾ã!" IDS_APP_REG_REMOVE "ã¬ã¸ã¹ããªããã¤ã³ã¹ãã¼ã«ãããããã°ã©ã ã«é¢ãããã¼ã¿ãåé¤ãã¦ãããããã§ãã?" IDS_INFORMATION "æ å ±" IDS_UNABLE_TO_REMOVE "ã¬ã¸ã¹ããªãããã®ããã°ã©ã ã«é¢ãããã¼ã¿ãåé¤ã§ãã¾ãã!" Modified: trunk/reactos/base/applications/rapps/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "Programmer" IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of programs:" IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!" - IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed program from the registry?" IDS_INFORMATION "Information" IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" Modified: trunk/reactos/base/applications/rapps/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -194,7 +194,6 @@ IDS_APPLICATIONS "Aplikacje" IDS_CHOOSE_FOLDER_TEXT "Wybierz katalog, w którym bÄda zapisywane pobrane programy:" IDS_CHOOSE_FOLDER_ERROR "WybraÅeÅ nieistniejÄ cy katalog! Czy chcesz utworzyÄ nowy?" - IDS_USER_NOT_ADMIN "Musisz mieÄ uprawnienia administratora, aby uruchomiÄ ""Menedżer aplikacji ReactOS""!" IDS_APP_REG_REMOVE "Czy na pewno chcesz usunÄ Ä wpis tego programu z rejestru?" IDS_INFORMATION "Informacja" IDS_UNABLE_TO_REMOVE "Nie można byÅo usunÄ Ä wpisu z rejestru!" Modified: trunk/reactos/base/applications/rapps/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -188,7 +188,6 @@ IDS_APPLICATIONS "Aplicativos" IDS_CHOOSE_FOLDER_TEXT "Escolha uma pasta para armazenar os Downloads:" IDS_CHOOSE_FOLDER_ERROR "A pasta especificada não existe. Deseja criá-la?" - IDS_USER_NOT_ADMIN "Você deve possuir privilégios administrativos para iniciar ""Central de Aplicativos ReactOS""!" IDS_APP_REG_REMOVE "Você tem certeza que deseja apagar as informações do programa instalado do registro?" IDS_INFORMATION "Informações" IDS_UNABLE_TO_REMOVE "Não foi possÃvel remover as informações do programa do registro!" Modified: trunk/reactos/base/applications/rapps/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -193,7 +193,6 @@ IDS_APPLICATIONS "AplicaÈii" IDS_CHOOSE_FOLDER_TEXT "SpecificaÈi un dosar destinaÈie pentru descÄrcÄri:" IDS_CHOOSE_FOLDER_ERROR "Dosarul specificat nu existÄ. DoriÈi crearea lui?" - IDS_USER_NOT_ADMIN "Pentru a porni âGestionar de aplicaÈii ReactOSâ sunt necesare drepturi de administrator!" IDS_APP_REG_REMOVE "Sigur doriÈi sÄ ÈtergeÈi datele din registru pentru aceastÄ aplicaÈe?" IDS_INFORMATION "InformaÈie" IDS_UNABLE_TO_REMOVE "Nu se pot elimina datele din registru pentru aceastÄ aplicaÈie!" Modified: trunk/reactos/base/applications/rapps/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -186,7 +186,6 @@ IDS_APPLICATIONS "ÐÑиложениÑ" IDS_CHOOSE_FOLDER_TEXT "ÐÑбеÑиÑе папкÑ, коÑоÑÐ°Ñ Ð±ÑÐ´ÐµÑ Ð¸ÑполÑзоваÑÑÑÑ Ð´Ð»Ñ Ð·Ð°Ð³ÑÑзки пÑогÑамм:" IDS_CHOOSE_FOLDER_ERROR "ÐÑ Ñказали неÑÑÑеÑÑвÑÑÑÑÑ Ð¿Ð°Ð¿ÐºÑ!" - IDS_USER_NOT_ADMIN "ÐÑ Ð´Ð¾Ð»Ð¶Ð½Ñ Ð±ÑÑÑ Ð°Ð´Ð¼Ð¸Ð½Ð¸ÑÑÑаÑоÑом Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка ""ÐенеджеÑа пÑиложений ReactOS""!" IDS_APP_REG_REMOVE "ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ Ð¾ÑиÑе ÑдалиÑÑ Ð´Ð°Ð½Ð½Ñе об ÑÑÑановленной пÑогÑамме из ÑееÑÑÑа?" IDS_INFORMATION "ÐнÑоÑмаÑиÑ" IDS_UNABLE_TO_REMOVE "Ðе ÑдалоÑÑ ÑдалиÑÑ Ð´Ð°Ð½Ð½Ñе о пÑогÑамме из ÑееÑÑÑа!" Modified: trunk/reactos/base/applications/rapps/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -191,7 +191,6 @@ IDS_APPLICATIONS "Aplikácie" IDS_CHOOSE_FOLDER_TEXT "Vyberte prieÄinok, ktorý sa použije pre sÅ¥ahovanie programov:" IDS_CHOOSE_FOLDER_ERROR "Zvolili ste si neexistujúci prieÄinok!" - IDS_USER_NOT_ADMIN "Mali by ste byÅ¥ administrátor pre spustenie ""Manažéra aplikácià systému ReactOS""!" IDS_APP_REG_REMOVE "Naozaj chcete vymazaÅ¥ údaje o nainÅ¡talovanom programe z registrov?" IDS_INFORMATION "Informácie" IDS_UNABLE_TO_REMOVE "Nie je možné odstrániÅ¥ z registrov údaje o programe!" Modified: trunk/reactos/base/applications/rapps/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -190,7 +190,6 @@ IDS_APPLICATIONS "Aplicacione" IDS_CHOOSE_FOLDER_TEXT "Zgjidh nje dosje ku do duhen Downloadusit:" IDS_CHOOSE_FOLDER_ERROR "Dosja qe keni zgjedhur nuk ekziston. Krijoje?" - IDS_USER_NOT_ADMIN "Ju duhet te jeni administrator per te filluar ""ReactOS Applications Manager""!" IDS_APP_REG_REMOVE "Jeni te sigurt qe do ti fshini informacionet e programit te instaluar nga regjistri?" IDS_INFORMATION "Informacione" IDS_UNABLE_TO_REMOVE "E pamundur te fshihen informacionet e programit nga regjistri!" Modified: trunk/reactos/base/applications/rapps/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -193,7 +193,6 @@ IDS_APPLICATIONS "Program" IDS_CHOOSE_FOLDER_TEXT "Välj en mapp som kommer att användas för nerladdning av program:" IDS_CHOOSE_FOLDER_ERROR "Du har specificrat en ej existerande mapp! Vill du skapa den?" - IDS_USER_NOT_ADMIN "Du mÃ¥ste vara administratör för att starta ""ReactOS programhanterare""!" IDS_APP_REG_REMOVE "Ãr du säker pÃ¥ att du vill ta bort data det installerade programmets data frÃ¥n registret?" IDS_INFORMATION "Information" IDS_UNABLE_TO_REMOVE "Det gick ej att ta bort programmets data frÃ¥n registret!" Modified: trunk/reactos/base/applications/rapps/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -188,7 +188,6 @@ IDS_APPLICATIONS "Yazılımlar" IDS_CHOOSE_FOLDER_TEXT "Ä°ndirme dizinini seçiniz:" IDS_CHOOSE_FOLDER_ERROR "BelirttiÄiniz dizin yok. BelirttiÄiniz dizin oluÅturulsun mu?" - IDS_USER_NOT_ADMIN "ReactOS Yazılım Yöneticisi'ni yönetici olarak çalıÅtırmalısınız." IDS_APP_REG_REMOVE "Bu yazılımın bilgilerini DeÄer Defteri'nden kaldırmayı onaylıyor musunuz?" IDS_INFORMATION "Bilgi" IDS_UNABLE_TO_REMOVE "Bu yazılımın bilgileri DeÄer Defteri'nden kaldırılamıyor." Modified: trunk/reactos/base/applications/rapps/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -194,7 +194,6 @@ IDS_APPLICATIONS "ÐодаÑки" IDS_CHOOSE_FOLDER_TEXT "ÐбеÑÑÑÑ ÑекÑ, Ñка бÑде викоÑиÑÑовÑваÑиÑÑ Ð´Ð»Ñ Ð·Ð°Ð²Ð°Ð½ÑÐ°Ð¶ÐµÐ½Ð½Ñ Ð¿ÑогÑам:" IDS_CHOOSE_FOLDER_ERROR "Ðи вказали неÑÑнÑÑÑÑ ÑекÑ!" - IDS_USER_NOT_ADMIN "Ðи Ð¿Ð¾Ð²Ð¸Ð½Ð½Ñ Ð±ÑÑи адмÑнÑÑÑÑаÑоÑом Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑÐºÑ ""ÐенеджеÑа пÑогÑам ReactOS""!" IDS_APP_REG_REMOVE "Ðи дÑйÑно Ñ Ð¾ÑеÑе видалиÑи Ð´Ð°Ð½Ñ Ð¿Ñо вÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ñ Ð¿ÑогÑÐ°Ð¼Ñ Ð· ÑеÑÑÑÑÑ?" IDS_INFORMATION "ÐнÑоÑмаÑÑÑ" IDS_UNABLE_TO_REMOVE "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñи Ð´Ð°Ð½Ñ Ð¿Ñо пÑогÑÐ°Ð¼Ñ Ð· ÑеÑÑÑÑÑ!" Modified: trunk/reactos/base/applications/rapps/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -188,7 +188,6 @@ IDS_APPLICATIONS "åºç¨ç¨åº" IDS_CHOOSE_FOLDER_TEXT "请éæ©ç¨æ¥ä¿åä¸è½½æ件çæ件夹ï¼" IDS_CHOOSE_FOLDER_ERROR "æ¨éæ©çæ件夹ä¸åå¨ãå建åï¼" - IDS_USER_NOT_ADMIN "æ¨å¿ 须以管çåæéå¯å¨ ""ReactOS ç¨åºç®¡çå¨""ï¼" IDS_APP_REG_REMOVE "æ¨ç¡®å®è¦ä»æ³¨å表å é¤è¯¥ç¨åºçæ°æ®åï¼" IDS_INFORMATION "ä¿¡æ¯" IDS_UNABLE_TO_REMOVE "æ æ³ä»æ³¨å表å é¤è¯¥ç¨åºçæ°æ®ï¼" Modified: trunk/reactos/base/applications/rapps/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -188,7 +188,6 @@ IDS_APPLICATIONS "æç¨ç¨å¼" IDS_CHOOSE_FOLDER_TEXT "è«é¸æç¨ä¾å²åä¸è¼æªæ¡çè³æ夾ï¼" IDS_CHOOSE_FOLDER_ERROR "æ¨é¸æçè³æ夾ä¸åå¨ãåµå»ºåï¼" - IDS_USER_NOT_ADMIN "æ¨å¿ é 以管çå¡è¨±å¯æ¬åå ""ReactOS ç¨å¼ç®¡çå¨""ï¼" IDS_APP_REG_REMOVE "æ¨ç¢ºå®è¦å¾ç»éæªåªé¤è©²ç¨å¼çè³æåï¼" IDS_INFORMATION "è³è¨" IDS_UNABLE_TO_REMOVE "ç¡æ³å¾ç»éæªåªé¤è©²ç¨å¼çè³æï¼" Modified: trunk/reactos/base/applications/rapps/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/re…
============================================================================== --- trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -87,7 +87,6 @@ #define IDS_APPLICATIONS 112 #define IDS_CHOOSE_FOLDER_TEXT 113 #define IDS_CHOOSE_FOLDER_ERROR 114 -#define IDS_USER_NOT_ADMIN 115 #define IDS_APP_REG_REMOVE 116 #define IDS_INFORMATION 117 #define IDS_UNABLE_TO_REMOVE 118 Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Jan 18 10:44:27 2014 @@ -212,7 +212,7 @@ /* Destroy old image list */ if (hImageListView) - ImageList_Destroy(hImageListView); + ImageList_Destroy(hImageListView); SelectedEnumType = EnumType; @@ -776,23 +776,16 @@ MSG Msg; switch (GetUserDefaultUILanguage()) - { - case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): - SetProcessDefaultLayout(LAYOUT_RTL); - break; - - default: - break; - } + { + case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): + SetProcessDefaultLayout(LAYOUT_RTL); + break; + + default: + break; + } hInst = hInstance; - - if (!IsUserAnAdmin()) - { - LoadStringW(hInst, IDS_USER_NOT_ADMIN, szErrorText, sizeof(szErrorText) / sizeof(WCHAR)); - MessageBox(0, szErrorText, NULL, MB_OK | MB_ICONWARNING); - return 1; - } hMutex = CreateMutexW(NULL, FALSE, szWindowClass); if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
10 years, 11 months
1
0
0
0
[tkreuzer] 61666: [ACPI] - Fix AcpiRegQueryValue, to allow querying the required buffer size only (which was already used, but just didn't work) - Fix GetProcessorInformation. Previously the functi...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 18 00:50:10 2014 New Revision: 61666 URL:
http://svn.reactos.org/svn/reactos?rev=61666&view=rev
Log: [ACPI] - Fix AcpiRegQueryValue, to allow querying the required buffer size only (which was already used, but just didn't work) - Fix GetProcessorInformation. Previously the function failed at the start, but no one checked the return value. Check return values of called functions, and properly NULL-Terminate the components of the REG_MULTI_SZ style value that ProcessorHardwareIds is supposed to be. - Fix NULL-termination in Bus_PDO_QueryDeviceId as well as clean up the code, fix indentation and broken if/else cases - Add some ASSERTs and comments Modified: trunk/reactos/drivers/bus/acpi/buspdo.c trunk/reactos/drivers/bus/acpi/main.c Modified: trunk/reactos/drivers/bus/acpi/buspdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?…
============================================================================== --- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Sat Jan 18 00:50:10 2014 @@ -419,6 +419,9 @@ switch (stack->Parameters.QueryId.IdType) { case BusQueryDeviceID: + + /* This is a REG_SZ value */ + if (DeviceData->AcpiHandle) { acpi_bus_get_device(DeviceData->AcpiHandle, &Device); @@ -437,9 +440,11 @@ L"ACPI\\FixedButton"); } - temp[++length] = UNICODE_NULL; - - buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); + temp[length++] = UNICODE_NULL; + + NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); + + buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); if (!buffer) { status = STATUS_INSUFFICIENT_RESOURCES; @@ -452,6 +457,9 @@ break; case BusQueryInstanceID: + + /* This is a REG_SZ value */ + /* See comment in BusQueryDeviceID case */ if(DeviceData->AcpiHandle) { @@ -466,10 +474,14 @@ length = swprintf(temp, L"%ls", L"0000"); } else + { /* FIXME: Generate unique id! */ length = swprintf(temp, L"%ls", L"0000"); - - temp[++length] = UNICODE_NULL; + } + + temp[length++] = UNICODE_NULL; + + NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof (WCHAR), 'IPCA'); if (!buffer) { @@ -483,6 +495,8 @@ break; case BusQueryHardwareIDs: + + /* This is a REG_MULTI_SZ value */ length = 0; /* See comment in BusQueryDeviceID case */ @@ -495,17 +509,6 @@ if (strcmp(Device->pnp.hardware_id, "Processor") == 0) { -/* - length += swprintf(&temp[length], - L"ACPI\\%s - %s", - ProcessorVendorIdentifier, ProcessorIdentifier); - length++; - - length += swprintf(&temp[length], - L"*%s - %s", - ProcessorVendorIdentifier, ProcessorIdentifier); - length++; -*/ length = ProcessorHardwareIds.Length / sizeof(WCHAR); src = ProcessorHardwareIds.Buffer; } @@ -514,40 +517,30 @@ length += swprintf(&temp[length], L"ACPI\\%hs", Device->pnp.hardware_id); - length++; + temp[length++] = UNICODE_NULL; length += swprintf(&temp[length], L"*%hs", Device->pnp.hardware_id); - length++; - - temp[length] = UNICODE_NULL; - - length++; - - temp[length] = UNICODE_NULL; - src = temp; - - } - } - else - { + temp[length++] = UNICODE_NULL; + temp[length++] = UNICODE_NULL; + src = temp; + } + } + else + { length += swprintf(&temp[length], L"ACPI\\FixedButton"); - length++; + temp[length++] = UNICODE_NULL; length += swprintf(&temp[length], L"*FixedButton"); - length++; - - temp[length] = UNICODE_NULL; - - length++; - - temp[length] = UNICODE_NULL; - src = temp; - } - + temp[length++] = UNICODE_NULL; + temp[length++] = UNICODE_NULL; + src = temp; + } + + NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); @@ -562,6 +555,8 @@ break; case BusQueryCompatibleIDs: + + /* This is a REG_MULTI_SZ value */ length = 0; status = STATUS_NOT_SUPPORTED; @@ -578,18 +573,15 @@ length += swprintf(&temp[length], L"ACPI\\%hs", Device->pnp.hardware_id); - length++; + temp[length++] = UNICODE_NULL; length += swprintf(&temp[length], L"*%hs", Device->pnp.hardware_id); - length++; - - temp[length] = UNICODE_NULL; - - length++; - - temp[length] = UNICODE_NULL; + temp[length++] = UNICODE_NULL; + temp[length++] = UNICODE_NULL; + + NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); if (!buffer) @@ -988,7 +980,7 @@ ResourceDescriptor->Flags = CM_RESOURCE_PORT_IO; ResourceDescriptor->u.Port.Start.QuadPart = io_data->Address; ResourceDescriptor->u.Port.Length = io_data->AddressLength; - + ResourceDescriptor++; break; } @@ -1118,7 +1110,7 @@ case ACPI_CACHABLE_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_CACHEABLE; break; case ACPI_WRITE_COMBINING_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_COMBINEDWRITE; break; case ACPI_PREFETCHABLE_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break; - } + } ResourceDescriptor->u.Memory.Start.QuadPart = addr64_data->Minimum; ResourceDescriptor->u.Memory.Length = addr64_data->AddressLength; } @@ -1163,7 +1155,7 @@ case ACPI_CACHABLE_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_CACHEABLE; break; case ACPI_WRITE_COMBINING_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_COMBINEDWRITE; break; case ACPI_PREFETCHABLE_MEMORY: ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break; - } + } ResourceDescriptor->u.Memory.Start.QuadPart = addr64_data->Minimum; ResourceDescriptor->u.Memory.Length = addr64_data->AddressLength; } @@ -1214,7 +1206,7 @@ ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE; ResourceDescriptor->u.Memory.Start.QuadPart = memfixed32_data->Address; ResourceDescriptor->u.Memory.Length = memfixed32_data->AddressLength; - + ResourceDescriptor++; break; } @@ -1466,7 +1458,7 @@ RequirementDescriptor->u.Port.Alignment = 1; RequirementDescriptor->u.Port.MinimumAddress.QuadPart = io_data->Address; RequirementDescriptor->u.Port.MaximumAddress.QuadPart = io_data->Address + io_data->AddressLength - 1; - + RequirementDescriptor++; break; } @@ -1607,7 +1599,7 @@ case ACPI_CACHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_CACHEABLE; break; case ACPI_WRITE_COMBINING_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_COMBINEDWRITE; break; case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break; - } + } RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr64_data->Minimum; RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1; RequirementDescriptor->u.Memory.Length = addr64_data->AddressLength; @@ -1656,7 +1648,7 @@ case ACPI_CACHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_CACHEABLE; break; case ACPI_WRITE_COMBINING_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_COMBINEDWRITE; break; case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break; - } + } RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr64_data->Minimum; RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1; RequirementDescriptor->u.Memory.Length = addr64_data->AddressLength; @@ -1714,7 +1706,7 @@ RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = fixedmem32_data->Address; RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = fixedmem32_data->Address + fixedmem32_data->AddressLength - 1; RequirementDescriptor->u.Memory.Length = fixedmem32_data->AddressLength; - + RequirementDescriptor++; break; } Modified: trunk/reactos/drivers/bus/acpi/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/main.c?re…
============================================================================== --- trunk/reactos/drivers/bus/acpi/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/main.c [iso-8859-1] Sat Jan 18 00:50:10 2014 @@ -225,7 +225,7 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); } - + NTSTATUS NTAPI @@ -372,18 +372,27 @@ ULONG BufferLength = 0; NTSTATUS Status; - RtlInitUnicodeString(&Name, - ValueName); + RtlInitUnicodeString(&Name, ValueName); if (DataLength != NULL) BufferLength = *DataLength; - BufferLength += FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); - - /* Allocate memory for the value */ - ValueInfo = ExAllocatePoolWithTag(PagedPool, BufferLength, 'IPCA'); - if (ValueInfo == NULL) - return STATUS_NO_MEMORY; + /* Check if the caller provided a valid buffer */ + if ((Data != NULL) && (BufferLength != 0)) + { + BufferLength += FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); + + /* Allocate memory for the value */ + ValueInfo = ExAllocatePoolWithTag(PagedPool, BufferLength, 'IPCA'); + if (ValueInfo == NULL) + return STATUS_NO_MEMORY; + } + else + { + /* Caller didn't provide a valid buffer, assume he wants the size only */ + ValueInfo = NULL; + BufferLength = 0; + } /* Query the value */ Status = ZwQueryValueKey(KeyHandle, @@ -392,26 +401,37 @@ ValueInfo, BufferLength, &BufferLength); - if ((NT_SUCCESS(Status)) || (Status == STATUS_BUFFER_OVERFLOW)) + + if (DataLength != NULL) + *DataLength = BufferLength; + + /* Check if we have the size only */ + if (ValueInfo == NULL) + { + /* Check for unexpected status */ + if ((Status != STATUS_BUFFER_OVERFLOW) && + (Status != STATUS_BUFFER_TOO_SMALL)) + { + return Status; + } + + /* All is well */ + Status = STATUS_SUCCESS; + } + /* Otherwise the caller wanted data back, check if we got it */ + else if (NT_SUCCESS(Status)) { if (Type != NULL) *Type = ValueInfo->Type; - if (DataLength != NULL) - *DataLength = ValueInfo->DataLength; - } - - /* Check if the caller wanted data back, and we got it */ - if ((NT_SUCCESS(Status)) && (Data != NULL)) - { /* Copy it */ - RtlMoveMemory(Data, - ValueInfo->Data, - ValueInfo->DataLength); + RtlMoveMemory(Data, ValueInfo->Data, ValueInfo->DataLength); /* if the type is REG_SZ and data is not 0-terminated * and there is enough space in the buffer NT appends a \0 */ - if (((ValueInfo->Type == REG_SZ) || (ValueInfo->Type == REG_EXPAND_SZ) || (ValueInfo->Type == REG_MULTI_SZ)) && + if (((ValueInfo->Type == REG_SZ) || + (ValueInfo->Type == REG_EXPAND_SZ) || + (ValueInfo->Type == REG_MULTI_SZ)) && (ValueInfo->DataLength <= *DataLength - sizeof(WCHAR))) { WCHAR *ptr = (WCHAR *)((ULONG_PTR)Data + ValueInfo->DataLength); @@ -421,10 +441,10 @@ } /* Free the memory and return status */ - ExFreePoolWithTag(ValueInfo, 'IPCA'); - - if ((Data == NULL) && (Status == STATUS_BUFFER_OVERFLOW)) - Status = STATUS_SUCCESS; + if (ValueInfo != NULL) + { + ExFreePoolWithTag(ValueInfo, 'IPCA'); + } return Status; } @@ -438,13 +458,15 @@ LPWSTR HardwareIdsBuffer = NULL; HANDLE ProcessorHandle = NULL; ULONG Length, Level1Length = 0, Level2Length = 0, Level3Length = 0; - ULONG HardwareIdsLength = 0; + SIZE_T HardwareIdsLength = 0; + SIZE_T VendorIdentifierLength; ULONG i; PWCHAR Ptr; NTSTATUS Status; DPRINT1("GetProcessorInformation()\n"); + /* Open the key for CPU 0 */ Status = AcpiRegOpenKey(NULL, L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0", KEY_READ, @@ -452,84 +474,93 @@ if (!NT_SUCCESS(Status)) goto done; - AcpiRegQueryValue(ProcessorHandle, - L"Identifier", - NULL, - NULL, - &Length); - - if (Length != 0) - { - ProcessorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); - if (ProcessorIdentifier == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - Status = AcpiRegQueryValue(ProcessorHandle, - L"Identifier", - NULL, - ProcessorIdentifier, - &Length); - if (!NT_SUCCESS(Status)) - goto done; - - Length = 0; - } - - AcpiRegQueryValue(ProcessorHandle, - L"ProcessorNameString", - NULL, - NULL, - &Length); - - if (Length != 0) - { - ProcessorNameString = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); - if (ProcessorNameString == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - Status = AcpiRegQueryValue(ProcessorHandle, - L"ProcessorNameString", - NULL, - ProcessorNameString, - &Length); - if (!NT_SUCCESS(Status)) - goto done; - - Length = 0; - } - - AcpiRegQueryValue(ProcessorHandle, - L"VendorIdentifier", - NULL, - NULL, - &Length); - - if (Length != 0) - { - ProcessorVendorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); - if (ProcessorVendorIdentifier == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - Status = AcpiRegQueryValue(ProcessorHandle, - L"VendorIdentifier", - NULL, - ProcessorVendorIdentifier, - &Length); - if (!NT_SUCCESS(Status)) - goto done; - - Length = 0; - } - + /* Query the processor identifier length */ + Status = AcpiRegQueryValue(ProcessorHandle, + L"Identifier", + NULL, + NULL, + &Length); + if (!NT_SUCCESS(Status)) + goto done; + + /* Remember the length as fallback for level 1-3 length */ + Level1Length = Level2Length = Level3Length = Length; + + /* Allocate a buffer large enough to be zero terminated */ + Length += sizeof(UNICODE_NULL); + ProcessorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); + if (ProcessorIdentifier == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Query the processor identifier string */ + Status = AcpiRegQueryValue(ProcessorHandle, + L"Identifier", + NULL, + ProcessorIdentifier, + &Length); + if (!NT_SUCCESS(Status)) + goto done; + + /* Query the processor name length */ + Length = 0; + Status = AcpiRegQueryValue(ProcessorHandle, + L"ProcessorNameString", + NULL, + NULL, + &Length); + if (!NT_SUCCESS(Status)) + goto done; + + /* Allocate a buffer large enough to be zero terminated */ + Length += sizeof(UNICODE_NULL); + ProcessorNameString = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); + if (ProcessorNameString == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Query the processor name string */ + Status = AcpiRegQueryValue(ProcessorHandle, + L"ProcessorNameString", + NULL, + ProcessorNameString, + &Length); + if (!NT_SUCCESS(Status)) + goto done; + + /* Query the vendor identifier length */ + Length = 0; + Status = AcpiRegQueryValue(ProcessorHandle, + L"VendorIdentifier", + NULL, + NULL, + &Length); + if (!NT_SUCCESS(Status) || (Length == 0)) + goto done; + + /* Allocate a buffer large enough to be zero terminated */ + Length += sizeof(UNICODE_NULL); + ProcessorVendorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); + if (ProcessorVendorIdentifier == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Query the vendor identifier string */ + Status = AcpiRegQueryValue(ProcessorHandle, + L"VendorIdentifier", + NULL, + ProcessorVendorIdentifier, + &Length); + if (!NT_SUCCESS(Status)) + goto done; + + /* Change spaces to underscores */ for (i = 0; i < wcslen(ProcessorIdentifier); i++) { if (ProcessorIdentifier[i] == L' ') @@ -557,15 +588,19 @@ Level3Length = (ULONG)(Ptr - ProcessorIdentifier); } - HardwareIdsLength = 5 + wcslen(ProcessorVendorIdentifier) + 3 + Level1Length + 1 + - 1 + wcslen(ProcessorVendorIdentifier) + 3 + Level1Length + 1 + - 5 + wcslen(ProcessorVendorIdentifier) + 3 + Level2Length + 1 + - 1 + wcslen(ProcessorVendorIdentifier) + 3 + Level2Length + 1 + - 5 + wcslen(ProcessorVendorIdentifier) + 3 + Level3Length + 1 + - 1 + wcslen(ProcessorVendorIdentifier) + 3 + Level3Length + 1 + - 2; - - HardwareIdsBuffer = ExAllocatePoolWithTag(PagedPool, HardwareIdsLength * sizeof(WCHAR), 'IPCA'); + VendorIdentifierLength = (USHORT)wcslen(ProcessorVendorIdentifier); + + /* Calculate the size of the full REG_MULTI_SZ data (see swprintf below) */ + HardwareIdsLength = (5 + VendorIdentifierLength + 3 + Level1Length + 1 + + 1 + VendorIdentifierLength + 3 + Level1Length + 1 + + 5 + VendorIdentifierLength + 3 + Level2Length + 1 + + 1 + VendorIdentifierLength + 3 + Level2Length + 1 + + 5 + VendorIdentifierLength + 3 + Level3Length + 1 + + 1 + VendorIdentifierLength + 3 + Level3Length + 1 + + 1) * sizeof(WCHAR); + + /* Allocate a buffer to the data */ + HardwareIdsBuffer = ExAllocatePoolWithTag(PagedPool, HardwareIdsLength, 'IPCA'); if (HardwareIdsBuffer == NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -574,25 +609,28 @@ Length = 0; Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); - Length++; + HardwareIdsBuffer[Length++] = UNICODE_NULL; Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); - Length++; + HardwareIdsBuffer[Length++] = UNICODE_NULL; Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); - Length++; + HardwareIdsBuffer[Length++] = UNICODE_NULL; Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); - Length++; + HardwareIdsBuffer[Length++] = UNICODE_NULL; Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); - Length++; + HardwareIdsBuffer[Length++] = UNICODE_NULL; Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); - Length++; - HardwareIdsBuffer[Length] = UNICODE_NULL; - - ProcessorHardwareIds.Length = HardwareIdsLength * sizeof(WCHAR); + HardwareIdsBuffer[Length++] = UNICODE_NULL; + HardwareIdsBuffer[Length++] = UNICODE_NULL; + + /* Make sure we counted correctly */ + NT_ASSERT(Length * sizeof(WCHAR) == HardwareIdsLength); + + ProcessorHardwareIds.Length = (SHORT)HardwareIdsLength; ProcessorHardwareIds.MaximumLength = ProcessorHardwareIds.Length; ProcessorHardwareIds.Buffer = HardwareIdsBuffer; @@ -622,9 +660,15 @@ PUNICODE_STRING RegistryPath ) { + NTSTATUS Status; DPRINT("Driver Entry \n"); - GetProcessorInformation(); + Status = GetProcessorInformation(); + if (!NT_SUCCESS(Status)) + { + NT_ASSERT(FALSE); + return Status; + } // // Set entry points into the driver
10 years, 11 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
43
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
Results per page:
10
25
50
100
200