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
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2013
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
348 discussions
Start a n
N
ew thread
[gadamopoulos] 61049: [shell32] - Implement cut and paste shortcut - Patch by Huw Campbell - CORE-7548
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 19 20:53:16 2013 New Revision: 61049 URL:
http://svn.reactos.org/svn/reactos?rev=61049&view=rev
Log: [shell32] - Implement cut and paste shortcut - Patch by Huw Campbell - CORE-7548 Modified: trunk/reactos/dll/win32/shell32/dataobject.cpp trunk/reactos/dll/win32/shell32/defcontextmenu.cpp trunk/reactos/dll/win32/shell32/folders/desktop.cpp trunk/reactos/dll/win32/shell32/folders/desktop.h trunk/reactos/dll/win32/shell32/folders/fs.cpp trunk/reactos/dll/win32/shell32/folders/fs.h trunk/reactos/dll/win32/shell32/shellfolder.h Modified: trunk/reactos/dll/win32/shell32/dataobject.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dataobje…
============================================================================== --- trunk/reactos/dll/win32/shell32/dataobject.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/dataobject.cpp [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -159,7 +159,7 @@ */ /* number of supported formats */ -#define MAX_FORMATS 4 +#define MAX_FORMATS 5 class IDataObjectImpl : public CComObjectRootEx<CComMultiThreadModelNoCS>, @@ -169,11 +169,13 @@ LPITEMIDLIST pidl; LPITEMIDLIST * apidl; UINT cidl; + DWORD dropeffect; FORMATETC pFormatEtc[MAX_FORMATS]; UINT cfShellIDList; UINT cfFileNameA; UINT cfFileNameW; + UINT cfPreferredDropEffect; public: IDataObjectImpl(); ~IDataObjectImpl(); @@ -200,9 +202,11 @@ pidl = NULL; apidl = NULL; cidl = 0; + dropeffect = 0; cfShellIDList = 0; cfFileNameA = 0; cfFileNameW = 0; + cfPreferredDropEffect = 0; } IDataObjectImpl::~IDataObjectImpl() @@ -219,14 +223,17 @@ if (pidl == NULL || apidl == NULL) return E_OUTOFMEMORY; cidl = cidlx; + dropeffect = DROPEFFECT_COPY; cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST); cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA); cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW); + cfPreferredDropEffect = RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECTW); InitFormatEtc(pFormatEtc[0], cfShellIDList, TYMED_HGLOBAL); InitFormatEtc(pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL); InitFormatEtc(pFormatEtc[2], cfFileNameA, TYMED_HGLOBAL); InitFormatEtc(pFormatEtc[3], cfFileNameW, TYMED_HGLOBAL); + InitFormatEtc(pFormatEtc[4], cfPreferredDropEffect, TYMED_HGLOBAL); return S_OK; } @@ -260,6 +267,10 @@ { if (cidl < 1) return(E_UNEXPECTED); pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl); + } + else if (pformatetcIn->cfFormat == cfPreferredDropEffect) + { + pmedium->hGlobal = RenderPREFEREDDROPEFFECT(dropeffect); } else { @@ -311,6 +322,19 @@ HRESULT WINAPI IDataObjectImpl::SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease) { + if (pformatetc->cfFormat == cfPreferredDropEffect) + { + const DWORD *src = (const DWORD *)GlobalLock(pmedium->hGlobal); + if (src != 0) + { + dropeffect = *src; + GlobalUnlock(pmedium->hGlobal); + return S_OK; + } + FIXME("Error setting data"); + return E_FAIL; + } + FIXME("(%p)->()\n", this); return E_NOTIMPL; } Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/defconte…
============================================================================== --- trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -59,6 +59,7 @@ UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu); UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags); HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi); + HRESULT DoPasteLink(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoDelete(LPCMINVOKECOMMANDINFO lpcmi); @@ -950,77 +951,70 @@ { HRESULT hr; - IDataObject *pda; - if (OleGetClipboard(&pda) != S_OK) - return E_FAIL; + CComPtr<IDataObject> pda; + hr = OleGetClipboard(&pda); + if (FAILED(hr)) + return hr; STGMEDIUM medium; FORMATETC formatetc; InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); hr = pda->GetData(&formatetc, &medium); - if (FAILED(hr)) - { - pda->Release(); - return E_FAIL; - } + return hr; /* lock the handle */ LPIDA lpcida = (LPIDA)GlobalLock(medium.hGlobal); if (!lpcida) { ReleaseStgMedium(&medium); - pda->Release(); return E_FAIL; } /* convert the data into pidl */ LPITEMIDLIST pidl; LPITEMIDLIST *apidl = _ILCopyCidaToaPidl(&pidl, lpcida); - if (!apidl) + { + ReleaseStgMedium(&medium); return E_FAIL; - - IShellFolder *psfDesktop; - if (FAILED(SHGetDesktopFolder(&psfDesktop))) - { - SHFree(pidl); - _ILFreeaPidl(apidl, lpcida->cidl); - ReleaseStgMedium(&medium); - pda->Release(); - return E_FAIL; - } + } + + CComPtr<IShellFolder> psfDesktop; + CComPtr<IShellFolder> psfFrom = NULL; + CComPtr<IShellFolder> psfTarget = NULL; + CComPtr<ISFHelper> psfhlpdst; + CComPtr<ISFHelper> psfhlpsrc; + bool bCopy = TRUE; + + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + goto cleanup; /* Find source folder */ - IShellFolder *psfFrom = NULL; if (_ILIsDesktop(pidl)) { /* use desktop shellfolder */ psfFrom = psfDesktop; } - else if (FAILED(psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfFrom)))) - { - ERR("no IShellFolder\n"); - - psfDesktop->Release(); - SHFree(pidl); - _ILFreeaPidl(apidl, lpcida->cidl); - ReleaseStgMedium(&medium); - pda->Release(); - - return E_FAIL; + else + { + hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfFrom)); + if (FAILED(hr)) + { + ERR("no IShellFolder\n"); + goto cleanup; + } } /* Find target folder */ - IShellFolder *psfTarget = NULL; if (m_Dcm.cidl) { - psfDesktop->Release(); hr = m_Dcm.psf->BindToObject(m_Dcm.apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfTarget)); } else { - IPersistFolder2 *ppf2 = NULL; + CComPtr<IPersistFolder2> ppf2 = NULL; LPITEMIDLIST pidl; /* cidl is zero due to explorer view */ @@ -1028,7 +1022,6 @@ if (SUCCEEDED(hr)) { hr = ppf2->GetCurFolder(&pidl); - ppf2->Release(); if (SUCCEEDED(hr)) { if (_ILIsDesktop(pidl)) @@ -1041,7 +1034,7 @@ /* retrieve target desktop folder */ hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfTarget)); } - TRACE("psfTarget %x %p, Desktop %u\n", hr, psfTarget, _ILIsDesktop(pidl)); + TRACE("psfTarget %x %p, Desktop %u\n", hr, psfTarget.p, _ILIsDesktop(pidl)); ILFree(pidl); } } @@ -1050,70 +1043,51 @@ if (FAILED(hr)) { ERR("no IShellFolder\n"); - - psfFrom->Release(); - SHFree(pidl); - _ILFreeaPidl(apidl, lpcida->cidl); - ReleaseStgMedium(&medium); - pda->Release(); - - return E_FAIL; + goto cleanup; } /* get source and destination shellfolder */ - ISFHelper *psfhlpdst; - if (FAILED(psfTarget->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpdst)))) + hr = psfTarget->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpdst)); + if (FAILED(hr)) { ERR("no IID_ISFHelper for destination\n"); - - psfFrom->Release(); - psfTarget->Release(); - SHFree(pidl); - _ILFreeaPidl(apidl, lpcida->cidl); - ReleaseStgMedium(&medium); - pda->Release(); - - return E_FAIL; - } - - ISFHelper *psfhlpsrc; - if (FAILED(psfFrom->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpsrc)))) + goto cleanup; + } + + hr = psfFrom->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpsrc)); + if (FAILED(hr)) { ERR("no IID_ISFHelper for source\n"); - - psfhlpdst->Release(); - psfFrom->Release(); - psfTarget->Release(); - SHFree(pidl); - _ILFreeaPidl(apidl, lpcida->cidl); - ReleaseStgMedium(&medium); - pda->Release(); - return E_FAIL; - } - - /* FIXXME - * do we want to perform a copy or move ??? - */ - hr = psfhlpdst->CopyItems(psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); - - psfhlpdst->Release(); - psfhlpsrc->Release(); - psfFrom->Release(); - psfTarget->Release(); + goto cleanup; + } + + FORMATETC formatetc2; + STGMEDIUM medium2; + InitFormatEtc(formatetc2, RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECT), TYMED_HGLOBAL); + + if SUCCEEDED(pda->GetData(&formatetc2, &medium2)) + { + DWORD * pdwFlag = (DWORD*)GlobalLock(medium2.hGlobal); + if (pdwFlag) + { + TRACE("Current drop effect flag %i\n", *pdwFlag); + if (*pdwFlag & DROPEFFECT_MOVE) + bCopy = FALSE; + } + GlobalUnlock(medium2.hGlobal); + } + + hr = psfhlpdst->CopyItems(psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl, bCopy); + + NotifyShellViewWindow(lpcmi, TRUE); + +cleanup: SHFree(pidl); _ILFreeaPidl(apidl, lpcida->cidl); ReleaseStgMedium(&medium); - pda->Release(); + TRACE("CP result %x\n", hr); return S_OK; -} - -HRESULT -CDefaultContextMenu::DoOpenOrExplore( - LPCMINVOKECOMMANDINFO lpcmi) -{ - UNIMPLEMENTED; - return E_FAIL; } BOOL @@ -1141,7 +1115,203 @@ } return TRUE; - +} + +HRESULT +CDefaultContextMenu::DoPasteLink( + LPCMINVOKECOMMANDINFO lpcmi) +{ + HRESULT hr; + WCHAR wszPath[MAX_PATH]; + WCHAR wszTarget[MAX_PATH]; + + CComPtr<IDataObject> pda; + hr = OleGetClipboard(&pda); + if (FAILED(hr)) + return hr; + + STGMEDIUM medium; + FORMATETC formatetc; + InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + hr = pda->GetData(&formatetc, &medium); + if (FAILED(hr)) + return hr; + + /* lock the handle */ + LPIDA lpcida = (LPIDA)GlobalLock(medium.hGlobal); + if (!lpcida) + { + ReleaseStgMedium(&medium); + return E_FAIL; + } + + /* convert the clipboard data into pidl (pointer to id list) */ + LPITEMIDLIST pidl; + LPITEMIDLIST *apidl = _ILCopyCidaToaPidl(&pidl, lpcida); + if (!apidl) + { + ReleaseStgMedium(&medium); + return E_FAIL; + } + + CComPtr<IShellFolder> psfDesktop; + CComPtr<IPersistFolder2> ppf2 = NULL; + CComPtr<IShellFolder> psfFrom = NULL; + + /* Grab the desktop shell folder */ + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + { + ERR("SHGetDesktopFolder failed\n"); + goto cleanup; + } + + /* Find source folder, this is where the clipboard data was copied from */ + if (_ILIsDesktop(pidl)) + { + /* use desktop shell folder */ + psfFrom = psfDesktop; + } + else + { + hr = psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder, (LPVOID*)&psfFrom); + if (FAILED(hr)) + { + ERR("no IShellFolder\n"); + goto cleanup; + } + } + + /* Find the target path, where we will be saving the new links (where the user right clicked) */ + STRRET strFile; + WCHAR wszTargetPath[MAX_PATH]; + + LPITEMIDLIST targetpidl; + + hr = m_Dcm.psf->QueryInterface(IID_IPersistFolder2, (LPVOID *) &ppf2); + if (SUCCEEDED(hr)) + { + hr = ppf2->GetCurFolder(&targetpidl); + if (SUCCEEDED(hr)) + { + hr = psfDesktop->GetDisplayNameOf(targetpidl, SHGDN_FORPARSING, &strFile); + ILFree(targetpidl); + if (SUCCEEDED(hr)) + { + hr = StrRetToBufW(&strFile, NULL, wszTargetPath, _countof(wszTargetPath)); + } + } + } + + if (FAILED(hr)) + { + ERR("Error obtaining target path"); + goto cleanup; + } + TRACE("target path = %s", debugstr_w(wszTargetPath)); + + /* We need to create a link for each pidl in the copied items, so step through the pidls from the clipboard */ + for (UINT i = 0; i < lpcida->cidl; i++) + { + //Find out which file we're copying + STRRET strFile; + hr = psfFrom->GetDisplayNameOf(apidl[i], SHGDN_FORPARSING, &strFile); + if (FAILED(hr)) + { + ERR("Error source obtaining path"); + break; + } + + hr = StrRetToBufW(&strFile, apidl[i], wszPath, _countof(wszPath)); + if (FAILED(hr)) + { + ERR("Error putting source path into buffer"); + break; + } + TRACE("source path = %s", debugstr_w(wszPath)); + + // Creating a buffer to hold the combined path + WCHAR buffer_1[MAX_PATH] = L""; + WCHAR *lpStr1; + lpStr1 = buffer_1; + + LPWSTR pwszFileName = PathFindFileNameW(wszPath); + LPWSTR pwszExt = PathFindExtensionW(wszPath); + LPWSTR placementPath = PathCombineW(lpStr1, wszTargetPath, pwszFileName); + CComPtr<IPersistFile> ppf; + + //Check to see if it's already a link. + if (!wcsicmp(pwszExt, L".lnk")) + { + //It's a link so, we create a new one which copies the old. + if(!GetUniqueFileName(placementPath, pwszExt, wszTarget, TRUE)) + { + ERR("Error getting unique file name"); + hr = E_FAIL; + break; + } + hr = IShellLink_ConstructFromFile(NULL, IID_IPersistFile, ILCombine(pidl, apidl[i]), (LPVOID*)&ppf); + if (FAILED(hr)) { + ERR("Error constructing link from file"); + break; + } + + hr = ppf->Save(wszTarget, FALSE); + } + else + { + //It's not a link, so build a new link using the creator class and fill it in. + //Create a file name for the link + if (!GetUniqueFileName(placementPath, L".lnk", wszTarget, TRUE)) + { + ERR("Error creating unique file name"); + hr = E_FAIL; + break; + } + + CComPtr<IShellLinkW> pLink; + hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellLinkW, &pLink)); + if (FAILED(hr)) { + ERR("Error instantiating IShellLinkW"); + break; + } + + WCHAR szDirPath[MAX_PATH], *pwszFile; + GetFullPathName(wszPath, MAX_PATH, szDirPath, &pwszFile); + if (pwszFile) pwszFile[0] = 0; + + hr = pLink->SetPath(wszPath); + if(FAILED(hr)) + break; + + hr = pLink->SetWorkingDirectory(szDirPath); + if(FAILED(hr)) + break; + + hr = pLink->QueryInterface(IID_PPV_ARG(IPersistFile, &ppf)); + if(FAILED(hr)) + break; + + hr = ppf->Save(wszTarget, TRUE); + } + } + + NotifyShellViewWindow(lpcmi, TRUE); + +cleanup: + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + + return hr; +} + +HRESULT +CDefaultContextMenu::DoOpenOrExplore( + LPCMINVOKECOMMANDINFO lpcmi) +{ + UNIMPLEMENTED; + return E_FAIL; } HRESULT @@ -1153,15 +1323,17 @@ HRESULT hr; STRRET strFile; - if (m_Dcm.psf->GetDisplayNameOf(m_Dcm.apidl[0], SHGDN_FORPARSING, &strFile) != S_OK) + hr = m_Dcm.psf->GetDisplayNameOf(m_Dcm.apidl[0], SHGDN_FORPARSING, &strFile); + if (FAILED(hr)) { ERR("IShellFolder_GetDisplayNameOf failed for apidl\n"); - return E_FAIL; + return hr; } WCHAR wszPath[MAX_PATH]; - if (StrRetToBufW(&strFile, m_Dcm.apidl[0], wszPath, _countof(wszPath)) != S_OK) - return E_FAIL; + hr = StrRetToBufW(&strFile, m_Dcm.apidl[0], wszPath, _countof(wszPath)); + if (FAILED(hr)) + return hr; LPWSTR pwszExt = PathFindExtensionW(wszPath); @@ -1170,8 +1342,17 @@ if (!GetUniqueFileName(wszPath, pwszExt, wszTarget, TRUE)) return E_FAIL; - hr = IShellLink_ConstructFromFile(NULL, IID_IPersistFile, m_Dcm.apidl[0], (LPVOID*)&ppf); - if (hr != S_OK) + IPersistFolder2 *ppf2 = NULL; + LPITEMIDLIST pidl; + hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + if (SUCCEEDED(hr)) + { + hr = ppf2->GetCurFolder(&pidl); + ppf2->Release(); + if (SUCCEEDED(hr)) + hr = IShellLink_ConstructFromFile(NULL, IID_IPersistFile, ILCombine(pidl, m_Dcm.apidl[0]), (LPVOID*)&ppf); + } + if (FAILED(hr)) return hr; hr = ppf->Save(wszTarget, FALSE); @@ -1282,6 +1463,19 @@ if (SUCCEEDED(SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj)))) { + if (!bCopy) + { + FORMATETC formatetc; + STGMEDIUM medium; + InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECT), TYMED_HGLOBAL); + pDataObj->GetData(&formatetc, &medium); + DWORD * pdwFlag = (DWORD*)GlobalLock(medium.hGlobal); + if (pdwFlag) + *pdwFlag = DROPEFFECT_MOVE; + GlobalUnlock(medium.hGlobal); + pDataObj->SetData(&formatetc, &medium, TRUE); + } + hr = OleSetClipboard(pDataObj); pDataObj->Release(); return hr; @@ -1649,8 +1843,9 @@ case FCIDM_SHVIEW_REFRESH: return NotifyShellViewWindow(lpcmi, FALSE); case FCIDM_SHVIEW_INSERT: + return DoPaste(lpcmi); case FCIDM_SHVIEW_INSERTLINK: - return DoPaste(lpcmi); + return DoPasteLink(lpcmi); case FCIDM_SHVIEW_OPEN: case FCIDM_SHVIEW_EXPLORE: return DoOpenOrExplore(lpcmi); Modified: trunk/reactos/dll/win32/shell32/folders/desktop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -1205,7 +1205,7 @@ return ret; } -HRESULT WINAPI CDesktopFolder::CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl) +HRESULT WINAPI CDesktopFolder::CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, bool bCopy) { CComPtr<IPersistFolder2> ppf2; WCHAR szSrcPath[MAX_PATH]; @@ -1291,7 +1291,7 @@ op.fFlags = FOF_MULTIDESTFILES; } op.hwnd = GetActiveWindow(); - op.wFunc = FO_COPY; + op.wFunc = bCopy ? FO_COPY : FO_MOVE; op.fFlags |= FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR; res = SHFileOperationW(&op); Modified: trunk/reactos/dll/win32/shell32/folders/desktop.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/desktop.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/desktop.h [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -76,7 +76,7 @@ virtual HRESULT WINAPI GetUniqueName(LPWSTR pwszName, UINT uLen); virtual HRESULT WINAPI AddFolder(HWND hwnd, LPCWSTR pwszName, LPITEMIDLIST *ppidlOut); virtual HRESULT WINAPI DeleteItems(UINT cidl, LPCITEMIDLIST *apidl); - virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl); + virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, bool bCopy); DECLARE_REGISTRY_RESOURCEID(IDR_SHELLDESKTOP) DECLARE_NOT_AGGREGATABLE(CDesktopFolder) Modified: trunk/reactos/dll/win32/shell32/folders/fs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -1035,7 +1035,7 @@ * copies items to this folder */ HRESULT WINAPI CFSFolder::CopyItems(IShellFolder * pSFFrom, UINT cidl, - LPCITEMIDLIST * apidl) + LPCITEMIDLIST * apidl, bool bCopy) { IPersistFolder2 *ppf2 = NULL; WCHAR szSrcPath[MAX_PATH]; @@ -1131,7 +1131,7 @@ op.fFlags = FOF_MULTIDESTFILES; } op.hwnd = GetActiveWindow(); - op.wFunc = FO_COPY; + op.wFunc = bCopy ? FO_COPY : FO_MOVE; op.fFlags |= FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR; res = SHFileOperationW(&op); Modified: trunk/reactos/dll/win32/shell32/folders/fs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -93,7 +93,7 @@ virtual HRESULT WINAPI GetUniqueName(LPWSTR pwszName, UINT uLen); virtual HRESULT WINAPI AddFolder(HWND hwnd, LPCWSTR pwszName, LPITEMIDLIST *ppidlOut); virtual HRESULT WINAPI DeleteItems(UINT cidl, LPCITEMIDLIST *apidl); - virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl); + virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, bool bCopy); DECLARE_REGISTRY_RESOURCEID(IDR_SHELLFSFOLDER) DECLARE_NOT_AGGREGATABLE(CFSFolder) Modified: trunk/reactos/dll/win32/shell32/shellfolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellfol…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellfolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellfolder.h [iso-8859-1] Tue Nov 19 20:53:16 2013 @@ -42,7 +42,7 @@ STDMETHOD(GetUniqueName)(THIS_ LPWSTR lpName, UINT uLen) PURE; STDMETHOD(AddFolder)(THIS_ HWND hwnd, LPCWSTR lpName, LPITEMIDLIST * ppidlOut) PURE; STDMETHOD(DeleteItems)(THIS_ UINT cidl, LPCITEMIDLIST * apidl) PURE; - STDMETHOD(CopyItems)(THIS_ IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl) PURE; + STDMETHOD(CopyItems)(THIS_ IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl, bool bCopy) PURE; }; #undef INTERFACE
10 years, 11 months
1
0
0
0
[gadamopoulos] 61048: [shell32] - Append class members with m_ in CDefView class
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Nov 19 19:05:17 2013 New Revision: 61048 URL:
http://svn.reactos.org/svn/reactos?rev=61048&view=rev
Log: [shell32] - Append class members with m_ in CDefView class Modified: trunk/reactos/dll/win32/shell32/shlview.cpp Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Tue Nov 19 19:05:17 2013 @@ -76,31 +76,31 @@ public IServiceProvider { private: - CComPtr<IShellFolder> pSFParent; - CComPtr<IShellFolder2> pSF2Parent; - CComPtr<IShellBrowser> pShellBrowser; - CComPtr<ICommDlgBrowser> pCommDlgBrowser; - HWND hWndList; /* ListView control */ - HWND hWndParent; - FOLDERSETTINGS FolderSettings; - HMENU hMenu; - UINT uState; - UINT cidl; - LPITEMIDLIST *apidl; - LISTVIEW_SORT_INFO ListViewSortInfo; - ULONG hNotify; /* change notification handle */ - HACCEL hAccel; - DWORD dwAspects; - DWORD dwAdvf; - CComPtr<IAdviseSink> pAdvSink; + CComPtr<IShellFolder> m_pSFParent; + CComPtr<IShellFolder2> m_pSF2Parent; + CComPtr<IShellBrowser> m_pShellBrowser; + CComPtr<ICommDlgBrowser> m_pCommDlgBrowser; + HWND m_hWndList; /* ListView control */ + HWND m_hWndParent; + FOLDERSETTINGS m_FolderSettings; + HMENU m_hMenu; + UINT m_uState; + UINT m_cidl; + LPITEMIDLIST *m_apidl; + LISTVIEW_SORT_INFO m_sortInfo; + ULONG m_hNotify; /* change notification handle */ + HACCEL m_hAccel; + DWORD m_dwAspects; + DWORD m_dwAdvf; + CComPtr<IAdviseSink> m_pAdvSink; // for drag and drop - CComPtr<IDropTarget> pCurDropTarget; /* The sub-item, which is currently dragged over */ - CComPtr<IDataObject> pCurDataObject; /* The dragged data-object */ - LONG iDragOverItem; /* Dragged over item's index, iff pCurDropTarget != NULL */ - UINT cScrollDelay; /* Send a WM_*SCROLL msg every 250 ms during drag-scroll */ - POINT ptLastMousePos; /* Mouse position at last DragOver call */ + CComPtr<IDropTarget> m_pCurDropTarget; /* The sub-item, which is currently dragged over */ + CComPtr<IDataObject> m_pCurDataObject; /* The dragged data-object */ + LONG m_iDragOverItem; /* Dragged over item's index, iff m_pCurDropTarget != NULL */ + UINT m_cScrollDelay; /* Send a WM_*SCROLL msg every 250 ms during drag-scroll */ + POINT m_ptLastMousePos; /* Mouse position at last DragOver call */ // - CComPtr<IContextMenu> pCM; + CComPtr<IContextMenu> m_pCM; public: CDefView(); ~CDefView(); @@ -319,38 +319,38 @@ CDefView::CDefView() { - hWndList = NULL; - hWndParent = NULL; - FolderSettings.fFlags = 0; - FolderSettings.ViewMode = 0; - hMenu = NULL; - uState = 0; - cidl = 0; - apidl = NULL; - ListViewSortInfo.bIsAscending = FALSE; - ListViewSortInfo.nHeaderID = 0; - ListViewSortInfo.nLastHeaderID = 0; - hNotify = 0; - hAccel = NULL; - dwAspects = 0; - dwAdvf = 0; - iDragOverItem = 0; - cScrollDelay = 0; - ptLastMousePos.x = 0; - ptLastMousePos.y = 0; + m_hWndList = NULL; + m_hWndParent = NULL; + m_FolderSettings.fFlags = 0; + m_FolderSettings.ViewMode = 0; + m_hMenu = NULL; + m_uState = 0; + m_cidl = 0; + m_apidl = NULL; + m_sortInfo.bIsAscending = FALSE; + m_sortInfo.nHeaderID = 0; + m_sortInfo.nLastHeaderID = 0; + m_hNotify = 0; + m_hAccel = NULL; + m_dwAspects = 0; + m_dwAdvf = 0; + m_iDragOverItem = 0; + m_cScrollDelay = 0; + m_ptLastMousePos.x = 0; + m_ptLastMousePos.y = 0; } CDefView::~CDefView() { TRACE(" destroying IShellView(%p)\n", this); - SHFree(apidl); + SHFree(m_apidl); } HRESULT WINAPI CDefView::Initialize(IShellFolder *shellFolder) { - pSFParent = shellFolder; - shellFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, &pSF2Parent)); + m_pSFParent = shellFolder; + shellFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, &m_pSF2Parent)); return S_OK; } @@ -363,10 +363,10 @@ { HRESULT ret = S_OK; - if (pCommDlgBrowser.p != NULL) + if (m_pCommDlgBrowser.p != NULL) { TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl); - ret = pCommDlgBrowser->IncludeObject((IShellView *)this, pidl); + ret = m_pCommDlgBrowser->IncludeObject((IShellView *)this, pidl); TRACE("--0x%08x\n", ret); } @@ -377,10 +377,10 @@ { HRESULT ret = S_FALSE; - if (pCommDlgBrowser.p != NULL) + if (m_pCommDlgBrowser.p != NULL) { TRACE("ICommDlgBrowser::OnDefaultCommand\n"); - ret = pCommDlgBrowser->OnDefaultCommand((IShellView *)this); + ret = m_pCommDlgBrowser->OnDefaultCommand((IShellView *)this); TRACE("-- returns %08x\n", ret); } @@ -391,10 +391,10 @@ { HRESULT ret = S_FALSE; - if (pCommDlgBrowser.p != NULL) + if (m_pCommDlgBrowser.p != NULL) { TRACE("ICommDlgBrowser::OnStateChange flags=%x\n", uFlags); - ret = pCommDlgBrowser->OnStateChange((IShellView *)this, uFlags); + ret = m_pCommDlgBrowser->OnStateChange((IShellView *)this, uFlags); TRACE("--\n"); } @@ -412,15 +412,15 @@ TRACE("\n"); - if (pCommDlgBrowser != NULL) - { - pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON, - FCIDM_TB_SMALLICON, (FolderSettings.ViewMode == FVM_LIST) ? TRUE : FALSE, &result); - pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON, - FCIDM_TB_REPORTVIEW, (FolderSettings.ViewMode == FVM_DETAILS) ? TRUE : FALSE, &result); - pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON, + if (m_pCommDlgBrowser != NULL) + { + m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON, + FCIDM_TB_SMALLICON, (m_FolderSettings.ViewMode == FVM_LIST) ? TRUE : FALSE, &result); + m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON, + FCIDM_TB_REPORTVIEW, (m_FolderSettings.ViewMode == FVM_DETAILS) ? TRUE : FALSE, &result); + m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_SMALLICON, TRUE, &result); - pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON, + m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_REPORTVIEW, TRUE, &result); } } @@ -438,8 +438,8 @@ TRACE("(%p)\n", this); - tmpstyle = ::GetWindowLongPtrW(hWndList, GWL_STYLE); - ::SetWindowLongPtrW(hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove)); + tmpstyle = ::GetWindowLongPtrW(m_hWndList, GWL_STYLE); + ::SetWindowLongPtrW(m_hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove)); } /********************************************************** @@ -456,12 +456,12 @@ LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE; dwExStyle = WS_EX_CLIENTEDGE; - if (FolderSettings.fFlags & FWF_DESKTOP) + if (m_FolderSettings.fFlags & FWF_DESKTOP) dwStyle |= LVS_ALIGNLEFT; else dwStyle |= LVS_ALIGNTOP; - switch (FolderSettings.ViewMode) + switch (m_FolderSettings.ViewMode) { case FVM_ICON: dwStyle |= LVS_ICON; @@ -484,34 +484,34 @@ break; } - if (FolderSettings.fFlags & FWF_AUTOARRANGE) + if (m_FolderSettings.fFlags & FWF_AUTOARRANGE) dwStyle |= LVS_AUTOARRANGE; - if (FolderSettings.fFlags & FWF_DESKTOP) - FolderSettings.fFlags |= FWF_NOCLIENTEDGE | FWF_NOSCROLL; - - if (FolderSettings.fFlags & FWF_SINGLESEL) + if (m_FolderSettings.fFlags & FWF_DESKTOP) + m_FolderSettings.fFlags |= FWF_NOCLIENTEDGE | FWF_NOSCROLL; + + if (m_FolderSettings.fFlags & FWF_SINGLESEL) dwStyle |= LVS_SINGLESEL; - if (FolderSettings.fFlags & FWF_NOCLIENTEDGE) + if (m_FolderSettings.fFlags & FWF_NOCLIENTEDGE) dwExStyle &= ~WS_EX_CLIENTEDGE; - hWndList = CreateWindowExW( dwExStyle, - WC_LISTVIEWW, - NULL, - dwStyle, - 0, 0, 0, 0, - m_hWnd, - (HMENU)ID_LISTVIEW, - shell32_hInstance, - NULL); - - if (!hWndList) + m_hWndList = CreateWindowExW( dwExStyle, + WC_LISTVIEWW, + NULL, + dwStyle, + 0, 0, 0, 0, + m_hWnd, + (HMENU)ID_LISTVIEW, + shell32_hInstance, + NULL); + + if (!m_hWndList) return FALSE; - ListViewSortInfo.bIsAscending = TRUE; - ListViewSortInfo.nHeaderID = -1; - ListViewSortInfo.nLastHeaderID = -1; + m_sortInfo.bIsAscending = TRUE; + m_sortInfo.nHeaderID = -1; + m_sortInfo.nLastHeaderID = -1; UpdateListColors(); @@ -521,7 +521,7 @@ void CDefView::UpdateListColors() { - if (FolderSettings.fFlags & FWF_DESKTOP) + if (m_FolderSettings.fFlags & FWF_DESKTOP) { /* Check if drop shadows option is enabled */ BOOL bDropShadow = FALSE; @@ -532,21 +532,21 @@ L"ListviewShadow", RRF_RT_DWORD, NULL, &bDropShadow, &cbDropShadow); if (bDropShadow && SystemParametersInfoW(SPI_GETDESKWALLPAPER, _countof(wszBuf), wszBuf, 0) && wszBuf[0]) { - SendMessageW(hWndList, LVM_SETTEXTBKCOLOR, 0, CLR_NONE); - SendMessageW(hWndList, LVM_SETBKCOLOR, 0, CLR_NONE); - SendMessageW(hWndList, LVM_SETTEXTCOLOR, 0, RGB(255, 255, 255)); - SendMessageW(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTSHADOWTEXT, LVS_EX_TRANSPARENTSHADOWTEXT); + SendMessageW(m_hWndList, LVM_SETTEXTBKCOLOR, 0, CLR_NONE); + SendMessageW(m_hWndList, LVM_SETBKCOLOR, 0, CLR_NONE); + SendMessageW(m_hWndList, LVM_SETTEXTCOLOR, 0, RGB(255, 255, 255)); + SendMessageW(m_hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTSHADOWTEXT, LVS_EX_TRANSPARENTSHADOWTEXT); } else { COLORREF crDesktop = GetSysColor(COLOR_DESKTOP); - SendMessageW(hWndList, LVM_SETTEXTBKCOLOR, 0, crDesktop); - SendMessageW(hWndList, LVM_SETBKCOLOR, 0, crDesktop); + SendMessageW(m_hWndList, LVM_SETTEXTBKCOLOR, 0, crDesktop); + SendMessageW(m_hWndList, LVM_SETBKCOLOR, 0, crDesktop); if (GetRValue(crDesktop) + GetGValue(crDesktop) + GetBValue(crDesktop) > 128 * 3) - SendMessageW(hWndList, LVM_SETTEXTCOLOR, 0, RGB(0, 0, 0)); + SendMessageW(m_hWndList, LVM_SETTEXTCOLOR, 0, RGB(0, 0, 0)); else - SendMessageW(hWndList, LVM_SETTEXTCOLOR, 0, RGB(255, 255, 255)); - SendMessageW(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTSHADOWTEXT, 0); + SendMessageW(m_hWndList, LVM_SETTEXTCOLOR, 0, RGB(255, 255, 255)); + SendMessageW(m_hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTSHADOWTEXT, 0); } } } @@ -564,22 +564,22 @@ TRACE("%p\n", this); - SendMessageW(hWndList, LVM_DELETEALLITEMS, 0, 0); + SendMessageW(m_hWndList, LVM_DELETEALLITEMS, 0, 0); lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; lvColumn.pszText = szTemp; - if (pSF2Parent) + if (m_pSF2Parent) { for (int i = 0; 1; i++) { - if (FAILED(pSF2Parent->GetDetailsOf(NULL, i, &sd))) + if (FAILED(m_pSF2Parent->GetDetailsOf(NULL, i, &sd))) break; lvColumn.fmt = sd.fmt; lvColumn.cx = sd.cxChar * 8; /* chars->pixel */ StrRetToStrNW( szTemp, 50, &sd.str, NULL); - SendMessageW(hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); + SendMessageW(m_hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); } } else @@ -587,8 +587,8 @@ FIXME("no SF2\n"); } - SendMessageW(hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); - SendMessageW(hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); + SendMessageW(m_hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); + SendMessageW(m_hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); return TRUE; } @@ -723,11 +723,11 @@ lvItem.mask = LVIF_PARAM; for (lvItem.iItem = 0; - SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); lvItem.iItem++) { LPITEMIDLIST currentpidl = (LPITEMIDLIST) lvItem.lParam; - HRESULT hr = pSFParent->CompareIDs(0, pidl, currentpidl); + HRESULT hr = m_pSFParent->CompareIDs(0, pidl, currentpidl); if (SUCCEEDED(hr) && !HRESULT_CODE(hr)) { @@ -747,13 +747,13 @@ TRACE("(%p)(pidl=%p)\n", this, pidl); lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/ - lvItem.iItem = ListView_GetItemCount(hWndList); /*add the item to the end of the list*/ + lvItem.iItem = ListView_GetItemCount(m_hWndList); /*add the item to the end of the list*/ lvItem.iSubItem = 0; lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/ lvItem.pszText = LPSTR_TEXTCALLBACKW; /*get text on a callback basis*/ lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/ - if (SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem) == -1) + if (SendMessageW(m_hWndList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem) == -1) return FALSE; else return TRUE; @@ -770,7 +770,7 @@ nIndex = LV_FindItemByPidl(ILFindLastID(pidl)); - return (-1 == ListView_DeleteItem(hWndList, nIndex)) ? FALSE : TRUE; + return (-1 == ListView_DeleteItem(m_hWndList, nIndex)) ? FALSE : TRUE; } /********************************************************** @@ -789,15 +789,15 @@ { lvItem.mask = LVIF_PARAM; /* only the pidl */ lvItem.iItem = nItem; - SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); SHFree((LPITEMIDLIST)lvItem.lParam); lvItem.mask = LVIF_PARAM|LVIF_IMAGE; lvItem.iItem = nItem; lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidlNew)); /* set the item's data */ - lvItem.iImage = SHMapPIDLToSystemImageListIndex(pSFParent, pidlNew, 0); - SendMessageW(hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); - SendMessageW(hWndList, LVM_UPDATE, nItem, 0); + lvItem.iImage = SHMapPIDLToSystemImageListIndex(m_pSFParent, pidlNew, 0); + SendMessageW(m_hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_UPDATE, nItem, 0); return TRUE; /* FIXME: better handling */ } @@ -834,7 +834,7 @@ TRACE("%p\n", this); /* get the itemlist from the shfolder*/ - hRes = pSFParent->EnumObjects(m_hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList); + hRes = m_pSFParent->EnumObjects(m_hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList); if (hRes != S_OK) { if (hRes == S_FALSE) @@ -859,15 +859,15 @@ } /* sort the array */ - DPA_Sort(hdpa, CompareItems, (LPARAM)pSFParent.p); + DPA_Sort(hdpa, CompareItems, (LPARAM)m_pSFParent.p); /*turn the listview's redrawing off*/ - SendMessageA(hWndList, WM_SETREDRAW, FALSE, 0); + SendMessageA(m_hWndList, WM_SETREDRAW, FALSE, 0); DPA_DestroyCallback( hdpa, fill_list, (void *)this); /*turn the listview's redrawing back on and force it to draw*/ - SendMessageA(hWndList, WM_SETREDRAW, TRUE, 0); + SendMessageA(m_hWndList, WM_SETREDRAW, TRUE, 0); pEnumIDList->Release(); /* destroy the list*/ @@ -876,27 +876,27 @@ LRESULT CDefView::OnShowWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - ::UpdateWindow(hWndList); + ::UpdateWindow(m_hWndList); bHandled = FALSE; return 0; } LRESULT CDefView::OnGetDlgCode(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - return SendMessageW(hWndList, uMsg, 0, 0); + return SendMessageW(m_hWndList, uMsg, 0, 0); } LRESULT CDefView::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { RevokeDragDrop(m_hWnd); - SHChangeNotifyDeregister(hNotify); + SHChangeNotifyDeregister(m_hNotify); bHandled = FALSE; return 0; } LRESULT CDefView::OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - if (FolderSettings.fFlags & (FWF_DESKTOP | FWF_TRANSPARENT)) + if (m_FolderSettings.fFlags & (FWF_DESKTOP | FWF_TRANSPARENT)) return SendMessageW(GetParent(), WM_ERASEBKGND, wParam, lParam); /* redirect to parent */ bHandled = FALSE; @@ -909,12 +909,12 @@ UpdateListColors(); /* Forward WM_SYSCOLORCHANGE to common controls */ - return SendMessageW(hWndList, uMsg, 0, 0); + return SendMessageW(m_hWndList, uMsg, 0, 0); } LRESULT CDefView::OnGetShellBrowser(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - return (LRESULT)pShellBrowser.p; + return (LRESULT)m_pShellBrowser.p; } /********************************************************** @@ -940,16 +940,16 @@ RegisterDragDrop(m_hWnd, pdt); /* register for receiving notifications */ - pSFParent->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + m_pSFParent->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); if (ppf2) { ppf2->GetCurFolder((LPITEMIDLIST*)&ntreg.pidl); ntreg.fRecursive = TRUE; - hNotify = SHChangeNotifyRegister(m_hWnd, SHCNF_IDLIST, SHCNE_ALLEVENTS, SHV_CHANGE_NOTIFY, 1, &ntreg); + m_hNotify = SHChangeNotifyRegister(m_hWnd, SHCNF_IDLIST, SHCNE_ALLEVENTS, SHV_CHANGE_NOTIFY, 1, &ntreg); SHFree((LPITEMIDLIST)ntreg.pidl); } - hAccel = LoadAcceleratorsA(shell32_hInstance, MAKEINTRESOURCEA( IDA_SHELLVIEW)); + m_hAccel = LoadAcceleratorsA(shell32_hInstance, MAKEINTRESOURCEA( IDA_SHELLVIEW)); return S_OK; } @@ -1048,7 +1048,7 @@ /********************************************************** * ShellView_GetSelections() * -* - fills the this->apidl list with the selected objects +* - fills the m_apidl list with the selected objects * * RETURNS * number of selected items @@ -1058,16 +1058,16 @@ LVITEMW lvItem; UINT i = 0; - SHFree(apidl); - - cidl = ListView_GetSelectedCount(hWndList); - apidl = (LPITEMIDLIST*)SHAlloc(cidl * sizeof(LPITEMIDLIST)); - - TRACE("selected=%i\n", cidl); - - if (apidl) - { - TRACE("-- Items selected =%u\n", cidl); + SHFree(m_apidl); + + m_cidl = ListView_GetSelectedCount(m_hWndList); + m_apidl = (LPITEMIDLIST*)SHAlloc(m_cidl * sizeof(LPITEMIDLIST)); + + TRACE("selected=%i\n", m_cidl); + + if (m_apidl) + { + TRACE("-- Items selected =%u\n", m_cidl); lvItem.mask = LVIF_STATE | LVIF_PARAM; lvItem.stateMask = LVIS_SELECTED; @@ -1075,13 +1075,13 @@ lvItem.iSubItem = 0; lvItem.state = 0; - while(SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM)&lvItem) && (i < cidl)) + while(SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM)&lvItem) && (i < m_cidl)) { if(lvItem.state & LVIS_SELECTED) { - apidl[i] = (LPITEMIDLIST)lvItem.lParam; + m_apidl[i] = (LPITEMIDLIST)lvItem.lParam; i++; - if (i == cidl) + if (i == m_cidl) break; TRACE("-- selected Item found\n"); } @@ -1089,7 +1089,7 @@ } } - return cidl; + return m_cidl; } /********************************************************** @@ -1102,8 +1102,8 @@ UINT uCommand; HRESULT hResult; - cidl = ListView_GetSelectedCount(hWndList); - if (cidl == 0) + m_cidl = ListView_GetSelectedCount(m_hWndList); + if (m_cidl == 0) return S_OK; hResult = OnDefaultCommand(); @@ -1114,15 +1114,15 @@ if (!hMenu) return E_FAIL; - hResult = GetItemObject( SVGIO_SELECTION, IID_PPV_ARG(IContextMenu, &pCM)); + hResult = GetItemObject( SVGIO_SELECTION, IID_PPV_ARG(IContextMenu, &m_pCM)); if (FAILED(hResult)) goto cleanup; - hResult = IUnknown_SetSite(pCM, (IShellView *)this); + hResult = IUnknown_SetSite(m_pCM, (IShellView *)this); //if (FAILED( hResult)) // goto cleanup; - hResult = pCM->QueryContextMenu(hMenu, 0, 0x20, 0x7fff, CMF_DEFAULTONLY); + hResult = m_pCM->QueryContextMenu(hMenu, 0, 0x20, 0x7fff, CMF_DEFAULTONLY); if (FAILED(hResult)) goto cleanup; @@ -1138,17 +1138,17 @@ cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand); cmi.hwnd = m_hWnd; - hResult = pCM->InvokeCommand(&cmi); + hResult = m_pCM->InvokeCommand(&cmi); cleanup: if (hMenu) DestroyMenu(hMenu); - if (pCM) - { - IUnknown_SetSite(pCM, NULL); - pCM.Release(); + if (m_pCM) + { + IUnknown_SetSite(m_pCM, NULL); + m_pCM.Release(); } return hResult; @@ -1167,7 +1167,7 @@ HRESULT hResult; // for some reason I haven't figured out, we sometimes recurse into this method - if (pCM != NULL) + if (m_pCM != NULL) return 0; x = LOWORD(lParam); @@ -1179,21 +1179,21 @@ if (!hMenu) return E_FAIL; - cidl = ListView_GetSelectedCount(hWndList); - - hResult = GetItemObject( cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_PPV_ARG(IContextMenu, &pCM)); + m_cidl = ListView_GetSelectedCount(m_hWndList); + + hResult = GetItemObject( m_cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_PPV_ARG(IContextMenu, &m_pCM)); if (FAILED( hResult)) goto cleanup; - hResult = IUnknown_SetSite(pCM, (IShellView *)this); + hResult = IUnknown_SetSite(m_pCM, (IShellView *)this); //if (FAILED( hResult)) // goto cleanup; - hResult = pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL); + hResult = m_pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL); if (FAILED( hResult)) goto cleanup; - if (FolderSettings.fFlags & FWF_DESKTOP) + if (m_FolderSettings.fFlags & FWF_DESKTOP) SetMenuDefaultItem(hMenu, FCIDM_SHVIEW_OPEN, MF_BYCOMMAND); uCommand = TrackPopupMenu(hMenu, @@ -1209,14 +1209,14 @@ cmi.cbSize = sizeof(cmi); cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand); cmi.hwnd = m_hWnd; - pCM->InvokeCommand(&cmi); + m_pCM->InvokeCommand(&cmi); cleanup: - if (pCM) - { - IUnknown_SetSite(pCM, NULL); - pCM.Release(); + if (m_pCM) + { + IUnknown_SetSite(m_pCM, NULL); + m_pCM.Release(); } if (hMenu) @@ -1235,15 +1235,15 @@ if (!hMenu) return 0; - hResult = GetItemObject( bUseSelection ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_PPV_ARG(IContextMenu, &pCM)); + hResult = GetItemObject( bUseSelection ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_PPV_ARG(IContextMenu, &m_pCM)); if (FAILED( hResult)) goto cleanup; - hResult = IUnknown_SetSite(pCM, (IShellView *)this); + hResult = IUnknown_SetSite(m_pCM, (IShellView *)this); //if (FAILED( hResult)) // goto cleanup; - hResult = pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL); + hResult = m_pCM->QueryContextMenu(hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL); if (FAILED( hResult)) goto cleanup; @@ -1251,14 +1251,14 @@ cmi.cbSize = sizeof(cmi); cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand); cmi.hwnd = m_hWnd; - pCM->InvokeCommand(&cmi); + m_pCM->InvokeCommand(&cmi); cleanup: - if (pCM) - { - IUnknown_SetSite(pCM, NULL); - pCM.Release(); + if (m_pCM) + { + IUnknown_SetSite(m_pCM, NULL); + m_pCM.Release(); } if (hMenu) @@ -1285,9 +1285,9 @@ TRACE("%p width=%u height=%u\n", this, wWidth, wHeight); /*resize the ListView to fit our window*/ - if (hWndList) - { - ::MoveWindow(hWndList, 0, 0, wWidth, wHeight, TRUE); + if (m_hWndList) + { + ::MoveWindow(m_hWndList, 0, 0, wWidth, wHeight, TRUE); } return 0; @@ -1303,17 +1303,17 @@ { TRACE("%p\n", this); - if (uState != SVUIA_DEACTIVATE) - { - if (hMenu) + if (m_uState != SVUIA_DEACTIVATE) + { + if (m_hMenu) { - pShellBrowser->SetMenuSB(0, 0, 0); - pShellBrowser->RemoveMenusSB(hMenu); - DestroyMenu(hMenu); - hMenu = 0; + m_pShellBrowser->SetMenuSB(0, 0, 0); + m_pShellBrowser->RemoveMenusSB(m_hMenu); + DestroyMenu(m_hMenu); + m_hMenu = 0; } - uState = SVUIA_DEACTIVATE; + m_uState = SVUIA_DEACTIVATE; } } @@ -1326,7 +1326,7 @@ TRACE("%p uState=%x\n", this, uState); /*don't do anything if the state isn't really changing */ - if (this->uState == uState) + if (m_uState == uState) { return; } @@ -1337,11 +1337,11 @@ if(uState != SVUIA_DEACTIVATE) { /*merge the menus */ - hMenu = CreateMenu(); - - if(hMenu) + m_hMenu = CreateMenu(); + + if(m_hMenu) { - pShellBrowser->InsertMenusSB(hMenu, &omw); + m_pShellBrowser->InsertMenusSB(m_hMenu, &omw); TRACE("-- after fnInsertMenusSB\n"); /*build the top level menu get the menu item's text*/ @@ -1358,7 +1358,7 @@ /*insert our menu into the menu bar*/ if (mii.hSubMenu) { - InsertMenuItemA(hMenu, FCIDM_MENU_HELP, FALSE, &mii); + InsertMenuItemA(m_hMenu, FCIDM_MENU_HELP, FALSE, &mii); } /*get the view menu so we can merge with it*/ @@ -1366,7 +1366,7 @@ mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU; - if (GetMenuItemInfoA(hMenu, FCIDM_MENU_VIEW, FALSE, &mii)) + if (GetMenuItemInfoA(m_hMenu, FCIDM_MENU_VIEW, FALSE, &mii)) { MergeViewMenu(mii.hSubMenu); } @@ -1379,17 +1379,17 @@ mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU; - if (GetMenuItemInfoA(hMenu, FCIDM_MENU_FILE, FALSE, &mii)) + if (GetMenuItemInfoA(m_hMenu, FCIDM_MENU_FILE, FALSE, &mii)) { MergeFileMenu(mii.hSubMenu); } } TRACE("-- before fnSetMenuSB\n"); - pShellBrowser->SetMenuSB(hMenu, 0, m_hWnd); + m_pShellBrowser->SetMenuSB(m_hMenu, 0, m_hWnd); } } - this->uState = uState; + m_uState = uState; TRACE("--\n"); } @@ -1414,11 +1414,11 @@ should always be done before merging menus (OnActivate merges the menus) if one of our windows has the focus.*/ - pShellBrowser->OnViewWindowActive((IShellView *)this); + m_pShellBrowser->OnViewWindowActive((IShellView *)this); DoActivate(SVUIA_ACTIVATE_FOCUS); /* Set the focus to the listview */ - ::SetFocus(hWndList); + ::SetFocus(m_hWndList); /* Notify the ICommDlgBrowser interface */ OnStateChange(CDBOSC_SETFOCUS); @@ -1461,25 +1461,25 @@ switch (dwCmdID) { case FCIDM_SHVIEW_SMALLICON: - FolderSettings.ViewMode = FVM_SMALLICON; + m_FolderSettings.ViewMode = FVM_SMALLICON; SetStyle (LVS_SMALLICON, LVS_TYPEMASK); CheckToolbar(); break; case FCIDM_SHVIEW_BIGICON: - FolderSettings.ViewMode = FVM_ICON; + m_FolderSettings.ViewMode = FVM_ICON; SetStyle (LVS_ICON, LVS_TYPEMASK); CheckToolbar(); break; case FCIDM_SHVIEW_LISTVIEW: - FolderSettings.ViewMode = FVM_LIST; + m_FolderSettings.ViewMode = FVM_LIST; SetStyle (LVS_LIST, LVS_TYPEMASK); CheckToolbar(); break; case FCIDM_SHVIEW_REPORTVIEW: - FolderSettings.ViewMode = FVM_DETAILS; + m_FolderSettings.ViewMode = FVM_DETAILS; SetStyle (LVS_REPORT, LVS_TYPEMASK); CheckToolbar(); break; @@ -1489,10 +1489,10 @@ case 0x31: case 0x32: case 0x33: - ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30); - ListViewSortInfo.bIsAscending = TRUE; - ListViewSortInfo.nLastHeaderID = ListViewSortInfo.nHeaderID; - SendMessageA(hWndList, LVM_SORTITEMS, (WPARAM) &ListViewSortInfo, (LPARAM)ListViewCompareItems); + m_sortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30); + m_sortInfo.bIsAscending = TRUE; + m_sortInfo.nLastHeaderID = m_sortInfo.nHeaderID; + SendMessageA(m_hWndList, LVM_SORTITEMS, (WPARAM) &m_sortInfo, (LPARAM)ListViewCompareItems); break; case FCIDM_SHVIEW_REFRESH: @@ -1579,8 +1579,8 @@ case HDN_ENDTRACKW: TRACE("-- HDN_ENDTRACKW %p\n", this); - /*nColumn1 = ListView_GetColumnWidth(hWndList, 0); - nColumn2 = ListView_GetColumnWidth(hWndList, 1);*/ + /*nColumn1 = ListView_GetColumnWidth(m_hWndList, 0); + nColumn2 = ListView_GetColumnWidth(m_hWndList, 1);*/ break; case LVN_DELETEITEM: @@ -1602,18 +1602,18 @@ break; case LVN_COLUMNCLICK: - ListViewSortInfo.nHeaderID = lpnmlv->iSubItem; - if (ListViewSortInfo.nLastHeaderID == ListViewSortInfo.nHeaderID) + m_sortInfo.nHeaderID = lpnmlv->iSubItem; + if (m_sortInfo.nLastHeaderID == m_sortInfo.nHeaderID) { - ListViewSortInfo.bIsAscending = !ListViewSortInfo.bIsAscending; + m_sortInfo.bIsAscending = !m_sortInfo.bIsAscending; } else { - ListViewSortInfo.bIsAscending = TRUE; + m_sortInfo.bIsAscending = TRUE; } - ListViewSortInfo.nLastHeaderID = ListViewSortInfo.nHeaderID; - - SendMessageW(lpnmlv->hdr.hwndFrom, LVM_SORTITEMS, (WPARAM) &ListViewSortInfo, (LPARAM)ListViewCompareItems); + m_sortInfo.nLastHeaderID = m_sortInfo.nHeaderID; + + SendMessageW(lpnmlv->hdr.hwndFrom, LVM_SORTITEMS, (WPARAM) &m_sortInfo, (LPARAM)ListViewCompareItems); break; case LVN_GETDISPINFOA: @@ -1623,10 +1623,10 @@ if (lpdi->item.mask & LVIF_TEXT) /* text requested */ { - if (pSF2Parent) + if (m_pSF2Parent) { SHELLDETAILS sd; - if (FAILED(pSF2Parent->GetDetailsOf(pidl, lpdi->item.iSubItem, &sd))) + if (FAILED(m_pSF2Parent->GetDetailsOf(pidl, lpdi->item.iSubItem, &sd))) { FIXME("failed to get details\n"); break; @@ -1652,7 +1652,7 @@ } if(lpdi->item.mask & LVIF_IMAGE) /* image requested */ { - lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(pSFParent, pidl, 0); + lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(m_pSFParent, pidl, 0); } lpdi->item.mask |= LVIF_DI_SETITEM; break; @@ -1672,11 +1672,11 @@ DWORD dwAttributes = SFGAO_CANLINK; DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE; - if (SUCCEEDED(pSFParent->GetUIObjectOf(m_hWnd, cidl, (LPCITEMIDLIST*)apidl, IID_IDataObject, 0, (LPVOID *)&pda))) + if (SUCCEEDED(m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, (LPCITEMIDLIST*)m_apidl, IID_IDataObject, 0, (LPVOID *)&pda))) { IDropSource * pds = (IDropSource *)this; /* own DropSource interface */ - if (SUCCEEDED(pSFParent->GetAttributesOf(cidl, (LPCITEMIDLIST*)apidl, &dwAttributes))) + if (SUCCEEDED(m_pSFParent->GetAttributesOf(m_cidl, (LPCITEMIDLIST*)m_apidl, &dwAttributes))) { if (dwAttributes & SFGAO_CANLINK) { @@ -1701,7 +1701,7 @@ TRACE("-- LVN_BEGINLABELEDITW %p\n", this); - pSFParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &dwAttr); + m_pSFParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &dwAttr); if (SFGAO_CANRENAME & dwAttr) { return FALSE; @@ -1720,18 +1720,18 @@ lvItem.iItem = lpdi->item.iItem; lvItem.iSubItem = 0; lvItem.mask = LVIF_PARAM; - SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); pidl = (LPITEMIDLIST)lpdi->item.lParam; - hr = pSFParent->SetNameOf(0, pidl, lpdi->item.pszText, SHGDN_INFOLDER, &pidl); + hr = m_pSFParent->SetNameOf(0, pidl, lpdi->item.pszText, SHGDN_INFOLDER, &pidl); if (SUCCEEDED(hr) && pidl) { lvItem.mask = LVIF_PARAM|LVIF_IMAGE; lvItem.lParam = (LPARAM)pidl; - lvItem.iImage = SHMapPIDLToSystemImageListIndex(pSFParent, pidl, 0); - SendMessageW(hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); - SendMessageW(hWndList, LVM_UPDATE, lpdi->item.iItem, 0); + lvItem.iImage = SHMapPIDLToSystemImageListIndex(m_pSFParent, pidl, 0); + SendMessageW(m_hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_UPDATE, lpdi->item.iItem, 0); return TRUE; } @@ -1748,7 +1748,7 @@ if (plvKeyDown->wVKey == VK_BACK) { LPSHELLBROWSER lpSb; - if ((lpSb = (LPSHELLBROWSER)SendMessageW(hWndParent, CWM_GETISHELLBROWSER, 0, 0))) + if ((lpSb = (LPSHELLBROWSER)SendMessageW(m_hWndParent, CWM_GETISHELLBROWSER, 0, 0))) { lpSb->BrowseObject(NULL, SBSP_PARENT); } @@ -1807,7 +1807,7 @@ */ LRESULT CDefView::OnCustomItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - if (!pCM.p) + if (!m_pCM.p) { /* no menu */ ERR("no menu!!!\n"); @@ -1815,7 +1815,7 @@ } CComPtr<IContextMenu2> pCM2; - HRESULT hres = pCM.p->QueryInterface(IID_PPV_ARG(IContextMenu2, &pCM2)); + HRESULT hres = m_pCM.p->QueryInterface(IID_PPV_ARG(IContextMenu2, &pCM2)); if(FAILED(hres)) return FALSE; @@ -1872,7 +1872,7 @@ { if (lpmsg->message >= WM_KEYFIRST && lpmsg->message <= WM_KEYLAST) { - if (::TranslateAcceleratorW(m_hWnd, hAccel, lpmsg) != 0) + if (::TranslateAcceleratorW(m_hWnd, m_hAccel, lpmsg) != 0) return S_OK; /* FIXME: should call TranslateAcceleratorSB */ @@ -1901,7 +1901,7 @@ TRACE("(%p)->(state=%x) stub\n", this, uState); /*don't do anything if the state isn't really changing*/ - if (this->uState == uState) + if (m_uState == uState) { return S_OK; } @@ -1915,14 +1915,14 @@ /* GetFolderPath is not a method of IShellFolder - IShellFolder_GetFolderPath( pSFParent, szName, sizeof(szName) ); + IShellFolder_GetFolderPath( m_pSFParent, szName, sizeof(szName) ); */ /* set the number of parts */ - pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, 1, (LPARAM)nPartArray, &lResult); + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, 1, (LPARAM)nPartArray, &lResult); /* set the text for the parts */ /* - pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXTA, 0, (LPARAM)szName, &lResult); + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXTA, 0, (LPARAM)szName, &lResult); */ } @@ -1933,7 +1933,7 @@ { TRACE("(%p)\n", this); - SendMessageW(hWndList, LVM_DELETEALLITEMS, 0, 0); + SendMessageW(m_hWndList, LVM_DELETEALLITEMS, 0, 0); FillList(); return S_OK; @@ -1955,20 +1955,20 @@ return E_UNEXPECTED; /*set up the member variables*/ - pShellBrowser = psb; - FolderSettings = *lpfs; + m_pShellBrowser = psb; + m_FolderSettings = *lpfs; /*get our parent window*/ - pShellBrowser->GetWindow(&hWndParent); + m_pShellBrowser->GetWindow(&m_hWndParent); /* try to get the ICommDlgBrowserInterface, adds a reference !!! */ - pCommDlgBrowser = NULL; - if (SUCCEEDED(pShellBrowser->QueryInterface(IID_PPV_ARG(ICommDlgBrowser, &pCommDlgBrowser)))) + m_pCommDlgBrowser = NULL; + if (SUCCEEDED(m_pShellBrowser->QueryInterface(IID_PPV_ARG(ICommDlgBrowser, &m_pCommDlgBrowser)))) { TRACE("-- CommDlgBrowser\n"); } - Create(hWndParent, prcView, NULL, WS_CHILD | WS_TABSTOP, 0, 0U); + Create(m_hWndParent, prcView, NULL, WS_CHILD | WS_TABSTOP, 0, 0U); if (m_hWnd == NULL) return E_FAIL; @@ -1992,14 +1992,14 @@ /*Make absolutely sure all our UI is cleaned up.*/ UIActivate(SVUIA_DEACTIVATE); - if (hMenu) - { - DestroyMenu(hMenu); + if (m_hMenu) + { + DestroyMenu(m_hMenu); } DestroyWindow(); - pShellBrowser.Release(); - pCommDlgBrowser.Release(); + m_pShellBrowser.Release(); + m_pCommDlgBrowser.Release(); return S_OK; } @@ -2007,12 +2007,12 @@ HRESULT WINAPI CDefView::GetCurrentInfo(LPFOLDERSETTINGS lpfs) { TRACE("(%p)->(%p) vmode=%x flags=%x\n", this, lpfs, - FolderSettings.ViewMode, FolderSettings.fFlags); + m_FolderSettings.ViewMode, m_FolderSettings.fFlags); if (!lpfs) return E_INVALIDARG; - *lpfs = FolderSettings; + *lpfs = m_FolderSettings; return S_OK; } @@ -2043,14 +2043,14 @@ LVITEMW lvItem; if(uFlags & SVSI_ENSUREVISIBLE) - SendMessageW(hWndList, LVM_ENSUREVISIBLE, i, 0); + SendMessageW(m_hWndList, LVM_ENSUREVISIBLE, i, 0); lvItem.mask = LVIF_STATE; lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED; lvItem.iItem = 0; lvItem.iSubItem = 0; - while (SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem)) + while (SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem)) { if (lvItem.iItem == i) { @@ -2068,13 +2068,13 @@ lvItem.state &= ~LVIS_SELECTED; } - SendMessageW(hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(m_hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); lvItem.iItem++; } if(uFlags & SVSI_EDIT) - SendMessageW(hWndList, LVM_EDITLABELW, i, 0); + SendMessageW(m_hWndList, LVM_EDITLABELW, i, 0); } return S_OK; @@ -2093,8 +2093,8 @@ case SVGIO_BACKGROUND: if (IsEqualIID(riid, IID_IContextMenu)) { - //*ppvOut = ISvBgCm_Constructor(pSFParent, FALSE); - CDefFolderMenu_Create2(NULL, NULL, 0, NULL, pSFParent, NULL, 0, NULL, (IContextMenu**)ppvOut); + //*ppvOut = ISvBgCm_Constructor(m_pSFParent, FALSE); + CDefFolderMenu_Create2(NULL, NULL, 0, NULL, m_pSFParent, NULL, 0, NULL, (IContextMenu**)ppvOut); if (!ppvOut) hr = E_OUTOFMEMORY; else @@ -2104,7 +2104,7 @@ case SVGIO_SELECTION: GetSelections(); - hr = pSFParent->GetUIObjectOf(m_hWnd, cidl, (LPCITEMIDLIST*)apidl, riid, 0, ppvOut); + hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, (LPCITEMIDLIST*)m_apidl, riid, 0, ppvOut); break; } @@ -2120,7 +2120,7 @@ if (!pViewMode) return E_INVALIDARG; - *pViewMode = this->FolderSettings.ViewMode; + *pViewMode = m_FolderSettings.ViewMode; return S_OK; } @@ -2163,17 +2163,17 @@ /* This will not necessarily be the actual mode set above. This mimics the behavior of Windows XP. */ - this->FolderSettings.ViewMode = ViewMode; + m_FolderSettings.ViewMode = ViewMode; return S_OK; } HRESULT STDMETHODCALLTYPE CDefView::GetFolder(REFIID riid, void **ppv) { - if (pSFParent == NULL) + if (m_pSFParent == NULL) return E_FAIL; - return pSFParent->QueryInterface(riid, ppv); + return m_pSFParent->QueryInterface(riid, ppv); } HRESULT STDMETHODCALLTYPE CDefView::Item(int iItemIndex, LPITEMIDLIST *ppidl) @@ -2185,7 +2185,7 @@ item.mask = LVIF_PARAM; item.iItem = iItemIndex; - if (SendMessageW(this->hWndList, LVM_GETITEMW, 0, (LPARAM)&item)) + if (SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM)&item)) { *ppidl = ILClone((PITEMID_CHILD)item.lParam); return S_OK; @@ -2203,7 +2203,7 @@ if (uFlags != SVGIO_ALLVIEW) FIXME("some flags unsupported, %x\n", uFlags & ~SVGIO_ALLVIEW); - *pcItems = SendMessageW(this->hWndList, LVM_GETITEMCOUNT, 0, 0); + *pcItems = SendMessageW(m_hWndList, LVM_GETITEMCOUNT, 0, 0); return S_OK; } @@ -2217,7 +2217,7 @@ { TRACE("(%p)->(%p)\n", this, piItem); - *piItem = SendMessageW(this->hWndList, LVM_GETSELECTIONMARK, 0, 0); + *piItem = SendMessageW(m_hWndList, LVM_GETSELECTIONMARK, 0, 0); return S_OK; } @@ -2226,7 +2226,7 @@ { TRACE("(%p)->(%p)\n", this, piItem); - *piItem = SendMessageW(this->hWndList, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + *piItem = SendMessageW(m_hWndList, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); return S_OK; } @@ -2240,11 +2240,11 @@ { TRACE("(%p)->(%p)\n", this, ppt); - if (NULL == this->hWndList) return S_FALSE; + if (NULL == m_hWndList) return S_FALSE; if (ppt) { - const DWORD ret = SendMessageW(this->hWndList, LVM_GETITEMSPACING, 0, 0); + const DWORD ret = SendMessageW(m_hWndList, LVM_GETITEMSPACING, 0, 0); ppt->x = LOWORD(ret); ppt->y = HIWORD(ret); @@ -2273,11 +2273,11 @@ lvItem.stateMask = LVIS_SELECTED; if (dwFlags & SVSI_ENSUREVISIBLE) - SendMessageW(this->hWndList, LVM_ENSUREVISIBLE, iItem, 0); + SendMessageW(m_hWndList, LVM_ENSUREVISIBLE, iItem, 0); /* all items */ if (dwFlags & SVSI_DESELECTOTHERS) - SendMessageW(this->hWndList, LVM_SETITEMSTATE, -1, (LPARAM)&lvItem); + SendMessageW(m_hWndList, LVM_SETITEMSTATE, -1, (LPARAM)&lvItem); /* this item */ if (dwFlags & SVSI_SELECT) @@ -2286,10 +2286,10 @@ if (dwFlags & SVSI_FOCUSED) lvItem.stateMask |= LVIS_FOCUSED; - SendMessageW(this->hWndList, LVM_SETITEMSTATE, iItem, (LPARAM)&lvItem); + SendMessageW(m_hWndList, LVM_SETITEMSTATE, iItem, (LPARAM)&lvItem); if (dwFlags & SVSI_EDIT) - SendMessageW(this->hWndList, LVM_EDITLABELW, iItem, 0); + SendMessageW(m_hWndList, LVM_EDITLABELW, iItem, 0); return S_OK; } @@ -2371,56 +2371,56 @@ htinfo.pt.x = pt.x; htinfo.pt.y = pt.y; htinfo.flags = LVHT_ONITEM; - ::ScreenToClient(hWndList, &htinfo.pt); - lResult = SendMessageW(hWndList, LVM_HITTEST, 0, (LPARAM)&htinfo); + ::ScreenToClient(m_hWndList, &htinfo.pt); + lResult = SendMessageW(m_hWndList, LVM_HITTEST, 0, (LPARAM)&htinfo); /* Send WM_*SCROLL messages every 250 ms during drag-scrolling */ - ::GetClientRect(hWndList, &clientRect); - if (htinfo.pt.x == ptLastMousePos.x && htinfo.pt.y == ptLastMousePos.y && + ::GetClientRect(m_hWndList, &clientRect); + if (htinfo.pt.x == m_ptLastMousePos.x && htinfo.pt.y == m_ptLastMousePos.y && (htinfo.pt.x < SCROLLAREAWIDTH || htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH || htinfo.pt.y < SCROLLAREAWIDTH || htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH )) { - cScrollDelay = (cScrollDelay + 1) % 5; /* DragOver is called every 50 ms */ - if (cScrollDelay == 0) + m_cScrollDelay = (m_cScrollDelay + 1) % 5; /* DragOver is called every 50 ms */ + if (m_cScrollDelay == 0) { /* Mouse did hover another 250 ms over the scroll-area */ if (htinfo.pt.x < SCROLLAREAWIDTH) - SendMessageW(hWndList, WM_HSCROLL, SB_LINEUP, 0); + SendMessageW(m_hWndList, WM_HSCROLL, SB_LINEUP, 0); if (htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH) - SendMessageW(hWndList, WM_HSCROLL, SB_LINEDOWN, 0); + SendMessageW(m_hWndList, WM_HSCROLL, SB_LINEDOWN, 0); if (htinfo.pt.y < SCROLLAREAWIDTH) - SendMessageW(hWndList, WM_VSCROLL, SB_LINEUP, 0); + SendMessageW(m_hWndList, WM_VSCROLL, SB_LINEUP, 0); if (htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH) - SendMessageW(hWndList, WM_VSCROLL, SB_LINEDOWN, 0); + SendMessageW(m_hWndList, WM_VSCROLL, SB_LINEDOWN, 0); } } else { - cScrollDelay = 0; /* Reset, if the cursor is not over the listview's scroll-area */ - } - - ptLastMousePos = htinfo.pt; + m_cScrollDelay = 0; /* Reset, if the cursor is not over the listview's scroll-area */ + } + + m_ptLastMousePos = htinfo.pt; /* If we are still over the previous sub-item, notify it via DragOver and return. */ - if (pCurDropTarget && lResult == iDragOverItem) - return pCurDropTarget->DragOver(grfKeyState, pt, pdwEffect); + if (m_pCurDropTarget && lResult == m_iDragOverItem) + return m_pCurDropTarget->DragOver(grfKeyState, pt, pdwEffect); /* We've left the previous sub-item, notify it via DragLeave and Release it. */ - if (pCurDropTarget) - { - pCurDropTarget->DragLeave(); - pCurDropTarget.Release(); - } - - iDragOverItem = lResult; + if (m_pCurDropTarget) + { + m_pCurDropTarget->DragLeave(); + m_pCurDropTarget.Release(); + } + + m_iDragOverItem = lResult; if (lResult == -1) { /* We are not above one of the listview's subitems. Bind to the parent folder's * DropTarget interface. */ - hr = pSFParent->QueryInterface(IID_PPV_ARG(IDropTarget,&pCurDropTarget)); + hr = m_pSFParent->QueryInterface(IID_PPV_ARG(IDropTarget,&m_pCurDropTarget)); } else { @@ -2429,25 +2429,25 @@ lvItem.mask = LVIF_PARAM; lvItem.iItem = lResult; lvItem.iSubItem = 0; - SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); - - /* ... and bind pCurDropTarget to the IDropTarget interface of an UIObject of this object */ - hr = pSFParent->GetUIObjectOf(hWndList, 1, - (LPCITEMIDLIST*)&lvItem.lParam, IID_IDropTarget, NULL, (LPVOID*)&pCurDropTarget); - } - - /* If anything failed, pCurDropTarget should be NULL now, which ought to be a save state. */ + SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); + + /* ... and bind m_pCurDropTarget to the IDropTarget interface of an UIObject of this object */ + hr = m_pSFParent->GetUIObjectOf(m_hWndList, 1, + (LPCITEMIDLIST*)&lvItem.lParam, IID_IDropTarget, NULL, (LPVOID*)&m_pCurDropTarget); + } + + /* If anything failed, m_pCurDropTarget should be NULL now, which ought to be a save state. */ if (FAILED(hr)) return hr; /* Notify the item just entered via DragEnter. */ - return pCurDropTarget->DragEnter(pCurDataObject, grfKeyState, pt, pdwEffect); + return m_pCurDropTarget->DragEnter(m_pCurDataObject, grfKeyState, pt, pdwEffect); } HRESULT WINAPI CDefView::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { /* Get a hold on the data object for later calls to DragEnter on the sub-folders */ - pCurDataObject = pDataObject; + m_pCurDataObject = pDataObject; pDataObject->AddRef(); return drag_notify_subitem(grfKeyState, pt, pdwEffect); @@ -2460,32 +2460,32 @@ HRESULT WINAPI CDefView::DragLeave() { - if (pCurDropTarget) - { - pCurDropTarget->DragLeave(); - pCurDropTarget.Release(); - } - - if (pCurDataObject != NULL) - { - pCurDataObject.Release(); - } - - iDragOverItem = 0; + if (m_pCurDropTarget) + { + m_pCurDropTarget->DragLeave(); + m_pCurDropTarget.Release(); + } + + if (m_pCurDataObject != NULL) + { + m_pCurDataObject.Release(); + } + + m_iDragOverItem = 0; return S_OK; } HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { - if (pCurDropTarget) - { - pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect); - pCurDropTarget.Release(); - } - - pCurDataObject.Release(); - iDragOverItem = 0; + if (m_pCurDropTarget) + { + m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect); + m_pCurDropTarget.Release(); + } + + m_pCurDataObject.Release(); + m_iDragOverItem = 0; return S_OK; } @@ -2550,9 +2550,9 @@ FIXME("partial stub: %p %08x %08x %p\n", this, aspects, advf, pAdvSink); /* FIXME: we set the AdviseSink, but never use it to send any advice */ - this->pAdvSink = pAdvSink; - dwAspects = aspects; - dwAdvf = advf; + m_pAdvSink = pAdvSink; + m_dwAspects = aspects; + m_dwAdvf = advf; return S_OK; } @@ -2563,15 +2563,15 @@ if (ppAdvSink) { - *ppAdvSink = pAdvSink; - pAdvSink.p->AddRef(); + *ppAdvSink = m_pAdvSink; + m_pAdvSink.p->AddRef(); } if (pAspects) - *pAspects = dwAspects; + *pAspects = m_dwAspects; if (pAdvf) - *pAdvf = dwAdvf; + *pAdvf = m_dwAdvf; return S_OK; } @@ -2579,7 +2579,7 @@ HRESULT STDMETHODCALLTYPE CDefView::QueryService(REFGUID guidService, REFIID riid, void **ppvObject) { if (IsEqualIID(guidService, SID_IShellBrowser)) - return pShellBrowser->QueryInterface(riid, ppvObject); + return m_pShellBrowser->QueryInterface(riid, ppvObject); else if(IsEqualIID(guidService, SID_IFolderView)) return QueryInterface(riid, ppvObject);
10 years, 11 months
1
0
0
0
[tfaber] 61047: [NOTEPAD] - Preserve modification flag when toggling the "Word Wrap" option. Patch by Edijs Kolesnikovičs. CORE-7589 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Nov 19 10:18:02 2013 New Revision: 61047 URL:
http://svn.reactos.org/svn/reactos?rev=61047&view=rev
Log: [NOTEPAD] - Preserve modification flag when toggling the "Word Wrap" option. Patch by Edijs Kolesnikovičs. CORE-7589 #resolve Modified: trunk/reactos/base/applications/notepad/dialog.c Modified: trunk/reactos/base/applications/notepad/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Tue Nov 19 10:18:02 2013 @@ -130,7 +130,7 @@ { LoadString(Globals.hInstance, STRING_UNTITLED, szCaption, SIZEOF(szCaption)); } - + StringCchCat(szCaption, SIZEOF(szCaption), _T(" - ")); StringCchCat(szCaption, SIZEOF(szCaption), szNotepad); SetWindowText(Globals.hMainWnd, szCaption); @@ -790,6 +790,7 @@ DWORD dwStyle; int iSize; LPTSTR pTemp = NULL; + BOOL bModified = FALSE; iSize = 0; @@ -812,6 +813,9 @@ // Recover the text into the control. GetWindowText(Globals.hEdit, pTemp, iSize + 1); + + if (SendMessage(Globals.hEdit, EM_GETMODIFY, 0, 0)) + bModified = TRUE; } // Restore original window procedure @@ -863,6 +867,9 @@ { SetWindowText(Globals.hEdit, pTemp); HeapFree(GetProcessHeap(), 0, pTemp); + + if (bModified) + SendMessage(Globals.hEdit, EM_SETMODIFY, TRUE, 0); } // Sub-class a new window callback for row/column detection.
10 years, 11 months
1
0
0
0
[ekohl] 61046: [EVENTLOG] ElfrClearELFW: Fail, if the log file is a backup file.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Nov 18 22:16:16 2013 New Revision: 61046 URL:
http://svn.reactos.org/svn/reactos?rev=61046&view=rev
Log: [EVENTLOG] ElfrClearELFW: Fail, if the log file is a backup file. Modified: trunk/reactos/base/services/eventlog/rpc.c Modified: trunk/reactos/base/services/eventlog/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
============================================================================== --- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Mon Nov 18 22:16:16 2013 @@ -234,6 +234,10 @@ { return STATUS_INVALID_HANDLE; } + + /* Fail, if the log file is a backup file */ + if (lpLogHandle->Flags & LOG_HANDLE_BACKUP_FILE) + return STATUS_INVALID_HANDLE; return LogfClearFile(lpLogHandle->LogFile, (PUNICODE_STRING)BackupFileName);
10 years, 11 months
1
0
0
0
[dgorbachev] 61045: [NTOSKRNL] Do not call RtlCopyMemory (i.e. memcpy/memmove) with NULL pointer, which gives undefined behavior.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Mon Nov 18 22:00:12 2013 New Revision: 61045 URL:
http://svn.reactos.org/svn/reactos?rev=61045&view=rev
Log: [NTOSKRNL] Do not call RtlCopyMemory (i.e. memcpy/memmove) with NULL pointer, which gives undefined behavior. Modified: trunk/reactos/ntoskrnl/ex/resource.c Modified: trunk/reactos/ntoskrnl/ex/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/resource.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] Mon Nov 18 22:00:12 2013 @@ -361,7 +361,7 @@ else { /* Copy the table */ - RtlCopyMemory(Table, Owner, OldSize * sizeof(OWNER_ENTRY)); + if (Owner) RtlCopyMemory(Table, Owner, OldSize * sizeof(OWNER_ENTRY)); /* Acquire dispatcher lock to prevent thread boosting */ OldIrql = KiAcquireDispatcherLock();
10 years, 11 months
1
0
0
0
[hbelusca] 61044: [NTVDM] : Implement getMSW and setMSW for getting and setting the Machine Status Word (lower word of CR0). [FAST486]: MSW = Machine Status Word
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Nov 18 20:25:10 2013 New Revision: 61044 URL:
http://svn.reactos.org/svn/reactos?rev=61044&view=rev
Log: [NTVDM] : Implement getMSW and setMSW for getting and setting the Machine Status Word (lower word of CR0). [FAST486]: MSW = Machine Status Word Modified: branches/ntvdm/lib/fast486/opgroups.c branches/ntvdm/subsystems/ntvdm/registers.c Modified: branches/ntvdm/lib/fast486/opgroups.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opgroups.c?re…
============================================================================== --- branches/ntvdm/lib/fast486/opgroups.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opgroups.c [iso-8859-1] Mon Nov 18 20:25:10 2013 @@ -1803,7 +1803,7 @@ /* SMSW */ case 4: { - /* Store the lower 16 bits of CR0 */ + /* Store the lower 16 bits (Machine Status Word) of CR0 */ return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, @@ -1813,7 +1813,7 @@ /* LMSW */ case 6: { - USHORT MasterStatusWord, Dummy; + USHORT MachineStatusWord, Dummy; /* This is a privileged instruction */ if (Fast486GetCurrentPrivLevel(State) != 0) @@ -1822,8 +1822,8 @@ return FALSE; } - /* Read the new master status word */ - if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &MasterStatusWord)) + /* Read the new Machine Status Word */ + if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &MachineStatusWord)) { /* Exception occurred */ return FALSE; @@ -1831,7 +1831,7 @@ /* This instruction cannot be used to return to real mode */ if ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) - && !(MasterStatusWord & FAST486_CR0_PE)) + && !(MachineStatusWord & FAST486_CR0_PE)) { Fast486Exception(State, FAST486_EXCEPTION_GP); return FALSE; @@ -1839,7 +1839,7 @@ /* Set the lowest 4 bits */ State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF0; - State->ControlRegisters[FAST486_REG_CR0] |= MasterStatusWord & 0x0F; + State->ControlRegisters[FAST486_REG_CR0] |= MachineStatusWord & 0x0F; return TRUE; } Modified: branches/ntvdm/subsystems/ntvdm/registers.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/register…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/registers.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/registers.c [iso-8859-1] Mon Nov 18 20:25:10 2013 @@ -661,14 +661,16 @@ CDECL getMSW(VOID) { - return 0; // UNIMPLEMENTED + return LOWORD(EmulatorContext.ControlRegisters[FAST486_REG_CR0]); } VOID CDECL setMSW(USHORT Value) { - // UNIMPLEMENTED + /* Set the lowest word (8 bits) */ + EmulatorContext.ControlRegisters[FAST486_REG_CR0] &= 0xFFFF0000; + EmulatorContext.ControlRegisters[FAST486_REG_CR0] |= Value & 0xFFFF; } /* EOF */
10 years, 11 months
1
0
0
0
[tfaber] 61043: [RAPPS] - Fix info display on selection change. Patch by Carlo Bramini. CORE-6139 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 18 20:24:18 2013 New Revision: 61043 URL:
http://svn.reactos.org/svn/reactos?rev=61043&view=rev
Log: [RAPPS] - Fix info display on selection change. Patch by Carlo Bramini. CORE-6139 #resolve Modified: trunk/reactos/base/applications/rapps/listview.c trunk/reactos/base/applications/rapps/winmain.c Modified: trunk/reactos/base/applications/rapps/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/li…
============================================================================== --- trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] Mon Nov 18 20:24:18 2013 @@ -103,7 +103,7 @@ hListView = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEWW, L"", - WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT | LVS_SINGLESEL, + WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS, 205, 28, 465, 250, hwnd, NULL, Modified: trunk/reactos/base/applications/rapps/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Mon Nov 18 20:24:18 2013 @@ -73,7 +73,7 @@ if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS) { - RegSetValueEx(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO)); + RegSetValueExW(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO)); RegCloseKey(hKey); } } @@ -631,21 +631,31 @@ } break; - case LVN_KEYDOWN: + case LVN_ITEMCHANGED: { - LPNMLVKEYDOWN pnkd = (LPNMLVKEYDOWN) lParam; - - if (pnkd->hdr.hwndFrom == hListView) + LPNMLISTVIEW pnic = (LPNMLISTVIEW) lParam; + + if (pnic->hdr.hwndFrom == hListView) { - INT ItemIndex = (INT) SendMessage(hListView, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); - - if (pnkd->wVKey == VK_UP) ItemIndex -= 1; - if (pnkd->wVKey == VK_DOWN) ItemIndex += 1; - - if (IS_INSTALLED_ENUM(SelectedEnumType)) - ShowInstalledAppInfo(ItemIndex); - if (IS_AVAILABLE_ENUM(SelectedEnumType)) - ShowAvailableAppInfo(ItemIndex); + /* Check if this is a valid item + * (technically, it can be also an unselect) */ + INT ItemIndex = pnic->iItem; + if (ItemIndex == -1 || + ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom)) + { + break; + } + + /* Check if the focus has been moved to another item */ + if ((pnic->uChanged & LVIF_STATE) && + (pnic->uNewState & LVIS_FOCUSED) && + !(pnic->uOldState & LVIS_FOCUSED)) + { + if (IS_INSTALLED_ENUM(SelectedEnumType)) + ShowInstalledAppInfo(ItemIndex); + if (IS_AVAILABLE_ENUM(SelectedEnumType)) + ShowAvailableAppInfo(ItemIndex); + } } } break; @@ -763,7 +773,7 @@ WCHAR szErrorText[MAX_STR_LEN]; HANDLE hMutex = NULL; MSG Msg; - + switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): @@ -773,7 +783,7 @@ default: break; } - + hInst = hInstance; if (!IsUserAnAdmin())
10 years, 11 months
1
0
0
0
[tfaber] 61042: [D3DCOMPILER_43] - Fix MSVC warnings (yes I know these are generated files. It's a flex bug)
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 18 19:02:56 2013 New Revision: 61042 URL:
http://svn.reactos.org/svn/reactos?rev=61042&view=rev
Log: [D3DCOMPILER_43] - Fix MSVC warnings (yes I know these are generated files. It's a flex bug) Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
============================================================================== --- trunk/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c [iso-8859-1] Mon Nov 18 19:02:56 2013 @@ -360,7 +360,7 @@ /* Begin user sect3 */ -#define asmshader_wrap(n) 1 +#define asmshader_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
============================================================================== --- trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c [iso-8859-1] Mon Nov 18 19:02:56 2013 @@ -360,7 +360,7 @@ /* Begin user sect3 */ -#define hlsl_wrap(n) 1 +#define hlsl_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR;
10 years, 11 months
1
0
0
0
[tkreuzer] 61041: [NTOSKRNL] Implement PoQueueShutdownWorkItem, PoRequestShutdownEvent, PoRequestShutdownWait, PopProcessShutDownLists. One step closer to ... proper shutdown.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Nov 18 17:47:37 2013 New Revision: 61041 URL:
http://svn.reactos.org/svn/reactos?rev=61041&view=rev
Log: [NTOSKRNL] Implement PoQueueShutdownWorkItem, PoRequestShutdownEvent, PoRequestShutdownWait, PopProcessShutDownLists. One step closer to ... proper shutdown. Modified: trunk/reactos/ntoskrnl/include/internal/po.h trunk/reactos/ntoskrnl/po/poshtdwn.c trunk/reactos/ntoskrnl/po/power.c Modified: trunk/reactos/ntoskrnl/include/internal/po.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] Mon Nov 18 17:47:37 2013 @@ -240,7 +240,7 @@ ULONG D0Count; LIST_ENTRY NotifyList; } POWER_CHANNEL_SUMMARY, *PPOWER_CHANNEL_SUMMARY; - + typedef struct _DEVICE_OBJECT_POWER_EXTENSION { ULONG IdleCount; @@ -255,6 +255,12 @@ LIST_ENTRY Volume; } DEVICE_OBJECT_POWER_EXTENSION, *PDEVICE_OBJECT_POWER_EXTENSION; +typedef struct _POP_SHUTDOWN_WAIT_ENTRY +{ + struct _POP_SHUTDOWN_WAIT_ENTRY *NextEntry; + PETHREAD Thread; +} POP_SHUTDOWN_WAIT_ENTRY, *PPOP_SHUTDOWN_WAIT_ENTRY; + // // Initialization routines // @@ -268,6 +274,12 @@ NTAPI PoInitializePrcb( IN PKPRCB Prcb +); + +VOID +NTAPI +PopInitShutdownList( + VOID ); // Modified: trunk/reactos/ntoskrnl/po/poshtdwn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/poshtdwn.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/po/poshtdwn.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/poshtdwn.c [iso-8859-1] Mon Nov 18 17:47:37 2013 @@ -18,8 +18,129 @@ /* GLOBALS *******************************************************************/ ULONG PopShutdownPowerOffPolicy; +KEVENT PopShutdownEvent; +PPOP_SHUTDOWN_WAIT_ENTRY PopShutdownThreadList; +LIST_ENTRY PopShutdownQueue; +KGUARDED_MUTEX PopShutdownListMutex; +BOOLEAN PopShutdownListAvailable; + /* PRIVATE FUNCTIONS *********************************************************/ + +VOID +NTAPI +PopInitShutdownList(VOID) +{ + PAGED_CODE(); + + /* Initialize the global shutdown event */ + KeInitializeEvent(&PopShutdownEvent, NotificationEvent, FALSE); + + /* Initialize the shutdown lists */ + PopShutdownThreadList = NULL; + InitializeListHead(&PopShutdownQueue); + + /* Initialize the shutdown list lock */ + KeInitializeGuardedMutex(&PopShutdownListMutex); + + /* The list is available now */ + PopShutdownListAvailable = TRUE; +} + +NTSTATUS +NTAPI +PoRequestShutdownWait( + _In_ PETHREAD Thread) +{ + PPOP_SHUTDOWN_WAIT_ENTRY ShutDownWaitEntry; + NTSTATUS Status; + PAGED_CODE(); + + /* Allocate a new shutdown wait entry */ + ShutDownWaitEntry = ExAllocatePoolWithTag(PagedPool, 8u, 'LSoP'); + if (ShutDownWaitEntry == NULL) + { + return STATUS_NO_MEMORY; + } + + /* Reference the thread and save it in the wait entry */ + ObReferenceObject(Thread); + ShutDownWaitEntry->Thread = Thread; + + /* Acquire the shutdown list lock */ + KeAcquireGuardedMutex(&PopShutdownListMutex); + + /* Check if the list is still available */ + if (PopShutdownListAvailable) + { + /* Insert the item in the list */ + ShutDownWaitEntry->NextEntry = PopShutdownThreadList; + PopShutdownThreadList = ShutDownWaitEntry; + + /* We are successful */ + Status = STATUS_SUCCESS; + } + else + { + /* We cannot proceed, cleanup and return failure */ + ObDereferenceObject(Thread); + ExFreePoolWithTag(ShutDownWaitEntry, 0); + Status = STATUS_UNSUCCESSFUL; + } + + /* Release the list lock */ + KeReleaseGuardedMutex(&PopShutdownListMutex); + + /* Return the status */ + return Status; +} + +VOID +NTAPI +PopProcessShutDownLists(VOID) +{ + PPOP_SHUTDOWN_WAIT_ENTRY ShutDownWaitEntry; + PWORK_QUEUE_ITEM WorkItem; + PLIST_ENTRY ListEntry; + + /* First signal the shutdown event */ + KeSetEvent(&PopShutdownEvent, IO_NO_INCREMENT, FALSE); + + /* Acquire the shutdown list lock */ + KeAcquireGuardedMutex(&PopShutdownListMutex); + + /* Block any further attempts to register a shutdown event */ + PopShutdownListAvailable = FALSE; + + /* Release the list lock, since we are exclusively using the lists now */ + KeReleaseGuardedMutex(&PopShutdownListMutex); + + /* Process the shutdown queue */ + while (!IsListEmpty(&PopShutdownQueue)) + { + /* Get the head entry */ + ListEntry = RemoveHeadList(&PopShutdownQueue); + WorkItem = CONTAINING_RECORD(ListEntry, WORK_QUEUE_ITEM, List); + + /* Call the shutdown worker routine */ + WorkItem->WorkerRoutine(WorkItem->Parameter); + } + + /* Now process the shutdown thread list */ + while (PopShutdownThreadList != NULL) + { + /* Get the top entry and remove it from the list */ + ShutDownWaitEntry = PopShutdownThreadList; + PopShutdownThreadList = PopShutdownThreadList->NextEntry; + + /* Wait for the thread to finish and dereference it */ + KeWaitForSingleObject(ShutDownWaitEntry->Thread, 0, 0, 0, 0); + ObfDereferenceObject(ShutDownWaitEntry->Thread); + + /* Finally free the entry */ + ExFreePoolWithTag(ShutDownWaitEntry, 0); + } +} VOID NTAPI @@ -27,7 +148,7 @@ { PUCHAR Logo1, Logo2; ULONG i; - + /* Stop all interrupts */ KeRaiseIrqlToDpcLevel(); _disable(); @@ -72,7 +193,7 @@ /* Unload symbols */ DPRINT1("It's the final countdown...%lx\n", SystemAction); DbgUnLoadImageSymbols(NULL, (PVOID)-1, 0); - + /* Run the thread on the boot processor */ KeSetSystemAffinityThread(1); @@ -101,7 +222,7 @@ /* Call shutdown handler */ //PopInvokeSystemStateHandler(PowerStateShutdownOff, NULL); - + /* ReactOS Hack */ PopSetSystemPowerState(PowerSystemShutdown, SystemAction); PopShutdownHandler(); @@ -123,6 +244,9 @@ PopGracefulShutdown(IN PVOID Context) { PEPROCESS Process = NULL; + + /* Process the registered waits and work items */ + PopProcessShutDownLists(); /* Loop every process */ Process = PsGetNextProcess(Process); @@ -144,13 +268,13 @@ HalEndOfBoot(); /* In this step, the I/O manager does first-chance shutdown notification */ - DPRINT1("I/O manager shutting down in phase 0\n"); + DPRINT1("I/O manager shutting down in phase 0\n"); IoShutdownSystem(0); - + /* In this step, all workers are killed and hives are flushed */ DPRINT1("Configuration Manager shutting down\n"); CmShutdownSystem(); - + /* Note that modified pages should be written here (MiShutdownSystem) */ #ifdef NEWCC /* Flush all user files before we start shutting down IO */ @@ -159,7 +283,7 @@ #endif /* In this step, the I/O manager does last-chance shutdown notification */ - DPRINT1("I/O manager shutting down in phase 1\n"); + DPRINT1("I/O manager shutting down in phase 1\n"); IoShutdownSystem(1); CcWaitForCurrentLazyWriterActivity(); @@ -168,7 +292,7 @@ /* In this step, the HAL disables any wake timers */ DPRINT1("Disabling wake timers\n"); HalSetWakeEnable(FALSE); - + /* And finally the power request is sent */ DPRINT1("Taking the system down\n"); PopShutdownSystem(PopAction.Action); @@ -185,7 +309,7 @@ ULONG Length; UCHAR Buffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG)]; PKEY_VALUE_PARTIAL_INFORMATION Info = (PVOID)Buffer; - + /* Setup object attributes */ RtlInitUnicodeString(&KeyString, L"\\Registry\\Machine\\Software\\Policies\\Microsoft\\Windows NT"); @@ -220,3 +344,60 @@ /* PUBLIC FUNCTIONS **********************************************************/ +/* + * @unimplemented + */ +NTSTATUS +NTAPI +PoQueueShutdownWorkItem( + _In_ PWORK_QUEUE_ITEM WorkItem) +{ + NTSTATUS Status; + + /* Acquire the shutdown list lock */ + KeAcquireGuardedMutex(&PopShutdownListMutex); + + /* Check if the list is (already/still) available */ + if (PopShutdownListAvailable) + { + /* Insert the item into the list */ + InsertTailList(&PopShutdownQueue, &WorkItem->List); + Status = STATUS_SUCCESS; + } + else + { + /* We are already in shutdown */ + Status = STATUS_SYSTEM_SHUTDOWN; + } + + /* Release the list lock */ + KeReleaseGuardedMutex(&PopShutdownListMutex); + + return Status; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +PoRequestShutdownEvent(OUT PVOID *Event) +{ + NTSTATUS Status; + PAGED_CODE(); + + /* Initialize to NULL */ + if (Event) *Event = NULL; + + /* Request a shutdown wait */ + Status = PoRequestShutdownWait(PsGetCurrentThread()); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Return the global shutdown event */ + if (Event) *Event = &PopShutdownEvent; + return STATUS_SUCCESS; +} + Modified: trunk/reactos/ntoskrnl/po/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=61…
============================================================================== --- trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] Mon Nov 18 17:47:37 2013 @@ -344,6 +344,10 @@ /* Initialize support for dope */ KeInitializeSpinLock(&PopDopeGlobalLock); + + /* Initialize support for shutdown waits and work-items */ + PopInitShutdownList(); + return TRUE; } @@ -443,17 +447,6 @@ BugCheckParameter2, BugCheckParameter3, BugCheckParameter4); -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -PoRequestShutdownEvent(OUT PVOID *Event) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; } /* @@ -635,19 +628,6 @@ PoUnregisterSystemState(IN PVOID StateHandle) { UNIMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -PoQueueShutdownWorkItem(IN PWORK_QUEUE_ITEM WorkItem) -{ - PAGED_CODE(); - - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; } /*
10 years, 11 months
1
0
0
0
[tkreuzer] 61040: [NTOSKRNK] Implement KiCallbackReturnHandler
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Nov 18 17:23:04 2013 New Revision: 61040 URL:
http://svn.reactos.org/svn/reactos?rev=61040&view=rev
Log: [NTOSKRNK] Implement KiCallbackReturnHandler Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Mon Nov 18 17:23:04 2013 @@ -236,7 +236,7 @@ IN PFX_SAVE_AREA SaveArea) { ULONG Cr0, Mask, Error, ErrorOffset, DataOffset; - + /* Check for VDM trap */ ASSERT((KiVdmTrap(TrapFrame)) == FALSE); @@ -245,7 +245,7 @@ { /* Kernel might've tripped a delayed error */ SaveArea->Cr0NpxState |= CR0_TS; - + /* Only valid if it happened during a restore */ //if ((PVOID)TrapFrame->Eip == FrRestore) { @@ -1455,7 +1455,16 @@ FASTCALL KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame) { - UNIMPLEMENTED_DBGBREAK(); + NTSTATUS Status; + + /* Pass the register parameters to NtCallbackReturn. + Result pointer is in ecx, result length in edx, status in eax */ + Status = NtCallbackReturn((PVOID)TrapFrame->Ecx, + TrapFrame->Edx, + TrapFrame->Eax); + + /* If we got here, something went wrong. Return an error to the caller */ + KiServiceExit(TrapFrame, Status); } DECLSPEC_NORETURN @@ -1567,7 +1576,7 @@ /* Decode the system call number */ Offset = (SystemCallNumber >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK; Id = SystemCallNumber & SERVICE_NUMBER_MASK; - + /* Get descriptor table */ DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset);
10 years, 11 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
35
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
Results per page:
10
25
50
100
200