Internally, ghidra presents some pointers to code as "code ", yet this type cannot be entered as function args or data structure elements. Neither can declarations like "int ()(int)". Currently, I am using "void *", which isn't too terrible, but I would prefer a more correct way to specify this.
Is there a way to specify a pointer to code? If not, consider this a feature request...
I personally use pointer32 or pointer64 which seem to work better with it than void*. Although if there's a designated type for it, I'd like to know it as well.
Generally, if you know that a specific function pointer has a specific return type/function parameters, it IS possible to make a function pointer type in the data structure area then use THAT as the type of parameter. I do this by going to the data type manager, create a function definition, then you can use that function definition as a function pointer (e.g. I recreated the _PVFV function from VS with _cdecl calling convention and the definition being void _PVFV(void) and now I can set function pointers to be _PVFV* after that). Otherwise, the best way to deal with that should probably be pointer32 or pointer64 from what I can tell for unknown function pointer types.
Most helpful comment
Generally, if you know that a specific function pointer has a specific return type/function parameters, it IS possible to make a function pointer type in the data structure area then use THAT as the type of parameter. I do this by going to the data type manager, create a function definition, then you can use that function definition as a function pointer (e.g. I recreated the _PVFV function from VS with _cdecl calling convention and the definition being void _PVFV(void) and now I can set function pointers to be _PVFV* after that). Otherwise, the best way to deal with that should probably be pointer32 or pointer64 from what I can tell for unknown function pointer types.