MCPcopy Create free account
hub / github.com/Wunkolo/UWPDumper / GetLocalPath

Method GetLocalPath

UWPDumper/source/UWP/UWP.cpp:296–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296std::wstring UWP::Current::Storage::GetLocalPath()
297{
298 ComPtr<ABI::Windows::Storage::IApplicationData> AppData = GetIApplicationData();
299
300 ComPtr<ABI::Windows::Storage::IStorageFolder> LocalStateFolder;
301
302 if( AppData->get_LocalFolder(&LocalStateFolder) < 0 )
303 {
304 // Failed to get folder
305 return L"";
306 }
307
308 ComPtr<ABI::Windows::Storage::IStorageItem> FolderItem;
309 if( LocalStateFolder.As(&FolderItem) < 0 )
310 {
311 // Failed to cast to IStorageItem
312 return L"";
313 }
314
315 HString LocalPathString;
316
317 if( FolderItem->get_Path(LocalPathString.GetAddressOf()) < 0 )
318 {
319 // Failed to get path as string
320 return L"";
321 }
322
323 std::uint32_t PathLength;
324 const wchar_t* LocalPathRaw = LocalPathString.GetRawBuffer(&PathLength);
325 return std::wstring(LocalPathRaw, PathLength);
326}
327
328std::wstring UWP::Current::Storage::GetRoamingPath()
329{

Callers

nothing calls this directly

Calls 1

GetIApplicationDataFunction · 0.85

Tested by

no test coverage detected