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
December 2005
----- 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
40 participants
704 discussions
Start a n
N
ew thread
[hpoussin] 20487: Implement VideoPortGetAssociatedDeviceExtension and VideoPortCheckForDeviceExistence
by hpoussin@svn.reactos.org
Implement VideoPortGetAssociatedDeviceExtension and VideoPortCheckForDeviceExistence Modified: trunk/reactos/drivers/video/videoprt/agp.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.h _____ Modified: trunk/reactos/drivers/video/videoprt/agp.c --- trunk/reactos/drivers/video/videoprt/agp.c 2005-12-31 15:54:25 UTC (rev 20486) +++ trunk/reactos/drivers/video/videoprt/agp.c 2005-12-31 16:01:02 UTC (rev 20487) @@ -27,7 +27,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ -STATIC NTSTATUS +NTSTATUS IopInitiatePnpIrp( PDEVICE_OBJECT DeviceObject, PIO_STATUS_BLOCK IoStatusBlock, _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.c --- trunk/reactos/drivers/video/videoprt/videoprt.c 2005-12-31 15:54:25 UTC (rev 20486) +++ trunk/reactos/drivers/video/videoprt/videoprt.c 2005-12-31 16:01:02 UTC (rev 20487) @@ -22,6 +22,7 @@ */ #include "videoprt.h" +#include <wdmguid.h> /* GLOBAL VARIABLES ***********************************************************/ @@ -738,11 +739,6 @@ DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); - if (IsParameterFileName) - { - UNIMPLEMENTED; - } - Context.HwDeviceExtension = HwDeviceExtension; Context.HwContext = HwContext; Context.HwGetRegistryRoutine = GetRegistryRoutine; @@ -758,12 +754,21 @@ QueryTable[1].QueryRoutine = NULL; QueryTable[1].Name = NULL; - return NT_SUCCESS(RtlQueryRegistryValues( + if (!NT_SUCCESS(RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, DeviceExtension->RegistryPath.Buffer, QueryTable, &Context, - NULL)) ? ERROR_SUCCESS : ERROR_INVALID_PARAMETER; + NULL))) + return ERROR_INVALID_PARAMETER; + + if (IsParameterFileName) + { + /* FIXME: need to read the contents of the file */ + UNIMPLEMENTED; + } + + return ERROR_SUCCESS; } /* @@ -1077,14 +1082,19 @@ } /* - * @unimplemented + * @implemented */ PVOID NTAPI VideoPortGetAssociatedDeviceExtension(IN PVOID DeviceObject) { - DPRINT1("VideoPortGetAssociatedDeviceExtension: Unimplemented.\n"); - return NULL; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + + DPRINT("VideoPortGetAssociatedDeviceExtension\n"); + DeviceExtension = ((PDEVICE_OBJECT)DeviceObject)->DeviceExtension; + if (!DeviceExtension) + return NULL; + return DeviceExtension->MiniPortDeviceExtension; } /* @@ -1126,7 +1136,7 @@ } /* - * @unimplemented + * @implemented */ BOOLEAN NTAPI @@ -1139,8 +1149,51 @@ IN USHORT SubSystemId, IN ULONG Flags) { - DPRINT1("VideoPortCheckForDeviceExistence: Unimplemented.\n"); - return TRUE; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PCI_DEVICE_PRESENT_INTERFACE PciDevicePresentInterface; + IO_STATUS_BLOCK IoStatusBlock; + IO_STACK_LOCATION IoStack; + ULONG PciFlags = 0; + NTSTATUS Status; + BOOL DevicePresent; + + DPRINT("VideoPortCheckForDeviceExistence\n"); + + if (Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS)) + { + DPRINT1("VideoPortCheckForDeviceExistence: Unknown flags 0x%lx\n", Flags & ~(CDE_USE_REVISION | CDE_USE_SUBSYSTEM_IDS)); + return FALSE; + } + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + + PciDevicePresentInterface.Size = sizeof(PCI_DEVICE_PRESENT_INTERFACE); + PciDevicePresentInterface.Version = 1; + IoStack.Parameters.QueryInterface.Size = PciDevicePresentInterface.Size; + IoStack.Parameters.QueryInterface.Version = PciDevicePresentInterface.Version; + IoStack.Parameters.QueryInterface.Interface = (PINTERFACE)&PciDevicePresentInterface; + IoStack.Parameters.QueryInterface.InterfaceType = + &GUID_PCI_DEVICE_PRESENT_INTERFACE; + Status = IopInitiatePnpIrp(DeviceExtension->NextDeviceObject, + &IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack); + if (!NT_SUCCESS(Status)) + { + DPRINT("IopInitiatePnpIrp() failed! (Status 0x%lx)\n", Status); + return FALSE; + } + + if (Flags & CDE_USE_REVISION) + PciFlags |= PCI_USE_REVISION; + if (Flags & CDE_USE_SUBSYSTEM_IDS) + PciFlags |= PCI_USE_SUBSYSTEM_IDS; + + DevicePresent = PciDevicePresentInterface.IsDevicePresent( + VendorId, DeviceId, RevisionId, + SubVendorId, SubSystemId, PciFlags); + + PciDevicePresentInterface.InterfaceDereference(PciDevicePresentInterface .Context); + + return DevicePresent; } /* _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.h --- trunk/reactos/drivers/video/videoprt/videoprt.h 2005-12-31 15:54:25 UTC (rev 20486) +++ trunk/reactos/drivers/video/videoprt/videoprt.h 2005-12-31 16:01:02 UTC (rev 20487) @@ -108,6 +108,13 @@ /* agp.c */ +NTSTATUS +IopInitiatePnpIrp( + PDEVICE_OBJECT DeviceObject, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG MinorFunction, + PIO_STACK_LOCATION Stack OPTIONAL); + NTSTATUS NTAPI IntAgpGetInterface( IN PVOID HwDeviceExtension,
18 years, 11 months
1
0
0
0
[mf] 20486: flatten Entry/ShellEntry class hierarchy
by mf@svn.reactos.org
flatten Entry/ShellEntry class hierarchy Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/globals.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. h _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -86,35 +86,6 @@ } -bool FileTypeManager::is_exe_file(LPCTSTR ext) -{ - static const LPCTSTR s_executable_extensions[] = { - TEXT("COM"), - TEXT("EXE"), - TEXT("BAT"), - TEXT("CMD"), - TEXT("CMM"), - TEXT("BTM"), - TEXT("AWK"), - 0 - }; - - TCHAR ext_buffer[_MAX_EXT]; - const LPCTSTR* p; - LPCTSTR s; - LPTSTR d; - - for(s=ext+1,d=ext_buffer; (*d=toupper(*s)); s++) - ++d; - - for(p=s_executable_extensions; *p; p++) - if (!lstrcmp(ext_buffer, *p)) - return true; - - return false; -} - - const FileTypeInfo& FileTypeManager::operator[](String ext) { _tcslwr((LPTSTR)ext.c_str()); @@ -149,7 +120,7 @@ return ftype; } -LPCTSTR FileTypeManager::set_type(Entry* entry, bool dont_hide_ext) +LPCTSTR FileTypeManager::set_type(ShellEntry* entry, bool dont_hide_ext) { LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.')); @@ -163,9 +134,6 @@ _tcsncpy(entry->_display_name, entry->_data.cFileName, len); entry->_display_name[len] = TEXT('\0'); } - - if (is_exe_file(ext)) - entry->_data.dwFileAttributes |= ATTRIBUTE_EXECUTABLE; } return ext; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 15:54:25 UTC (rev 20486) @@ -406,10 +406,6 @@ # End Source File # Begin Source File -SOURCE=.\shell\shellfs.h -# End Source File -# Begin Source File - SOURCE=.\shell\startup.c # SUBTRACT CPP /YX /Yc /Yu # End Source File _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 15:54:25 UTC (rev 20486) @@ -34,7 +34,6 @@ #include "utility/shellclasses.h" #include "shell/entries.h" -#include "shell/shellfs.h" #include "utility/window.h" _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/globals.h --- branches/lean-explorer/reactos/subsys/system/explorer/globals.h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/globals.h 2005-12-31 15:54:25 UTC (rev 20486) @@ -39,9 +39,7 @@ const FileTypeInfo& operator[](String ext); - static bool is_exe_file(LPCTSTR ext); - - LPCTSTR set_type(struct Entry* entry, bool dont_hide_ext=false); + LPCTSTR set_type(struct ShellEntry* entry, bool dont_hide_ext=false); }; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -30,7 +30,7 @@ // allocate and initialise a directory entry -Entry::Entry() +ShellEntry::ShellEntry() { _up = NULL; _next = NULL; @@ -42,9 +42,10 @@ _display_name = _data.cFileName; } -Entry::Entry(Entry* parent) - : _up(parent) +ShellEntry::ShellEntry(LPITEMIDLIST shell_path) + : _pidl(shell_path) { + _up = NULL; _next = NULL; _down = NULL; _expanded = false; @@ -54,10 +55,51 @@ _display_name = _data.cFileName; } -Entry::Entry(const Entry& other) +ShellEntry::ShellEntry(const ShellPath& shell_path) + : _pidl(shell_path) { + _up = NULL; _next = NULL; _down = NULL; + _expanded = false; + _scanned = false; + _level = 0; + _icon_id = ICID_UNKNOWN; + _display_name = _data.cFileName; +} + + +ShellEntry::ShellEntry(ShellDirectory* parent, const ShellPath& shell_path) + : _up(parent), + _pidl(shell_path) +{ + _next = NULL; + _down = NULL; + _expanded = false; + _scanned = false; + _level = 0; + _icon_id = ICID_UNKNOWN; + _display_name = _data.cFileName; +} + +ShellEntry::ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path) + : _up(parent), + _pidl(shell_path) +{ + _next = NULL; + _down = NULL; + _expanded = false; + _scanned = false; + _level = 0; + _icon_id = ICID_UNKNOWN; + _display_name = _data.cFileName; +} + +ShellEntry::ShellEntry(const ShellEntry& other) + : _pidl(other._pidl) +{ + _next = NULL; + _down = NULL; _up = NULL; assert(!other._next); @@ -77,7 +119,7 @@ } // free a directory entry -Entry::~Entry() +ShellEntry::~ShellEntry() { if (_icon_id > ICID_NONE) g_Globals._icon_cache.free_icon(_icon_id); @@ -88,24 +130,27 @@ // read directory tree and expand to the given location -Entry* Entry::read_tree(const void* path, SORT_ORDER sortOrder) +ShellEntry* ShellDirectory::read_tree(const void* path, SORT_ORDER sortOrder) { - CONTEXT("Entry::read_tree()"); + CONTEXT("ShellEntry::read_tree()"); HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); - Entry* entry = this; + ShellDirectory* entry = this; for(const void*p=path; p && entry; ) { + if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + break; + entry->read_directory(sortOrder); if (entry->_down) entry->_expanded = true; - Entry* next_entry = entry->find_entry(p); + ShellEntry* next_entry = entry->find_entry(p); p = entry->get_next_path_component(p); - entry = next_entry; + entry = static_cast<ShellDirectory*>(next_entry); } SetCursor(old_cursor); @@ -114,19 +159,21 @@ } -void Entry::read_directory(SORT_ORDER sortOrder, int scan_flags) +void ShellDirectory::read_directory(SORT_ORDER sortOrder, int scan_flags) { - CONTEXT("Entry::read_directory(SORT_ORDER)"); + CONTEXT("ShellEntry::read_directory(SORT_ORDER)"); // call into subclass read_directory(scan_flags); #ifndef ROSSHELL if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu. - for(Entry*entry=_down; entry; entry=entry->_next) + for(ShellEntry*entry=_down; entry; entry=entry->_next) if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - entry->read_directory(scan_flags); - entry->sort_directory(sortOrder); + ShellDirectory* dir = static_cast<ShellDirectory*>(entry); + + dir->read_directory(scan_flags); + dir->sort_directory(sortOrder); } } #endif @@ -170,8 +217,8 @@ static int compareName(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data; - const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data; + const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data; + const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data; int cmp = compareType(fd1, fd2); if (cmp) @@ -182,8 +229,8 @@ static int compareExt(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data; - const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data; + const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data; + const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data; const TCHAR *name1, *name2, *ext1, *ext2; int cmp = compareType(fd1, fd2); @@ -215,8 +262,8 @@ static int compareSize(const void* arg1, const void* arg2) { - WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data; - WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data; + WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data; + WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data; int cmp = compareType(fd1, fd2); if (cmp) @@ -236,8 +283,8 @@ static int compareDate(const void* arg1, const void* arg2) { - WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data; - WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data; + WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data; + WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data; int cmp = compareType(fd1, fd2); if (cmp) @@ -256,11 +303,11 @@ }; -void Entry::sort_directory(SORT_ORDER sortOrder) +void ShellDirectory::sort_directory(SORT_ORDER sortOrder) { if (sortOrder != SORT_NONE) { - Entry* entry = _down; - Entry** array, **p; + ShellEntry* entry = _down; + ShellEntry** array, **p; int len; len = 0; @@ -268,7 +315,7 @@ ++len; if (len) { - array = (Entry**) alloca(len*sizeof(Entry*)); + array = (ShellEntry**) alloca(len*sizeof(ShellEntry*)); p = array; for(entry=_down; entry; entry=entry->_next) @@ -288,9 +335,9 @@ } -void Entry::smart_scan(int scan_flags) +void ShellDirectory::smart_scan(int scan_flags) { - CONTEXT("Entry::smart_scan()"); + CONTEXT("ShellEntry::smart_scan()"); if (!_scanned) { free_subentries(); @@ -299,7 +346,7 @@ } -int Entry::extract_icon() +int ShellEntry::extract_icon() { TCHAR path[MAX_PATH]; @@ -367,7 +414,7 @@ return icon_id; } -int Entry::safe_extract_icon() +int ShellEntry::safe_extract_icon() { try { return extract_icon(); @@ -379,82 +426,10 @@ } -BOOL Entry::launch_entry(HWND hwnd, UINT nCmdShow) -{ - TCHAR cmd[MAX_PATH]; - - if (!get_path(cmd)) - return FALSE; - - // add path to the recent file list - SHAddToRecentDocs(SHARD_PATH, cmd); - - // start program, open document... - return launch_file(hwnd, cmd, nCmdShow); -} - - -HRESULT Entry::GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut) -{ - TCHAR path[MAX_PATH]; -/* - if (!get_path(path)) - return E_FAIL; - - ShellPath shell_path(path); - - IShellFolder* pFolder; - LPCITEMIDLIST pidl_last = NULL; - - static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent"); - - if (!SHBindToParent) - return E_NOTIMPL; - - HRESULT hr = (*SHBindToParent)(shell_path, IID_IShellFolder, (LPVOID*)&pFolder, &pidl_last); - if (FAILED(hr)) - return hr; - - ShellFolder shell_folder(pFolder); - - shell_folder->Release(); - - return shell_folder->GetUIObjectOf(hWnd, 1, &pidl_last, riid, NULL, ppvOut); -*/ - if (!_up) - return E_INVALIDARG; - - if (!_up->get_path(path)) - return E_FAIL; - - ShellPath shell_path(path); - ShellFolder shell_folder(shell_path); - -#ifdef UNICODE - LPWSTR wname = _data.cFileName; -#else - WCHAR wname[MAX_PATH]; - MultiByteToWideChar(CP_ACP, 0, _data.cFileName, -1, wname, MAX_PATH); -#endif - - LPITEMIDLIST pidl_last = NULL; - HRESULT hr = shell_folder->ParseDisplayName(hWnd, NULL, wname, NULL, &pidl_last, NULL); - - if (FAILED(hr)) - return hr; - - hr = shell_folder->GetUIObjectOf(hWnd, 1, (LPCITEMIDLIST*)&pidl_last, riid, NULL, ppvOut); - - ShellMalloc()->Free((void*)pidl_last); - - return hr; -} - - // recursively free all child entries -void Entry::free_subentries() +void ShellEntry::free_subentries() { - Entry *entry, *next=_down; + ShellEntry *entry, *next=_down; if (next) { _down = 0; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 15:54:25 UTC (rev 20486) @@ -1,5 +1,5 @@ /* - * Copyright 2003, 2004 Martin Fuchs + * Copyright 2003, 2004, 2005 Martin Fuchs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,28 +40,32 @@ }; #ifndef ATTRIBUTE_SYMBOLIC_LINK -#define ATTRIBUTE_LONGNAME 0x08000000 -#define ATTRIBUTE_VOLNAME 0x10000000 -#define ATTRIBUTE_ERASED 0x20000000 #define ATTRIBUTE_SYMBOLIC_LINK 0x40000000 #define ATTRIBUTE_EXECUTABLE 0x80000000 #endif - /// base of all file and directory entries -struct Entry +struct ShellDirectory; + + + /// base of all file entries +struct ShellEntry { + ShellEntry(); + ShellEntry(const ShellEntry& other); + ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path); + ShellEntry(ShellDirectory* parent, const ShellPath& shell_path); + protected: - Entry(); - Entry(Entry* parent); - Entry(const Entry&); + ShellEntry(LPITEMIDLIST shell_path); + ShellEntry(const ShellPath& shell_path); public: - virtual ~Entry(); + virtual ~ShellEntry(); - Entry* _next; - Entry* _down; - Entry* _up; + ShellEntry* _next; + ShellEntry* _down; + ShellDirectory* _up; bool _expanded; bool _scanned; @@ -74,22 +78,19 @@ int /*ICON_ID*/ _icon_id; + ShellPath _pidl; // parent relative PIDL + void free_subentries(); - void read_directory(SORT_ORDER sortOrder, int scan_flags=0); - Entry* read_tree(const void* path, SORT_ORDER sortOrder); - void sort_directory(SORT_ORDER sortOrder); - void smart_scan(int scan_flags=0); int extract_icon(); int safe_extract_icon(); - virtual void read_directory(int scan_flags=0) {} - virtual const void* get_next_path_component(const void*) const {return NULL;} - virtual Entry* find_entry(const void*) {return NULL;} - virtual bool get_path(PTSTR path) const = 0; - virtual ShellPath create_absolute_pidl() const {return (LPCITEMIDLIST)NULL;} - virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut); - virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL); + virtual bool get_path(PTSTR path) const; + ShellPath create_absolute_pidl() const; + BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL); + HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut); + + IShellFolder* get_parent_folder() const; }; @@ -103,12 +104,92 @@ }; + /// shell folder entry +struct ShellDirectory : public ShellEntry, public Directory +{ + ShellDirectory(ShellFolder& root_folder, const ShellPath& shell_path, HWND hwnd) + : ShellEntry(shell_path), + _folder(root_folder, shell_path), + _hwnd(hwnd) + { + CONTEXT("ShellDirectory::ShellDirectory()"); + + lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORPARSING)); + _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; + _shell_attribs = SFGAO_FOLDER; + + ShellFolder subfolder(root_folder, shell_path); + IShellFolder* pFolder = subfolder; + pFolder->AddRef(); + _path = pFolder; + } + + explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST shell_path, HWND hwnd) + : ShellEntry(parent, shell_path), + _folder(parent->_folder, shell_path), + _hwnd(hwnd) + { + /* not neccessary - the caller will fill the info + lstrcpy(_data.cFileName, _folder.get_name(shell_path)); + _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; + _shell_attribs = SFGAO_FOLDER; */ + + _folder->AddRef(); + _path = _folder; + } + + ShellDirectory(const ShellDirectory& other) + : ShellEntry(other), + Directory(other), + _folder(other._folder), + _hwnd(other._hwnd) + { + IShellFolder* pFolder = (IShellFolder*)_path; + pFolder->AddRef(); + } + + ~ShellDirectory() + { + IShellFolder* pFolder = (IShellFolder*)_path; + _path = NULL; + pFolder->Release(); + } + + ShellEntry* read_tree(const void* path, SORT_ORDER sortOrder); + void read_directory(SORT_ORDER sortOrder, int scan_flags=0); + void read_directory(int scan_flags=0); + void sort_directory(SORT_ORDER sortOrder); + void smart_scan(int scan_flags=0); + virtual const void* get_next_path_component(const void*) const; + virtual ShellEntry* find_entry(const void* p); + + virtual bool get_path(PTSTR path) const; + + int extract_icons(); + + ShellFolder _folder; + HWND _hwnd; + +protected: + void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, bool do_access=true); +}; + + +inline IShellFolder* ShellEntry::get_parent_folder() const +{ + if (_up) + return static_cast<ShellDirectory*>(_up)->_folder; + else + return GetDesktopFolder(); +} + + /// root entry for file system trees struct Root { Root(); ~Root(); - Entry* _entry; + ShellDirectory* _entry; TCHAR _path[MAX_PATH]; TCHAR _volname[_MAX_FNAME]; TCHAR _fs[_MAX_DIR]; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -201,9 +201,9 @@ LPARAM itemData = TreeView_GetItemData(hwndTreeView, hItem); if (itemData) { - Entry* entry = (Entry*)itemData; + ShellEntry* entry = (ShellEntry*)itemData; - ShellDirectory* dir = static_cast<ShellDirectory*>(entry->_up); + ShellDirectory* dir = entry->_up; ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl; @@ -238,7 +238,7 @@ } } -int ShellBrowserChild::get_entry_image(Entry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache) +int ShellBrowserChild::get_entry_image(ShellEntry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache) { SHFILEINFO sfi; int idx = -1; @@ -296,7 +296,7 @@ } } -int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry) +int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, ShellDirectory* dir) { CONTEXT("ShellBrowserChild::InsertSubitems()"); @@ -307,15 +307,21 @@ SendMessage(_left_hwnd, WM_SETREDRAW, FALSE, 0); try { - entry->smart_scan(); + dir->smart_scan(); } catch(COMException& e) { HandleException(e, g_Globals._hMainWnd); } + // remove old children items + for(HTREEITEM hchild,hnext=TreeView_GetChild(_left_hwnd, hParentItem); hchild=hnext; ) { + hnext = TreeView_GetNextSibling(_left_hwnd, hchild); + TreeView_DeleteItem(_left_hwnd, hchild); + } + TV_ITEM tvItem; TV_INSERTSTRUCT tvInsert; - for(entry=entry->_down; entry; entry=entry->_next) { + for(ShellEntry*entry=dir->_down; entry; entry=entry->_next) { #ifndef _LEFT_FILES if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) #endif @@ -354,7 +360,7 @@ CONTEXT("ShellBrowserChild::OnTreeItemSelected()"); _last_sel = pnmtv->itemNew.hItem; - Entry* entry = (Entry*)pnmtv->itemNew.lParam; + ShellDirectory* entry = (ShellDirectory*)pnmtv->itemNew.lParam; jump_to(entry); } @@ -583,7 +589,7 @@ UINT firstOffset = pida->aoffset[1]; LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset); - Entry* entry = parent->find_entry(pidl); + ShellEntry* entry = parent->find_entry(pidl); if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) if (expand_folder(static_cast<ShellDirectory*>(entry))) @@ -639,10 +645,10 @@ void ShellBrowserChild::jump_to(LPCITEMIDLIST pidl) { - Entry* entry = NULL; + ShellDirectory* entry = NULL; if (!_cur_dir) - _cur_dir = static_cast<ShellDirectory*>(_root._entry); + _cur_dir = _root._entry; if (_cur_dir) { static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24); @@ -655,7 +661,7 @@ _cur_dir->smart_scan(); - entry = _cur_dir->find_entry(child_pidl); + entry = static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl)); if (!entry) break; @@ -664,7 +670,7 @@ } else { _cur_dir->smart_scan(); - entry = _cur_dir->find_entry(pidl); // This is not correct in the common case, but works on the desktop level. + entry = static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl)); // This is not correct in the common case, but works on the desktop level. if (entry) jump_to(entry); @@ -676,10 +682,10 @@ UpdateFolderView(ShellFolder(pidl)); } -void ShellBrowserChild::jump_to(Entry* entry) +void ShellBrowserChild::jump_to(ShellDirectory* entry) { IShellFolder* folder; - ShellDirectory* se = static_cast<ShellDirectory*>(entry); + ShellDirectory* se = entry; if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) folder = static_cast<ShellDirectory*>(se)->_folder; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 15:54:25 UTC (rev 20486) @@ -102,8 +102,6 @@ return E_NOTIMPL; } - const Root& get_root() const {return _root;} - protected: HWND _hwnd; HWND _left_hwnd; @@ -128,7 +126,7 @@ LRESULT Init(); void InitializeTree(); - int InsertSubitems(HTREEITEM hParentItem, Entry* entry); + int InsertSubitems(HTREEITEM hParentItem, ShellDirectory* dir); bool InitDragDrop(); HRESULT OnDefaultCommand(LPIDA pida); @@ -152,16 +150,16 @@ void jump_to(LPCTSTR path); void jump_to(LPCITEMIDLIST pidl); - void jump_to(Entry* entry); + void jump_to(ShellDirectory* entry); protected: ShellDirectory* _cur_dir; CtxMenuInterfaces& _cm_ifs; - typedef map<Entry*, int> ImageMap; + typedef map<ShellEntry*, int> ImageMap; ImageMap _image_map; ImageMap _image_map_open; - int get_entry_image(Entry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache); + int get_entry_image(ShellEntry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache); void invalidate_cache(); }; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -195,8 +195,8 @@ int level = _level + 1; - Entry* first_entry = NULL; - Entry* last = NULL; + ShellEntry* first_entry = NULL; + ShellEntry* last = NULL; /*if (_folder.empty()) return;*/ @@ -251,7 +251,7 @@ fill_w32fdata_shell(pidls[n], attribs, &w32fd, !(scan_flags&SCAN_DONT_ACCESS)&&!removeable); try { - Entry* entry = NULL; // eliminate useless GCC warning by initializing entry + ShellEntry* entry = NULL; // eliminate useless GCC warning by initializing entry if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry = new ShellDirectory(this, pidls[n], _hwnd); @@ -319,11 +319,11 @@ return pidl; } -Entry* ShellDirectory::find_entry(const void* p) +ShellEntry* ShellDirectory::find_entry(const void* p) { LPITEMIDLIST pidl = (LPITEMIDLIST) p; - for(Entry*entry=_down; entry; entry=entry->_next) { + for(ShellEntry*entry=_down; entry; entry=entry->_next) { ShellEntry* se = static_cast<ShellEntry*>(entry); if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb)) @@ -337,7 +337,7 @@ { int cnt = 0; - for(Entry*entry=_down; entry; entry=entry->_next) + for(ShellEntry*entry=_down; entry; entry=entry->_next) if (entry->_icon_id == ICID_UNKNOWN) { entry->_icon_id = entry->extract_icon(); _____ Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 15:54:25 UTC (rev 20486) @@ -1,123 +0,0 @@ -/* - * Copyright 2003, 2004 Martin Fuchs - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - - // - // Explorer clone, lean version - // - // shellfs.h - // - // Martin Fuchs, 23.07.2003 - // - - - /// shell file/directory entry -struct ShellEntry : public Entry -{ - ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent), _pidl(shell_path) {} - ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent), _pidl(shell_path) {} - - virtual bool get_path(PTSTR path) const; - virtual ShellPath create_absolute_pidl() const; - virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL); - virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut); - - IShellFolder* get_parent_folder() const; - - ShellPath _pidl; // parent relative PIDL - -protected: - ShellEntry(LPITEMIDLIST shell_path) : _pidl(shell_path) {} - ShellEntry(const ShellPath& shell_path) : _pidl(shell_path) {} -}; - - - /// shell folder entry -struct ShellDirectory : public ShellEntry, public Directory -{ - ShellDirectory(ShellFolder& root_folder, const ShellPath& shell_path, HWND hwnd) - : ShellEntry(shell_path), - _folder(root_folder, shell_path), - _hwnd(hwnd) - { - CONTEXT("ShellDirectory::ShellDirectory()"); - - lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORPARSING)); - _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; - _shell_attribs = SFGAO_FOLDER; - - ShellFolder subfolder(root_folder, shell_path); - IShellFolder* pFolder = subfolder; - pFolder->AddRef(); - _path = pFolder; - } - - explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST shell_path, HWND hwnd) - : ShellEntry(parent, shell_path), - _folder(parent->_folder, shell_path), - _hwnd(hwnd) - { - /* not neccessary - the caller will fill the info - lstrcpy(_data.cFileName, _folder.get_name(shell_path)); - _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; - _shell_attribs = SFGAO_FOLDER; */ - - _folder->AddRef(); - _path = _folder; - } - - ShellDirectory(const ShellDirectory& other) - : ShellEntry(other), - Directory(other), - _folder(other._folder), - _hwnd(other._hwnd) - { - IShellFolder* pFolder = (IShellFolder*)_path; - pFolder->AddRef(); - } - - ~ShellDirectory() - { - IShellFolder* pFolder = (IShellFolder*)_path; - _path = NULL; - pFolder->Release(); - } - - virtual void read_directory(int scan_flags=0); - virtual const void* get_next_path_component(const void*) const; - virtual Entry* find_entry(const void* p); - - virtual bool get_path(PTSTR path) const; - - int extract_icons(); - - ShellFolder _folder; - HWND _hwnd; - -protected: - void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, bool do_access=true); -}; - - -inline IShellFolder* ShellEntry::get_parent_folder() const -{ - if (_up) - return static_cast<ShellDirectory*>(_up)->_folder; - else - return GetDesktopFolder(); -} _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -149,7 +149,7 @@ SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep); - for(Entry*entry=_dir->_down; entry; entry=entry->_next) { + for(ShellEntry*entry=_dir->_down; entry; entry=entry->_next) { // hide files like "desktop.ini" if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) continue; @@ -168,7 +168,7 @@ SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0); } -void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags) +void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, ShellEntry* entry, int flags) { TBADDBITMAP ab = {0, (UINT_PTR)hbmp}; int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab); _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.h --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.h 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.h 2005-12-31 15:54:25 UTC (rev 20486) @@ -47,7 +47,7 @@ HBITMAP _hbmp; String _title; - Entry* _entry; + ShellEntry* _entry; }; /// map for managing the task bar buttons @@ -80,6 +80,6 @@ int _size; void AddShortcuts(); - void AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags=TBSTATE_ENABLED); + void AddButton(int id, HBITMAP hbmp, LPCTSTR name, ShellEntry* entry, int flags=TBSTATE_ENABLED); void UpdateDesktopButtons(int desktop_idx); }; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp 2005-12-31 15:47:15 UTC (rev 20485) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp 2005-12-31 15:54:25 UTC (rev 20486) @@ -254,7 +254,7 @@ *ignore_name = '\0'; [truncated at 1000 lines; 90 more skipped]
18 years, 11 months
1
0
0
0
[weiden] 20485: set eol-style to native
by weiden@svn.reactos.org
set eol-style to native Property changes on: trunk/reactos/lib/objsel/objsel.xml ___________________________________________________________________ Name: svn:eol-style + native
18 years, 11 months
1
0
0
0
[mbosma] 20484: Add a tree file without subcategories.
by mbosma@svn.reactos.org
Add a tree file without subcategories. Added: trunk/rosapps/packmgr/tree/tree_bare.xml _____ Added: trunk/rosapps/packmgr/tree/tree_bare.xml --- trunk/rosapps/packmgr/tree/tree_bare.xml 2005-12-31 14:33:58 UTC (rev 20483) +++ trunk/rosapps/packmgr/tree/tree_bare.xml 2005-12-31 15:13:01 UTC (rev 20484) @@ -0,0 +1,4 @@ +<tree> + <node name="Mozilla Control" file="mozcontrol.xml"/> + <node name="AbiWord" file="abiword.xml"/> +</tree> \ No newline at end of file
18 years, 11 months
1
0
0
0
[mf] 20483: lean explorer: remove unused attributes
by mf@svn.reactos.org
lean explorer: remove unused attributes Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 14:24:43 UTC (rev 20482) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp 2005-12-31 14:33:58 UTC (rev 20483) @@ -156,9 +156,6 @@ if (ext) { const FileTypeInfo& type = (*this)[ext]; - if (!type._displayname.empty()) - entry->_type_name = _tcsdup(type._displayname); - // hide some file extensions if (type._neverShowExt && !dont_hide_ext) { int len = ext - entry->_data.cFileName; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 14:24:43 UTC (rev 20482) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 14:33:58 UTC (rev 20483) @@ -37,12 +37,9 @@ _down = NULL; _expanded = false; _scanned = false; - _bhfi_valid = false; _level = 0; _icon_id = ICID_UNKNOWN; _display_name = _data.cFileName; - _type_name = NULL; - _content = NULL; } Entry::Entry(Entry* parent) @@ -52,12 +49,9 @@ _down = NULL; _expanded = false; _scanned = false; - _bhfi_valid = false; _level = 0; _icon_id = ICID_UNKNOWN; _display_name = _data.cFileName; - _type_name = NULL; - _content = NULL; } Entry::Entry(const Entry& other) @@ -78,13 +72,8 @@ _shell_attribs = other._shell_attribs; _display_name = other._display_name==other._data.cFileName? _data.cFileName: _tcsdup(other._display_name); - _type_name = other._type_name? _tcsdup(other._type_name): NULL; - _content = other._content? _tcsdup(other._content): NULL; _icon_id = other._icon_id; - - _bhfi = other._bhfi; - _bhfi_valid = other._bhfi_valid; } // free a directory entry @@ -95,12 +84,6 @@ if (_display_name != _data.cFileName) free(_display_name); - - if (_type_name) - free(_type_name); - - if (_content) - free(_content); } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 14:24:43 UTC (rev 20482) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 14:33:58 UTC (rev 20483) @@ -71,14 +71,9 @@ SFGAOF _shell_attribs; LPTSTR _display_name; - LPTSTR _type_name; - LPTSTR _content; int /*ICON_ID*/ _icon_id; - BY_HANDLE_FILE_INFORMATION _bhfi; - bool _bhfi_valid; - void free_subentries(); void read_directory(SORT_ORDER sortOrder, int scan_flags=0); _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 14:24:43 UTC (rev 20482) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 14:33:58 UTC (rev 20483) @@ -31,12 +31,10 @@ #include <shlwapi.h> -bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, BY_HANDLE_FILE_INFORMATION* pbhfi, bool do_access) +void ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, bool do_access) { CONTEXT("ShellDirectory::fill_w32fdata_shell()"); - bool bhfi_valid = false; - if (do_access && !( (attribs&SFGAO_FILESYSTEM) && SUCCEEDED( SHGetDataFromIDList(_folder, pidl, SHGDFIL_FINDDATA, pw32fdata, sizeof(WIN32_FIND_DATA))) )) { WIN32_FILE_ATTRIBUTE_DATA fad; @@ -73,16 +71,6 @@ } } - HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); - - if (hFile != INVALID_HANDLE_VALUE) { - if (GetFileInformationByHandle(hFile, pbhfi)) - bhfi_valid = true; - - CloseHandle(hFile); - } - SetErrorMode(sem_org); GlobalUnlock(medium.hGlobal); @@ -100,8 +88,6 @@ if (attribs & SFGAO_COMPRESSED) pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED; - - return bhfi_valid; } @@ -238,8 +224,6 @@ for(ULONG n=0; n<cnt; ++n) { WIN32_FIND_DATA w32fd; - BY_HANDLE_FILE_INFORMATION bhfi; - bool bhfi_valid = false; memset(&w32fd, 0, sizeof(WIN32_FIND_DATA)); @@ -264,8 +248,7 @@ } else attribs = 0; - bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, - !(scan_flags&SCAN_DONT_ACCESS) && !removeable); + fill_w32fdata_shell(pidls[n], attribs, &w32fd, !(scan_flags&SCAN_DONT_ACCESS)&&!removeable); try { Entry* entry = NULL; // eliminate useless GCC warning by initializing entry @@ -283,9 +266,6 @@ memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA)); - if (bhfi_valid) - memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION)); - if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, MAX_PATH, SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) { if (!entry->_data.cFileName[0]) _tcscpy(entry->_data.cFileName, name); @@ -298,7 +278,6 @@ entry->_level = level; entry->_shell_attribs = attribs; - entry->_bhfi_valid = bhfi_valid; // set file type name g_Globals._ftype_mgr.set_type(entry); _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 14:24:43 UTC (rev 20482) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 14:33:58 UTC (rev 20483) @@ -110,7 +110,7 @@ HWND _hwnd; protected: - bool fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, BY_HANDLE_FILE_INFORMATION*, bool do_access=true); + void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, bool do_access=true); };
18 years, 11 months
1
0
0
0
[mf] 20482: lean explorer: remove WINFS
by mf@svn.reactos.org
lean explorer: remove WINFS Modified: branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.MinG W Modified: branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.mak Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile.MinGW Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile.PCH Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.MinG W --- branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.MinG W 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.MinG W 2005-12-31 14:24:43 UTC (rev 20482) @@ -53,7 +53,6 @@ shellbrowserimpl.o \ explorer.o \ entries.o \ - winfs.o \ shellfs.o \ desktop.o \ desktopbar.o \ _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.mak --- branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.mak 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/Make-rosshell.mak 2005-12-31 14:24:43 UTC (rev 20482) @@ -78,7 +78,6 @@ shellbrowserimpl.o \ explorer.o \ entries.o \ - winfs.o \ shellfs.o \ desktop.o \ desktopbar.o \ _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile --- branches/lean-explorer/reactos/subsys/system/explorer/Makefile 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/Makefile 2005-12-31 14:24:43 UTC (rev 20482) @@ -78,7 +78,6 @@ shellbrowserimpl.o \ explorer.o \ entries.o \ - winfs.o \ shellfs.o \ mainframe.o \ shellbrowser.o \ _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile.MinGW --- branches/lean-explorer/reactos/subsys/system/explorer/Makefile.MinGW 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/Makefile.MinGW 2005-12-31 14:24:43 UTC (rev 20482) @@ -52,7 +52,6 @@ shellbrowserimpl.o \ explorer.o \ entries.o \ - winfs.o \ shellfs.o \ mainframe.o \ shellbrowser.o \ _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/Makefile.PCH --- branches/lean-explorer/reactos/subsys/system/explorer/Makefile.PCH 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/Makefile.PCH 2005-12-31 14:24:43 UTC (rev 20482) @@ -53,7 +53,6 @@ shellbrowserimpl.o \ explorer.o \ entries.o \ - winfs.o \ shellfs.o \ mainframe.o \ shellbrowser.o \ _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 14:24:43 UTC (rev 20482) @@ -413,15 +413,6 @@ SOURCE=.\shell\startup.c # SUBTRACT CPP /YX /Yc /Yu # End Source File -# Begin Source File - -SOURCE=.\shell\winfs.cpp -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\shell\winfs.h -# End Source File # End Group # Begin Group "dialogs" _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 14:24:43 UTC (rev 20482) @@ -29,17 +29,11 @@ #define _LIGHT_STARTMENU //#define _LAZY_ICONEXTRACT //#define _SINGLE_ICONEXTRACT -#define _NO_WIN_FS #include "utility/shellclasses.h" #include "shell/entries.h" - -#ifndef _NO_WIN_FS -#include "shell/winfs.h" -#endif - #include "shell/shellfs.h" #include "utility/window.h" _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 14:24:43 UTC (rev 20482) @@ -30,12 +30,7 @@ // allocate and initialise a directory entry -#ifndef _NO_WIN_FS -Entry::Entry(ENTRY_TYPE etype) - : _etype(etype) -#else Entry::Entry() -#endif { _up = NULL; _next = NULL; @@ -50,14 +45,8 @@ _content = NULL; } -#ifndef _NO_WIN_FS -Entry::Entry(Entry* parent, ENTRY_TYPE etype) - : _up(parent), - _etype(etype) -#else Entry::Entry(Entry* parent) : _up(parent) -#endif { _next = NULL; _down = NULL; @@ -92,9 +81,6 @@ _type_name = other._type_name? _tcsdup(other._type_name): NULL; _content = other._content? _tcsdup(other._content): NULL; -#ifndef _NO_WIN_FS - _etype = other._etype; -#endif _icon_id = other._icon_id; _bhfi = other._bhfi; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 14:24:43 UTC (rev 20482) @@ -26,13 +26,6 @@ // -#ifndef _NO_WIN_FS -enum ENTRY_TYPE { - ET_WINDOWS, - ET_SHELL -}; -#endif - enum SORT_ORDER { SORT_NONE, SORT_NAME, @@ -59,13 +52,8 @@ struct Entry { protected: -#ifndef _NO_WIN_FS - Entry(ENTRY_TYPE etype); - Entry(Entry* parent, ENTRY_TYPE etype); -#else Entry(); Entry(Entry* parent); -#endif Entry(const Entry&); public: @@ -86,9 +74,6 @@ LPTSTR _type_name; LPTSTR _content; -#ifndef _NO_WIN_FS - ENTRY_TYPE _etype; -#endif int /*ICON_ID*/ _icon_id; BY_HANDLE_FILE_INFORMATION _bhfi; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p --- branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 14:24:43 UTC (rev 20482) @@ -1,5 +1,5 @@ /* - * Copyright 2003, 2004 Martin Fuchs + * Copyright 2003, 2004, 2005 Martin Fuchs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 14:24:43 UTC (rev 20482) @@ -1,5 +1,5 @@ /* - * Copyright 2003, 2004 Martin Fuchs + * Copyright 2003, 2004, 2005 Martin Fuchs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -194,66 +194,6 @@ } } - // local replacement implementation for SHBindToParent() - // (derived from
http://www.geocities.com/SiliconValley/2060/articles/shell-helpers.html
) -static HRESULT my_SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, VOID** ppv, LPCITEMIDLIST* ppidlLast) -{ - HRESULT hr; - - if (!ppv) - return E_POINTER; - - // There must be at least one item ID. - if (!pidl || !pidl->mkid.cb) - return E_INVALIDARG; - - // Get the desktop folder as root. - ShellFolder desktop; -/* IShellFolderPtr desktop; - hr = SHGetDesktopFolder(&desktop); - if (FAILED(hr)) - return hr; */ - - // Walk to the penultimate item ID. - LPCITEMIDLIST marker = pidl; - for (;;) - { - LPCITEMIDLIST next = reinterpret_cast<LPCITEMIDLIST>( - marker->mkid.abID - sizeof(marker->mkid.cb) + marker->mkid.cb); - if (!next->mkid.cb) - break; - marker = next; - } - - if (marker == pidl) - { - // There was only a single item ID, so bind to the root folder. - hr = desktop->QueryInterface(riid, ppv); - } - else - { - // Copy the ID list, truncating the last item. - int length = marker->mkid.abID - pidl->mkid.abID; - if (LPITEMIDLIST parent_id = reinterpret_cast<LPITEMIDLIST>( - malloc(length + sizeof(pidl->mkid.cb)))) - { - LPBYTE raw_data = reinterpret_cast<LPBYTE>(parent_id); - memcpy(raw_data, pidl, length); - memset(raw_data + length, 0, sizeof(pidl->mkid.cb)); - hr = desktop->BindToObject(parent_id, 0, riid, ppv); - free(parent_id); - } - else - return E_OUTOFMEMORY; - } - - // Return a pointer to the last item ID. - if (ppidlLast) - *ppidlLast = marker; - - return hr; -} - void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen) { CONTEXT("ShellBrowserChild::Tree_DoItemMenu()"); @@ -263,36 +203,11 @@ if (itemData) { Entry* entry = (Entry*)itemData; -#ifndef _NO_WIN_FS - if (entry->_etype == ET_SHELL) -#endif - { - ShellDirectory* dir = static_cast<ShellDirectory*>(entry->_up); - ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); - LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl; + ShellDirectory* dir = static_cast<ShellDirectory*>(entry->_up); + ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); + LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl; - CHECKERROR(ShellFolderContextMenu(folder, _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs)); - } -#ifndef _NO_WIN_FS - else { - ShellPath shell_path = entry->create_absolute_pidl(); - LPCITEMIDLIST pidl_abs = shell_path; - - IShellFolder* parentFolder; - LPCITEMIDLIST pidlLast; - - // get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ... - HRESULT hr = my_SHBindToParent(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast); - - if (SUCCEEDED(hr)) { - hr = ShellFolderContextMenu(parentFolder, _hwnd, 1, &pidlLast, pptScreen->x, pptScreen->y, _cm_ifs); - - parentFolder->Release(); - } - - CHECKERROR(hr); - } -#endif + CHECKERROR(ShellFolderContextMenu(folder, _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs)); } } @@ -671,11 +586,8 @@ Entry* entry = parent->find_entry(pidl); if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) -#ifndef _NO_WIN_FS - if (entry->_etype == ET_SHELL) -#endif - if (expand_folder(static_cast<ShellDirectory*>(entry))) - return S_OK; + if (expand_folder(static_cast<ShellDirectory*>(entry))) + return S_OK; } //@@} } else { // no tree control @@ -766,30 +678,25 @@ void ShellBrowserChild::jump_to(Entry* entry) { -#ifndef _NO_WIN_FS - if (entry->_etype == ET_SHELL) -#endif - { - IShellFolder* folder; - ShellDirectory* se = static_cast<ShellDirectory*>(entry); + IShellFolder* folder; + ShellDirectory* se = static_cast<ShellDirectory*>(entry); - if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - folder = static_cast<ShellDirectory*>(se)->_folder; - else - folder = se->get_parent_folder(); + if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + folder = static_cast<ShellDirectory*>(se)->_folder; + else + folder = se->get_parent_folder(); - if (!folder) { - assert(folder); - return; - } + if (!folder) { + assert(folder); + return; + } - if (_create_info._open_mode & OWM_EXPLORE) { + if (_create_info._open_mode & OWM_EXPLORE) { - //@@ todo + //@@ todo - } else; - UpdateFolderView(folder); + } else; + UpdateFolderView(folder); - _cur_dir = se; - } + _cur_dir = se; } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 14:24:43 UTC (rev 20482) @@ -1,5 +1,5 @@ /* - * Copyright 2003, 2004 Martin Fuchs + * Copyright 2003, 2004, 2005 Martin Fuchs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -109,20 +109,12 @@ { CONTEXT("ShellEntry::create_absolute_pidl()"); - if (_up) -#ifndef _NO_WIN_FS - if (_up->_etype == ET_SHELL) -#endif - { - ShellDirectory* dir = static_cast<ShellDirectory*>(_up); + if (_up) { + ShellDirectory* dir = static_cast<ShellDirectory*>(_up); - if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. - return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); - } -#ifndef _NO_WIN_FS - else - return _pidl.create_absolute_pidl(_up->create_absolute_pidl()); -#endif + if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. + return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); + } return _pidl; } @@ -223,38 +215,65 @@ /*if (_folder.empty()) return;*/ -#ifndef _NO_WIN_FS - TCHAR buffer[MAX_PATH]; + ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREAB LE|SHCONTF_STORAGE); - if (get_path(buffer)) { - Entry* entry = NULL; // eliminate useless GCC warning by initializing entry + TCHAR name[MAX_PATH]; + HRESULT hr_next = S_OK; - LPTSTR p = buffer + _tcslen(buffer); + do { +#define FETCH_ITEM_COUNT 32 + LPITEMIDLIST pidls[FETCH_ITEM_COUNT]; + ULONG cnt = 0; - lstrcpy(p, TEXT("\\*")); + memset(pidls, 0, sizeof(pidls)); - WIN32_FIND_DATA w32fd; - HANDLE hFind = FindFirstFile(buffer, &w32fd); + hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt); - if (hFind != INVALID_HANDLE_VALUE) { - do { - // ignore hidden files (usefull in the start menu) - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) - continue; + /* don't break yet now: Registry Explorer Plugin returns E_FAIL! + if (!SUCCEEDED(hr_next)) + break; */ - // ignore directory entries "." and ".." - if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && - w32fd.cFileName[0]==TEXT('.') && - (w32fd.cFileName[1]==TEXT('\0') || - (w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0')))) - continue; + if (hr_next == S_FALSE) + break; - lstrcpy(p+1, w32fd.cFileName); + for(ULONG n=0; n<cnt; ++n) { + WIN32_FIND_DATA w32fd; + BY_HANDLE_FILE_INFORMATION bhfi; + bool bhfi_valid = false; + memset(&w32fd, 0, sizeof(WIN32_FIND_DATA)); + + SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE; + SFGAOF attribs = attribs_before; + HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs); + bool removeable = false; + + if (SUCCEEDED(hr) && attribs!=attribs_before) { + // avoid accessing floppy drives when browsing "My Computer" + if (attribs & SFGAO_REMOVABLE) { + attribs |= SFGAO_HASSUBFOLDER; + removeable = true; + } else if (!(scan_flags & SCAN_DONT_ACCESS)) { + DWORD attribs2 = SFGAO_READONLY; + + HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2); + + if (SUCCEEDED(hr)) + attribs |= attribs2; + } + } else + attribs = 0; + + bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, + !(scan_flags&SCAN_DONT_ACCESS) && !removeable); + + try { + Entry* entry = NULL; // eliminate useless GCC warning by initializing entry + if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - entry = new WinDirectory(this, buffer); + entry = new ShellDirectory(this, pidls[n], _hwnd); else - entry = new WinEntry(this); + entry = new ShellEntry(this, pidls[n]); if (!first_entry) first_entry = entry; @@ -264,166 +283,43 @@ memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA)); - entry->_level = level; + if (bhfi_valid) + memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION)); - if (!(scan_flags & SCAN_DONT_ACCESS)) { - HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); - - if (hFile != INVALID_HANDLE_VALUE) { - if (GetFileInformationByHandle(hFile, &entry->_bhfi)) - entry->_bhfi_valid = true; - - CloseHandle(hFile); - } + if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, MAX_PATH, SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) { + if (!entry->_data.cFileName[0]) + _tcscpy(entry->_data.cFileName, name); + else if (_tcscmp(entry->_display_name, name)) + entry->_display_name = _tcsdup(name); // store display name separate from file name; sort display by file name } - // set file type name - LPCTSTR ext = g_Globals._ftype_mgr.set_type(entry); - - DWORD attribs = SFGAO_FILESYSTEM; - - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - attribs |= SFGAO_FOLDER|SFGAO_HASSUBFOLDER; - - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) - attribs |= SFGAO_READONLY; - - //if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) - // attribs |= SFGAO_HIDDEN; - - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED) - attribs |= SFGAO_COMPRESSED; - - if (ext && !_tcsicmp(ext, _T(".lnk"))) { - attribs |= SFGAO_LINK; + if (attribs & SFGAO_LINK) w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK; - } + entry->_level = level; entry->_shell_attribs = attribs; + entry->_bhfi_valid = bhfi_valid; - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + // set file type name + g_Globals._ftype_mgr.set_type(entry); + + // get icons for files and virtual objects + if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + !(attribs & SFGAO_FILESYSTEM)) { + if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS)) + entry->_icon_id = entry->safe_extract_icon(); + } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry->_icon_id = ICID_FOLDER; - else if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS)) - entry->_icon_id = entry->safe_extract_icon(); + else + entry->_icon_id = ICID_NONE; // don't try again later last = entry; - } while(FindNextFile(hFind, &w32fd)); - - FindClose(hFind); + } catch(COMException& e) { + HandleException(e, _hwnd); + } } + } while(SUCCEEDED(hr_next)); - } - else // no file system path -#endif - { - - ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREAB LE|SHCONTF_STORAGE); - - TCHAR name[MAX_PATH]; - HRESULT hr_next = S_OK; - - do { -#define FETCH_ITEM_COUNT 32 - LPITEMIDLIST pidls[FETCH_ITEM_COUNT]; - ULONG cnt = 0; - - memset(pidls, 0, sizeof(pidls)); - - hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt); - - /* don't break yet now: Registry Explorer Plugin returns E_FAIL! - if (!SUCCEEDED(hr_next)) - break; */ - - if (hr_next == S_FALSE) - break; - - for(ULONG n=0; n<cnt; ++n) { - WIN32_FIND_DATA w32fd; - BY_HANDLE_FILE_INFORMATION bhfi; - bool bhfi_valid = false; - - memset(&w32fd, 0, sizeof(WIN32_FIND_DATA)); - - SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE; - SFGAOF attribs = attribs_before; - HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs); - bool removeable = false; - - if (SUCCEEDED(hr) && attribs!=attribs_before) { - // avoid accessing floppy drives when browsing "My Computer" - if (attribs & SFGAO_REMOVABLE) { - attribs |= SFGAO_HASSUBFOLDER; - removeable = true; - } else if (!(scan_flags & SCAN_DONT_ACCESS)) { - DWORD attribs2 = SFGAO_READONLY; - - HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2); - - if (SUCCEEDED(hr)) - attribs |= attribs2; - } - } else - attribs = 0; - - bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, - !(scan_flags&SCAN_DONT_ACCESS) && !removeable); - - try { - Entry* entry = NULL; // eliminate useless GCC warning by initializing entry - - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - entry = new ShellDirectory(this, pidls[n], _hwnd); - else - entry = new ShellEntry(this, pidls[n]); - - if (!first_entry) - first_entry = entry; - - if (last) - last->_next = entry; - - memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA)); - - if (bhfi_valid) - memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION)); - - if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, MAX_PATH, SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) { - if (!entry->_data.cFileName[0]) - _tcscpy(entry->_data.cFileName, name); - else if (_tcscmp(entry->_display_name, name)) - entry->_display_name = _tcsdup(name); // store display name separate from file name; sort display by file name - } - - if (attribs & SFGAO_LINK) - w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK; - - entry->_level = level; - entry->_shell_attribs = attribs; - entry->_bhfi_valid = bhfi_valid; - - // set file type name - g_Globals._ftype_mgr.set_type(entry); - - // get icons for files and virtual objects - if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - !(attribs & SFGAO_FILESYSTEM)) { - if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS)) - entry->_icon_id = entry->safe_extract_icon(); - } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - entry->_icon_id = ICID_FOLDER; - else - entry->_icon_id = ICID_NONE; // don't try again later - - last = entry; - } catch(COMException& e) { - HandleException(e, _hwnd); - } - } - } while(SUCCEEDED(hr_next)); - } - if (last) last->_next = NULL; @@ -448,16 +344,12 @@ { LPITEMIDLIST pidl = (LPITEMIDLIST) p; - for(Entry*entry=_down; entry; entry=entry->_next) -#ifndef _NO_WIN_FS - if (entry->_etype == ET_SHELL) -#endif - { - ShellEntry* se = static_cast<ShellEntry*>(entry); + for(Entry*entry=_down; entry; entry=entry->_next) { + ShellEntry* se = static_cast<ShellEntry*>(entry); - if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb)) - return entry; - } + if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb)) + return entry; + } return NULL; } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 14:24:43 UTC (rev 20482) @@ -29,13 +29,8 @@ /// shell file/directory entry struct ShellEntry : public Entry { -#ifndef _NO_WIN_FS - ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {} - ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {} -#else ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent), _pidl(shell_path) {} ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent), _pidl(shell_path) {} -#endif virtual bool get_path(PTSTR path) const; virtual ShellPath create_absolute_pidl() const; @@ -47,13 +42,8 @@ ShellPath _pidl; // parent relative PIDL protected: -#ifndef _NO_WIN_FS - ShellEntry(LPITEMIDLIST shell_path) : Entry(ET_SHELL), _pidl(shell_path) {} - ShellEntry(const ShellPath& shell_path) : Entry(ET_SHELL), _pidl(shell_path) {} -#else ShellEntry(LPITEMIDLIST shell_path) : _pidl(shell_path) {} ShellEntry(const ShellPath& shell_path) : _pidl(shell_path) {} -#endif }; _____ Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp 2005-12-31 14:24:43 UTC (rev 20482) @@ -1,227 +0,0 @@ -/* - * Copyright 2003, 2004 Martin Fuchs - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - - // - // Explorer clone, lean version - // - // winfs.cpp - // - // Martin Fuchs, 23.07.2003 - // - - -#include "precomp.h" - - -void WinDirectory::read_directory(int scan_flags) -{ - CONTEXT("WinDirectory::read_directory()"); - - int level = _level + 1; - - Entry* first_entry = NULL; - Entry* last = NULL; - Entry* entry; - - LPCTSTR path = (LPCTSTR)_path; - TCHAR buffer[MAX_PATH], *pname; - for(pname=buffer; *path; ) - *pname++ = *path++; - - lstrcpy(pname, TEXT("\\*")); - - WIN32_FIND_DATA w32fd; - HANDLE hFind = FindFirstFile(buffer, &w32fd); - - if (hFind != INVALID_HANDLE_VALUE) { - do { - // ignore hidden files (usefull in the start menu) - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) - continue; - - // ignore directory entries "." and ".." - if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && - w32fd.cFileName[0]==TEXT('.') && - (w32fd.cFileName[1]==TEXT('\0') || - (w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0')))) - continue; - - lstrcpy(pname+1, w32fd.cFileName); - - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - entry = new WinDirectory(this, buffer); - else - entry = new WinEntry(this); - - if (!first_entry) - first_entry = entry; - - if (last) - last->_next = entry; - - memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA)); - entry->_level = level; - - // display file type names, but don't hide file extensions - g_Globals._ftype_mgr.set_type(entry, true); - - if (!(scan_flags & SCAN_DONT_ACCESS)) { - HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); - - if (hFile != INVALID_HANDLE_VALUE) { - if (GetFileInformationByHandle(hFile, &entry->_bhfi)) - entry->_bhfi_valid = true; - - CloseHandle(hFile); - } - } - - last = entry; // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries. - } while(FindNextFile(hFind, &w32fd)); - - if (last) - last->_next = NULL; - - FindClose(hFind); - } - - _down = first_entry; - _scanned = true; -} - - -const void* WinDirectory::get_next_path_component(const void* p) const -{ - LPCTSTR s = (LPCTSTR) p; - - while(*s && *s!=TEXT('\\') && *s!=TEXT('/')) - ++s; - - while(*s==TEXT('\\') || *s==TEXT('/')) - ++s; - - if (!*s) - return NULL; - - return s; -} - - -Entry* WinDirectory::find_entry(const void* p) -{ - LPCTSTR name = (LPCTSTR)p; - - for(Entry*entry=_down; entry; entry=entry->_next) { - LPCTSTR p = name; - LPCTSTR q = entry->_data.cFileName; - - do { - if (!*p || *p==TEXT('\\') || *p==TEXT('/')) - return entry; - } while(tolower(*p++) == tolower(*q++)); - - p = name; - q = entry->_data.cAlternateFileName; - - do { - if (!*p || *p==TEXT('\\') || *p==TEXT('/')) - return entry; - } while(tolower(*p++) == tolower(*q++)); - } - - return NULL; -} - - - // get full path of specified directory entry -bool WinEntry::get_path(PTSTR path) const -{ - int level = 0; - int len = 0; - int l = 0; - LPCTSTR name = NULL; - TCHAR buffer[MAX_PATH]; - - const Entry* entry; - for(entry=this; entry; level++) { - l = 0; - - if (entry->_etype == ET_WINDOWS) { - name = entry->_data.cFileName; - - for(LPCTSTR s=name; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++) - ++l; - - if (!entry->_up) - break; - } else { - if (entry->get_path(buffer)) { - l = _tcslen(buffer); - name = buffer; - - /* special handling of drive names */ - if (l>0 && buffer[l-1]=='\\' && path[0]=='\\') - --l; - - memmove(path+l, path, len*sizeof(TCHAR)); - memcpy(path, name, l*sizeof(TCHAR)); - len += l; - } - - entry = NULL; - break; - } - - if (l > 0) { - memmove(path+l+1, path, len*sizeof(TCHAR)); - memcpy(path+1, name, l*sizeof(TCHAR)); - len += l+1; - - path[0] = TEXT('\\'); - } - - entry = entry->_up; - } - - if (entry) { - memmove(path+l, path, len*sizeof(TCHAR)); - memcpy(path, name, l*sizeof(TCHAR)); - len += l; - } - - if (!level) - path[len++] = TEXT('\\'); - - path[len] = TEXT('\0'); - - return true; -} - -ShellPath WinEntry::create_absolute_pidl() const -{ - CONTEXT("WinEntry::create_absolute_pidl()"); - - TCHAR path[MAX_PATH]; - - if (get_path(path)) - return ShellPath(path); - - return ShellPath(); -} _____ Deleted: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h 2005-12-31 13:37:09 UTC (rev 20481) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h 2005-12-31 14:24:43 UTC (rev 20482) @@ -1,66 +0,0 @@ -/* - * Copyright 2003, 2004 Martin Fuchs - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [truncated at 1000 lines; 89 more skipped]
18 years, 11 months
1
0
0
0
[mf] 20481: lean explorer:
by mf@svn.reactos.org
lean explorer: - simplfy SCAN flags - disable WINFS in favor to code size using only shell namespace Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/rosshell.dsp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. h _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp 2005-12-31 13:37:09 UTC (rev 20481) @@ -416,6 +416,7 @@ # Begin Source File SOURCE=.\shell\winfs.cpp +# PROP Exclude_From_Build 1 # End Source File # Begin Source File _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/explorer.h --- branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.h 2005-12-31 13:37:09 UTC (rev 20481) @@ -26,11 +26,20 @@ // +#define _LIGHT_STARTMENU +//#define _LAZY_ICONEXTRACT +//#define _SINGLE_ICONEXTRACT +#define _NO_WIN_FS + + #include "utility/shellclasses.h" #include "shell/entries.h" +#ifndef _NO_WIN_FS #include "shell/winfs.h" +#endif + #include "shell/shellfs.h" #include "utility/window.h" _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/rosshell.dsp --- branches/lean-explorer/reactos/subsys/system/explorer/rosshell.dsp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/rosshell.dsp 2005-12-31 13:37:09 UTC (rev 20481) @@ -233,6 +233,11 @@ # End Source File # Begin Source File +SOURCE=".\explorer-jp.rc" +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\res\explorer.ico # End Source File # Begin Source File @@ -297,11 +302,6 @@ # End Source File # Begin Source File -SOURCE=".\explorer-jp.rc" -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\res\rosshell.ico # End Source File # Begin Source File @@ -408,6 +408,7 @@ # Begin Source File SOURCE=.\shell\winfs.cpp +# PROP Exclude_From_Build 1 # End Source File # Begin Source File _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -30,8 +30,12 @@ // allocate and initialise a directory entry +#ifndef _NO_WIN_FS Entry::Entry(ENTRY_TYPE etype) : _etype(etype) +#else +Entry::Entry() +#endif { _up = NULL; _next = NULL; @@ -46,9 +50,14 @@ _content = NULL; } +#ifndef _NO_WIN_FS Entry::Entry(Entry* parent, ENTRY_TYPE etype) : _up(parent), _etype(etype) +#else +Entry::Entry(Entry* parent) + : _up(parent) +#endif { _next = NULL; _down = NULL; @@ -83,7 +92,9 @@ _type_name = other._type_name? _tcsdup(other._type_name): NULL; _content = other._content? _tcsdup(other._content): NULL; +#ifndef _NO_WIN_FS _etype = other._etype; +#endif _icon_id = other._icon_id; _bhfi = other._bhfi; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h 2005-12-31 13:37:09 UTC (rev 20481) @@ -26,11 +26,12 @@ // +#ifndef _NO_WIN_FS enum ENTRY_TYPE { - ET_UNKNOWN, ET_WINDOWS, ET_SHELL }; +#endif enum SORT_ORDER { SORT_NONE, @@ -41,12 +42,8 @@ }; enum SCAN_FLAGS { - SCAN_EXTRACT_ICONS = 1, - SCAN_DO_ACCESS = 2, - - SCAN_ALL = 3, - - SCAN_FILESYSTEM = 4 + SCAN_DONT_EXTRACT_ICONS = 1, + SCAN_DONT_ACCESS = 2 }; #ifndef ATTRIBUTE_SYMBOLIC_LINK @@ -62,8 +59,13 @@ struct Entry { protected: +#ifndef _NO_WIN_FS Entry(ENTRY_TYPE etype); Entry(Entry* parent, ENTRY_TYPE etype); +#else + Entry(); + Entry(Entry* parent); +#endif Entry(const Entry&); public: @@ -84,7 +86,9 @@ LPTSTR _type_name; LPTSTR _content; +#ifndef _NO_WIN_FS ENTRY_TYPE _etype; +#endif int /*ICON_ID*/ _icon_id; BY_HANDLE_FILE_INFORMATION _bhfi; @@ -92,14 +96,14 @@ void free_subentries(); - void read_directory(SORT_ORDER sortOrder, int scan_flags=SCAN_ALL); + void read_directory(SORT_ORDER sortOrder, int scan_flags=0); Entry* read_tree(const void* path, SORT_ORDER sortOrder); void sort_directory(SORT_ORDER sortOrder); - void smart_scan(int scan_flags=SCAN_ALL); + void smart_scan(int scan_flags=0); int extract_icon(); int safe_extract_icon(); - virtual void read_directory(int scan_flags=SCAN_ALL) {} + virtual void read_directory(int scan_flags=0) {} virtual const void* get_next_path_component(const void*) const {return NULL;} virtual Entry* find_entry(const void*) {return NULL;} virtual bool get_path(PTSTR path) const = 0; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p --- branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 13:37:09 UTC (rev 20481) @@ -175,7 +175,6 @@ } else { _create_info._open_mode = mode; _create_info._shell_path = path; - _create_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd); //@@ update_explorer_view(); } @@ -192,7 +191,6 @@ } else { _create_info._open_mode = mode; _create_info._shell_path = path; - _create_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd); //@@ update_explorer_view(); } @@ -305,6 +303,11 @@ path = buffer; } + if (wparam & OWM_ROOTED) + _create_info._root_shell_path = shell_path; + else + _create_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd); + jump_to(shell_path, (OPEN_WINDOW_MODE)wparam); return TRUE;} // success _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -263,13 +263,18 @@ if (itemData) { Entry* entry = (Entry*)itemData; - if (entry->_etype == ET_SHELL) { +#ifndef _NO_WIN_FS + if (entry->_etype == ET_SHELL) +#endif + { ShellDirectory* dir = static_cast<ShellDirectory*>(entry->_up); ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl; CHECKERROR(ShellFolderContextMenu(folder, _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs)); - } else { + } +#ifndef _NO_WIN_FS + else { ShellPath shell_path = entry->create_absolute_pidl(); LPCITEMIDLIST pidl_abs = shell_path; @@ -287,6 +292,7 @@ CHECKERROR(hr); } +#endif } } @@ -301,16 +307,19 @@ if (lpdi->item.mask & TVIF_TEXT) lpdi->item.pszText = entry->_display_name; - if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE)) { - ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance. - LPCITEMIDLIST pidl = pidl_abs; + if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE)) + try { + ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance. + LPCITEMIDLIST pidl = pidl_abs; - if (lpdi->item.mask & TVIF_IMAGE) - lpdi->item.iImage = get_entry_image(entry, pidl, SHGFI_SMALLICON, _image_map); + if (lpdi->item.mask & TVIF_IMAGE) + lpdi->item.iImage = get_entry_image(entry, pidl, SHGFI_SMALLICON, _image_map); - if (lpdi->item.mask & TVIF_SELECTEDIMAGE) - lpdi->item.iSelectedImage = get_entry_image(entry, pidl, SHGFI_SMALLICON|SHGFI_OPENICON, _image_map_open); - } + if (lpdi->item.mask & TVIF_SELECTEDIMAGE) + lpdi->item.iSelectedImage = get_entry_image(entry, pidl, SHGFI_SMALLICON|SHGFI_OPENICON, _image_map_open); + } catch(COMException&) { + // ignore exception + } } } @@ -662,7 +671,9 @@ Entry* entry = parent->find_entry(pidl); if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) +#ifndef _NO_WIN_FS if (entry->_etype == ET_SHELL) +#endif if (expand_folder(static_cast<ShellDirectory*>(entry))) return S_OK; } @@ -748,14 +759,17 @@ } } - // in case of any problem directly call UpdateFolderView() + // If not already called, now directly call UpdateFolderView() using pidl. if (!entry) UpdateFolderView(ShellFolder(pidl)); } void ShellBrowserChild::jump_to(Entry* entry) { - if (entry->_etype == ET_SHELL) { +#ifndef _NO_WIN_FS + if (entry->_etype == ET_SHELL) +#endif + { IShellFolder* folder; ShellDirectory* se = static_cast<ShellDirectory*>(entry); @@ -769,8 +783,13 @@ return; } - UpdateFolderView(folder); + if (_create_info._open_mode & OWM_EXPLORE) { + //@@ todo + + } else; + UpdateFolderView(folder); + _cur_dir = se; } } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -110,13 +110,19 @@ CONTEXT("ShellEntry::create_absolute_pidl()"); if (_up) - if (_up->_etype == ET_SHELL) { +#ifndef _NO_WIN_FS + if (_up->_etype == ET_SHELL) +#endif + { ShellDirectory* dir = static_cast<ShellDirectory*>(_up); if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); - } else + } +#ifndef _NO_WIN_FS + else return _pidl.create_absolute_pidl(_up->create_absolute_pidl()); +#endif return _pidl; } @@ -217,9 +223,10 @@ /*if (_folder.empty()) return;*/ +#ifndef _NO_WIN_FS TCHAR buffer[MAX_PATH]; - if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer)) { + if (get_path(buffer)) { Entry* entry = NULL; // eliminate useless GCC warning by initializing entry LPTSTR p = buffer + _tcslen(buffer); @@ -259,7 +266,7 @@ entry->_level = level; - if (scan_flags & SCAN_DO_ACCESS) { + if (!(scan_flags & SCAN_DONT_ACCESS)) { HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); @@ -277,7 +284,7 @@ DWORD attribs = SFGAO_FILESYSTEM; if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - attribs |= SFGAO_FOLDER; + attribs |= SFGAO_FOLDER|SFGAO_HASSUBFOLDER; if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) attribs |= SFGAO_READONLY; @@ -297,7 +304,7 @@ if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry->_icon_id = ICID_FOLDER; - else if (scan_flags & SCAN_EXTRACT_ICONS) + else if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS)) entry->_icon_id = entry->safe_extract_icon(); last = entry; @@ -306,7 +313,10 @@ FindClose(hFind); } - } else { // !SCAN_FILESYSTEM + } + else // no file system path +#endif + { ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREAB LE|SHCONTF_STORAGE); @@ -346,7 +356,7 @@ if (attribs & SFGAO_REMOVABLE) { attribs |= SFGAO_HASSUBFOLDER; removeable = true; - } else if (scan_flags & SCAN_DO_ACCESS) { + } else if (!(scan_flags & SCAN_DONT_ACCESS)) { DWORD attribs2 = SFGAO_READONLY; HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2); @@ -358,7 +368,7 @@ attribs = 0; bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, - (scan_flags&SCAN_DO_ACCESS) && !removeable); + !(scan_flags&SCAN_DONT_ACCESS) && !removeable); try { Entry* entry = NULL; // eliminate useless GCC warning by initializing entry @@ -399,7 +409,7 @@ // get icons for files and virtual objects if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !(attribs & SFGAO_FILESYSTEM)) { - if (scan_flags & SCAN_EXTRACT_ICONS) + if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS)) entry->_icon_id = entry->safe_extract_icon(); } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry->_icon_id = ICID_FOLDER; @@ -439,7 +449,10 @@ LPITEMIDLIST pidl = (LPITEMIDLIST) p; for(Entry*entry=_down; entry; entry=entry->_next) - if (entry->_etype == ET_SHELL) { +#ifndef _NO_WIN_FS + if (entry->_etype == ET_SHELL) +#endif + { ShellEntry* se = static_cast<ShellEntry*>(entry); if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb)) _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h 2005-12-31 13:37:09 UTC (rev 20481) @@ -29,8 +29,13 @@ /// shell file/directory entry struct ShellEntry : public Entry { +#ifndef _NO_WIN_FS ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {} ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {} +#else + ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent), _pidl(shell_path) {} + ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent), _pidl(shell_path) {} +#endif virtual bool get_path(PTSTR path) const; virtual ShellPath create_absolute_pidl() const; @@ -42,8 +47,13 @@ ShellPath _pidl; // parent relative PIDL protected: +#ifndef _NO_WIN_FS ShellEntry(LPITEMIDLIST shell_path) : Entry(ET_SHELL), _pidl(shell_path) {} ShellEntry(const ShellPath& shell_path) : Entry(ET_SHELL), _pidl(shell_path) {} +#else + ShellEntry(LPITEMIDLIST shell_path) : _pidl(shell_path) {} + ShellEntry(const ShellPath& shell_path) : _pidl(shell_path) {} +#endif }; @@ -98,7 +108,7 @@ pFolder->Release(); } - virtual void read_directory(int scan_flags=SCAN_ALL); + virtual void read_directory(int scan_flags=0); virtual const void* get_next_path_component(const void*) const; virtual Entry* find_entry(const void* p); _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -51,6 +51,17 @@ if (hFind != INVALID_HANDLE_VALUE) { do { + // ignore hidden files (usefull in the start menu) + if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + continue; + + // ignore directory entries "." and ".." + if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && + w32fd.cFileName[0]==TEXT('.') && + (w32fd.cFileName[1]==TEXT('\0') || + (w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0')))) + continue; + lstrcpy(pname+1, w32fd.cFileName); if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) @@ -70,7 +81,7 @@ // display file type names, but don't hide file extensions g_Globals._ftype_mgr.set_type(entry, true); - if (scan_flags & SCAN_DO_ACCESS) { + if (!(scan_flags & SCAN_DONT_ACCESS)) { HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); @@ -85,7 +96,8 @@ last = entry; // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries. } while(FindNextFile(hFind, &w32fd)); - last->_next = NULL; + if (last) + last->_next = NULL; FindClose(hFind); } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/winfs.h 2005-12-31 13:37:09 UTC (rev 20481) @@ -60,7 +60,7 @@ _path = NULL; } - virtual void read_directory(int scan_flags=SCAN_ALL); + virtual void read_directory(int scan_flags=0); virtual const void* get_next_path_component(const void* p) const; virtual Entry* find_entry(const void*); }; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc h.cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -104,7 +104,7 @@ RecursiveCreateDirectory(path); _dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd); - _dir->smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM); + _dir->smart_scan(SCAN_DONT_ACCESS); } catch(COMException&) { return; } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. cpp 2005-12-31 13:37:09 UTC (rev 20481) @@ -211,9 +211,9 @@ WaitCursor wait; #ifdef _LAZY_ICONEXTRACT - dir.smart_scan(SCAN_FILESYSTEM); // lazy icon extraction, try to read directly from filesystem + dir.smart_scan(SCAN_DONT_EXTRACT_ICONS); // extract icons later #else - dir.smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM); + dir.smart_scan(); #endif } @@ -268,10 +268,14 @@ if (++cnt == max) break; +#ifndef _NO_WIN_FS if (entry->_etype == ET_SHELL) AddEntry(dir._folder, static_cast<ShellEntry*>(entry)); else AddEntry(dir._folder, entry); +#else + AddEntry(dir._folder, static_cast<ShellEntry*>(entry)); +#endif } } @@ -1234,6 +1238,7 @@ ///@todo If the user explicitly clicked on a submenu, display this folder as floating start menu. +#ifndef _NO_WIN_FS if (entry->_etype == ET_SHELL) new_folders.push_back(entry->create_absolute_pidl()); else { @@ -1242,6 +1247,9 @@ if (entry->get_path(path)) new_folders.push_back(path); } +#else + new_folders.push_back(entry->create_absolute_pidl()); +#endif if (title.empty()) title = entry->_display_name; @@ -2018,9 +2026,9 @@ WaitCursor wait; #ifdef _LAZY_ICONEXTRACT - dir.smart_scan(SCAN_FILESYSTEM); + dir.smart_scan(SCAN_DONT_EXTRACT_ICONS); #else - dir.smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM); + dir.smart_scan(); #endif } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. h --- branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. h 2005-12-31 11:33:46 UTC (rev 20480) +++ branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu. h 2005-12-31 13:37:09 UTC (rev 20481) @@ -26,11 +26,6 @@ // -#define _LIGHT_STARTMENU -//#define _LAZY_ICONEXTRACT -//#define _SINGLE_ICONEXTRACT - - #define CLASSNAME_STARTMENU TEXT("ReactosStartmenuClass") #define TITLE_STARTMENU TEXT("Start Menu") @@ -138,7 +133,7 @@ typedef list<ShellPath> StartMenuFolders; - /// structor containing information for creating start menus + /// struct containing information for creating start menus struct StartMenuCreateInfo { StartMenuCreateInfo() : _border_top(0) {}
18 years, 11 months
1
0
0
0
[ekohl] 20480: Forward StartServiceA/W to services.exe
by ekohl@svn.reactos.org
Forward StartServiceA/W to services.exe Modified: trunk/reactos/include/idl/svcctl.idl Modified: trunk/reactos/lib/advapi32/service/scm.c Modified: trunk/reactos/subsys/system/services/rpcserver.c _____ Modified: trunk/reactos/include/idl/svcctl.idl --- trunk/reactos/include/idl/svcctl.idl 2005-12-31 11:22:44 UTC (rev 20479) +++ trunk/reactos/include/idl/svcctl.idl 2005-12-31 11:33:46 UTC (rev 20480) @@ -184,6 +184,13 @@ [out] LPDWORD pcbBytesNeeded); /* Function 19 */ + DWORD ScmrStartServiceW([in] handle_t BindingHandle, + [in] SC_HANDLE hService, + [in] DWORD dwNumServiceArgs, + [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, + [in] DWORD cbBufSize); + + /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ // DWORD ScmrStartServiceW([in] handle_t BindingHandle, // [in] SC_HANDLE hService, // [in] DWORD dwNumServiceArgs, @@ -288,13 +295,20 @@ [out] LPDWORD pcbBytesNeeded); /* Function 30 */ -// DWORD ScmrQueryServiceLockStatusA([in] handle_t BindingHandle, -// [in] SC_HANDLE hSCManager, -// [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, -// [in] DWORD cbBufSize, -// [out] LPDWORD pcbBytesNeeded); + DWORD ScmrQueryServiceLockStatusA([in] handle_t BindingHandle, + [in] SC_HANDLE hSCManager, + [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, + [in] DWORD cbBufSize, + [out] LPDWORD pcbBytesNeeded); /* Function 31 */ + DWORD ScmrStartServiceA([in] handle_t BindingHandle, + [in] SC_HANDLE hService, + [in] DWORD dwNumServiceArgs, + [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, + [in] DWORD cbBufSize); + + /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ // DWORD ScmrStartServiceA([in] handle_t BindingHandle, // [in] SC_HANDLE hService, // [in] DWORD dwNumServiceArgs, @@ -314,20 +328,24 @@ [out, unique, size_is(*lpcchBuffer)] LPSTR lpServiceName, [in, out, ref] LPDWORD lpcchBuffer); - /* Function 35 */ + /* Function 34 */ /* ScmrGetCurrentGroupStateW */ /* Function 35 */ /* ScmrEnumServiceGroupW */ /* Function 36 */ - /* ScmrChangeServiceConfig2A */ +// DWORD ScmrChangeServiceConfig2A([in] handle_t BindingHandle, +// [in] SC_HANDLE hService, +// [in] DWORD dwInfoLevel, +// [in, size_is(dwInfoSize)] LPBYTE lpInfo, +// [in] DWORD dwInfoSize); /* Function 37 */ DWORD ScmrChangeServiceConfig2W([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwInfoLevel, - [in, size_is(dwInfoSize)] unsigned char *lpInfo, + [in, size_is(dwInfoSize)] LPBYTE lpInfo, [in] DWORD dwInfoSize); /* Function 38 */ _____ Modified: trunk/reactos/lib/advapi32/service/scm.c --- trunk/reactos/lib/advapi32/service/scm.c 2005-12-31 11:22:44 UTC (rev 20479) +++ trunk/reactos/lib/advapi32/service/scm.c 2005-12-31 11:33:46 UTC (rev 20480) @@ -1557,32 +1557,89 @@ /********************************************************************** * StartServiceA * - * @unimplemented + * @implemented */ -BOOL -STDCALL -StartServiceA( - SC_HANDLE hService, - DWORD dwNumServiceArgs, - LPCSTR *lpServiceArgVectors) +BOOL STDCALL +StartServiceA(SC_HANDLE hService, + DWORD dwNumServiceArgs, + LPCSTR *lpServiceArgVectors) { - DPRINT1("StartServiceA is unimplemented\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; +#if 0 + DWORD dwError; + + DPRINT("StartServiceA()\n"); + + HandleBind(); + + /* Call to services.exe using RPC */ + dwError = ScmrStartServiceA(BindingHandle, + hService, + dwNumServiceArgs, + lpServiceArgVectors); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ScmrStartServiceA() failed (Error %lu)\n", dwError); + SetLastError(dwError); + return FALSE; + } + + return TRUE; +#endif + LPSTR lpBuffer; + LPSTR lpStr; + DWORD dwError; + DWORD dwBufSize; + DWORD i; + + dwBufSize = 0; + for (i = 0; i < dwNumServiceArgs; i++) + { + dwBufSize += (strlen(lpServiceArgVectors[i]) + 1); + } + DPRINT1("dwBufSize: %lu\n", dwBufSize); + + lpBuffer = HeapAlloc(GetProcessHeap(), 0, dwBufSize); + if (lpBuffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + lpStr = lpBuffer; + for (i = 0; i < dwNumServiceArgs; i++) + { + strcpy(lpStr, lpServiceArgVectors[i]); + lpStr += (strlen(lpServiceArgVectors[i]) + 1); + } + + dwError = ScmrStartServiceA(BindingHandle, + (unsigned int)hService, + dwNumServiceArgs, + (unsigned char *)lpBuffer, + dwBufSize); + + HeapFree(GetProcessHeap(), 0, lpBuffer); + + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ScmrStartServiceA() failed (Error %lu)\n", dwError); + SetLastError(dwError); + return FALSE; + } + + return TRUE; } /********************************************************************** * StartServiceW * - * @unimplemented + * @implemented */ -BOOL -STDCALL -StartServiceW( - SC_HANDLE hService, - DWORD dwNumServiceArgs, - LPCWSTR *lpServiceArgVectors) +BOOL STDCALL +StartServiceW(SC_HANDLE hService, + DWORD dwNumServiceArgs, + LPCWSTR *lpServiceArgVectors) { #if 0 DWORD dwError; @@ -1593,6 +1650,7 @@ /* Call to services.exe using RPC */ dwError = ScmrStartServiceW(BindingHandle, + hService, dwNumServiceArgs, lpServiceArgVectors); if (dwError != ERROR_SUCCESS) @@ -1604,9 +1662,48 @@ return TRUE; #endif - DPRINT1("StartServiceW is unimplemented, but returns success...\n"); - //SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - //return FALSE; + LPWSTR lpBuffer; + LPWSTR lpStr; + DWORD dwError; + DWORD dwBufSize; + DWORD i; + + dwBufSize = 0; + for (i = 0; i < dwNumServiceArgs; i++) + { + dwBufSize += ((wcslen(lpServiceArgVectors[i]) + 1) * sizeof(WCHAR)); + } + DPRINT1("dwBufSize: %lu\n", dwBufSize); + + lpBuffer = HeapAlloc(GetProcessHeap(), 0, dwBufSize); + if (lpBuffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + lpStr = lpBuffer; + for (i = 0; i < dwNumServiceArgs; i++) + { + wcscpy(lpStr, lpServiceArgVectors[i]); + lpStr += (wcslen(lpServiceArgVectors[i]) + 1); + } + + dwError = ScmrStartServiceW(BindingHandle, + (unsigned int)hService, + dwNumServiceArgs, + (unsigned char *)lpBuffer, + dwBufSize); + + HeapFree(GetProcessHeap(), 0, lpBuffer); + + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ScmrStartServiceW() failed (Error %lu)\n", dwError); + SetLastError(dwError); + return FALSE; + } + return TRUE; } _____ Modified: trunk/reactos/subsys/system/services/rpcserver.c --- trunk/reactos/subsys/system/services/rpcserver.c 2005-12-31 11:22:44 UTC (rev 20479) +++ trunk/reactos/subsys/system/services/rpcserver.c 2005-12-31 11:33:46 UTC (rev 20480) @@ -1730,9 +1730,55 @@ /* Function 19 */ -/* ScmrStartServiceW */ +unsigned long +ScmrStartServiceW(handle_t BindingHandle, + unsigned int hService, + unsigned long dwNumServiceArgs, + unsigned char *lpServiceArgBuffer, + unsigned long cbBufSize) +{ + DWORD dwError = ERROR_SUCCESS; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + DPRINT1("ScmrStartServiceW() called\n"); + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + hSvc = (PSERVICE_HANDLE)hService; + if (hSvc->Handle.Tag != SERVICE_TAG) + { + DPRINT1("Invalid handle tag!\n"); + return ERROR_INVALID_HANDLE; + } + + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SERVICE_START)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + + if (lpService->dwStartType == SERVICE_DISABLED) + return ERROR_SERVICE_DISABLED; + + if (lpService->bDeleted) + return ERROR_SERVICE_MARKED_FOR_DELETE; + + /* FIXME: Start the service */ + + return dwError; +} + + /* Function 20 */ unsigned long ScmrGetServiceDisplayNameW(handle_t BindingHandle, @@ -2019,7 +2065,17 @@ /* Function 31 */ -/* ScmrStartServiceA */ +unsigned long +ScmrStartServiceA(handle_t BindingHandle, + unsigned int hService, + unsigned long dwNumServiceArgs, + unsigned char *lpServiceArgBuffer, + unsigned long cbBufSize) +{ + DPRINT1("ScmrStartServiceA() called\n"); + return ERROR_SUCCESS; +// return ERROR_CALL_NOT_IMPLEMENTED; +} /* Function 32 */
18 years, 11 months
1
0
0
0
[mf] 20479: lean explorer:
by mf@svn.reactos.org
lean explorer: - correct folder display when using the "/e" command line option - handle owner draw menu messages in folder pane Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p --- branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 10:11:58 UTC (rev 20478) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/mainframe.cp p 2005-12-31 11:22:44 UTC (rev 20479) @@ -107,6 +107,8 @@ _shellBrowser = auto_ptr<ShellBrowserChild>(new ShellBrowserChild(_hwnd, _left_hwnd, _right_hwnd, _create_info, _cm_ifs)); + _shellBrowser->Init(); + // update _shellBrowser->_clnt_rect ClientRect rect(_hwnd); resize_frame(rect.right, rect.bottom); @@ -312,11 +314,15 @@ break; - default: + default: { + LRESULT res; + if (_shellBrowser.get()) - return _shellBrowser->WndProc(nmsg, wparam, lparam); - else - return super::WndProc(nmsg, wparam, lparam); + if (_shellBrowser->WndProc(nmsg, wparam, lparam, res)) + return res; + + return super::WndProc(nmsg, wparam, lparam); + } } return 0; _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 10:11:58 UTC (rev 20478) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .cpp 2005-12-31 11:22:44 UTC (rev 20479) @@ -48,6 +48,7 @@ ShellBrowserChild::ShellBrowserChild(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, CtxMenuInterfaces& cm_ifs) : _hwnd(hwnd), + _hWndFrame(hwnd), _left_hwnd(left_hwnd), _right_hwnd(right_hwnd), _create_info(create_info), @@ -65,8 +66,6 @@ _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0); ImageList_SetBkColor(_himl, GetSysColor(COLOR_WINDOW)); - - Init(hwnd); } ShellBrowserChild::~ShellBrowserChild() @@ -89,12 +88,10 @@ } -LRESULT ShellBrowserChild::Init(HWND hWndFrame) +LRESULT ShellBrowserChild::Init() { CONTEXT("ShellBrowserChild::Init()"); - _hWndFrame = hWndFrame; - ClientRect rect(_hwnd); const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR); @@ -271,7 +268,7 @@ ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl; - CHECKERROR(ShellFolderContextMenu(folder, ::GetParent(hwndTreeView), 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs)); + CHECKERROR(ShellFolderContextMenu(folder, _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs)); } else { ShellPath shell_path = entry->create_absolute_pidl(); LPCITEMIDLIST pidl_abs = shell_path; @@ -501,11 +498,12 @@ } -LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +bool ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT& res) { switch(nmsg) { case WM_GETISHELLBROWSER: // for Registry Explorer Plugin - return (LRESULT)static_cast<IShellBrowser*>(this); + res = (LRESULT)static_cast<IShellBrowser*>(this); + return true; // SDI integration: @@ -536,7 +534,8 @@ if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) { SetCursor(LoadCursor(0, IDC_SIZEWE)); - return TRUE; + res = TRUE; + return true; } } goto def; @@ -590,10 +589,11 @@ default: def: - return DefWindowProc(_hwnd, nmsg, wparam, lparam); + return false; } - return 0; + res = 0; + return true; } int ShellBrowserChild::Command(int id, int code) @@ -718,38 +718,37 @@ { Entry* entry = NULL; - ///@todo use OWM_EXPLORE flag in _create_info._open_mode - if (!_cur_dir) _cur_dir = static_cast<ShellDirectory*>(_root._entry); -/*@todo - we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path - _root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME); - -> see FileChildWindow::FileChildWindow() -*/ - if (_cur_dir) { static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24); - LPCITEMIDLIST child_pidl; + if (ILFindChild) { + for(;;) { + LPCITEMIDLIST child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl); + if (!child_pidl || !child_pidl->mkid.cb) + break; - if (ILFindChild) - child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl); - else - child_pidl = pidl; // This is not correct in the common case, but works on the desktop level. + _cur_dir->smart_scan(); - if (child_pidl) { + entry = _cur_dir->find_entry(child_pidl); + if (!entry) + break; + + jump_to(entry); + } + } else { _cur_dir->smart_scan(); - entry = _cur_dir->find_entry(child_pidl); + entry = _cur_dir->find_entry(pidl); // This is not correct in the common case, but works on the desktop level. if (entry) jump_to(entry); } } - //@@ work around as long as we don't iterate correctly through the ShellEntry tree + // in case of any problem directly call UpdateFolderView() if (!entry) UpdateFolderView(ShellFolder(pidl)); } _____ Modified: branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h --- branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 10:11:58 UTC (rev 20478) +++ branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser .h 2005-12-31 11:22:44 UTC (rev 20479) @@ -122,11 +122,11 @@ HTREEITEM _last_sel; public: - LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + bool WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT& res); int Command(int id, int code); int Notify(int id, NMHDR* pnmh); - LRESULT Init(HWND hWndFrame); + LRESULT Init(); void InitializeTree(); int InsertSubitems(HTREEITEM hParentItem, Entry* entry); bool InitDragDrop();
18 years, 11 months
1
0
0
0
[hpoussin] 20478: Fix bugs in ChangeServiceConfig2W spotted by Casper and Royce
by hpoussin@svn.reactos.org
Fix bugs in ChangeServiceConfig2W spotted by Casper and Royce Modified: trunk/reactos/lib/advapi32/service/scm.c _____ Modified: trunk/reactos/lib/advapi32/service/scm.c --- trunk/reactos/lib/advapi32/service/scm.c 2005-12-31 01:38:59 UTC (rev 20477) +++ trunk/reactos/lib/advapi32/service/scm.c 2005-12-31 10:11:58 UTC (rev 20478) @@ -97,8 +97,10 @@ { case SERVICE_CONFIG_DESCRIPTION: lpInfoSize = sizeof(SERVICE_DESCRIPTION); + break; case SERVICE_CONFIG_FAILURE_ACTIONS: lpInfoSize = sizeof(SERVICE_FAILURE_ACTIONS); + break; default: DPRINT1("Unknown info level 0x%lx\n", dwInfoLevel); SetLastError(ERROR_INVALID_PARAMETER); @@ -121,6 +123,8 @@ SetLastError(dwError); return FALSE; } + + return TRUE; }
18 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200