From 24d5936eb903e60b467687728a6aed513b12097e Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Mon, 10 Feb 2014 14:24:36 +0000 Subject: [PATCH] [KERNEL32] Implement SetVDMCurrentDirectories. svn path=/branches/ntvdm/; revision=62098 --- dll/win32/kernel32/client/vdm.c | 41 +++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/dll/win32/kernel32/client/vdm.c b/dll/win32/kernel32/client/vdm.c index e3679487f41..40002532f2d 100644 --- a/dll/win32/kernel32/client/vdm.c +++ b/dll/win32/kernel32/client/vdm.c @@ -1239,17 +1239,44 @@ RegisterWowExec ( /* - * @unimplemented + * @implemented */ BOOL WINAPI -SetVDMCurrentDirectories ( - DWORD Unknown0, - DWORD Unknown1 - ) +SetVDMCurrentDirectories(DWORD cchCurDirs, PCHAR lpszzCurDirs) { - STUB; - return FALSE; + BASE_API_MESSAGE ApiMessage; + 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 FALSE; + } + + /* Setup the input parameters */ + VDMCurrentDirsRequest->cchCurDirs = cchCurDirs; + CsrCaptureMessageBuffer(CaptureBuffer, + lpszzCurDirs, + 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)); + + /* Free the capture buffer */ + CsrFreeCaptureBuffer(CaptureBuffer); + + /* Set the last error */ + BaseSetLastNTError(ApiMessage.Status); + + return NT_SUCCESS(ApiMessage.Status) ? TRUE : FALSE; } /*