Author: hbelusca
Date: Sat Jan 26 23:56:07 2013
New Revision: 58236
URL: http://svn.reactos.org/svn/reactos?rev=58236&view=rev
Log:
[SMSS]
Clarify a bit the code. No logical changes.
Modified:
trunk/reactos/base/system/smss/sminit.c
trunk/reactos/base/system/smss/smsubsys.c
Modified: trunk/reactos/base/system/smss/sminit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/sminit.c?…
==============================================================================
--- trunk/reactos/base/system/smss/sminit.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss/sminit.c [iso-8859-1] Sat Jan 26 23:56:07 2013
@@ -463,15 +463,17 @@
IN PVOID EntryContext)
{
/* Check which value is being set */
- if (_wcsicmp(ValueName, L"DllDirectory"))
+ if (_wcsicmp(ValueName, L"DllDirectory") == 0)
+ {
+ /* This is the directory, initialize it */
+ DPRINT("KnownDll Path: %S\n", ValueData);
+ return SmpInitializeKnownDllPath(&SmpKnownDllPath, ValueData, ValueLength);
+ }
+ else
{
/* Add to the linked list -- this is a file */
return SmpSaveRegistryValue(EntryContext, ValueName, ValueData, TRUE);
}
-
- /* This is the directory, initialize it */
- DPRINT("KnownDll Path: %S\n", ValueData);
- return SmpInitializeKnownDllPath(&SmpKnownDllPath, ValueData, ValueLength);
}
NTSTATUS
@@ -499,7 +501,7 @@
}
/* Check if the path is being set, and wait for the second instantiation */
- if (!(_wcsicmp(ValueName, L"Path")) && (++SmpCalledConfigEnv == 2))
+ if ((_wcsicmp(ValueName, L"Path") == 0) && (++SmpCalledConfigEnv == 2))
{
/* Allocate the path buffer */
SmpDefaultLibPathBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
@@ -528,12 +530,12 @@
PSMP_REGISTRY_VALUE RegEntry;
PWCHAR SubsystemName;
- /* Is this a required or optional subsystem */
- if ((_wcsicmp(ValueName, L"Required")) &&
- (_wcsicmp(ValueName, L"Optional")))
+ /* Is this a required or optional subsystem? */
+ if ((_wcsicmp(ValueName, L"Required") != 0) &&
+ (_wcsicmp(ValueName, L"Optional") != 0))
{
/* It isn't, is this the PSI flag? */
- if ((_wcsicmp(ValueName, L"PosixSingleInstance")) ||
+ if ((_wcsicmp(ValueName, L"PosixSingleInstance") != 0) ||
(ValueType != REG_DWORD))
{
/* It isn't, must be a subsystem entry, add it to the list */
@@ -567,17 +569,17 @@
RemoveEntryList(&RegEntry->Entry);
/* Figure out which list to put it in */
- if (_wcsicmp(ValueName, L"Required"))
+ if (_wcsicmp(ValueName, L"Required") == 0)
+ {
+ /* Put it into the required list */
+ DPRINT("Required\n");
+ InsertTailList(&SmpSubSystemsToLoad, &RegEntry->Entry);
+ }
+ else
{
/* Put it into the optional list */
DPRINT("Optional\n");
InsertTailList(&SmpSubSystemsToDefer, &RegEntry->Entry);
- }
- else
- {
- /* Put it into the required list */
- DPRINT("Required\n");
- InsertTailList(&SmpSubSystemsToLoad, &RegEntry->Entry);
}
}
Modified: trunk/reactos/base/system/smss/smsubsys.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smsubsys.…
==============================================================================
--- trunk/reactos/base/system/smss/smsubsys.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss/smsubsys.c [iso-8859-1] Sat Jan 26 23:56:07 2013
@@ -595,7 +595,7 @@
{
/* Get each entry and check if it's the internal debug or not */
RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
- if (_wcsicmp(RegEntry->Name.Buffer, L"debug") == 0)
+ if (_wcsicmp(RegEntry->Name.Buffer, L"Debug") == 0)
{
/* Load the internal debug system */
Status = SmpExecuteCommand(&RegEntry->Value,
Author: hbelusca
Date: Sat Jan 26 21:23:10 2013
New Revision: 58232
URL: http://svn.reactos.org/svn/reactos?rev=58232&view=rev
Log:
[CSRSRV]
- Zero-out some allocated memory.
- During my investigations preceding the implementation of AttachConsole (r58166), I wanted (in a first attempt; finally I've found a better way to achieve what I wanted to do) to retrieve the CSR_PROCESS structure of the parent of a given process. I've found the 'Parent' member in the CSR_PROCESS structure, however this member was always initialized to NULL when new processes were created via CsrCreateProcess (and via the call to CsrInsertProcess). After looking at some informating here (http://svn.reactos.org/svn/reactos/trunk/reactos/include/subsys/csr/server.…) and there (http://forum.sysinternals.com/csrwalker-processes-detection-from-user-mode_…), I became convinced that the 'Parent' member was unexistent starting from Windows Server 2003. Also, after much more investigation, I've found that the CsrInsertProcess function was called with only two parameters starting from Windows Server 2003 (and still continues in Windows 7), the always-NULL paramater being removed.
Therefore, I remove that unneeded parameter from CsrInsertProcess and the corresponding 'Parent' member from CSR_PROCESS.
Modified:
branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h
branches/ros-csrss/subsystems/win32/csrsrv/api.c
branches/ros-csrss/subsystems/win32/csrsrv/include/api.h
branches/ros-csrss/subsystems/win32/csrsrv/procsup.c
branches/ros-csrss/subsystems/win32/csrsrv/server.c
branches/ros-csrss/subsystems/win32/csrsrv/session.c
branches/ros-csrss/subsystems/win32/csrsrv/wait.c
Modified: branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -39,7 +39,6 @@
CLIENT_ID ClientId;
LIST_ENTRY ListLink;
LIST_ENTRY ThreadList;
- struct _CSR_PROCESS *Parent;
PCSR_NT_SESSION NtSession;
ULONG ExpectedVersion;
HANDLE ClientPort;
Modified: branches/ros-csrss/subsystems/win32/csrsrv/api.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/api.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/api.c [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -1171,7 +1171,7 @@
} _SEH2_END;
/* We validated the incoming buffer, now allocate the remote one */
- RemoteCaptureBuffer = RtlAllocateHeap(CsrHeap, 0, Length);
+ RemoteCaptureBuffer = RtlAllocateHeap(CsrHeap, HEAP_ZERO_MEMORY, Length);
if (!RemoteCaptureBuffer)
{
/* We're out of memory */
Modified: branches/ros-csrss/subsystems/win32/csrsrv/include/api.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/include/api.h [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/include/api.h [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -119,8 +119,7 @@
VOID
NTAPI
-CsrInsertProcess(IN PCSR_PROCESS Parent OPTIONAL,
- IN PCSR_PROCESS CurrentProcess OPTIONAL,
+CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL,
IN PCSR_PROCESS CsrProcess);
NTSTATUS
Modified: branches/ros-csrss/subsystems/win32/csrsrv/procsup.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/procsup.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/procsup.c [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -451,11 +451,8 @@
* The CsrInsertProcess routine inserts a CSR Process into the Process List
* and notifies Server DLLs of the creation of a new CSR Process.
*
- * @param Parent
- * Optional pointer to the CSR Process creating this CSR Process.
- *
- * @param CurrentProcess
- * Optional pointer to the current CSR Process.
+ * @param ParentProcess
+ * Optional pointer to the Parent Process creating this CSR Process.
*
* @param CsrProcess
* Pointer to the CSR Process which is to be inserted.
@@ -467,17 +464,13 @@
*--*/
VOID
NTAPI
-CsrInsertProcess(IN PCSR_PROCESS Parent OPTIONAL, // ParentProcess
- IN PCSR_PROCESS CurrentProcess OPTIONAL, // CallingProcess
- IN PCSR_PROCESS CsrProcess) // Process
+CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL,
+ IN PCSR_PROCESS CsrProcess)
{
PCSR_SERVER_DLL ServerDll;
ULONG i;
ASSERT(ProcessStructureListLocked());
- /* Set the parent */
- CsrProcess->Parent = Parent;
-
/* Insert it into the Root List */
InsertTailList(&CsrRootProcess->ListLink, &CsrProcess->ListLink);
@@ -490,7 +483,7 @@
/* Make sure it's valid and that it has callback */
if (ServerDll && ServerDll->NewProcessCallback)
{
- ServerDll->NewProcessCallback(CurrentProcess, CsrProcess);
+ ServerDll->NewProcessCallback(ParentProcess, CsrProcess);
}
}
}
@@ -706,7 +699,7 @@
CsrSetBackgroundPriority(CsrProcess);
/* Insert the Process */
- CsrInsertProcess(NULL, CurrentProcess, CsrProcess);
+ CsrInsertProcess(CurrentProcess, CsrProcess);
/* Release lock and return */
CsrReleaseProcessLock();
Modified: branches/ros-csrss/subsystems/win32/csrsrv/server.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/server.c [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -43,11 +43,11 @@
};
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX];
-PVOID CsrSrvSharedSectionHeap;
-PVOID CsrSrvSharedSectionBase;
-PVOID *CsrSrvSharedStaticServerData;
-ULONG CsrSrvSharedSectionSize;
-HANDLE CsrSrvSharedSection;
+PVOID CsrSrvSharedSectionHeap = NULL;
+PVOID CsrSrvSharedSectionBase = NULL;
+PVOID *CsrSrvSharedStaticServerData = NULL;
+ULONG CsrSrvSharedSectionSize = 0;
+HANDLE CsrSrvSharedSection = NULL;
/* PRIVATE FUNCTIONS **********************************************************/
Modified: branches/ros-csrss/subsystems/win32/csrsrv/session.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/session.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/session.c [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -84,7 +84,7 @@
PCSR_NT_SESSION NtSession;
/* Allocate an NT Session Object */
- NtSession = RtlAllocateHeap(CsrHeap, 0, sizeof(CSR_NT_SESSION));
+ NtSession = RtlAllocateHeap(CsrHeap, HEAP_ZERO_MEMORY, sizeof(CSR_NT_SESSION));
if (NtSession)
{
/* Setup the Session Object */
@@ -331,7 +331,7 @@
}
/* Insert the Process */
- CsrInsertProcess(NULL, NULL, CsrProcess);
+ CsrInsertProcess(NULL, CsrProcess);
/* Activate the Thread */
ApiMessage->ReturnValue = NtResumeThread(hThread, NULL);
Modified: branches/ros-csrss/subsystems/win32/csrsrv/wait.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/wait.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/wait.c [iso-8859-1] Sat Jan 26 21:23:10 2013
@@ -62,7 +62,7 @@
WaitApiMessage->Header.u1.s1.TotalLength;
/* Allocate the Wait Block */
- WaitBlock = RtlAllocateHeap(CsrHeap, 0, Size);
+ WaitBlock = RtlAllocateHeap(CsrHeap, HEAP_ZERO_MEMORY, Size);
if (!WaitBlock)
{
/* Fail */
Author: pschweitzer
Date: Sat Jan 26 19:37:01 2013
New Revision: 58231
URL: http://svn.reactos.org/svn/reactos?rev=58231&view=rev
Log:
[NTOSKRNL]
Fix a fixme in IopParseDevice() by calling SeFastTraverseCheck for traverse access check
Modified:
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Sat Jan 26 19:37:01 2013
@@ -335,8 +335,11 @@
/* Check if this is a restricted token */
if (!(AccessState->Flags & TOKEN_IS_RESTRICTED))
{
- /* FIXME: Do the FAST traverse check */
- AccessGranted = FALSE;
+ /* Do the FAST traverse check */
+ AccessGranted = SeFastTraverseCheck(OriginalDeviceObject->SecurityDescriptor,
+ AccessState,
+ FILE_TRAVERSE,
+ UserMode);
}
else
{