[WIN32CSR/CSRSS]: Implement the Sound Sentry CSRSS API. Obviously won't work until a real winsrv.dll exists (and its job will be to call NtUserSoundSentry in win32k.sys).

svn path=/trunk/; revision=54357
This commit is contained in:
Alex Ionescu 2011-11-12 08:16:33 +00:00
parent bfac43fe4e
commit c461e96188
4 changed files with 49 additions and 1 deletions

View file

@ -91,6 +91,7 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] =
CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo),
CSRSS_DEFINE_API(GET_TEMP_FILE, CsrGetTempFile),
CSRSS_DEFINE_API(DEFINE_DOS_DEVICE, CsrDefineDosDevice),
CSRSS_DEFINE_API(SOUND_SENTRY, CsrSoundSentry),
{ 0, 0, NULL }
};

View file

@ -16,12 +16,58 @@
/* GLOBALS *******************************************************************/
typedef BOOL (WINAPI *PUSER_SOUND_SENTRY)(VOID);
BOOL
WINAPI
FirstSoundSentry(VOID);
UINT CsrGetTempFileUnique;
LIST_ENTRY DosDeviceHistory;
RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec;
PUSER_SOUND_SENTRY _UserSoundSentry = FirstSoundSentry;
/* FUNCTIONS *****************************************************************/
BOOL
WINAPI
FailSoundSentry(VOID)
{
/* In case the function can't be found/is unimplemented */
return FALSE;
}
BOOL
WINAPI
FirstSoundSentry(VOID)
{
UNICODE_STRING DllString = RTL_CONSTANT_STRING(L"winsrv");
STRING FuncString = RTL_CONSTANT_STRING("_UserSoundSentry");
HANDLE DllHandle;
NTSTATUS Status;
PUSER_SOUND_SENTRY NewSoundSentry = FailSoundSentry;
/* Load winsrv manually */
Status = LdrGetDllHandle(NULL, NULL, &DllString, &DllHandle);
if (NT_SUCCESS(Status))
{
/* If it was found, get SoundSentry export */
Status = LdrGetProcedureAddress(DllHandle,
&FuncString,
0,
(PVOID*)&NewSoundSentry);
}
/* Set it as the callback for the future, and call it */
_UserSoundSentry = NewSoundSentry;
return _UserSoundSentry();
}
CSR_API(CsrSoundSentry)
{
/* Call the API and see if it suceeds */
return _UserSoundSentry() ? STATUS_SUCCESS : STATUS_ACCESS_DENIED;
}
CSR_API(CsrGetTempFile)
{
DPRINT("CsrGetTempFile entered\n");

View file

@ -5,7 +5,7 @@
#include <ndk/mmtypes.h>
#include <ndk/mmfuncs.h>
#include <ndk/obfuncs.h>
#include <ndk/umfuncs.h>
#include <psapi.h>
/* External Winlogon Header */

View file

@ -75,5 +75,6 @@ CSR_API(CsrExitReactos);
CSR_API(CsrSetLogonNotifyWindow);
CSR_API(CsrRegisterLogonProcess);
CSR_API(CsrSoundSentry);
/* EOF */