I only want to allow specific DLLs to execute code I have written on a function I hooked. short of performing a stack trace how do you get the module name of your caller?
Get a stack trace to find the return address of your function, for instance with
And then call
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS to obtain the module handle containing that code.
GetModuleFileName to find the filename associated with that module.