MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getAbsolutePidlFromAbsFilePath

Function getAbsolutePidlFromAbsFilePath

trunk/win/Source/BT_WindowsHelper.cpp:18–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include "BT_VistaFileOperation.h"
17
18LPITEMIDLIST getAbsolutePidlFromAbsFilePath(LPWSTR path)
19{
20 LPITEMIDLIST pidl = NULL;
21 LPITEMIDLIST pidlAbsolute = NULL;
22
23 // namespace extension root (desktop) for parsing path
24 LPSHELLFOLDER psfDesktop = NULL;
25 if (FAILED(SHGetDesktopFolder(&psfDesktop)))
26 return pidl;
27
28 // parse path for absolute PIDL
29 if (FAILED(psfDesktop->ParseDisplayName(NULL, NULL, path, NULL, &pidl, NULL)))
30 return pidl;
31
32 // get the absolute pidl, do not need to free pidlTemp
33 pidlAbsolute = ILClone(pidl);
34
35 // cleanup
36 CoTaskMemFree(pidl);
37 psfDesktop->Release();
38
39 return pidlAbsolute;
40}
41
42bool moveFilesVistaHelper(QList<LPWSTR>& src, LPWSTR destFolder, QList<FileOperationResult>& results)
43{

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected