Author: mjansen
Date: Thu May 5 14:13:29 2016
New Revision: 71263
URL:
http://svn.reactos.org/svn/reactos?rev=71263&view=rev
Log:
[NTOSKRNL] Fix NtApphelpCacheControl image lookup failure return codes when validating
file times.
Also silence some debug outputs in the normal usage flow.
Modified:
trunk/reactos/ntoskrnl/ps/apphelp.c
Modified: trunk/reactos/ntoskrnl/ps/apphelp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/apphelp.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/apphelp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/apphelp.c [iso-8859-1] Thu May 5 14:13:29 2016
@@ -546,14 +546,14 @@
Entry = RtlLookupElementGenericTableAvl(&ApphelpShimCache, &Lookup);
if (Entry == NULL)
{
- DPRINT1("SHIMS: ApphelpCacheLookupEntry: could not find %wZ\n",
ImageName);
+ DPRINT("SHIMS: ApphelpCacheLookupEntry: could not find %wZ\n",
ImageName);
goto Cleanup;
}
- DPRINT1("SHIMS: ApphelpCacheLookupEntry: found %wZ\n", ImageName);
+ DPRINT("SHIMS: ApphelpCacheLookupEntry: found %wZ\n", ImageName);
if (ImageHandle == INVALID_HANDLE_VALUE)
{
- DPRINT1("SHIMS: ApphelpCacheLookupEntry: ok\n");
+ DPRINT("SHIMS: ApphelpCacheLookupEntry: ok\n");
/* just return if we know it, do not query file info */
Status = STATUS_SUCCESS;
}
@@ -564,7 +564,7 @@
Lookup.Persistent.DateTime.QuadPart == Entry->Persistent.DateTime.QuadPart
&&
Lookup.Persistent.FileSize.QuadPart ==
Entry->Persistent.FileSize.QuadPart)
{
- DPRINT1("SHIMS: ApphelpCacheLookupEntry: found &
validated\n");
+ DPRINT("SHIMS: ApphelpCacheLookupEntry: found & validated\n");
Status = STATUS_SUCCESS;
/* move it to the front to keep it alive */
RemoveEntryList(&Entry->List);
@@ -572,7 +572,8 @@
}
else
{
- DPRINT1("SHIMS: ApphelpCacheLookupEntry: file info mismatch\n");
+ DPRINT1("SHIMS: ApphelpCacheLookupEntry: file info mismatch
(%lx)\n", Status);
+ Status = STATUS_NOT_FOUND;
/* Could not read file info, or it did not match, drop it from the cache */
ApphelpCacheRemoveEntryNolock(Entry);
}
@@ -642,7 +643,7 @@
&NodeOrParent, &SearchResult);
if (Lookup)
{
- DPRINT1("SHIMS: ApphelpCacheUpdateEntry: Entry already exists, reusing
it\n");
+ DPRINT("SHIMS: ApphelpCacheUpdateEntry: Entry already exists, reusing
it\n");
/* Unlink the found item, so we can put it back at the front,
and copy the earlier obtained file info*/
RemoveEntryList(&Lookup->List);
@@ -651,7 +652,7 @@
}
else
{
- DPRINT1("SHIMS: ApphelpCacheUpdateEntry: Inserting new Entry\n");
+ DPRINT("SHIMS: ApphelpCacheUpdateEntry: Inserting new Entry\n");
/* Insert a new entry, with its own copy of the ImageName */
ApphelpDuplicateUnicodeString(&Entry.Persistent.ImageName, ImageName);
Lookup = RtlInsertElementGenericTableFullAvl(&ApphelpShimCache,
@@ -705,7 +706,7 @@
PLIST_ENTRY ListEntry;
PSHIM_CACHE_ENTRY Entry;
- DPRINT1("SHIMS: NtApphelpCacheControl( Dumping entries, newset to oldest
)\n");
+ DPRINT1("SHIMS: NtApphelpCacheControl( Dumping entries, newest to oldest
)\n");
ApphelpCacheAcquireLock();
ListEntry = ApphelpShimCacheAge.Flink;
while (ListEntry != &ApphelpShimCacheAge)
@@ -741,19 +742,19 @@
switch (Service)
{
case ApphelpCacheServiceLookup:
- DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceLookup
)\n");
+ DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceLookup
)\n");
Status = ApphelpValidateData(ServiceData, &ImageName, &Handle);
if (NT_SUCCESS(Status))
Status = ApphelpCacheLookupEntry(&ImageName, Handle);
break;
case ApphelpCacheServiceRemove:
- DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceRemove
)\n");
+ DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceRemove
)\n");
Status = ApphelpValidateData(ServiceData, &ImageName, &Handle);
if (NT_SUCCESS(Status))
Status = ApphelpCacheRemoveEntry(&ImageName);
break;
case ApphelpCacheServiceUpdate:
- DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceUpdate
)\n");
+ DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceUpdate
)\n");
Status = ApphelpCacheAccessCheck();
if (NT_SUCCESS(Status))
{