[NTOS] Fix Shim AVL prototypes to exactly match the types expected by RtlInitializeGe...
[reactos.git] / ntoskrnl / ps / apphelp.c
index bc2a307..6cdea62 100644 (file)
@@ -208,7 +208,7 @@ ApphelpCacheQueryInfo(
 RTL_GENERIC_COMPARE_RESULTS
 NTAPI
 ApphelpShimCacheCompareRoutine(
-    _In_ PRTL_AVL_TABLE Table,
+    _In_ struct _RTL_AVL_TABLE *Table,
     _In_ PVOID FirstStruct,
     _In_ PVOID SecondStruct)
 {
@@ -233,7 +233,7 @@ ApphelpShimCacheCompareRoutine(
 PVOID
 NTAPI
 ApphelpShimCacheAllocateRoutine(
-    _In_ PRTL_AVL_TABLE Table,
+    _In_ struct _RTL_AVL_TABLE *Table,
     _In_ CLONG ByteSize)
 {
     return ApphelpAlloc(ByteSize);
@@ -242,7 +242,7 @@ ApphelpShimCacheAllocateRoutine(
 VOID
 NTAPI
 ApphelpShimCacheFreeRoutine(
-    _In_ PRTL_AVL_TABLE Table,
+    _In_ struct _RTL_AVL_TABLE *Table,
     _In_ PVOID Buffer)
 {
     ApphelpFree(Buffer);
@@ -546,14 +546,14 @@ ApphelpCacheLookupEntry(
     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 @@ ApphelpCacheLookupEntry(
             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 @@ ApphelpCacheLookupEntry(
         }
         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 @@ ApphelpCacheUpdateEntry(
                                                  &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 @@ ApphelpCacheUpdateEntry(
     }
     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 @@ ApphelpCacheDump(VOID)
     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 @@ NtApphelpCacheControl(
     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))
             {