mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:35:08 +00:00
Driver: fortps: Minor refactor of error code
This commit is contained in:
parent
277d5efb82
commit
632698af80
@ -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(¶ms->ImagePathName, params);
|
||||
PVOID userBuffer = GetUnicodeStringBuffer(¶ms->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(¶ms->CommandLine, params);
|
||||
PVOID userBuffer = GetUnicodeStringBuffer(¶ms->CommandLine, params);
|
||||
ReadProcessStringBuffer(epa->process, userBuffer, &epa->commandLine, commandLineLength);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user