Driver: fortps: Minor refactor of error code

This commit is contained in:
Nodir Temirkhodjaev 2023-04-25 11:31:09 +03:00
parent 277d5efb82
commit 632698af80

View File

@ -246,18 +246,18 @@ static NTSTATUS GetCurrentProcessPathArgs(PFORT_PSENUM_PROCESS_ARG epa)
PRTL_USER_PROCESS_PARAMETERS params = epa->peb.ProcessParameters;
if (params == NULL)
return STATUS_INVALID_ADDRESS;
return STATUS_INVALID_ADDRESS_COMPONENT;
const USHORT pathLength = params->ImagePathName.Length;
if (pathLength != 0 && pathLength <= epa->pb.path.MaximumLength - sizeof(WCHAR)) {
PVOID userBuffer = (PVOID) GetUnicodeStringBuffer(&params->ImagePathName, params);
PVOID userBuffer = GetUnicodeStringBuffer(&params->ImagePathName, params);
ReadProcessStringBuffer(epa->process, userBuffer, &epa->pb.path, pathLength);
}
const USHORT commandLineLength = params->CommandLine.Length;
if (commandLineLength != 0
&& commandLineLength <= epa->commandLine.MaximumLength - sizeof(WCHAR)) {
PVOID userBuffer = (PVOID) GetUnicodeStringBuffer(&params->CommandLine, params);
PVOID userBuffer = GetUnicodeStringBuffer(&params->CommandLine, params);
ReadProcessStringBuffer(epa->process, userBuffer, &epa->commandLine, commandLineLength);
}