mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 13:45:58 +00:00
[KERNEL32]
Implement GetVDMCurrentDirectories. [BASESRV] Fix a bug in BaseSrvGetVDMCurDirs. svn path=/branches/ntvdm/; revision=62097
This commit is contained in:
parent
158d2645a5
commit
5a678ff4e0
|
@ -1138,17 +1138,51 @@ GetNextVDMCommand(PGET_NEXT_VDM_COMMAND_DATA CommandData)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
DWORD
|
DWORD
|
||||||
WINAPI
|
WINAPI
|
||||||
GetVDMCurrentDirectories (
|
GetVDMCurrentDirectories(DWORD cchCurDirs, PCHAR lpszzCurDirs)
|
||||||
DWORD Unknown0,
|
|
||||||
DWORD Unknown1
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
STUB;
|
BASE_API_MESSAGE ApiMessage;
|
||||||
return 0;
|
PBASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest = &ApiMessage.Data.VDMCurrentDirsRequest;
|
||||||
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
|
|
||||||
|
/* Allocate the capture buffer */
|
||||||
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, cchCurDirs);
|
||||||
|
if (CaptureBuffer == NULL)
|
||||||
|
{
|
||||||
|
BaseSetLastNTError(STATUS_NO_MEMORY);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Setup the input parameters */
|
||||||
|
VDMCurrentDirsRequest->cchCurDirs = cchCurDirs;
|
||||||
|
CsrAllocateMessagePointer(CaptureBuffer,
|
||||||
|
cchCurDirs,
|
||||||
|
(PVOID*)&VDMCurrentDirsRequest->lpszzCurDirs);
|
||||||
|
|
||||||
|
/* Call CSRSS */
|
||||||
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
|
CaptureBuffer,
|
||||||
|
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepGetVDMCurDirs),
|
||||||
|
sizeof(BASE_GETSET_VDM_CURDIRS));
|
||||||
|
|
||||||
|
/* Set the last error */
|
||||||
|
BaseSetLastNTError(ApiMessage.Status);
|
||||||
|
|
||||||
|
if (NT_SUCCESS(ApiMessage.Status))
|
||||||
|
{
|
||||||
|
/* Copy the result */
|
||||||
|
RtlMoveMemory(lpszzCurDirs, VDMCurrentDirsRequest->lpszzCurDirs, cchCurDirs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free the capture buffer */
|
||||||
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
|
/* Return the size if it was successful, or if the buffer was too small */
|
||||||
|
return (NT_SUCCESS(ApiMessage.Status) || (ApiMessage.Status == STATUS_BUFFER_TOO_SMALL))
|
||||||
|
? VDMCurrentDirsRequest->cchCurDirs : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,9 @@ CSR_API(BaseSrvGetVDMCurDirs)
|
||||||
Status = BaseSrvGetConsoleRecord(VDMCurrentDirsRequest->ConsoleHandle, &ConsoleRecord);
|
Status = BaseSrvGetConsoleRecord(VDMCurrentDirsRequest->ConsoleHandle, &ConsoleRecord);
|
||||||
if (!NT_SUCCESS(Status)) goto Cleanup;
|
if (!NT_SUCCESS(Status)) goto Cleanup;
|
||||||
|
|
||||||
|
/* Return the actual size of the current directory information */
|
||||||
|
VDMCurrentDirsRequest->cchCurDirs = ConsoleRecord->CurDirsLength;
|
||||||
|
|
||||||
/* Check if the buffer is large enough */
|
/* Check if the buffer is large enough */
|
||||||
if (VDMCurrentDirsRequest->cchCurDirs < ConsoleRecord->CurDirsLength)
|
if (VDMCurrentDirsRequest->cchCurDirs < ConsoleRecord->CurDirsLength)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue