[ui] report process(es) that are preventing access on error

* Also revert loc file changes that were introduced in f53b22a077
This commit is contained in:
Pete Batard 2017-07-11 17:43:51 +01:00
parent c00557900b
commit a528bb3d83
9 changed files with 252 additions and 58 deletions

View file

@ -57,6 +57,7 @@ PF_TYPE_DECL(NTAPI, NTSTATUS, NtAdjustPrivilegesToken, (HANDLE, BOOLEAN, PTOKEN_
PF_TYPE_DECL(NTAPI, NTSTATUS, NtClose, (HANDLE));
static PVOID PhHeapHandle = NULL;
extern StrArray BlockingProcess;
/*
* Convert an NT Status to an error message
@ -399,6 +400,7 @@ NTSTATUS PhQueryProcessesUsingVolumeOrFile(HANDLE VolumeOrFileHandle,
BOOL SearchProcess(char* HandleName, BOOL bPartialMatch, BOOL bIgnoreSelf)
{
const char *access_rights_str[8] = { "n", "r", "w", "rw", "x", "rx", "wx", "rwx" };
char tmp[MAX_PATH];
NTSTATUS status = STATUS_SUCCESS;
PSYSTEM_HANDLE_INFORMATION_EX handles = NULL;
POBJECT_NAME_INFORMATION buffer = NULL;
@ -426,6 +428,8 @@ BOOL SearchProcess(char* HandleName, BOOL bPartialMatch, BOOL bIgnoreSelf)
PF_INIT_OR_SET_STATUS(RtlInitUnicodeString, NtDll);
#endif
StrArrayClear(&BlockingProcess);
if (NT_SUCCESS(status))
status = PhCreateHeap();
@ -481,7 +485,9 @@ BOOL SearchProcess(char* HandleName, BOOL bPartialMatch, BOOL bIgnoreSelf)
// If we're switching process and found a match, print it
if (bFound) {
uprintf("o '%s' (pid: %ld, access: %s)", exe_path, pid[cur_pid], access_rights_str[access_rights & 0x7]);
uprintf("● '%s' (pid: %ld, access: %s)", exe_path, pid[cur_pid], access_rights_str[access_rights & 0x7]);
static_sprintf(tmp, "● %s (pid %ld)", exe_path, pid[cur_pid]);
StrArrayAdd(&BlockingProcess, tmp, TRUE);
bFound = FALSE;
access_rights = 0;
}