Tidy up PhGetProcessItemImageTypeText
@@ -97,56 +97,36 @@ PPH_STRING PhGetProcessItemImageTypeText (
_In_ PPH_PROCESS_ITEM ProcessItem
)
{
- PWSTR arch;
- PWSTR bits;
+ PWSTR arch = L"";
+ PWSTR bits = L"";
switch (ProcessItem->Architecture)
{
case IMAGE_FILE_MACHINE_I386:
- {
arch = L"I386 ";
break;
- }
case IMAGE_FILE_MACHINE_AMD64:
- {
arch = L"AMD64 ";
break;
- }
case IMAGE_FILE_MACHINE_ARM:
- {
arch = L"ARM ";
break;
- }
case IMAGE_FILE_MACHINE_ARM64:
- {
arch = L"ARM64 ";
break;
}
- case IMAGE_FILE_MACHINE_UNKNOWN:
- default:
- {
- arch = L"";
- break;
- }
- }
#if _WIN64
if (ProcessItem->IsWow64Valid)
{
bits = ProcessItem->IsWow64 ? L"(32-bit)" : L"(64-bit)";
}
- else
- {
- bits = L"";
- }
#else
bits = L"(32-bit)";
#endif
- if ((arch[0] == L'\0') && (bits[0] == L'\0'))
- {
+ if (arch[0] == UNICODE_NULL && bits[0] == UNICODE_NULL)
return PhCreateString(L"N/A");
- }
return PhConcatStrings2(arch, bits);
}
