mirror of
https://github.com/vxunderground/VX-API
synced 2024-06-28 09:41:13 +00:00
23 lines
853 B
C++
23 lines
853 B
C++
DWORD RfGetCurrentDirectoryA(DWORD nBufferLength, PCHAR lpBuffer)
|
|
{
|
|
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = GetPeb()->ProcessParameters;
|
|
|
|
if (ProcessParameters->CurrentDirectory.DosPath.Length > nBufferLength)
|
|
return ERROR_FAILURE_RETURN;
|
|
|
|
return (DWORD)WCharStringToCharString(lpBuffer, ProcessParameters->CurrentDirectory.DosPath.Buffer, ProcessParameters->CurrentDirectory.DosPath.MaximumLength);
|
|
}
|
|
|
|
DWORD RfGetCurrentDirectoryW(DWORD nBufferLength, PWCHAR lpBuffer)
|
|
{
|
|
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = GetPeb()->ProcessParameters;
|
|
|
|
if (ProcessParameters->CurrentDirectory.DosPath.Length > nBufferLength)
|
|
return ERROR_FAILURE_RETURN;
|
|
|
|
if (StringCopyW(lpBuffer, ProcessParameters->CurrentDirectory.DosPath.Buffer) == NULL)
|
|
return ERROR_FAILURE_RETURN;
|
|
|
|
return ProcessParameters->CurrentDirectory.DosPath.Length;
|
|
}
|