ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2014
----- 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
18 participants
373 discussions
Start a n
N
ew thread
[gadamopoulos] 65245: [SHELL32] - Rename IFileSystemBindDataImpl to CFileSysBindData - Rename IconExtraction to CExtractIcon - Rename IEnumIDListImpl to CEnumIDListBase - Rename IDataObjectImpl to ...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 4 12:49:36 2014 New Revision: 65245 URL:
http://svn.reactos.org/svn/reactos?rev=65245&view=rev
Log: [SHELL32] - Rename IFileSystemBindDataImpl to CFileSysBindData - Rename IconExtraction to CExtractIcon - Rename IEnumIDListImpl to CEnumIDListBase - Rename IDataObjectImpl to CIDLDataObj Modified: branches/shell-experiments/dll/win32/shell32/dataobject.cpp branches/shell-experiments/dll/win32/shell32/enumidlist.cpp branches/shell-experiments/dll/win32/shell32/enumidlist.h branches/shell-experiments/dll/win32/shell32/extracticon.cpp branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp branches/shell-experiments/dll/win32/shell32/folders/fs.cpp branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp branches/shell-experiments/dll/win32/shell32/folders/printers.cpp branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp branches/shell-experiments/dll/win32/shell32/shlfsbind.cpp Modified: branches/shell-experiments/dll/win32/shell32/dataobject.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/dataobject.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/dataobject.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -140,7 +140,7 @@ /* number of supported formats */ #define MAX_FORMATS 5 -class IDataObjectImpl : +class CIDLDataObj : public CComObjectRootEx<CComMultiThreadModelNoCS>, public IDataObject, public IAsyncOperation @@ -158,8 +158,8 @@ UINT cfPreferredDropEffect; BOOL doasync; public: - IDataObjectImpl(); - ~IDataObjectImpl(); + CIDLDataObj(); + ~CIDLDataObj(); HRESULT WINAPI Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx); /////////// @@ -178,13 +178,13 @@ virtual HRESULT WINAPI StartOperation(IBindCtx *pbcReserved); virtual HRESULT WINAPI EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects); -BEGIN_COM_MAP(IDataObjectImpl) +BEGIN_COM_MAP(CIDLDataObj) COM_INTERFACE_ENTRY_IID(IID_IDataObject, IDataObject) COM_INTERFACE_ENTRY_IID(IID_IAsyncOperation, IAsyncOperation) END_COM_MAP() }; -IDataObjectImpl::IDataObjectImpl() +CIDLDataObj::CIDLDataObj() { pidl = NULL; apidl = NULL; @@ -197,14 +197,14 @@ doasync = FALSE; } -IDataObjectImpl::~IDataObjectImpl() +CIDLDataObj::~CIDLDataObj() { TRACE(" destroying IDataObject(%p)\n",this); _ILFreeaPidl(apidl, cidl); ILFree(pidl); } -HRESULT WINAPI IDataObjectImpl::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx) +HRESULT WINAPI CIDLDataObj::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx) { pidl = ILClone(pMyPidl); apidl = _ILCopyaPidl(apidlx, cidlx); @@ -228,7 +228,7 @@ /************************************************************************** * IDataObject_fnGetData */ -HRESULT WINAPI IDataObjectImpl::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium) +HRESULT WINAPI CIDLDataObj::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium) { char szTemp[256]; @@ -274,13 +274,13 @@ return E_OUTOFMEMORY; } -HRESULT WINAPI IDataObjectImpl::GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI IDataObjectImpl::QueryGetData(LPFORMATETC pformatetc) +HRESULT WINAPI CIDLDataObj::GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CIDLDataObj::QueryGetData(LPFORMATETC pformatetc) { UINT i; @@ -302,13 +302,13 @@ return DV_E_TYMED; } -HRESULT WINAPI IDataObjectImpl::GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI IDataObjectImpl::SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease) +HRESULT WINAPI CIDLDataObj::GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CIDLDataObj::SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease) { if (pformatetc->cfFormat == cfPreferredDropEffect) { @@ -327,7 +327,7 @@ return E_NOTIMPL; } -HRESULT WINAPI IDataObjectImpl::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc) +HRESULT WINAPI CIDLDataObj::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc) { TRACE("(%p)->()\n", this); *ppenumFormatEtc = NULL; @@ -341,48 +341,48 @@ return E_NOTIMPL; } -HRESULT WINAPI IDataObjectImpl::DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI IDataObjectImpl::DUnadvise(DWORD dwConnection) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI IDataObjectImpl::EnumDAdvise(IEnumSTATDATA **ppenumAdvise) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI IDataObjectImpl::GetAsyncMode(BOOL *pfIsOpAsync) +HRESULT WINAPI CIDLDataObj::DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CIDLDataObj::DUnadvise(DWORD dwConnection) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CIDLDataObj::EnumDAdvise(IEnumSTATDATA **ppenumAdvise) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CIDLDataObj::GetAsyncMode(BOOL *pfIsOpAsync) { TRACE("(%p)->()\n", this); *pfIsOpAsync = doasync; return S_OK; } -HRESULT WINAPI IDataObjectImpl::InOperation(BOOL *pfInAsyncOp) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} -HRESULT WINAPI IDataObjectImpl::SetAsyncMode(BOOL fDoOpAsync) +HRESULT WINAPI CIDLDataObj::InOperation(BOOL *pfInAsyncOp) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} +HRESULT WINAPI CIDLDataObj::SetAsyncMode(BOOL fDoOpAsync) { TRACE("(%p)->()\n", this); doasync = fDoOpAsync; return S_OK; } -HRESULT WINAPI IDataObjectImpl::StartOperation(IBindCtx *pbcReserved) -{ - FIXME("(%p)->()\n", this); - return E_NOTIMPL; -} -HRESULT WINAPI IDataObjectImpl::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects) +HRESULT WINAPI CIDLDataObj::StartOperation(IBindCtx *pbcReserved) +{ + FIXME("(%p)->()\n", this); + return E_NOTIMPL; +} +HRESULT WINAPI CIDLDataObj::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects) { FIXME("(%p)->()\n", this); return E_NOTIMPL; @@ -395,7 +395,7 @@ */ HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl, IDataObject **dataObject) { - return ShellObjectCreatorInit<IDataObjectImpl>(hwndOwner, pMyPidl, apidl, cidl, IID_IDataObject, dataObject); + return ShellObjectCreatorInit<CIDLDataObj>(hwndOwner, pMyPidl, apidl, cidl, IID_IDataObject, dataObject); } /************************************************************************* Modified: branches/shell-experiments/dll/win32/shell32/enumidlist.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/enumidlist.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/enumidlist.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -22,21 +22,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -IEnumIDListImpl::IEnumIDListImpl() +CEnumIDListBase::CEnumIDListBase() { mpFirst = NULL; mpLast = NULL; mpCurrent = NULL; } -IEnumIDListImpl::~IEnumIDListImpl() +CEnumIDListBase::~CEnumIDListBase() { } /************************************************************************** * AddToEnumList() */ -BOOL IEnumIDListImpl::AddToEnumList(LPITEMIDLIST pidl) +BOOL CEnumIDListBase::AddToEnumList(LPITEMIDLIST pidl) { ENUMLIST *pNew; @@ -76,7 +76,7 @@ /************************************************************************** * DeleteList() */ -BOOL IEnumIDListImpl::DeleteList() +BOOL CEnumIDListBase::DeleteList() { ENUMLIST *pDelete; @@ -98,7 +98,7 @@ /************************************************************************** * HasItemWithCLSID() */ -BOOL IEnumIDListImpl::HasItemWithCLSID(LPITEMIDLIST pidl) +BOOL CEnumIDListBase::HasItemWithCLSID(LPITEMIDLIST pidl) { ENUMLIST *pCur; IID *ptr = _ILGetGUIDPointer(pidl); @@ -126,7 +126,7 @@ /************************************************************************** * CreateFolderEnumList() */ -BOOL IEnumIDListImpl::CreateFolderEnumList( +BOOL CEnumIDListBase::CreateFolderEnumList( LPCWSTR lpszPath, DWORD dwFlags) { @@ -193,7 +193,7 @@ * IEnumIDList_fnNext */ -HRESULT WINAPI IEnumIDListImpl::Next( +HRESULT WINAPI CEnumIDListBase::Next( ULONG celt, LPITEMIDLIST * rgelt, ULONG *pceltFetched) @@ -238,7 +238,7 @@ /************************************************************************** * IEnumIDList_fnSkip */ -HRESULT WINAPI IEnumIDListImpl::Skip( +HRESULT WINAPI CEnumIDListBase::Skip( ULONG celt) { DWORD dwIndex; @@ -259,7 +259,7 @@ /************************************************************************** * IEnumIDList_fnReset */ -HRESULT WINAPI IEnumIDListImpl::Reset() +HRESULT WINAPI CEnumIDListBase::Reset() { TRACE("(%p)\n", this); mpCurrent = mpFirst; @@ -269,7 +269,7 @@ /************************************************************************** * IEnumIDList_fnClone */ -HRESULT WINAPI IEnumIDListImpl::Clone(LPENUMIDLIST *ppenum) +HRESULT WINAPI CEnumIDListBase::Clone(LPENUMIDLIST *ppenum) { TRACE("(%p)->() to (%p)->() E_NOTIMPL\n", this, ppenum); return E_NOTIMPL; @@ -281,5 +281,5 @@ */ HRESULT IEnumIDList_Constructor(IEnumIDList **enumerator) { - return ShellObjectCreator<IEnumIDListImpl>(IID_IEnumIDList, enumerator); -} + return ShellObjectCreator<CEnumIDListBase>(IID_IEnumIDList, enumerator); +} Modified: branches/shell-experiments/dll/win32/shell32/enumidlist.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/enumidlist.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/enumidlist.h [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -23,7 +23,7 @@ LPITEMIDLIST pidl; }; -class IEnumIDListImpl : +class CEnumIDListBase : public CComObjectRootEx<CComMultiThreadModelNoCS>, public IEnumIDList { @@ -32,8 +32,8 @@ ENUMLIST *mpLast; ENUMLIST *mpCurrent; public: - IEnumIDListImpl(); - ~IEnumIDListImpl(); + CEnumIDListBase(); + ~CEnumIDListBase(); BOOL AddToEnumList(LPITEMIDLIST pidl); BOOL DeleteList(); BOOL HasItemWithCLSID(LPITEMIDLIST pidl); @@ -45,7 +45,7 @@ virtual HRESULT STDMETHODCALLTYPE Reset(); virtual HRESULT STDMETHODCALLTYPE Clone(IEnumIDList **ppenum); -BEGIN_COM_MAP(IEnumIDListImpl) +BEGIN_COM_MAP(CEnumIDListBase) COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList) END_COM_MAP() }; Modified: branches/shell-experiments/dll/win32/shell32/extracticon.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/extracticon.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/extracticon.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -17,7 +17,7 @@ UINT index; }; -class IconExtraction : +class CExtractIcon : public CComObjectRootEx<CComMultiThreadModelNoCS>, public IDefaultExtractIconInit, public IExtractIconW, @@ -31,8 +31,8 @@ struct IconLocation openIcon; struct IconLocation shortcutIcon; public: - IconExtraction(); - ~IconExtraction(); + CExtractIcon(); + ~CExtractIcon(); // IDefaultExtractIconInit virtual HRESULT STDMETHODCALLTYPE SetDefaultIcon(LPCWSTR pszFile, int iIcon); @@ -60,7 +60,7 @@ virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName); virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName); -BEGIN_COM_MAP(IconExtraction) +BEGIN_COM_MAP(CExtractIcon) COM_INTERFACE_ENTRY_IID(IID_IDefaultExtractIconInit, IDefaultExtractIconInit) COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW) COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA) @@ -85,7 +85,7 @@ CopyMemory(*Destination, Source, cb); } -IconExtraction::IconExtraction() +CExtractIcon::CExtractIcon() { flags = 0; memset(&defaultIcon, 0, sizeof(defaultIcon)); @@ -94,7 +94,7 @@ memset(&shortcutIcon, 0, sizeof(shortcutIcon)); } -IconExtraction::~IconExtraction() +CExtractIcon::~CExtractIcon() { if (defaultIcon.file) CoTaskMemFree(defaultIcon.file); if (normalIcon.file) CoTaskMemFree(normalIcon.file); @@ -102,7 +102,7 @@ if (shortcutIcon.file) CoTaskMemFree(shortcutIcon.file); } -HRESULT STDMETHODCALLTYPE IconExtraction::SetDefaultIcon( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetDefaultIcon( LPCWSTR pszFile, int iIcon) { @@ -115,7 +115,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::SetFlags( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetFlags( UINT uFlags) { TRACE("(%p, 0x%x)\n", this, uFlags); @@ -124,7 +124,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::SetKey( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetKey( HKEY hkey) { FIXME("(%p, %p)\n", this, hkey); @@ -132,7 +132,7 @@ return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE IconExtraction::SetNormalIcon( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetNormalIcon( LPCWSTR pszFile, int iIcon) { @@ -145,7 +145,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::SetOpenIcon( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetOpenIcon( LPCWSTR pszFile, int iIcon) { @@ -158,7 +158,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::SetShortcutIcon( +HRESULT STDMETHODCALLTYPE CExtractIcon::SetShortcutIcon( LPCWSTR pszFile, int iIcon) { @@ -171,7 +171,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::GetIconLocation( +HRESULT STDMETHODCALLTYPE CExtractIcon::GetIconLocation( UINT uFlags, LPWSTR szIconFile, UINT cchMax, @@ -207,7 +207,7 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::Extract( +HRESULT STDMETHODCALLTYPE CExtractIcon::Extract( LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, @@ -220,7 +220,7 @@ return S_FALSE; } -HRESULT STDMETHODCALLTYPE IconExtraction::GetIconLocation( +HRESULT STDMETHODCALLTYPE CExtractIcon::GetIconLocation( UINT uFlags, LPSTR szIconFile, UINT cchMax, @@ -248,7 +248,7 @@ return hr; } -HRESULT STDMETHODCALLTYPE IconExtraction::Extract( +HRESULT STDMETHODCALLTYPE CExtractIcon::Extract( LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, @@ -282,7 +282,7 @@ return hr; } -HRESULT STDMETHODCALLTYPE IconExtraction::GetClassID( +HRESULT STDMETHODCALLTYPE CExtractIcon::GetClassID( CLSID *pClassID) { TRACE("(%p, %p)\n", this, pClassID); @@ -294,14 +294,14 @@ return S_OK; } -HRESULT STDMETHODCALLTYPE IconExtraction::IsDirty() +HRESULT STDMETHODCALLTYPE CExtractIcon::IsDirty() { FIXME("(%p)\n", this); UNIMPLEMENTED; return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE IconExtraction::Load( +HRESULT STDMETHODCALLTYPE CExtractIcon::Load( LPCOLESTR pszFileName, DWORD dwMode) { @@ -310,7 +310,7 @@ return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE IconExtraction::Save( +HRESULT STDMETHODCALLTYPE CExtractIcon::Save( LPCOLESTR pszFileName, BOOL fRemember) { @@ -319,7 +319,7 @@ return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE IconExtraction::SaveCompleted( +HRESULT STDMETHODCALLTYPE CExtractIcon::SaveCompleted( LPCOLESTR pszFileName) { FIXME("(%p, %s)\n", this, debugstr_w(pszFileName)); @@ -327,7 +327,7 @@ return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE IconExtraction::GetCurFile( +HRESULT STDMETHODCALLTYPE CExtractIcon::GetCurFile( LPOLESTR *ppszFileName) { FIXME("(%p, %p)\n", this, ppszFileName); @@ -337,5 +337,5 @@ HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv) { - return ShellObjectCreator<IconExtraction>(riid, ppv); -} + return ShellObjectCreator<CExtractIcon>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -34,7 +34,7 @@ */ class CControlPanelEnum : - public IEnumIDListImpl + public CEnumIDListBase { public: CControlPanelEnum(); Modified: branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -51,7 +51,7 @@ class CDesktopFolder; class CDesktopFolderEnum : - public IEnumIDListImpl + public CEnumIDListBase { private: // CComPtr fDesktopEnumerator; Modified: branches/shell-experiments/dll/win32/shell32/folders/fs.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -36,7 +36,7 @@ */ class CFileSysEnum : - public IEnumIDListImpl + public CEnumIDListBase { private: public: Modified: branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -40,7 +40,7 @@ */ class CDrivesFolderEnum : - public IEnumIDListImpl + public CEnumIDListBase { public: CDrivesFolderEnum(); Modified: branches/shell-experiments/dll/win32/shell32/folders/printers.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -195,7 +195,7 @@ * Printers folder implementation */ -class CPrintersEnum: public IEnumIDListImpl +class CPrintersEnum: public CEnumIDListBase { public: CPrintersEnum(); Modified: branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -63,7 +63,7 @@ */ class CRecycleBinEnum : - public IEnumIDListImpl + public CEnumIDListBase { private: public: Modified: branches/shell-experiments/dll/win32/shell32/shlfsbind.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] Tue Nov 4 12:49:36 2014 @@ -27,24 +27,24 @@ /*********************************************************************** * IFileSystemBindData implementation */ -class IFileSystemBindDataImpl : +class CFileSysBindData : public CComObjectRootEx<CComMultiThreadModelNoCS>, public IFileSystemBindData { private: WIN32_FIND_DATAW findFile; public: - IFileSystemBindDataImpl(); - ~IFileSystemBindDataImpl(); + CFileSysBindData(); + ~CFileSysBindData(); // *** IFileSystemBindData methods *** virtual HRESULT STDMETHODCALLTYPE SetFindData(const WIN32_FIND_DATAW *pfd); virtual HRESULT STDMETHODCALLTYPE GetFindData(WIN32_FIND_DATAW *pfd); -DECLARE_NOT_AGGREGATABLE(IFileSystemBindDataImpl) +DECLARE_NOT_AGGREGATABLE(CFileSysBindData) DECLARE_PROTECT_FINAL_CONSTRUCT() -BEGIN_COM_MAP(IFileSystemBindDataImpl) +BEGIN_COM_MAP(CFileSysBindData) COM_INTERFACE_ENTRY_IID(IID_IFileSystemBindData, IFileSystemBindData) END_COM_MAP() }; @@ -63,7 +63,7 @@ *ppV = NULL; - hResult = IFileSystemBindDataImpl::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IFileSystemBindData, &fileSystemBindData)); + hResult = CFileSysBindData::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IFileSystemBindData, &fileSystemBindData)); if (FAILED(hResult)) return hResult; hResult = fileSystemBindData->SetFindData(pfd); @@ -128,17 +128,17 @@ return ret; } -IFileSystemBindDataImpl::IFileSystemBindDataImpl() +CFileSysBindData::CFileSysBindData() { memset(&findFile, 0, sizeof(WIN32_FIND_DATAW)); } -IFileSystemBindDataImpl::~IFileSystemBindDataImpl() +CFileSysBindData::~CFileSysBindData() { TRACE(" destroying ISFBindPidl(%p)\n", this); } -HRESULT WINAPI IFileSystemBindDataImpl::GetFindData(WIN32_FIND_DATAW *pfd) +HRESULT WINAPI CFileSysBindData::GetFindData(WIN32_FIND_DATAW *pfd) { TRACE("(%p), %p\n", this, pfd); @@ -149,7 +149,7 @@ return S_OK; } -HRESULT WINAPI IFileSystemBindDataImpl::SetFindData(const WIN32_FIND_DATAW *pfd) +HRESULT WINAPI CFileSysBindData::SetFindData(const WIN32_FIND_DATAW *pfd) { TRACE("(%p), %p\n", this, pfd);
9 years, 10 months
1
0
0
0
[tfaber] 65244: [NTOS:SE] Various minor behavior corrections & simplifications for SeAssignSecurityEx: - Fail on missing subject context or invalid group - Initialize NewDescriptor to NULL on failu...
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Nov 4 12:35:22 2014 New Revision: 65244 URL:
http://svn.reactos.org/svn/reactos?rev=65244&view=rev
Log: [NTOS:SE] Various minor behavior corrections & simplifications for SeAssignSecurityEx: - Fail on missing subject context or invalid group - Initialize NewDescriptor to NULL on failure - Never set SE_*_DEFAULTED flags - Assume a primary token exists - Remove unnecessary variable initialization - Remove unnecessary length alignment CORE-8745 Modified: trunk/reactos/ntoskrnl/se/sd.c Modified: trunk/reactos/ntoskrnl/se/sd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=65244…
============================================================================== --- trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] Tue Nov 4 12:35:22 2014 @@ -1173,12 +1173,12 @@ PISECURITY_DESCRIPTOR ExplicitDescriptor = _ExplicitDescriptor; PISECURITY_DESCRIPTOR_RELATIVE Descriptor; PTOKEN Token; - ULONG OwnerLength = 0; - ULONG GroupLength = 0; - ULONG DaclLength = 0; - ULONG SaclLength = 0; - ULONG Length = 0; - ULONG Control = 0; + ULONG OwnerLength; + ULONG GroupLength; + ULONG DaclLength; + ULONG SaclLength; + ULONG Length; + SECURITY_DESCRIPTOR_CONTROL Control = 0; ULONG Current; PSID Owner = NULL; PSID Group = NULL; @@ -1192,6 +1192,13 @@ PAGED_CODE(); + *NewDescriptor = NULL; + + if (!ARGUMENT_PRESENT(SubjectContext)) + { + return STATUS_NO_TOKEN; + } + /* Lock subject context */ SeLockSubjectContext(SubjectContext); @@ -1210,48 +1217,33 @@ DPRINT("Use explicit owner sid!\n"); Owner = SepGetOwnerFromDescriptor(ExplicitDescriptor); } - if (!Owner) { - if (Token != NULL) - { - DPRINT("Use token owner sid!\n"); - Owner = Token->UserAndGroups[Token->DefaultOwnerIndex].Sid; - } - else - { - DPRINT("Use default owner sid!\n"); - Owner = SeLocalSystemSid; - } - - Control |= SE_OWNER_DEFAULTED; - } - - OwnerLength = ROUND_UP(RtlLengthSid(Owner), 4); + DPRINT("Use token owner sid!\n"); + Owner = Token->UserAndGroups[Token->DefaultOwnerIndex].Sid; + } + + OwnerLength = RtlLengthSid(Owner); + NT_ASSERT(OwnerLength % sizeof(ULONG) == 0); /* Inherit the Group SID */ if (ExplicitDescriptor != NULL) { Group = SepGetGroupFromDescriptor(ExplicitDescriptor); } - if (!Group) { - if (Token != NULL) - { - DPRINT("Use token group sid!\n"); - Group = Token->PrimaryGroup; - } - else - { - DPRINT("Use default group sid!\n"); - Group = SeLocalSystemSid; - } - - Control |= SE_GROUP_DEFAULTED; - } - - GroupLength = ROUND_UP(RtlLengthSid(Group), 4); + DPRINT("Use token group sid!\n"); + Group = Token->PrimaryGroup; + } + if (!Group) + { + SeUnlockSubjectContext(SubjectContext); + return STATUS_INVALID_PRIMARY_GROUP; + } + + GroupLength = RtlLengthSid(Group); + NT_ASSERT(GroupLength % sizeof(ULONG) == 0); /* Inherit the DACL */ if (ExplicitDescriptor != NULL && @@ -1268,23 +1260,17 @@ DPRINT("Use parent DACL!\n"); /* FIXME: Inherit */ Dacl = SepGetDaclFromDescriptor(ParentDescriptor); - Control |= (SE_DACL_PRESENT | SE_DACL_DEFAULTED); - } - else if (Token != NULL && Token->DefaultDacl != NULL) + Control |= SE_DACL_PRESENT; + } + else if (Token->DefaultDacl) { DPRINT("Use token default DACL!\n"); - /* FIXME: Inherit */ Dacl = Token->DefaultDacl; - Control |= (SE_DACL_PRESENT | SE_DACL_DEFAULTED); - } - else - { - DPRINT("Use NULL DACL!\n"); - Dacl = NULL; - Control |= (SE_DACL_PRESENT | SE_DACL_DEFAULTED); - } - - DaclLength = (Dacl != NULL) ? ROUND_UP(Dacl->AclSize, 4) : 0; + Control |= SE_DACL_PRESENT; + } + + DaclLength = (Dacl != NULL) ? Dacl->AclSize : 0; + NT_ASSERT(DaclLength % sizeof(ULONG) == 0); /* Inherit the SACL */ if (ExplicitDescriptor != NULL && @@ -1301,10 +1287,11 @@ DPRINT("Use parent SACL!\n"); /* FIXME: Inherit */ Sacl = SepGetSaclFromDescriptor(ParentDescriptor); - Control |= (SE_SACL_PRESENT | SE_SACL_DEFAULTED); - } - - SaclLength = (Sacl != NULL) ? ROUND_UP(Sacl->AclSize, 4) : 0; + Control |= SE_SACL_PRESENT; + } + + SaclLength = (Sacl != NULL) ? Sacl->AclSize : 0; + NT_ASSERT(SaclLength % sizeof(ULONG) == 0); /* Allocate and initialize the new security descriptor */ Length = sizeof(SECURITY_DESCRIPTOR_RELATIVE) + @@ -1328,7 +1315,7 @@ RtlZeroMemory(Descriptor, Length); RtlCreateSecurityDescriptor(Descriptor, SECURITY_DESCRIPTOR_REVISION); - Descriptor->Control = (USHORT)Control | SE_SELF_RELATIVE; + Descriptor->Control = Control | SE_SELF_RELATIVE; Current = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
9 years, 10 months
1
0
0
0
[gadamopoulos] 65243: [SHELL32] - Simplify CMyDocsFolder folder to use a CFSFolder internally - Note that while CAdminToolsFolder and CFontsFolder should aggregate CFSFolder, CMyDocsFolder shouldn'...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 4 11:45:05 2014 New Revision: 65243 URL:
http://svn.reactos.org/svn/reactos?rev=65243&view=rev
Log: [SHELL32] - Simplify CMyDocsFolder folder to use a CFSFolder internally - Note that while CAdminToolsFolder and CFontsFolder should aggregate CFSFolder, CMyDocsFolder shouldn't and this is implementation is much closer to windows. Modified: branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp branches/shell-experiments/dll/win32/shell32/folders/mydocuments.h Modified: branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1] Tue Nov 4 11:45:05 2014 @@ -33,65 +33,26 @@ * MyDocumentsfolder implementation */ -class CFileSysEnumX : - public IEnumIDListImpl -{ - private: - public: - CFileSysEnumX(); - ~CFileSysEnumX(); - HRESULT WINAPI Initialize(DWORD dwFlags); - - BEGIN_COM_MAP(CFileSysEnumX) - COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList) - END_COM_MAP() -}; - -static const shvheader MyDocumentsSFHeader[] = { - {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, - {IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, - {IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, - {IDS_SHV_COLUMN4, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12}, - {IDS_SHV_COLUMN5, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5} -}; - -#define MYDOCUMENTSSHELLVIEWCOLUMNS 5 - -CFileSysEnumX::CFileSysEnumX() -{ -} - -CFileSysEnumX::~CFileSysEnumX() -{ -} - -HRESULT WINAPI CFileSysEnumX::Initialize(DWORD dwFlags) -{ - WCHAR szPath[MAX_PATH]; - - if (SHGetSpecialFolderPathW(0, szPath, CSIDL_PERSONAL, FALSE) == FALSE) - return E_FAIL; - return CreateFolderEnumList(szPath, dwFlags); -} - CMyDocsFolder::CMyDocsFolder() { + m_pisfInner = NULL; + m_pisf2Inner = NULL; pidlRoot = NULL; sPathTarget = NULL; - mFSDropTarget = NULL; } CMyDocsFolder::~CMyDocsFolder() { - TRACE ("-- destroying IShellFolder(%p)\n", this); SHFree(pidlRoot); - HeapFree(GetProcessHeap(), 0, sPathTarget); - mFSDropTarget->Release(); + if (sPathTarget) + HeapFree(GetProcessHeap(), 0, sPathTarget); + m_pisfInner.Release(); + m_pisf2Inner.Release(); } HRESULT WINAPI CMyDocsFolder::FinalConstruct() { - WCHAR szMyPath[MAX_PATH]; + WCHAR szMyPath[MAX_PATH]; if (!SHGetSpecialFolderPathW(0, szMyPath, CSIDL_PERSONAL, TRUE)) return E_UNEXPECTED; @@ -100,318 +61,103 @@ sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR)); wcscpy(sPathTarget, szMyPath); - LPITEMIDLIST pidl = NULL; - WCHAR szPath[MAX_PATH]; lstrcpynW(szPath, sPathTarget, MAX_PATH); - PathAddBackslashW(szPath); - CComPtr<IShellFolder> psfDesktop = NULL; - - HRESULT hr = SHGetDesktopFolder(&psfDesktop); - if (SUCCEEDED(hr)) - hr = psfDesktop->ParseDisplayName(NULL, NULL, szPath, NULL, &pidl, NULL); - else - ERR("Error getting desktop folder\n"); - - if (SUCCEEDED(hr)) - { - hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &mFSDropTarget)); - CoTaskMemFree(pidl); - if (FAILED(hr)) - ERR("Error Binding"); - } - else - ERR("Error creating from %s\n", debugstr_w(szPath)); - - return S_OK; + + HRESULT hr; + CComPtr<IPersistFolder3> ppf3; + + hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder, &m_pisfInner)); + if (FAILED(hr)) + return hr; + + hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IShellFolder2, &m_pisf2Inner)); + if (FAILED(hr)) + return hr; + + hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); + if (FAILED(hr)) + return hr; + + PERSIST_FOLDER_TARGET_INFO info; + ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); + info.csidl = CSIDL_PERSONAL; + hr = ppf3->InitializeEx(NULL, pidlRoot, &info); + + return hr; } HRESULT WINAPI CMyDocsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, - DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) -{ - WCHAR szElement[MAX_PATH]; - LPCWSTR szNext = NULL; - LPITEMIDLIST pidlTemp = NULL; - HRESULT hr = S_OK; - CLSID clsid; - - TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", - this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), - pchEaten, ppidl, pdwAttributes); - - if (!lpszDisplayName || !ppidl) - return E_INVALIDARG; - - *ppidl = 0; - - if (pchEaten) - *pchEaten = 0; /* strange but like the original */ - - if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') - { - szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); - TRACE("-- element: %s\n", debugstr_w (szElement)); - CLSIDFromString(szElement + 2, &clsid); - pidlTemp = _ILCreateGuid (PT_GUID, clsid); - } - else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) ) - { - *ppidl = pidlTemp; - return S_OK; - } - else - { - /* it's a filesystem path on the desktop. Let a FSFolder parse it */ - - if (*lpszDisplayName) - { - WCHAR szPath[MAX_PATH]; - LPWSTR pathPtr; - - /* build a complete path to create a simple pidl */ - lstrcpynW(szPath, sPathTarget, MAX_PATH); - pathPtr = PathAddBackslashW(szPath); - if (pathPtr) - { - lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath)); - hr = _ILCreateFromPathW(szPath, &pidlTemp); - } - else - { - /* should never reach here, but for completeness */ - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - else - pidlTemp = _ILCreateMyDocuments(); - - szNext = NULL; - } - - if (SUCCEEDED(hr) && pidlTemp) - { - if (szNext && *szNext) - { - hr = SHELL32_ParseNextElement(this, hwndOwner, pbc, - &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); - } - else - { - if (pdwAttributes && *pdwAttributes) - hr = SHELL32_GetItemAttributes(this, pidlTemp, pdwAttributes); - } - } - - *ppidl = pidlTemp; - - TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr); - - return hr; -} - -/************************************************************************** - * ISF_MyDocuments_fnEnumObjects - */ + ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes) +{ + return m_pisfInner->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes); +} + HRESULT WINAPI CMyDocsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CFileSysEnumX>(dwFlags, IID_IEnumIDList, ppEnumIDList); -} - -/************************************************************************** - * CMyDocsFolder::BindToObject - */ + return m_pisfInner->EnumObjects(hwndOwner, dwFlags, ppEnumIDList); +} + HRESULT WINAPI CMyDocsFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) { - TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", - this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut); - - return SHELL32_BindToChild( pidlRoot, sPathTarget, pidl, riid, ppvOut ); -} - -/************************************************************************** - * CMyDocsFolder::BindToStorage - */ + return m_pisfInner->BindToObject(pidl, pbcReserved, riid, ppvOut); +} + HRESULT WINAPI CMyDocsFolder::BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) { - FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", - this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut); - - *ppvOut = NULL; - return E_NOTIMPL; -} - -/************************************************************************** - * CMyDocsFolder::CompareIDs - */ + return m_pisfInner->BindToStorage(pidl, pbcReserved, riid, ppvOut); +} + HRESULT WINAPI CMyDocsFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) { - int nReturn; - - TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", this, lParam, pidl1, pidl2); - nReturn = SHELL32_CompareIDs (this, lParam, pidl1, pidl2); - TRACE ("-- %i\n", nReturn); - return nReturn; -} - -/************************************************************************** - * CMyDocsFolder::CreateViewObject - */ + return m_pisfInner->CompareIDs(lParam, pidl1, pidl2); +} + HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) { - CComPtr<IShellView> pShellView; - HRESULT hr = E_INVALIDARG; - - TRACE ("(%p)->(hwnd=%p,%s,%p)\n", - this, hwndOwner, shdebugstr_guid (&riid), ppvOut); - - if (!ppvOut) - return hr; - - *ppvOut = NULL; - - if (IsEqualIID (riid, IID_IDropTarget)) - { - hr = this->QueryInterface (IID_IDropTarget, ppvOut); - } - else if (IsEqualIID (riid, IID_IContextMenu)) - { - WARN ("IContextMenu not implemented\n"); - hr = E_NOTIMPL; - } - else if (IsEqualIID (riid, IID_IShellView)) - { - hr = IShellView_Constructor ((IShellFolder *)this, &pShellView); - if (pShellView) - { - hr = pShellView->QueryInterface(riid, ppvOut); - } - } - TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut); - return hr; -} - -/************************************************************************** - * CMyDocsFolder::GetAttributesOf - */ + return m_pisfInner->CreateViewObject(hwndOwner, riid, ppvOut); +} + HRESULT WINAPI CMyDocsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) { - HRESULT hr = S_OK; static const DWORD dwMyDocumentsAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_CANCOPY | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; - TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", - this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); - - if (!rgfInOut) - return E_INVALIDARG; - if (cidl && !apidl) - return E_INVALIDARG; - - if (*rgfInOut == 0) - *rgfInOut = ~0; - - if(cidl == 0) { + if(cidl) + { + return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut); + } + else + { + if (!rgfInOut) + return E_INVALIDARG; + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + *rgfInOut &= dwMyDocumentsAttributes; - } else { - while (cidl > 0 && *apidl) { - pdump (*apidl); - if (_ILIsMyDocuments(*apidl)) { - *rgfInOut &= dwMyDocumentsAttributes; - } else { - SHELL32_GetItemAttributes (this, *apidl, rgfInOut); - } - apidl++; - cidl--; - } - } - /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ - *rgfInOut &= ~SFGAO_VALIDATE; - - TRACE ("-- result=0x%08x\n", *rgfInOut); - - return hr; -} - -/************************************************************************** - * CMyDocsFolder::GetUIObjectOf - * - * PARAMETERS - * HWND hwndOwner, //[in ] Parent window for any output - * UINT cidl, //[in ] array size - * LPCITEMIDLIST* apidl, //[in ] simple pidl array - * REFIID riid, //[in ] Requested Interface - * UINT* prgfInOut, //[ ] reserved - * LPVOID* ppvObject) //[out] Resulting Interface - * - */ + + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + return S_OK; + } +} + HRESULT WINAPI CMyDocsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) { - LPITEMIDLIST pidl; - IUnknown *pObj = NULL; - HRESULT hr = E_INVALIDARG; - - TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", - this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut); - - if (!ppvOut) - return hr; - - *ppvOut = NULL; - - if (IsEqualIID (riid, IID_IContextMenu)) - { - IContextMenu * pCm = NULL; - hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm); - pObj = pCm; - } - else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1)) - { - IDataObject * pDo = NULL; - hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, &pDo); - pObj = pDo; - } - else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1)) - { - pidl = ILCombine (pidlRoot, apidl[0]); - pObj = IExtractIconA_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } - else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1)) - { - pidl = ILCombine (pidlRoot, apidl[0]); - pObj = IExtractIconW_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } - else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1)) - { - IDropTarget * pDt = NULL; - hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt)); - pObj = pDt; - } - else if ((IsEqualIID(riid, IID_IShellLinkW) || - IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1)) - { - pidl = ILCombine (pidlRoot, apidl[0]); - hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); - SHFree (pidl); - } - else - hr = E_NOINTERFACE; - - if (SUCCEEDED(hr) && !pObj) - hr = E_OUTOFMEMORY; - - *ppvOut = pObj; - TRACE ("(%p)->hr=0x%08x\n", this, hr); - return hr; + return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut); } HRESULT WINAPI CMyDocsFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) { + if (!_ILIsSpecialFolder(pidl)) + return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet); + HRESULT hr = S_OK; LPWSTR pszPath; @@ -427,7 +173,7 @@ ZeroMemory(pszPath, (MAX_PATH + 1) * sizeof(WCHAR)); - if (_ILIsMyDocuments (pidl)) + if (_ILIsMyDocuments (pidl) || !pidl->mkid.cb) { if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) @@ -436,106 +182,9 @@ HCR_GetClassNameW(CLSID_MyDocuments, pszPath, MAX_PATH); TRACE("CP\n"); } - else if (_ILIsPidlSimple (pidl)) - { - GUID const *clsid; - - if ((clsid = _ILGetGUIDPointer (pidl))) - { - if (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING) - { - int bWantsForParsing; - - /* - * We can only get a filesystem path from a shellfolder if the - * value WantsFORPARSING in CLSID\\{...}\\shellfolder exists. - * - * Exception: The MyComputer folder doesn't have this key, - * but any other filesystem backed folder it needs it. - */ - if (IsEqualIID (*clsid, CLSID_MyDocuments)) - { - bWantsForParsing = TRUE; - } - else - { - /* get the "WantsFORPARSING" flag from the registry */ - static const WCHAR clsidW[] = L"CLSID\\"; - static const WCHAR shellfolderW[] = L"shellfolder"; - static const WCHAR wantsForParsingW[] = L"WantsForParsing"; - WCHAR szRegPath[100]; - LONG r; - - wcscpy (szRegPath, clsidW); - SHELL32_GUIDToStringW (*clsid, &szRegPath[6]); - wcscat (szRegPath, shellfolderW); - r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, - wantsForParsingW, NULL, NULL, NULL); - if (r == ERROR_SUCCESS) - bWantsForParsing = TRUE; - else - bWantsForParsing = FALSE; - } - - if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && - bWantsForParsing) - { - /* - * we need the filesystem path to the destination folder. - * Only the folder itself can know it - */ - hr = SHELL32_GetDisplayNameOfChild (this, pidl, dwFlags, - pszPath, - MAX_PATH); - TRACE("CP\n"); - } - else - { - /* parsing name like ::{...} */ - pszPath[0] = ':'; - pszPath[1] = ':'; - SHELL32_GUIDToStringW (*clsid, &pszPath[2]); - TRACE("CP\n"); - } - } - else - { - /* user friendly name */ - HCR_GetClassNameW (*clsid, pszPath, MAX_PATH); - TRACE("CP\n"); - } - } - else - { - int cLen = 0; - - /* file system folder or file rooted at the desktop */ - if ((GET_SHGDN_FOR(dwFlags) == SHGDN_FORPARSING) && - (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER)) - { - lstrcpynW(pszPath, sPathTarget, MAX_PATH - 1); - TRACE("CP %s\n", debugstr_w(pszPath)); - } - - if (!_ILIsDesktop(pidl)) - { - PathAddBackslashW(pszPath); - cLen = wcslen(pszPath); - _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); - if (!_ILIsFolder(pidl)) - { - SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); - TRACE("CP\n"); - } - } - } - } - else - { - /* a complex pidl, let the subfolder do the work */ - hr = SHELL32_GetDisplayNameOfChild (this, pidl, dwFlags, - pszPath, MAX_PATH); - TRACE("CP\n"); + else + { + hr = E_INVALIDARG; } if (SUCCEEDED(hr)) @@ -551,112 +200,48 @@ } HRESULT WINAPI CMyDocsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */ - LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) -{ - FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this, hwndOwner, pidl, - debugstr_w (lpName), dwFlags, pPidlOut); - - return E_FAIL; + LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) +{ + return m_pisfInner->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut); } HRESULT WINAPI CMyDocsFolder::GetDefaultSearchGUID(GUID *pguid) { - FIXME ("(%p)\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI CMyDocsFolder::EnumSearches(IEnumExtraSearch **ppenum) -{ - FIXME ("(%p)\n", this); - return E_NOTIMPL; + return m_pisf2Inner->GetDefaultSearchGUID(pguid); +} + +HRESULT WINAPI CMyDocsFolder::EnumSearches(IEnumExtraSearch ** ppenum) +{ + return m_pisf2Inner->EnumSearches(ppenum); } HRESULT WINAPI CMyDocsFolder::GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) { - TRACE ("(%p)\n", this); - - if (pSort) - *pSort = 0; - if (pDisplay) - *pDisplay = 0; - - return S_OK; + return m_pisf2Inner->GetDefaultColumn(dwRes, pSort, pDisplay); } HRESULT WINAPI CMyDocsFolder::GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) { - TRACE ("(%p)\n", this); - - if (!pcsFlags || iColumn >= MYDOCUMENTSSHELLVIEWCOLUMNS) - return E_INVALIDARG; - - *pcsFlags = MyDocumentsSFHeader[iColumn].pcsFlags; - - return S_OK; + return m_pisf2Inner->GetDefaultColumnState(iColumn, pcsFlags); } HRESULT WINAPI CMyDocsFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) { - FIXME ("(%p)\n", this); - - return E_NOTIMPL; + return m_pisf2Inner->GetDetailsEx(pidl, pscid, pv); } HRESULT WINAPI CMyDocsFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) { - HRESULT hr = S_OK; - - TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd); - - if (!psd || iColumn >= MYDOCUMENTSSHELLVIEWCOLUMNS) - return E_INVALIDARG; - - if (!pidl) - { - psd->fmt = MyDocumentsSFHeader[iColumn].fmt; - psd->cxChar = MyDocumentsSFHeader[iColumn].cxChar; - psd->str.uType = STRRET_CSTR; - LoadStringA (shell32_hInstance, MyDocumentsSFHeader[iColumn].colnameid, - psd->str.cStr, MAX_PATH); - return S_OK; - } - - /* the data from the pidl */ - psd->str.uType = STRRET_CSTR; - switch (iColumn) - { - case 0: /* name */ - hr = GetDisplayNameOf(pidl, - SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); - break; - case 1: /* size */ - _ILGetFileSize (pidl, psd->str.cStr, MAX_PATH); - break; - case 2: /* type */ - _ILGetFileType (pidl, psd->str.cStr, MAX_PATH); - break; - case 3: /* date */ - _ILGetFileDate (pidl, psd->str.cStr, MAX_PATH); - break; - case 4: /* attributes */ - _ILGetFileAttributes (pidl, psd->str.cStr, MAX_PATH); - break; - } - - return hr; -} - -HRESULT WINAPI CMyDocsFolder::MapColumnToSCID (UINT column, SHCOLUMNID *pscid) -{ - FIXME ("(%p)\n", this); - return E_NOTIMPL; + return m_pisf2Inner->GetDetailsOf(pidl, iColumn, psd); +} + +HRESULT WINAPI CMyDocsFolder::MapColumnToSCID(UINT column, SHCOLUMNID *pscid) +{ + return m_pisf2Inner->MapColumnToSCID(column, pscid); } HRESULT WINAPI CMyDocsFolder::GetClassID(CLSID *lpClassId) { - static GUID const CLSID_MyDocuments = - { 0x450d8fba, 0xad25, 0x11d0, {0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03} }; - TRACE ("(%p)\n", this); if (!lpClassId) @@ -682,26 +267,3 @@ *pidl = ILClone (pidlRoot); return S_OK; } - -HRESULT WINAPI CMyDocsFolder::DragEnter(IDataObject *pDataObject, - DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) -{ - return mFSDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect); -} - -HRESULT WINAPI CMyDocsFolder::DragOver(DWORD dwKeyState, POINTL pt, - DWORD *pdwEffect) -{ - return mFSDropTarget->DragOver(dwKeyState, pt, pdwEffect); -} - -HRESULT WINAPI CMyDocsFolder::DragLeave() -{ - return mFSDropTarget->DragLeave(); -} - -HRESULT WINAPI CMyDocsFolder::Drop(IDataObject *pDataObject, - DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) -{ - return mFSDropTarget->Drop(pDataObject, dwKeyState, pt, pdwEffect); -} Modified: branches/shell-experiments/dll/win32/shell32/folders/mydocuments.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/mydocuments.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/mydocuments.h [iso-8859-1] Tue Nov 4 11:45:05 2014 @@ -26,14 +26,15 @@ public CComCoClass<CMyDocsFolder, &CLSID_MyDocuments>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IShellFolder2, - public IPersistFolder2, - public IDropTarget + public IPersistFolder2 { private: + CComPtr<IShellFolder> m_pisfInner; + CComPtr<IShellFolder2> m_pisf2Inner; + /* both paths are parsible from the MyDocuments */ LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */ LPITEMIDLIST pidlRoot; /* absolute pidl */ - IDropTarget *mFSDropTarget; public: CMyDocsFolder(); ~CMyDocsFolder(); @@ -69,12 +70,6 @@ // IPersistFolder2 virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl); - // IDropTarget - virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); - virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); - virtual HRESULT WINAPI DragLeave(); - virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); - DECLARE_REGISTRY_RESOURCEID(IDR_MYDOCUMENTS) DECLARE_NOT_AGGREGATABLE(CMyDocsFolder) @@ -86,7 +81,6 @@ COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder) COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2) COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) - COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget) END_COM_MAP() };
9 years, 10 months
1
0
0
0
[jgardou] 65242: [IPHLPAPI] - Retrieve unicast addresses and prefixes in GetAdaptersAddresses.
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Nov 4 10:38:43 2014 New Revision: 65242 URL:
http://svn.reactos.org/svn/reactos?rev=65242&view=rev
Log: [IPHLPAPI] - Retrieve unicast addresses and prefixes in GetAdaptersAddresses. Modified: trunk/reactos/dll/win32/iphlpapi/address.c Modified: trunk/reactos/dll/win32/iphlpapi/address.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/address…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/address.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/address.c [iso-8859-1] Tue Nov 4 10:38:43 2014 @@ -89,7 +89,6 @@ return Status; } -#if 0 static NTSTATUS GetSnmpInfo( @@ -128,7 +127,46 @@ return Status; } -#endif + +static +NTSTATUS +GetAddrEntries( + _In_ HANDLE TcpFile, + _In_ TDIEntityID InterfaceID, + _Out_ IPAddrEntry* Entries, + _In_ ULONG NumEntries) +{ + TCP_REQUEST_QUERY_INFORMATION_EX TcpQueryInfo; + IO_STATUS_BLOCK StatusBlock; + NTSTATUS Status; + + ZeroMemory(&TcpQueryInfo, sizeof(TcpQueryInfo)); + TcpQueryInfo.ID.toi_class = INFO_CLASS_PROTOCOL; + TcpQueryInfo.ID.toi_type = INFO_TYPE_PROVIDER; + TcpQueryInfo.ID.toi_id = IP_MIB_ADDRTABLE_ENTRY_ID; + TcpQueryInfo.ID.toi_entity = InterfaceID; + + Status = NtDeviceIoControlFile( + TcpFile, + NULL, + NULL, + NULL, + &StatusBlock, + IOCTL_TCP_QUERY_INFORMATION_EX, + &TcpQueryInfo, + sizeof(TcpQueryInfo), + Entries, + NumEntries * sizeof(Entries[0])); + if (Status == STATUS_PENDING) + { + /* So we have to wait a bit */ + Status = NtWaitForSingleObject(TcpFile, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = StatusBlock.Status; + } + + return Status; +} /* * Fills the IFEntry buffer from tcpip.sys. @@ -439,14 +477,17 @@ return ERROR_NO_DATA; } -/* Disabled for now until someone knows how to differentiate unicast/multicast whatver adresses */ -#if 0 - /* See what we will fill our buffer with */ + /* See if we have anything to add */ + // FIXME: Anycast and multicast + if ((Flags & (GAA_FLAG_SKIP_UNICAST | GAA_FLAG_INCLUDE_PREFIX)) == GAA_FLAG_SKIP_UNICAST) + goto Success; + + /* Now fill in the addresses */ for (i = 0; i < InterfacesCount; i++) { /* Look for network layers */ - if ((InterfacesList[i].tei_entity == CL_TL_ENTITY) - || (InterfacesList[i].tei_entity == CO_TL_ENTITY)) + if ((InterfacesList[i].tei_entity == CL_NL_ENTITY) + || (InterfacesList[i].tei_entity == CO_NL_ENTITY)) { IPSNMPInfo SnmpInfo; PIP_ADAPTER_ADDRESSES CurrentAA = NULL; @@ -457,6 +498,9 @@ Status = GetSnmpInfo(TcpFile, InterfacesList[i], &SnmpInfo); if (!NT_SUCCESS(Status)) goto Error; + + if (SnmpInfo.ipsi_numaddr == 0) + continue; /* Allocate the address entry array and get them */ AddrEntries = HeapAlloc(GetProcessHeap(), @@ -493,12 +537,81 @@ continue; } } + + ERR("address is 0x%08x, mask is 0x%08x\n", AddrEntries[j].iae_addr, AddrEntries[j].iae_mask); + + //FIXME: For now reactos only supports unicast addresses + if (!(Flags & GAA_FLAG_SKIP_UNICAST)) + { + ULONG Size = sizeof(IP_ADAPTER_UNICAST_ADDRESS) + sizeof(SOCKADDR); + + if (Ptr && (RemainingSize >= Size)) + { + PIP_ADAPTER_UNICAST_ADDRESS UnicastAddress = (PIP_ADAPTER_UNICAST_ADDRESS)Ptr; + + /* Fill in the structure */ + UnicastAddress->Length = sizeof(IP_ADAPTER_UNICAST_ADDRESS); + UnicastAddress->Next = CurrentAA->FirstUnicastAddress; + + // FIXME: Put meaningful value here + UnicastAddress->Flags = 0; + UnicastAddress->PrefixOrigin = IpPrefixOriginOther; + UnicastAddress->SuffixOrigin = IpSuffixOriginOther; + UnicastAddress->DadState = IpDadStatePreferred; + UnicastAddress->ValidLifetime = 0xFFFFFFFF; + UnicastAddress->PreferredLifetime = 0xFFFFFFFF; + + /* Set the address */ + //FIXME: ipv4 only (again...) + UnicastAddress->Address.lpSockaddr = (LPSOCKADDR)(UnicastAddress + 1); + UnicastAddress->Address.iSockaddrLength = sizeof(AddrEntries[j].iae_addr); + UnicastAddress->Address.lpSockaddr->sa_family = AF_INET; + memcpy(UnicastAddress->Address.lpSockaddr->sa_data, &AddrEntries[j].iae_addr, sizeof(AddrEntries[j].iae_addr)); + + CurrentAA->FirstUnicastAddress = UnicastAddress; + Ptr += Size; + RemainingSize -= Size; + } + + TotalSize += Size; + } + + if (Flags & GAA_FLAG_INCLUDE_PREFIX) + { + ULONG Size = sizeof(IP_ADAPTER_PREFIX) + sizeof(SOCKADDR); + + if (Ptr && (RemainingSize >= Size)) + { + PIP_ADAPTER_PREFIX Prefix = (PIP_ADAPTER_PREFIX)Ptr; + + /* Fill in the structure */ + Prefix->Length = sizeof(IP_ADAPTER_PREFIX); + Prefix->Next = CurrentAA->FirstPrefix; + + /* Set the address */ + //FIXME: ipv4 only (again...) + Prefix->Address.lpSockaddr = (LPSOCKADDR)(Prefix + 1); + Prefix->Address.iSockaddrLength = sizeof(AddrEntries[j].iae_mask); + Prefix->Address.lpSockaddr->sa_family = AF_INET; + memcpy(Prefix->Address.lpSockaddr->sa_data, &AddrEntries[j].iae_mask, sizeof(AddrEntries[j].iae_mask)); + + /* Compute the prefix size */ + _BitScanReverse(&Prefix->PrefixLength, AddrEntries[j].iae_mask); + + CurrentAA->FirstPrefix = Prefix; + Ptr += Size; + RemainingSize -= Size; + } + + TotalSize += Size; + } } + HeapFree(GetProcessHeap(), 0, AddrEntries); } } -#endif - + +Success: /* We're done */ HeapFree(GetProcessHeap(), 0, InterfacesList); NtClose(TcpFile);
9 years, 10 months
1
0
0
0
[jgardou] 65241: [TCPIP/AFD] - Use less weird internal structures and more public headers.
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Nov 4 10:38:26 2014 New Revision: 65241 URL:
http://svn.reactos.org/svn/reactos?rev=65241&view=rev
Log: [TCPIP/AFD] - Use less weird internal structures and more public headers. Modified: trunk/reactos/drivers/network/afd/afd/tdi.c trunk/reactos/drivers/network/afd/include/afd.h trunk/reactos/drivers/network/tcpip/include/info.h trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c Modified: trunk/reactos/drivers/network/afd/afd/tdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] Tue Nov 4 10:38:26 2014 @@ -768,7 +768,7 @@ TDIEntityID *Entities; ULONG EntityCount; ULONG EntityType; - IPSNMP_INFO SnmpInfo; + IPSNMPInfo SnmpInfo; PIPADDR_ENTRY IpAddress; ULONG BufferSize; NTSTATUS Status = STATUS_SUCCESS; @@ -832,15 +832,15 @@ IP_MIB_STATS_ID, /* Entity id */ &SnmpInfo, /* Output buffer */ &BufferSize); /* Output buffer size */ - if (!NT_SUCCESS(Status) || (SnmpInfo.NumAddr == 0)) { + if (!NT_SUCCESS(Status) || (SnmpInfo.ipsi_numaddr == 0)) { AFD_DbgPrint(MIN_TRACE, ("Unable to get SNMP information or no IP addresses available (Status = 0x%X).\n", Status)); break; } /* Query device for all IP addresses */ - if (SnmpInfo.NumAddr != 0) { - BufferSize = SnmpInfo.NumAddr * sizeof(IPADDR_ENTRY); + if (SnmpInfo.ipsi_numaddr != 0) { + BufferSize = SnmpInfo.ipsi_numaddr * sizeof(IPADDR_ENTRY); IpAddress = (PIPADDR_ENTRY)ExAllocatePool(NonPagedPool, BufferSize); if (!IpAddress) { AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); @@ -861,7 +861,7 @@ break; } - if (SnmpInfo.NumAddr != 1) { + if (SnmpInfo.ipsi_numaddr != 1) { /* Skip loopback address */ *Address = DN2H(IpAddress[1].Addr); } else { Modified: trunk/reactos/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
============================================================================== --- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Tue Nov 4 10:38:26 2014 @@ -14,6 +14,7 @@ #include <ntifs.h> #include <ndk/obtypes.h> #include <tdi.h> +#include <tcpioctl.h> #define _WINBASE_ #define _WINDOWS_H #define _INC_WINDOWS @@ -30,38 +31,9 @@ #define MIN(x,y) (((x)<(y))?(x):(y)) #endif -#define IOCTL_TCP_QUERY_INFORMATION_EX \ - CTL_CODE(FILE_DEVICE_NETWORK, 0, METHOD_NEITHER, FILE_ANY_ACCESS) - #define TL_INSTANCE 0 #define IP_MIB_STATS_ID 1 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 - -typedef struct IPSNMP_INFO { - ULONG Forwarding; - ULONG DefaultTTL; - ULONG InReceives; - ULONG InHdrErrors; - ULONG InAddrErrors; - ULONG ForwDatagrams; - ULONG InUnknownProtos; - ULONG InDiscards; - ULONG InDelivers; - ULONG OutRequests; - ULONG RoutingDiscards; - ULONG OutDiscards; - ULONG OutNoRoutes; - ULONG ReasmTimeout; - ULONG ReasmReqds; - ULONG ReasmOks; - ULONG ReasmFails; - ULONG FragOks; - ULONG FragFails; - ULONG FragCreates; - ULONG NumIf; - ULONG NumAddr; - ULONG NumRoutes; -} IPSNMP_INFO, *PIPSNMP_INFO; typedef struct IPADDR_ENTRY { ULONG Addr; Modified: trunk/reactos/drivers/network/tcpip/include/info.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/info.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/info.h [iso-8859-1] Tue Nov 4 10:38:26 2014 @@ -11,32 +11,6 @@ #define MAX_PHYSADDR_LEN 8 #define MAX_IFDESCR_LEN 256 - -typedef struct IPSNMP_INFO { - ULONG Forwarding; - ULONG DefaultTTL; - ULONG InReceives; - ULONG InHdrErrors; - ULONG InAddrErrors; - ULONG ForwDatagrams; - ULONG InUnknownProtos; - ULONG InDiscards; - ULONG InDelivers; - ULONG OutRequests; - ULONG RoutingDiscards; - ULONG OutDiscards; - ULONG OutNoRoutes; - ULONG ReasmTimeout; - ULONG ReasmReqds; - ULONG ReasmOks; - ULONG ReasmFails; - ULONG FragOks; - ULONG FragFails; - ULONG FragCreates; - ULONG NumIf; - ULONG NumAddr; - ULONG NumRoutes; -} IPSNMP_INFO, *PIPSNMP_INFO; typedef struct IPADDR_ENTRY { ULONG Addr; Modified: trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] Tue Nov 4 10:38:26 2014 @@ -156,18 +156,18 @@ PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize ) { - IPSNMP_INFO SnmpInfo; + IPSNMPInfo SnmpInfo; UINT IfCount = CountInterfaces(); UINT RouteCount = CountFIBs(IF); TDI_STATUS Status = TDI_INVALID_REQUEST; TI_DbgPrint(DEBUG_INFO, ("Called.\n")); - RtlZeroMemory(&SnmpInfo, sizeof(IPSNMP_INFO)); - - SnmpInfo.NumIf = IfCount; - SnmpInfo.NumAddr = 1; - SnmpInfo.NumRoutes = RouteCount; + RtlZeroMemory(&SnmpInfo, sizeof(SnmpInfo)); + + SnmpInfo.ipsi_numif = IfCount; + SnmpInfo.ipsi_numaddr = 1; + SnmpInfo.ipsi_numroutes = RouteCount; Status = InfoCopyOut( (PCHAR)&SnmpInfo, sizeof(SnmpInfo), Buffer, BufferSize );
9 years, 10 months
1
0
0
0
[pschweitzer] 65240: [NTFS] - Move the ROUND_UP & ROUND_DOWN macro definition to header - Make NtfsReadDisk() sector size aware so that it can properly align read on the disk (and thus prevent them...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Nov 4 07:56:20 2014 New Revision: 65240 URL:
http://svn.reactos.org/svn/reactos?rev=65240&view=rev
Log: [NTFS] - Move the ROUND_UP & ROUND_DOWN macro definition to header - Make NtfsReadDisk() sector size aware so that it can properly align read on the disk (and thus prevent them from failing) - If $ATTRIBUTE_LIST is non resident, then display a message and continue, don't assert on it. This is to be implemented later on. This fixes directory enumeration on a Windows 7 NTFS volume. Modified: trunk/reactos/drivers/filesystems/ntfs/blockdev.c trunk/reactos/drivers/filesystems/ntfs/mft.c trunk/reactos/drivers/filesystems/ntfs/ntfs.h trunk/reactos/drivers/filesystems/ntfs/rw.c Modified: trunk/reactos/drivers/filesystems/ntfs/blockdev.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/b…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] Tue Nov 4 07:56:20 2014 @@ -36,6 +36,7 @@ NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject, IN LONGLONG StartingOffset, IN ULONG Length, + IN ULONG SectorSize, IN OUT PUCHAR Buffer, IN BOOLEAN Override) { @@ -45,20 +46,41 @@ KEVENT Event; PIRP Irp; NTSTATUS Status; + ULONGLONG RealReadOffset; + ULONG RealLength; + BOOLEAN AllocatedBuffer = FALSE; + PUCHAR ReadBuffer = Buffer; - DPRINT("NtfsReadDisk(%p, %I64x, %u, %p, %d)\n", DeviceObject, StartingOffset, Length, Buffer, Override); + DPRINT("NtfsReadDisk(%p, %I64x, %u, %u, %p, %d)\n", DeviceObject, StartingOffset, Length, SectorSize, Buffer, Override); KeInitializeEvent(&Event, NotificationEvent, FALSE); - Offset.QuadPart = StartingOffset; + RealReadOffset = (ULONGLONG)StartingOffset; + RealLength = Length; + + if ((RealReadOffset % SectorSize) != 0 || (RealLength % SectorSize) != 0) + { + RealReadOffset = ROUND_DOWN(StartingOffset, SectorSize); + RealLength = ROUND_UP(Length, SectorSize); + + ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength + SectorSize, TAG_NTFS); + if (ReadBuffer == NULL) + { + DPRINT1("Not enough memory!\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + AllocatedBuffer = TRUE; + } + + Offset.QuadPart = RealReadOffset; DPRINT("Building synchronous FSD Request...\n"); Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, DeviceObject, - Buffer, - Length, + ReadBuffer, + RealLength, &Offset, &Event, &IoStatus); @@ -86,6 +108,12 @@ Status = IoStatus.Status; } + if (NT_SUCCESS(Status) && AllocatedBuffer) + { + RtlCopyMemory(Buffer, ReadBuffer + (StartingOffset - RealReadOffset), Length); + ExFreePoolWithTag(ReadBuffer, TAG_NTFS); + } + DPRINT("NtfsReadDisk() done (Status %x)\n", Status); return Status; @@ -105,7 +133,7 @@ Offset = (LONGLONG)DiskSector * (LONGLONG)SectorSize; BlockSize = SectorCount * SectorSize; - return NtfsReadDisk(DeviceObject, Offset, BlockSize, Buffer, Override); + return NtfsReadDisk(DeviceObject, Offset, BlockSize, SectorSize, Buffer, Override); } Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Tue Nov 4 07:56:20 2014 @@ -106,37 +106,43 @@ PNTFS_ATTR_RECORD ListAttrRecordEnd; // Do not handle non-resident yet - ASSERT(!(AttrRecord->IsNonResident & 1)); - - ListContext = PrepareAttributeContext(AttrRecord); - - ListSize = AttributeDataLength(&ListContext->Record); - if(ListSize <= 0xFFFFFFFF) - ListBuffer = ExAllocatePoolWithTag(NonPagedPool, (ULONG)ListSize, TAG_NTFS); + if (AttrRecord->IsNonResident) + { + UNIMPLEMENTED; + continue; + } else - ListBuffer = NULL; - - if(!ListBuffer) - { - DPRINT("Failed to allocate memory: %x\n", (ULONG)ListSize); - continue; - } - - ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; - ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); - - if (ReadAttribute(Vcb, ListContext, 0, ListBuffer, (ULONG)ListSize) == ListSize) - { - Context = FindAttributeHelper(Vcb, ListAttrRecord, ListAttrRecordEnd, - Type, Name, NameLength); - - ReleaseAttributeContext(ListContext); - ExFreePoolWithTag(ListBuffer, TAG_NTFS); - - if (Context != NULL) + { + ListContext = PrepareAttributeContext(AttrRecord); + + ListSize = AttributeDataLength(&ListContext->Record); + if(ListSize <= 0xFFFFFFFF) + ListBuffer = ExAllocatePoolWithTag(NonPagedPool, (ULONG)ListSize, TAG_NTFS); + else + ListBuffer = NULL; + + if(!ListBuffer) { - DPRINT("Found context = %p\n", Context); - return Context; + DPRINT("Failed to allocate memory: %x\n", (ULONG)ListSize); + continue; + } + + ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; + ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); + + if (ReadAttribute(Vcb, ListContext, 0, ListBuffer, (ULONG)ListSize) == ListSize) + { + Context = FindAttributeHelper(Vcb, ListAttrRecord, ListAttrRecordEnd, + Type, Name, NameLength); + + ReleaseAttributeContext(ListContext); + ExFreePoolWithTag(ListBuffer, TAG_NTFS); + + if (Context != NULL) + { + DPRINT("Found context = %p\n", Context); + return Context; + } } } } @@ -310,6 +316,7 @@ Status = NtfsReadDisk(Vcb->StorageDevice, DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster + Offset - CurrentOffset, ReadLength, + Vcb->NtfsInfo.BytesPerSector, (PVOID)Buffer, FALSE); if (NT_SUCCESS(Status)) @@ -344,6 +351,7 @@ Status = NtfsReadDisk(Vcb->StorageDevice, DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster, ReadLength, + Vcb->NtfsInfo.BytesPerSector, (PVOID)Buffer, FALSE); if (!NT_SUCCESS(Status)) Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Tue Nov 4 07:56:20 2014 @@ -10,6 +10,7 @@ #define TAG_NTFS 'SFTN' #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) +#define ROUND_DOWN(N, S) ((N) - ((N) % (S))) #define DEVICE_NAME L"\\Ntfs" @@ -456,6 +457,7 @@ NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject, IN LONGLONG StartingOffset, IN ULONG Length, + IN ULONG SectorSize, IN OUT PUCHAR Buffer, IN BOOLEAN Override); Modified: trunk/reactos/drivers/filesystems/ntfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] Tue Nov 4 07:56:20 2014 @@ -31,11 +31,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *******************************************************************/ - -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) -#define ROUND_DOWN(N, S) ((N) - ((N) % (S))) /* FUNCTIONS ****************************************************************/
9 years, 10 months
1
0
0
0
[pschweitzer] 65239: [NTFS] Try to read the names from the biggest name space to the smallest. Only at the end assert we have to have a name. This fixes name enumeration on Windows 7 NTFS volumes.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Nov 4 07:52:14 2014 New Revision: 65239 URL:
http://svn.reactos.org/svn/reactos?rev=65239&view=rev
Log: [NTFS] Try to read the names from the biggest name space to the smallest. Only at the end assert we have to have a name. This fixes name enumeration on Windows 7 NTFS volumes. Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Tue Nov 4 07:52:14 2014 @@ -137,7 +137,15 @@ DPRINT("NtfsGetNameInformation() called\n"); - FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS); + } + } ASSERT(FileName != NULL); Length = FileName->NameLength * sizeof (WCHAR); @@ -165,7 +173,15 @@ DPRINT("NtfsGetDirectoryInformation() called\n"); - FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS); + } + } ASSERT(FileName != NULL); Length = FileName->NameLength * sizeof (WCHAR); @@ -206,7 +222,15 @@ DPRINT("NtfsGetFullDirectoryInformation() called\n"); - FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS); + } + } ASSERT(FileName != NULL); Length = FileName->NameLength * sizeof (WCHAR); @@ -248,7 +272,15 @@ DPRINT("NtfsGetBothDirectoryInformation() called\n"); - FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_POSIX); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_WIN32); + if (FileName == NULL) + { + FileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS); + } + } ASSERT(FileName != NULL); ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
9 years, 10 months
1
0
0
0
[jimtabor] 65238: [NtUser] - Capture is already set. Trouble shooting CORE-8299 and CORE-3247. - Correct spellings and adding traces.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Nov 4 05:21:41 2014 New Revision: 65238 URL:
http://svn.reactos.org/svn/reactos?rev=65238&view=rev
Log: [NtUser] - Capture is already set. Trouble shooting CORE-8299 and CORE-3247. - Correct spellings and adding traces. Modified: trunk/reactos/win32ss/user/ntuser/focus.c Modified: trunk/reactos/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Tue Nov 4 05:21:41 2014 @@ -25,6 +25,9 @@ return (gppiLockSFW || guSFWLockCount); } +/* + Get capture window via foreground Queue. +*/ HWND FASTCALL IntGetCaptureWindow(VOID) { @@ -701,7 +704,7 @@ (Wnd && !VerifyWnd(Wnd)) || ThreadQueue != pti->MessageQueue ) { - ERR("SetActiveWindow: Summery ERROR, active state changed!\n"); + ERR("SetActiveWindow: Summary ERROR, active state changed!\n"); return FALSE; } @@ -937,6 +940,7 @@ { if (Window->head.pti->MessageQueue != ThreadQueue) { + ERR("Window Thread dos not match Current!\n"); return NULL; } } @@ -957,13 +961,10 @@ { if (ThreadQueue->MenuOwner && Window) ThreadQueue->QF_flags |= QF_CAPTURELOCKED; - //co_IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); co_IntSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); ThreadQueue->QF_flags &= ~QF_CAPTURELOCKED; } - - ThreadQueue->spwndCapture = Window; if (hWnd == NULL) // Release mode. {
9 years, 10 months
1
0
0
0
[hbelusca] 65237: [NTVDM] - Fix the BIOS32 Wait hack (Sleep takes a duration in milliseconds, whereas the BIOS function takes the duration in microseconds). - Initialize the PIT channels with reali...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Nov 3 21:27:20 2014 New Revision: 65237 URL:
http://svn.reactos.org/svn/reactos?rev=65237&view=rev
Log: [NTVDM] - Fix the BIOS32 Wait hack (Sleep takes a duration in milliseconds, whereas the BIOS function takes the duration in microseconds). - Initialize the PIT channels with realistic values (realistic == found on real BIOSes). - Remove unneeded commented code. Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c trunk/reactos/subsystems/ntvdm/dos/mouse32.c trunk/reactos/subsystems/ntvdm/hardware/keyboard.c trunk/reactos/subsystems/ntvdm/hardware/mouse.c Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Mon Nov 3 21:27:20 2014 @@ -166,7 +166,9 @@ * See Ralf Brown:
http://www.ctyme.com/intr/rb-1525.htm
* for more information. */ - Sleep(MAKELONG(getDX(), getCX())); + + // HACK: For now, use the Win32 API (that takes time in milliseconds). + Sleep(MAKELONG(getDX(), getCX()) / 1000); /* Clear CF */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; @@ -471,20 +473,23 @@ IOWriteB(PIC_SLAVE_DATA , 0xFF); - /* Initialize PIT Counter 0 */ + /* Initialize PIT Counter 0 - Mode 2, 16bit binary count */ + // NOTE: Some BIOSes set it to Mode 3 instead. IOWriteB(PIT_COMMAND_PORT, 0x34); + // 18.2Hz refresh rate IOWriteB(PIT_DATA_PORT(0), 0x00); IOWriteB(PIT_DATA_PORT(0), 0x00); - /* Initialize PIT Counter 1 */ - IOWriteB(PIT_COMMAND_PORT, 0x74); - IOWriteB(PIT_DATA_PORT(1), 0x00); - IOWriteB(PIT_DATA_PORT(1), 0x00); - - /* Initialize PIT Counter 2 */ - IOWriteB(PIT_COMMAND_PORT, 0xB4); - IOWriteB(PIT_DATA_PORT(2), 0x00); - IOWriteB(PIT_DATA_PORT(2), 0x00); + /* Initialize PIT Counter 1 - Mode 2, 8bit binary count */ + IOWriteB(PIT_COMMAND_PORT, 0x54); + // DRAM refresh every 15ms:
http://www.cs.dartmouth.edu/~spl/Academic/Organization/docs/PC%20Timer%2082…
+ IOWriteB(PIT_DATA_PORT(1), 18); + + /* Initialize PIT Counter 2 - Mode 3, 16bit binary count */ + IOWriteB(PIT_COMMAND_PORT, 0xB6); + // Count for 440Hz + IOWriteB(PIT_DATA_PORT(2), 0x97); + IOWriteB(PIT_DATA_PORT(2), 0x0A); EnableHwIRQ(0, BiosTimerIrq); } Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/mouse…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] Mon Nov 3 21:27:20 2014 @@ -327,11 +327,11 @@ DriverState.GraphicsCursor.HotSpot.X = getBX(); DriverState.GraphicsCursor.HotSpot.Y = getCX(); - RtlMoveMemory(DriverState.GraphicsCursor.ScreenMask, + RtlCopyMemory(DriverState.GraphicsCursor.ScreenMask, MaskBitmap, sizeof(DriverState.GraphicsCursor.ScreenMask)); - RtlMoveMemory(DriverState.GraphicsCursor.CursorMask, + RtlCopyMemory(DriverState.GraphicsCursor.CursorMask, &MaskBitmap[16], sizeof(DriverState.GraphicsCursor.CursorMask)); Modified: trunk/reactos/subsystems/ntvdm/hardware/keyboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/…
============================================================================== --- trunk/reactos/subsystems/ntvdm/hardware/keyboard.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/hardware/keyboard.c [iso-8859-1] Mon Nov 3 21:27:20 2014 @@ -41,8 +41,6 @@ } DPRINT("Press 0x%X\n", ScanCode); - - // PicInterruptRequest(1); } BOOLEAN KeyboardInit(BYTE PS2Connector) Modified: trunk/reactos/subsystems/ntvdm/hardware/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/…
============================================================================== --- trunk/reactos/subsystems/ntvdm/hardware/mouse.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/hardware/mouse.c [iso-8859-1] Mon Nov 3 21:27:20 2014 @@ -317,7 +317,6 @@ MouseBiosUpdateButtons(LOWORD(MouseEvent->dwButtonState)); // PS2QueuePush(PS2Port, Data); - // PicInterruptRequest(12); } BOOLEAN MouseInit(BYTE PS2Connector)
9 years, 10 months
1
0
0
0
[gadamopoulos] 65236: [SHELL32] - Make CFontsFolder a dumb wrapper around CFSFolder
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Nov 3 21:14:49 2014 New Revision: 65236 URL:
http://svn.reactos.org/svn/reactos?rev=65236&view=rev
Log: [SHELL32] - Make CFontsFolder a dumb wrapper around CFSFolder Modified: branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp branches/shell-experiments/dll/win32/shell32/folders/fonts.h Modified: branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] Mon Nov 3 21:14:49 2014 @@ -34,142 +34,11 @@ * IShellFolder implementation */ -class CDesktopFolderEnumZ: public IEnumIDListImpl -{ - public: - CDesktopFolderEnumZ(); - ~CDesktopFolderEnumZ(); - HRESULT WINAPI Initialize(DWORD dwFlags); - BOOL CreateFontsEnumList(DWORD dwFlags); - - BEGIN_COM_MAP(CDesktopFolderEnumZ) - COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList) - END_COM_MAP() -}; - -static shvheader FontsSFHeader[] = { - {IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, - {IDS_SHV_COLUMN_FONTTYPE , SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, - {IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, - {IDS_SHV_COLUMN12, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15} -}; - -#define COLUMN_NAME 0 -#define COLUMN_TYPE 1 -#define COLUMN_SIZE 2 -#define COLUMN_FILENAME 3 - -#define FontsSHELLVIEWCOLUMNS (4) - -CDesktopFolderEnumZ::CDesktopFolderEnumZ() -{ -} - -CDesktopFolderEnumZ::~CDesktopFolderEnumZ() -{ -} - -HRESULT WINAPI CDesktopFolderEnumZ::Initialize(DWORD dwFlags) -{ - if (CreateFontsEnumList(dwFlags) == FALSE) - return E_FAIL; - return S_OK; -} - -static LPITEMIDLIST _ILCreateFontItem(LPWSTR pszFont, LPWSTR pszFile) -{ - LPITEMIDLIST pidl; - LPPIDLDATA data; - int length = wcslen(pszFont) + 1; - int size = sizeof(PIDLDATA) + sizeof(ITEMIDLIST); - - size += length * sizeof(WCHAR); - size += (wcslen(pszFile) + 1) * sizeof(WCHAR); - - pidl = (LPITEMIDLIST)SHAlloc(size + 5); - if (!pidl) - return pidl; - - ZeroMemory(pidl, size + 5); - pidl->mkid.cb = size + 3; - - data = _ILGetDataPointer(pidl); - data->type = 0x00; - data->u.cfont.dummy = 0xFF; - data->u.cfont.offsFile = length; - wcscpy(data->u.cfont.szName, pszFont); - wcscpy(&data->u.cfont.szName[length], pszFile); - - return pidl; -} - -static PIDLFontStruct * _ILGetFontStruct(LPCITEMIDLIST pidl) -{ - LPPIDLDATA pdata = _ILGetDataPointer(pidl); - - if (pdata && pdata->type == 0x00) - return (PIDLFontStruct*) & (pdata->u.cfont); - - return NULL; -} - -/************************************************************************** - * CDesktopFolderEnumZ::CreateFontsEnumList() - */ -BOOL CDesktopFolderEnumZ::CreateFontsEnumList(DWORD dwFlags) -{ - WCHAR szPath[MAX_PATH]; - WCHAR szName[LF_FACESIZE+20]; - WCHAR szFile[MAX_PATH]; - LPWSTR pszPath; - UINT Length; - LONG ret; - DWORD dwType, dwName, dwFile, dwIndex; - LPITEMIDLIST pidl; - HKEY hKey; - - if (dwFlags & SHCONTF_NONFOLDERS) - { - if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_FONTS, FALSE)) - return FALSE; - - pszPath = PathAddBackslashW(szPath); - if (!pszPath) - return FALSE; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", 0, KEY_READ, &hKey) != ERROR_SUCCESS) - return FALSE; - - Length = pszPath - szPath; - dwIndex = 0; - do - { - dwName = sizeof(szName) / sizeof(WCHAR); - dwFile = sizeof(szFile) / sizeof(WCHAR); - ret = RegEnumValueW(hKey, dwIndex++, szName, &dwName, NULL, &dwType, (LPBYTE)szFile, &dwFile); - if (ret == ERROR_SUCCESS) - { - szFile[(sizeof(szFile)/sizeof(WCHAR))-1] = L'\0'; - if (dwType == REG_SZ && wcslen(szFile) + Length + 1 < (sizeof(szPath) / sizeof(WCHAR))) - { - wcscpy(&szPath[Length], szFile); - pidl = _ILCreateFontItem(szName, szPath); - TRACE("pidl %p name %s path %s\n", pidl, debugstr_w(szName), debugstr_w(szPath)); - if (pidl) - { - if (!AddToEnumList(pidl)) - SHFree(pidl); - } - } - } - } while(ret != ERROR_NO_MORE_ITEMS); - RegCloseKey(hKey); - - } - return TRUE; -} - CFontsFolder::CFontsFolder() { + m_pisfInner = NULL; + m_pisf2Inner = NULL; + pidlRoot = NULL; apidl = NULL; } @@ -182,259 +51,83 @@ HRESULT WINAPI CFontsFolder::FinalConstruct() { - pidlRoot = _ILCreateFont(); /* my qualified pidl */ - if (pidlRoot == NULL) - return E_OUTOFMEMORY; - return S_OK; -} - -/************************************************************************** -* CFontsFolder::ParseDisplayName -*/ -HRESULT WINAPI CFontsFolder::ParseDisplayName( - HWND hwndOwner, - LPBC pbcReserved, - LPOLESTR lpszDisplayName, - DWORD *pchEaten, - PIDLIST_RELATIVE *ppidl, - DWORD * pdwAttributes) -{ - HRESULT hr = E_UNEXPECTED; - - TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this, - hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), - pchEaten, ppidl, pdwAttributes); - - *ppidl = 0; - if (pchEaten) - *pchEaten = 0; /* strange but like the original */ - - TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr); + HRESULT hr; + CComPtr<IPersistFolder3> ppf3; + hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder, &m_pisfInner)); + if (FAILED(hr)) + return hr; + + hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IShellFolder2, &m_pisf2Inner)); + if (FAILED(hr)) + return hr; + + hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); + if (FAILED(hr)) + return hr; + + PERSIST_FOLDER_TARGET_INFO info; + ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); + info.csidl = CSIDL_FONTS; + hr = ppf3->InitializeEx(NULL, _ILCreateFont(), &info); return hr; } -/************************************************************************** -* CFontsFolder::EnumObjects -*/ + +HRESULT WINAPI CFontsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, + ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes) +{ + return m_pisfInner->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes); +} + HRESULT WINAPI CFontsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - return ShellObjectCreatorInit<CDesktopFolderEnumZ>(dwFlags, IID_IEnumIDList, ppEnumIDList); -} - -/************************************************************************** -* CFontsFolder::BindToObject -*/ + return m_pisfInner->EnumObjects(hwndOwner, dwFlags, ppEnumIDList); +} + HRESULT WINAPI CFontsFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) { - TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", this, - pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut); - - return SHELL32_BindToChild (pidlRoot, NULL, pidl, riid, ppvOut); -} - -/************************************************************************** -* CFontsFolder::BindToStorage -*/ + return m_pisfInner->BindToObject(pidl, pbcReserved, riid, ppvOut); +} + HRESULT WINAPI CFontsFolder::BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) { - FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", this, - pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut); - - *ppvOut = NULL; - return E_NOTIMPL; -} - -/************************************************************************** -* CFontsFolder::CompareIDs -*/ + return m_pisfInner->BindToStorage(pidl, pbcReserved, riid, ppvOut); +} HRESULT WINAPI CFontsFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) { - int nReturn; - - TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", this, lParam, pidl1, pidl2); - nReturn = SHELL32_CompareIDs (this, lParam, pidl1, pidl2); - TRACE ("-- %i\n", nReturn); - return nReturn; -} - -/************************************************************************** -* CFontsFolder::CreateViewObject -*/ + return m_pisfInner->CompareIDs(lParam, pidl1, pidl2); +} + HRESULT WINAPI CFontsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) { - CComPtr<IShellView> pShellView; - HRESULT hr = E_INVALIDARG; - - TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this, - hwndOwner, shdebugstr_guid (&riid), ppvOut); - - if (!ppvOut) - return hr; - - *ppvOut = NULL; - - if (IsEqualIID (riid, IID_IDropTarget)) - { - WARN ("IDropTarget not implemented\n"); - hr = E_NOTIMPL; - } - else if (IsEqualIID (riid, IID_IContextMenu)) - { - WARN ("IContextMenu not implemented\n"); - hr = E_NOTIMPL; - } - else if (IsEqualIID (riid, IID_IShellView)) - { - hr = IShellView_Constructor (this, &pShellView); - if (pShellView) - hr = pShellView->QueryInterface(riid, ppvOut); - } - TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut); - return hr; -} - -/************************************************************************** -* CFontsFolder::GetAttributesOf -*/ + return m_pisfInner->CreateViewObject(hwndOwner, riid, ppvOut); +} + HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) { - HRESULT hr = S_OK; - - TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", this, - cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); - - if (!rgfInOut) - return E_INVALIDARG; - if (cidl && !apidl) - return E_INVALIDARG; - - if (*rgfInOut == 0) - *rgfInOut = ~0; - - if (cidl == 0) - { - CComPtr<IShellFolder> psfParent; - LPCITEMIDLIST rpidl = NULL; - - hr = SHBindToParent(pidlRoot, IID_PPV_ARG(IShellFolder, &psfParent), (LPCITEMIDLIST *)&rpidl); - if (SUCCEEDED(hr)) - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - } - else - { - while (cidl > 0 && *apidl) - { - pdump (*apidl); - SHELL32_GetItemAttributes (this, *apidl, rgfInOut); - apidl++; - cidl--; - } - } - - /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ - *rgfInOut &= ~SFGAO_VALIDATE; - - TRACE ("-- result=0x%08x\n", *rgfInOut); - return hr; -} - -/************************************************************************** -* CFontsFolder::GetUIObjectOf -* -* PARAMETERS -* hwndOwner [in] Parent window for any output -* cidl [in] array size -* apidl [in] simple pidl array -* riid [in] Requested Interface -* prgfInOut [ ] reserved -* ppvObject [out] Resulting Interface -* -*/ -HRESULT WINAPI CFontsFolder::GetUIObjectOf( - HWND hwndOwner, - UINT cidl, PCUITEMID_CHILD_ARRAY apidl, - REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) -{ - LPITEMIDLIST pidl; - CComPtr<IUnknown> pObj; - HRESULT hr = E_INVALIDARG; - - TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this, - hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut); - - if (!ppvOut) - return hr; - - *ppvOut = NULL; - - if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1)) - { - pObj = (IContextMenu *)this; - this->apidl = apidl[0]; - hr = S_OK; - } - else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1)) - { - hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj); - } - else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1)) - { - pidl = ILCombine (pidlRoot, apidl[0]); - pObj = IExtractIconA_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } - else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1)) - { - pidl = ILCombine (pidlRoot, apidl[0]); - pObj = IExtractIconW_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } - else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1)) - { - IDropTarget * pDt = NULL; - hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt)); - pObj = pDt; - } - else - hr = E_NOINTERFACE; - - if (SUCCEEDED(hr) && !pObj) - hr = E_OUTOFMEMORY; - - *ppvOut = pObj.Detach(); - TRACE ("(%p)->hr=0x%08x\n", this, hr); - return hr; -} - -/************************************************************************** -* CFontsFolder::GetDisplayNameOf -* -*/ + return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut); +} + +HRESULT WINAPI CFontsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, + REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) +{ + return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut); +} + HRESULT WINAPI CFontsFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) { - PIDLFontStruct *pFont; - - TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet); + if (!_ILIsSpecialFolder(pidl)) + return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet); + + TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet); pdump (pidl); if (!strRet) return E_INVALIDARG; - pFont = _ILGetFontStruct(pidl); - if (pFont) - { - strRet->pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(pFont->szName) + 1) * sizeof(WCHAR)); - if (!strRet->pOleStr) - return E_OUTOFMEMORY; - - wcscpy(strRet->pOleStr, pFont->szName); - strRet->uType = STRRET_WSTR; - } - else if (!pidl->mkid.cb) +if (!pidl->mkid.cb) { WCHAR wszPath[MAX_PATH]; @@ -453,176 +146,52 @@ wcscpy(strRet->pOleStr, wszPath); strRet->uType = STRRET_WSTR; + + return S_OK; } else return E_INVALIDARG; - - return S_OK; -} - -/************************************************************************** -* CFontsFolder::SetNameOf -* Changes the name of a file object or subfolder, possibly changing its item -* identifier in the process. -* -* PARAMETERS -* hwndOwner [in] Owner window for output -* pidl [in] simple pidl of item to change -* lpszName [in] the items new display name -* dwFlags [in] SHGNO formatting flags -* ppidlOut [out] simple pidl returned -*/ -HRESULT WINAPI CFontsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /*simple pidl */ - LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) -{ - FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this, - hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut); - return E_FAIL; +} + +HRESULT WINAPI CFontsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) +{ + return m_pisfInner->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut); } HRESULT WINAPI CFontsFolder::GetDefaultSearchGUID(GUID *pguid) { - FIXME ("(%p)\n", this); - return E_NOTIMPL; -} - -HRESULT WINAPI CFontsFolder::EnumSearches(IEnumExtraSearch **ppenum) -{ - FIXME ("(%p)\n", this); - return E_NOTIMPL; + return m_pisf2Inner->GetDefaultSearchGUID(pguid); +} + +HRESULT WINAPI CFontsFolder::EnumSearches(IEnumExtraSearch ** ppenum) +{ + return m_pisf2Inner->EnumSearches(ppenum); } HRESULT WINAPI CFontsFolder::GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) { - TRACE ("(%p)\n", this); - - if (pSort) - *pSort = 0; - if (pDisplay) - *pDisplay = 0; - - return S_OK; + return m_pisf2Inner->GetDefaultColumn(dwRes, pSort, pDisplay); } HRESULT WINAPI CFontsFolder::GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) { - TRACE ("(%p)\n", this); - - if (!pcsFlags || iColumn >= FontsSHELLVIEWCOLUMNS) - return E_INVALIDARG; - *pcsFlags = FontsSFHeader[iColumn].pcsFlags; - return S_OK; + return m_pisf2Inner->GetDefaultColumnState(iColumn, pcsFlags); } HRESULT WINAPI CFontsFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) { - FIXME ("(%p)\n", this); - return E_NOTIMPL; + return m_pisf2Inner->GetDetailsEx(pidl, pscid, pv); } HRESULT WINAPI CFontsFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) { - WCHAR buffer[MAX_PATH] = {0}; - HRESULT hr = E_FAIL; - PIDLFontStruct * pfont; - HANDLE hFile; - LARGE_INTEGER FileSize; - SHFILEINFOW fi; - - TRACE("(%p, %p, %d, %p)\n", this, pidl, iColumn, psd); - - if (iColumn >= FontsSHELLVIEWCOLUMNS) - return E_FAIL; - - psd->fmt = FontsSFHeader[iColumn].fmt; - psd->cxChar = FontsSFHeader[iColumn].cxChar; - if (pidl == NULL) - { - psd->str.uType = STRRET_WSTR; - if (LoadStringW(shell32_hInstance, FontsSFHeader[iColumn].colnameid, buffer, MAX_PATH)) - hr = SHStrDupW(buffer, &psd->str.pOleStr); - - return hr; - } - - if (iColumn == COLUMN_NAME) - { - psd->str.uType = STRRET_WSTR; - return GetDisplayNameOf(pidl, SHGDN_NORMAL, &psd->str); - } - - psd->str.uType = STRRET_CSTR; - psd->str.cStr[0] = '\0'; - - switch(iColumn) - { - case COLUMN_TYPE: - pfont = _ILGetFontStruct(pidl); - if (pfont) - { - if (SHGetFileInfoW(pfont->szName + pfont->offsFile, 0, &fi, sizeof(fi), SHGFI_TYPENAME)) - { - psd->str.pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(fi.szTypeName) + 1) * sizeof(WCHAR)); - if (!psd->str.pOleStr) - return E_OUTOFMEMORY; - wcscpy(psd->str.pOleStr, fi.szTypeName); - psd->str.uType = STRRET_WSTR; - return S_OK; - } - } - break; - case COLUMN_SIZE: - pfont = _ILGetFontStruct(pidl); - if (pfont) - { - hFile = CreateFileW(pfont->szName + pfont->offsFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile != INVALID_HANDLE_VALUE) - { - if (GetFileSizeEx(hFile, &FileSize)) - { - if (StrFormatByteSizeW(FileSize.QuadPart, buffer, sizeof(buffer) / sizeof(WCHAR))) - { - psd->str.pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(buffer) + 1) * sizeof(WCHAR)); - if (!psd->str.pOleStr) - { - CloseHandle(hFile); - return E_OUTOFMEMORY; - } - wcscpy(psd->str.pOleStr, buffer); - psd->str.uType = STRRET_WSTR; - CloseHandle(hFile); - return S_OK; - } - } - CloseHandle(hFile); - } - } - break; - case COLUMN_FILENAME: - pfont = _ILGetFontStruct(pidl); - if (pfont) - { - psd->str.pOleStr = (LPWSTR)CoTaskMemAlloc((wcslen(pfont->szName + pfont->offsFile) + 1) * sizeof(WCHAR)); - if (psd->str.pOleStr) - { - psd->str.uType = STRRET_WSTR; - wcscpy(psd->str.pOleStr, pfont->szName + pfont->offsFile); - return S_OK; - } - else - return E_OUTOFMEMORY; - } - break; - } - - return E_FAIL; + return m_pisf2Inner->GetDetailsOf(pidl, iColumn, psd); } HRESULT WINAPI CFontsFolder::MapColumnToSCID(UINT column, SHCOLUMNID *pscid) { - FIXME ("(%p)\n", this); - - return E_NOTIMPL; + return m_pisf2Inner->MapColumnToSCID(column, pscid); } /************************************************************************ @@ -666,125 +235,3 @@ return S_OK; } - -/************************************************************************** -* IContextMenu2 Implementation -*/ - -/************************************************************************** -* CFontsFolder::QueryContextMenu() -*/ -HRESULT WINAPI CFontsFolder::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) -{ - WCHAR szBuffer[30] = {0}; - ULONG Count = 1; - - TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", - this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - - if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); - Count++; - } - - if (LoadStringW(shell32_hInstance, IDS_PRINT_VERB, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); - } - - if (LoadStringW(shell32_hInstance, IDS_COPY, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); - } - - if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); - } - - if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); - } - - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); -} - -/************************************************************************** -* CFontsFolder::InvokeCommand() -*/ -HRESULT WINAPI CFontsFolder::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) -{ - SHELLEXECUTEINFOW sei; - PIDLFontStruct * pfont; - SHFILEOPSTRUCTW op; - - TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n", this, lpcmi, lpcmi->lpVerb, lpcmi->hwnd); - - if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(2) || lpcmi->lpVerb == MAKEINTRESOURCEA(7)) - { - ZeroMemory(&sei, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.hwnd = lpcmi->hwnd; - sei.nShow = SW_SHOWNORMAL; - if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) - sei.lpVerb = L"open"; - else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) - sei.lpVerb = L"print"; - else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7)) - sei.lpVerb = L"properties"; - - pfont = _ILGetFontStruct(apidl); - sei.lpFile = pfont->szName + pfont->offsFile; - - if (ShellExecuteExW(&sei) == FALSE) - return E_FAIL; - } - else if (lpcmi->lpVerb == MAKEINTRESOURCEA(4)) - { - FIXME("implement font copying\n"); - return E_NOTIMPL; - } - else if (lpcmi->lpVerb == MAKEINTRESOURCEA(6)) - { - ZeroMemory(&op, sizeof(op)); - op.hwnd = lpcmi->hwnd; - op.wFunc = FO_DELETE; - op.fFlags = FOF_ALLOWUNDO; - pfont = _ILGetFontStruct(apidl); - op.pFrom = pfont->szName + pfont->offsFile; - SHFileOperationW(&op); - } - - return S_OK; -} - -/************************************************************************** - * CFontsFolder::GetCommandString() - * - */ -HRESULT WINAPI CFontsFolder::GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) -{ - TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); - - return E_FAIL; -} - -/************************************************************************** -* CFontsFolder::HandleMenuMsg() -*/ -HRESULT WINAPI CFontsFolder::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - TRACE("(%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam); - - return E_NOTIMPL; -} Modified: branches/shell-experiments/dll/win32/shell32/folders/fonts.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/fonts.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/fonts.h [iso-8859-1] Mon Nov 3 21:14:49 2014 @@ -26,10 +26,12 @@ public CComCoClass<CFontsFolder, &CLSID_FontsFolderShortcut>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IShellFolder2, - public IPersistFolder2, - public IContextMenu2 + public IPersistFolder2 { private: + CComPtr<IShellFolder> m_pisfInner; + CComPtr<IShellFolder2> m_pisf2Inner; + /* both paths are parsible from the desktop */ LPITEMIDLIST pidlRoot; /* absolute pidl */ LPCITEMIDLIST apidl; /* currently focused font item */ @@ -68,14 +70,6 @@ // IPersistFolder2 virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST *pidl); - // IContextMenu - virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); - virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); - virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen); - - // IContextMenu2 - virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam); - DECLARE_REGISTRY_RESOURCEID(IDR_FONTSFOLDERSHORTCUT) DECLARE_NOT_AGGREGATABLE(CFontsFolder) @@ -87,8 +81,6 @@ COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder) COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2) COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) - COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) - COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2) END_COM_MAP() };
9 years, 10 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
38
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
Results per page:
10
25
50
100
200