Writing a naked function could be made to work but its horrible to do. What exactly are you trying to achieve with the detour? Do you need to all the parameters in your routine?
Also could you post (or pastebin) the entire function from the server.dll as well as a function that calls it?