"Alistair Leslie-Hughes" leslie_alistair@hotmail.com wrote:
- if(RtlUnicodeStringToAnsiString(&routineNameA, SystemRoutineName, TRUE) == STATUS_SUCCESS)
- {
/* We only support functions exported from ntoskrnl.exe or hal.dll */
hMod = GetModuleHandleW(ntoskrnlW);
if(hMod)
{
pFunc = GetProcAddress(hMod, routineNameA.Buffer);
}
You are calling GetModuleHandleW from inside of ntoskrnl.exe, how that could fail?
if(!pFunc)
{
hMod = GetModuleHandleW(halW);
if(hMod)
{
pFunc = GetProcAddress(hMod, routineNameA.Buffer);
}
}
RtlFreeAnsiString(&routineNameA);
- }
- TRACE("Function addresss %p\n", pFunc);
- return pFunc;
+}
Please follow the existing coding style, place a space after 'if' and avoid not necessary braces for single line statements after 'if'.