windows-nt/Source/XPSP1/NT/inetsrv/iis/lkrhash/lkrdbg/lkrcust.cpp
2020-09-26 16:20:57 +08:00

81 lines
1.3 KiB
C++

#include "precomp.hxx"
#include "lkrcust.h"
enum {
NAME_SIZE = LKRHASH_NS::CLKRHashTable::NAME_SIZE,
};
LKR_CUST_EXTN*
FindLkrCustExtn(
LPCSTR cmdName,
VOID* lkrAddress,
DWORD& rdwSig)
{
extern LKR_CUST_EXTN g_alce[];
struct LKRheader {
DWORD m_dwSignature;
CHAR m_szName[NAME_SIZE];
};
LKRheader lkrh;
rdwSig = 0;
if (!ReadMemory(lkrAddress, &lkrh, sizeof(lkrh), NULL) )
{
dprintf(DBGEXT ".%s: cannot read memory @ %p\n",
cmdName, (PVOID) lkrAddress);
return NULL;
}
rdwSig = lkrh.m_dwSignature;
lkrh.m_szName[NAME_SIZE-1] = '\0';
for (LKR_CUST_EXTN* plce = g_alce + 1;
plce->m_pszTableName != NULL;
++plce)
{
if (strcmp(plce->m_pszTableName, lkrh.m_szName) == 0)
return plce;
}
return &g_alce[0]; // Dummy methods
}
BOOL
WINAPI
Dummy_LKHT_Dump(
IN LKRHASH_NS::CLKRHashTable* pht,
IN INT nVerbose)
{
return TRUE;
}
BOOL
WINAPI
Dummy_LKLH_Dump(
IN LKRHASH_NS::CLKRLinearHashTable* plht,
IN INT nVerbose)
{
return TRUE;
}
BOOL
WINAPI
Dummy_Record_Dump(
IN const void* pvRecord,
IN DWORD dwSignature,
IN INT nVerbose)
{
dprintf("%p (%08x)\n", pvRecord, dwSignature);
return TRUE;
}