Driver: Fix warnings

This commit is contained in:
Nodir Temirkhodjaev 2023-04-13 14:16:50 +03:00
parent e5ae4a7506
commit 59b3031623
2 changed files with 6 additions and 5 deletions

View File

@ -408,7 +408,7 @@ static void NTAPI fort_device_load_expand(PVOID parameter)
FORT_API NTSTATUS fort_device_load(void)
{
NTSTATUS status_expand;
NTSTATUS status_expand = STATUS_SUCCESS;
const NTSTATUS status = KeExpandKernelStackAndCallout(
&fort_device_load_expand, &status_expand, KERNEL_STACK_SIZE);

View File

@ -577,9 +577,10 @@ static void fort_pstree_check_proc_parent_inheritance_conf(PFORT_PSTREE ps_tree,
const HANDLE parentHandle = OpenProcessById(parent_process_id);
if (parentHandle != NULL) {
fort_pstree_check_proc_conf(ps_tree, conf_ref, parent, parentHandle, parent_process_id);
}
ZwClose(parentHandle);
}
}
/* Set process inheritance by parent */
KeAcquireInStackQueuedSpinLock(&ps_tree->lock, &lock_queue);
@ -772,15 +773,15 @@ static NTSTATUS fort_pstree_enum_process(PFORT_PSTREE ps_tree, PSYSTEM_PROCESSES
if (fort_pstree_svchost_path_check(path)) {
status = GetProcessPathArgs(processHandle, path, commandLine);
if (!NT_SUCCESS(status)) {
LOG("PsTree: Process Args Error: pid=%d %x\n", processEntry->ProcessId, status);
LOG("PsTree: Process Args Error: pid=%d %x\n", (DWORD) processEntry->ProcessId, status);
return status;
}
} else {
path->Length = 0;
}
const DWORD processId = (DWORD) (ptrdiff_t) processEntry->ProcessId;
const DWORD parentProcessId = (DWORD) (ptrdiff_t) processEntry->ParentProcessId;
const DWORD processId = (DWORD) processEntry->ProcessId;
const DWORD parentProcessId = (DWORD) processEntry->ParentProcessId;
const tommy_key_t pid_hash = fort_pstree_proc_hash(processId);