Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zodiacon committed Nov 4, 2018
1 parent b9eaf5a commit 3bdb36c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions UwpList/UwpList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ void DisplayProcessInfo(HANDLE hProcess, DWORD pid) {
auto error = ::GetPackageFullName(hProcess, &len, nullptr);

PCWSTR packageName{};
if (error == ERROR_SUCCESS) {
auto name = make_unique<wchar_t[]>(len);
unique_ptr<wchar_t[]> name;
if (error == ERROR_INSUFFICIENT_BUFFER) {
name = make_unique<wchar_t[]>(len);
error = ::GetPackageFullName(hProcess, &len, name.get());
packageName = name.get();
}
Expand Down

0 comments on commit 3bdb36c

Please sign in to comment.