Author: ion
Date: Sat Nov 12 08:16:33 2011
New Revision: 54357
URL:
http://svn.reactos.org/svn/reactos?rev=54357&view=rev
Log:
[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).
Modified:
trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
trunk/reactos/subsystems/win32/csrss/win32csr/file.c
trunk/reactos/subsystems/win32/csrss/win32csr/w32csr.h
trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] Sat Nov 12
08:16:33 2011
@@ -91,6 +91,7 @@
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 }
};
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/file.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/file.c [iso-8859-1] Sat Nov 12 08:16:33
2011
@@ -16,11 +16,57 @@
/* 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)
{
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/w32csr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/w32csr.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/w32csr.h [iso-8859-1] Sat Nov 12
08:16:33 2011
@@ -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 */
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] Sat Nov 12
08:16:33 2011
@@ -75,5 +75,6 @@
CSR_API(CsrSetLogonNotifyWindow);
CSR_API(CsrRegisterLogonProcess);
+CSR_API(CsrSoundSentry);
/* EOF */