This is C4055 Warning message.
'conversion' : from data pointer 'type1' to function pointer 'type2'
A data pointer is cast (possibly incorrectly) to a function pointer.
This is a level 1 warning under /Za and a level 4 warning under /Ze.
How do we resolve this warning?(By correct way, not a trick)
Edit:
This is a code snippet has warning.
typedef NTSTATUS (*t_ObRegisterCallbacks)
(
IN POB_CALLBACK_REGISTRATION CallBackRegistration,
OUT PVOID *RegistrationHandle
);
t_ObRegisterCallbacks g_ObRegisterCallbacks = NULL;
void foo()
{
g_ObRegisterCallbacks = (t_ObRegisterCallbacks)MmGetSystemRoutineAddress(®Name); //C4055
}
//warning C4055: 'type cast' : from data pointer 'PVOID' to function pointer 't_ObRegisterCallbacks'