So you need to write a winsvc unit too, but maybe packages/extra/winunits/jwawinsvc.pas, from the fpcsrc directory can be used too? (I don't know what winsvc contains, but the jedi unit seems to be about services too.) If this is the case, just replace winsvc by jwawinsvc in your source code.