[SHIMENG] Don't crash on a shim not found

CORE-15846
This commit is contained in:
Mark Jansen
2019-03-11 22:47:22 +01:00
parent 0ebeced143
commit cfdb7d564c

View File

@@ -1142,10 +1142,13 @@ VOID SeiInit(PUNICODE_STRING ProcessImage, HSDB hsdb, SDBQUERYRESULT* pQuery)
SHIMENG_INFO("Using SHIM \"%S!%S\"\n", DllName, ShimName);
/* Ask this shim what hooks it needs (and pass along the commandline) */
dwHookCount = 0;
pHookApi = pShimModuleInfo->pGetHookAPIs(AnsiCommandLine.Buffer, ShimName, &dwHookCount);
SHIMENG_INFO("GetHookAPIs returns %d hooks for DLL \"%wZ\" SHIM \"%S\"\n", dwHookCount, &UnicodeDllName, ShimName);
if (dwHookCount)
if (dwHookCount && pHookApi)
pShimInfo = SeiAppendHookInfo(pShimModuleInfo, pHookApi, dwHookCount, ShimName);
else
dwHookCount = 0;
/* If this shim has hooks, create the include / exclude lists */
if (pShimInfo)