Author: janderwald
Date: Tue Feb 5 00:24:09 2008
New Revision: 32121
URL:
http://svn.reactos.org/svn/reactos?rev=32121&view=rev
Log:
- insert new entry when required
- check for null
Modified:
trunk/reactos/subsystems/win32/csrss/api/alias.c
Modified: trunk/reactos/subsystems/win32/csrss/api/alias.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/alias.c (original)
+++ trunk/reactos/subsystems/win32/csrss/api/alias.c Tue Feb 5 00:24:09 2008
@@ -106,6 +106,9 @@
PALIAS_ENTRY
IntGetAliasEntry(PALIAS_HEADER Header, LPCWSTR lpSrcName)
{
+ if (Header == NULL)
+ return NULL;
+
PALIAS_ENTRY RootHeader = Header->Data;
while(RootHeader)
{
@@ -303,7 +306,7 @@
}
Header = IntFindAliasHeader(RootHeader, Request->Data.AddConsoleAlias.lpExeName);
- if (!Header)
+ if (!Header && Request->Data.AddConsoleAlias.lpTarget != NULL)
{
Header = IntCreateAliasHeader(Request->Data.AddConsoleAlias.lpExeName);
if (!Header)
@@ -311,6 +314,7 @@
Request->Status = STATUS_INSUFFICIENT_RESOURCES;
return STATUS_INSUFFICIENT_RESOURCES;
}
+ IntInsertAliasHeader(&RootHeader, Header);
}
if (Request->Data.AddConsoleAlias.lpTarget == NULL) // delete the entry