mirror of
https://github.com/reactos/reactos.git
synced 2024-07-12 23:55:07 +00:00
[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:
parent
bfac43fe4e
commit
c461e96188
|
@ -91,6 +91,7 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] =
|
||||||
CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo),
|
CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo),
|
||||||
CSRSS_DEFINE_API(GET_TEMP_FILE, CsrGetTempFile),
|
CSRSS_DEFINE_API(GET_TEMP_FILE, CsrGetTempFile),
|
||||||
CSRSS_DEFINE_API(DEFINE_DOS_DEVICE, CsrDefineDosDevice),
|
CSRSS_DEFINE_API(DEFINE_DOS_DEVICE, CsrDefineDosDevice),
|
||||||
|
CSRSS_DEFINE_API(SOUND_SENTRY, CsrSoundSentry),
|
||||||
{ 0, 0, NULL }
|
{ 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,58 @@
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
typedef BOOL (WINAPI *PUSER_SOUND_SENTRY)(VOID);
|
||||||
|
BOOL
|
||||||
|
WINAPI
|
||||||
|
FirstSoundSentry(VOID);
|
||||||
|
|
||||||
UINT CsrGetTempFileUnique;
|
UINT CsrGetTempFileUnique;
|
||||||
LIST_ENTRY DosDeviceHistory;
|
LIST_ENTRY DosDeviceHistory;
|
||||||
RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec;
|
RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec;
|
||||||
|
PUSER_SOUND_SENTRY _UserSoundSentry = FirstSoundSentry;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* 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)
|
CSR_API(CsrGetTempFile)
|
||||||
{
|
{
|
||||||
DPRINT("CsrGetTempFile entered\n");
|
DPRINT("CsrGetTempFile entered\n");
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <ndk/mmtypes.h>
|
#include <ndk/mmtypes.h>
|
||||||
#include <ndk/mmfuncs.h>
|
#include <ndk/mmfuncs.h>
|
||||||
#include <ndk/obfuncs.h>
|
#include <ndk/obfuncs.h>
|
||||||
|
#include <ndk/umfuncs.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
|
|
||||||
/* External Winlogon Header */
|
/* External Winlogon Header */
|
||||||
|
|
|
@ -75,5 +75,6 @@ CSR_API(CsrExitReactos);
|
||||||
CSR_API(CsrSetLogonNotifyWindow);
|
CSR_API(CsrSetLogonNotifyWindow);
|
||||||
CSR_API(CsrRegisterLogonProcess);
|
CSR_API(CsrRegisterLogonProcess);
|
||||||
|
|
||||||
|
CSR_API(CsrSoundSentry);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue