Author: ion
Date: Wed Feb 8 23:49:19 2012
New Revision: 55507
URL:
http://svn.reactos.org/svn/reactos?rev=55507&view=rev
Log:
[SMSS2]: Make not-implemented functions return a failure. Cleanup the SMSS hack in the
_main function to be cleaner. Add a few more functions and flags to the header. Fix a
function prototype.
Modified:
trunk/reactos/base/system/smss2/smloop.c
trunk/reactos/base/system/smss2/smss.c
trunk/reactos/base/system/smss2/smss.h
trunk/reactos/base/system/smss2/smsubsys.c
Modified: trunk/reactos/base/system/smss2/smloop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smloop.c…
==============================================================================
--- trunk/reactos/base/system/smss2/smloop.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss2/smloop.c [iso-8859-1] Wed Feb 8 23:49:19 2012
@@ -42,7 +42,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -52,7 +52,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -62,7 +62,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -72,7 +72,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -82,7 +82,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -92,7 +92,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -102,7 +102,7 @@
IN HANDLE SmApiPort)
{
DPRINT1("%s is not yet implemented\n", __FUNCTION__);
- return STATUS_SUCCESS;
+ return STATUS_NOT_IMPLEMENTED;
}
PSM_API_HANDLER SmpApiDispatch[SmMaxApiNumber] =
Modified: trunk/reactos/base/system/smss2/smss.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smss.c?r…
==============================================================================
--- trunk/reactos/base/system/smss2/smss.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss2/smss.c [iso-8859-1] Wed Feb 8 23:49:19 2012
@@ -265,7 +265,8 @@
&Directory,
CommandLine,
MuSessionId,
- ProcessId);
+ ProcessId,
+ Flags);
}
else if (Flags & SMP_INVALID_PATH)
{
@@ -590,7 +591,7 @@
NTSTATUS
NTAPI
-LaunchOldSmss(OUT PHANDLE Handles)
+LaunchOldSmss(VOID)
{
PINIT_BUFFER InitBuffer;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL;
@@ -598,9 +599,6 @@
NTSTATUS Status;
PCHAR Environment;
- /* No handles at first */
- Handles[0] = Handles[1] = NULL;
-
/* Initialize the system root */
RtlInitUnicodeString(&SmpSystemRoot, SharedUserData->NtSystemRoot);
@@ -623,8 +621,6 @@
}
/* Return the handle and status */
- Handles[0] = ProcessInfo->ProcessHandle;
- Handles[1] = ProcessInfo->ProcessHandle;
return Status;
}
@@ -723,6 +719,8 @@
/* Enter SEH so we can terminate correctly if anything goes wrong */
_SEH2_TRY
{
+ LARGE_INTEGER Infinite = {{0x80000000, 0x7FFFFFFF}};
+
/* Initialize SMSS */
Status = SmpInit(&InitialCommand, Handles);
if (!NT_SUCCESS(Status))
@@ -731,9 +729,10 @@
RtlInitUnicodeString(&DbgString, L"Session Manager
Initialization");
Parameters[1] = Status;
DPRINT1("SMSS-2 Loaded... Launching original SMSS\n");
- Status = LaunchOldSmss(Handles);
- goto SetupHack;
//_SEH2_LEAVE; Hack so that setup can work. will go away later
+ Status = LaunchOldSmss();
+ if (!NT_SUCCESS(Status)) return Status;
+ return NtDelayExecution(FALSE, &Infinite);
}
/* Get the global flags */
@@ -750,19 +749,6 @@
DPRINT1("Global Flags Set to SMSS Debugging: Not yet
supported\n");
}
- /* Launch the original SMSS */
- DPRINT1("SMSS-2 Loaded... Launching original SMSS\n");
- Status = LaunchOldSmss(Handles);
- if (!NT_SUCCESS(Status))
- {
- /* Fail and raise a hard error */
- DPRINT1("SMSS: Execute Old SMSS failed\n");
- RtlInitUnicodeString(&DbgString,
- L"Session Manager LaunchOldSmss");
- Parameters[1] = Status;
- _SEH2_LEAVE;
- }
-
/* Execute the initial command (Winlogon.exe) */
Status = SmpExecuteInitialCommand(0, &InitialCommand, &Handles[1],
NULL);
if (!NT_SUCCESS(Status))
@@ -772,7 +758,11 @@
RtlInitUnicodeString(&DbgString,
L"Session Manager ExecuteInitialCommand");
Parameters[1] = Status;
- _SEH2_LEAVE;
+ //_SEH2_LEAVE;
+ DPRINT1("SMSS-2 Loaded... Launching original SMSS\n");
+ Status = LaunchOldSmss();
+ if (!NT_SUCCESS(Status)) return Status;
+ return NtDelayExecution(FALSE, &Infinite);
}
/* Check if we're already attached to a session */
@@ -789,7 +779,6 @@
SmpReleasePrivilege(State);
/* Wait on either CSRSS or Winlogon to die */
-SetupHack:
Status = NtWaitForMultipleObjects(RTL_NUMBER_OF(Handles),
Handles,
WaitAny,
Modified: trunk/reactos/base/system/smss2/smss.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smss.h?r…
==============================================================================
--- trunk/reactos/base/system/smss2/smss.h [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss2/smss.h [iso-8859-1] Wed Feb 8 23:49:19 2012
@@ -38,6 +38,8 @@
#define SMP_SUBSYSTEM_FLAG 0x08
#define SMP_INVALID_PATH 0x10
#define SMP_DEFERRED_FLAG 0x20
+#define SMP_POSIX_FLAG 0x100
+#define SMP_OS2_FLAG 0x200
/* STRUCTURES *****************************************************************/
@@ -87,6 +89,7 @@
extern LIST_ENTRY SmpExecuteList;
extern LIST_ENTRY SmpSubSystemList;
extern ULONG AttachedSessionId;
+extern BOOLEAN SmpDebug;
/* FUNCTIONS ******************************************************************/
@@ -182,7 +185,8 @@
IN PUNICODE_STRING Directory,
IN PUNICODE_STRING CommandLine,
IN ULONG MuSessionId,
- OUT PHANDLE ProcessId
+ OUT PHANDLE ProcessId,
+ IN ULONG Flags
);
NTSTATUS
@@ -250,4 +254,44 @@
IN PSMP_SUBSYSTEM SubSystem
);
+NTSTATUS
+NTAPI
+SmpSbCreateSession(
+ IN PVOID Reserved,
+ IN PSMP_SUBSYSTEM OtherSubsystem,
+ IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
+ IN ULONG MuSessionId,
+ IN PCLIENT_ID DbgClientId
+);
+
+ULONG
+NTAPI
+SmpAllocateSessionId(
+ IN PSMP_SUBSYSTEM Subsystem,
+ IN PSMP_SUBSYSTEM OtherSubsystem
+);
+
+VOID
+NTAPI
+SmpDeleteSession(
+ IN ULONG SessionId
+);
+
+BOOLEAN
+NTAPI
+SmpCheckDuplicateMuSessionId(
+ IN ULONG MuSessionId
+);
+
+NTSTATUS
+NTAPI
+SmpExecuteImage(
+ IN PUNICODE_STRING FileName,
+ IN PUNICODE_STRING Directory,
+ IN PUNICODE_STRING CommandLine,
+ IN ULONG MuSessionId,
+ IN ULONG Flags,
+ IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
+);
+
#endif
Modified: trunk/reactos/base/system/smss2/smsubsys.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smsubsys…
==============================================================================
--- trunk/reactos/base/system/smss2/smsubsys.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss2/smsubsys.c [iso-8859-1] Wed Feb 8 23:49:19 2012
@@ -120,7 +120,8 @@
IN PUNICODE_STRING Directory,
IN PUNICODE_STRING CommandLine,
IN ULONG MuSessionId,
- OUT PHANDLE ProcessId)
+ OUT PHANDLE ProcessId,
+ IN ULONG Flags)
{
DPRINT1("Should start subsystem %wZ for Session: %lx\n", FileName,
MuSessionId);
return STATUS_SUCCESS;