[APPHELP] Implement ShimDumpCache and ShimFlushCache

These functions simply call into the Base* functions,
having a prototype that is compatible with rundll32
CORE-11301
This commit is contained in:
Mark Jansen 2019-01-06 17:51:55 +01:00
parent f2f54a052e
commit 5c05a29d3d
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
4 changed files with 50 additions and 8 deletions

View file

@ -292,3 +292,38 @@ BOOL WINAPI SdbUnregisterDatabase(_In_ GUID *pguidDB)
return FALSE;
}
/* kernel32.dll */
BOOL WINAPI BaseDumpAppcompatCache(VOID);
BOOL WINAPI BaseFlushAppcompatCache(VOID);
/**
* @name ShimDumpCache
* Dump contents of the shim cache.
*
* @param hwnd Unused, pass 0
* @param hInstance Unused, pass 0
* @param lpszCmdLine Unused, pass 0
* @param nCmdShow Unused, pass 0
* @return
*/
BOOL WINAPI ShimDumpCache(HWND hwnd, HINSTANCE hInstance, LPCSTR lpszCmdLine, int nCmdShow)
{
return BaseDumpAppcompatCache();
}
/**
* @name ShimFlushCache
* Flush the shim cache. Call this after installing a new shim database
*
* @param hwnd Unused, pass 0
* @param hInstance Unused, pass 0
* @param lpszCmdLine Unused, pass 0
* @param nCmdShow Unused, pass 0
* @return
*/
BOOL WINAPI ShimFlushCache(HWND hwnd, HINSTANCE hInstance, LPCSTR lpszCmdLine, int nCmdShow)
{
return BaseFlushAppcompatCache();
}

View file

@ -173,7 +173,7 @@
@ stub SE_LdrEntryRemoved
@ stub SetPermLayers
@ cdecl ShimDbgPrint(long str str)
@ stub ShimDumpCache
@ stub ShimFlushCache
@ stdcall ShimDumpCache(ptr ptr wstr long)
@ stdcall ShimFlushCache(ptr ptr wstr long)
@ stdcall SetPermLayerState(wstr wstr long long long)
@ stdcall SdbRegisterDatabaseEx(wstr long ptr)

View file

@ -309,23 +309,29 @@ BasepCheckBadapp(IN HANDLE FileHandle,
}
/*
* @unimplemented
* @implemented
*/
VOID
BOOL
WINAPI
BaseDumpAppcompatCache(VOID)
{
STUB;
NTSTATUS Status;
Status = NtApphelpCacheControl(ApphelpCacheServiceDump, NULL);
return NT_SUCCESS(Status);
}
/*
* @unimplemented
* @implemented
*/
VOID
BOOL
WINAPI
BaseFlushAppcompatCache(VOID)
{
STUB;
NTSTATUS Status;
Status = NtApphelpCacheControl(ApphelpCacheServiceFlush, NULL);
return NT_SUCCESS(Status);
}
/*

View file

@ -764,6 +764,7 @@ NtApphelpCacheControl(
}
break;
case ApphelpCacheServiceFlush:
/* FIXME: Check for admin or system here. */
Status = ApphelpCacheFlush();
break;
case ApphelpCacheServiceDump: