SM: some server side code for SM_API_QUERY_INFORMATION
Modified: trunk/reactos/subsys/smss/client.c
Modified: trunk/reactos/subsys/smss/makefile
Modified: trunk/reactos/subsys/smss/smapiquery.c
Modified: trunk/reactos/subsys/smss/smss.c
Modified: trunk/reactos/subsys/smss/smss.h
_____
Modified: trunk/reactos/subsys/smss/client.c
--- trunk/reactos/subsys/smss/client.c 2005-04-11 22:38:53 UTC (rev
14597)
+++ trunk/reactos/subsys/smss/client.c 2005-04-12 21:25:58 UTC (rev
14598)
@@ -276,4 +276,49 @@
return Status;
}
+/* === Utilities for SmQryInfo === */
+
+/**********************************************************************
+ * SmGetClientBasicInformation/1
+ */
+NTSTATUS FASTCALL
+SmGetClientBasicInformation (PSM_BASIC_INFORMATION i)
+{
+ INT Index = 0;
+ PSM_CLIENT_DATA Client = NULL;
+
+ DPRINT("SM: %s called\n", __FUNCTION__);
+
+ RtlEnterCriticalSection (& SmpClientDirectory.Lock);
+
+ i->SubSystemCount = SmpClientDirectory.Count;
+ i->Unused = 0;
+
+ if (SmpClientDirectory.Count > 0)
+ {
+ Client = SmpClientDirectory.Client;
+ while ((NULL != Client) && (Index <
SM_QRYINFO_MAX_SS_COUNT))
+ {
+ i->SubSystem[Index].Id =
Client->SubsystemId;
+ i->SubSystem[Index].Flags = 0; /* TODO */
+ i->SubSystem[Index].ProcessId = 0; /* TODO */
+ Client = Client->Next;
+ }
+ }
+
+ RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
+ return STATUS_SUCCESS;
+}
+
+/**********************************************************************
+ * SmGetSubSystemInformation/1
+ */
+NTSTATUS FASTCALL
+SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION i)
+{
+ DPRINT("SM: %s called\n", __FUNCTION__);
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
/* EOF */
_____
Modified: trunk/reactos/subsys/smss/makefile
--- trunk/reactos/subsys/smss/makefile 2005-04-11 22:38:53 UTC (rev
14597)
+++ trunk/reactos/subsys/smss/makefile 2005-04-12 21:25:58 UTC (rev
14598)
@@ -24,8 +24,12 @@
smapi.o smapicomp.o smapiexec.o smapiquery.o \
client.o debug.o print.o
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
+include $(TOOLS_PATH)/depend.mk
+
# EOF
_____
Modified: trunk/reactos/subsys/smss/smapiquery.c
--- trunk/reactos/subsys/smss/smapiquery.c 2005-04-11 22:38:53 UTC
(rev 14597)
+++ trunk/reactos/subsys/smss/smapiquery.c 2005-04-12 21:25:58 UTC
(rev 14598)
@@ -1,4 +1,4 @@
-/* $Id: $
+/* $Id$
*
* smapiquery.c - SM_API_QUERY_INFORMATION
*
@@ -37,8 +37,33 @@
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s called\n", __FUNCTION__);
-
- Request->SmHeader.Status = STATUS_NOT_IMPLEMENTED;
+
+ switch (Request->Request.QryInfo.SmInformationClass)
+ {
+ case SmBasicInformation:
+ if(Request->Request.QryInfo.DataLength != sizeof
(SM_BASIC_INFORMATION))
+ {
+ Request->Reply.QryInfo.DataLength = sizeof
(SM_BASIC_INFORMATION);
+ Request->SmHeader.Status =
STATUS_INFO_LENGTH_MISMATCH;
+ }else{
+ Request->SmHeader.Status =
+ SmGetClientBasicInformation (&
Request->Reply.QryInfo.BasicInformation);
+ }
+ break;
+ case SmSubSystemInformation:
+ if(Request->Request.QryInfo.DataLength != sizeof
(SM_SUBSYSTEM_INFORMATION))
+ {
+ Request->Reply.QryInfo.DataLength = sizeof
(SM_SUBSYSTEM_INFORMATION);
+ Request->SmHeader.Status =
STATUS_INFO_LENGTH_MISMATCH;
+ }else{
+ Request->SmHeader.Status =
+ SmGetSubSystemInformation (&
Request->Reply.QryInfo.SubSystemInformation);
+ }
+ break;
+ default:
+ Request->SmHeader.Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
return Status;
}
_____
Modified: trunk/reactos/subsys/smss/smss.c
--- trunk/reactos/subsys/smss/smss.c 2005-04-11 22:38:53 UTC (rev
14597)
+++ trunk/reactos/subsys/smss/smss.c 2005-04-12 21:25:58 UTC (rev
14598)
@@ -56,6 +56,7 @@
}
/* Initialize the system */
Status = InitSessionManager();
+ /* Watch required subsystems TODO */
#if 0
if (!NT_SUCCESS(Status))
{
_____
Modified: trunk/reactos/subsys/smss/smss.h
--- trunk/reactos/subsys/smss/smss.h 2005-04-11 22:38:53 UTC (rev
14597)
+++ trunk/reactos/subsys/smss/smss.h 2005-04-12 21:25:58 UTC (rev
14598)
@@ -96,6 +96,8 @@
NTSTATUS STDCALL SmCreateClient(PSM_PORT_MESSAGE,PSM_CLIENT_DATA*);
NTSTATUS STDCALL SmDestroyClient(ULONG);
NTSTATUS STDCALL SmCompleteClientInitialization (HANDLE hProcess);
+NTSTATUS FASTCALL SmGetClientBasicInformation (PSM_BASIC_INFORMATION);
+NTSTATUS FASTCALL SmGetSubSystemInformation
(PSM_SUBSYSTEM_INFORMATION);
/* debug.c */
extern HANDLE DbgSsApiPort;
Show replies by date