MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / DecodeFriendlyPath

Function DecodeFriendlyPath

Explorer++/Helper/ShellHelper.cpp:228–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228HRESULT DecodeFriendlyPath(const TCHAR *szFriendlyPath, TCHAR *szParsingPath, UINT cchMax)
229{
230 PIDLIST_ABSOLUTE pidl = NULL;
231 TCHAR szName[MAX_PATH];
232
233 SHGetFolderLocation(NULL, CSIDL_CONTROLS, NULL, 0, &pidl);
234 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
235 CoTaskMemFree(pidl);
236
237 if (lstrcmpi(szName, szFriendlyPath) == 0)
238 {
239 GetCsidlDisplayName(CSIDL_CONTROLS, szParsingPath, cchMax, SHGDN_FORPARSING);
240 return S_OK;
241 }
242
243 SHGetFolderLocation(NULL, CSIDL_BITBUCKET, NULL, 0, &pidl);
244 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
245 CoTaskMemFree(pidl);
246
247 if (lstrcmpi(szName, szFriendlyPath) == 0)
248 {
249 GetCsidlDisplayName(CSIDL_BITBUCKET, szParsingPath, cchMax, SHGDN_FORPARSING);
250 return S_OK;
251 }
252
253 SHGetFolderLocation(NULL, CSIDL_DRIVES, NULL, 0, &pidl);
254 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
255 CoTaskMemFree(pidl);
256
257 if (lstrcmpi(szName, szFriendlyPath) == 0)
258 {
259 GetCsidlDisplayName(CSIDL_DRIVES, szParsingPath, cchMax, SHGDN_FORPARSING);
260 return S_OK;
261 }
262
263 SHGetFolderLocation(NULL, CSIDL_NETWORK, NULL, 0, &pidl);
264 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
265 CoTaskMemFree(pidl);
266
267 if (lstrcmpi(szName, szFriendlyPath) == 0)
268 {
269 GetCsidlDisplayName(CSIDL_NETWORK, szParsingPath, cchMax, SHGDN_FORPARSING);
270 return S_OK;
271 }
272
273 SHGetFolderLocation(NULL, CSIDL_CONNECTIONS, NULL, 0, &pidl);
274 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
275 CoTaskMemFree(pidl);
276
277 if (lstrcmpi(szName, szFriendlyPath) == 0)
278 {
279 GetCsidlDisplayName(CSIDL_CONNECTIONS, szParsingPath, cchMax, SHGDN_FORPARSING);
280 return S_OK;
281 }
282
283 SHGetFolderLocation(NULL, CSIDL_PRINTERS, NULL, 0, &pidl);
284 GetDisplayName(pidl, szName, SIZEOF_ARRAY(szName), SHGDN_INFOLDER);
285 CoTaskMemFree(pidl);

Callers 3

GeneralSettingsProcMethod · 0.85
DecodePathFunction · 0.85

Calls 2

GetDisplayNameFunction · 0.85
GetCsidlDisplayNameFunction · 0.85

Tested by

no test coverage detected