I dont need special permissions or anything so I dont need the kernel driver.
I open my process with processhacker (without admin rights) and I right click the module I want to unload and then click unload. It unloads perfectly.
Right, so I have my own program that enumerates all the modules of given process (I am testing with its own procoss GetCurrentProcessId)
I find "themodule.dll" I want to unload and with the MODULEENTRY32 structure I use .hModule to get the handle id of the module.
Ive also tried getmodulehandle to retrieve the module handle and called the module by LoadLibrary to get the handle also.
But Im guessing what Im doing wrong is the way of unloading the module.
Im using freelibrary. But Its not unloading with this.
I would need some help to be pointed in the right direction please.