Hello Guido,
the interface given above is correct. The additional two imports (REG_SERVER, CHAR1 and USE_GWHOST, CHAR1) can be ignored. (Perhaps they have been used for something long time ago, but as far as I can see, they are not necessary for this scenario, where the program shall certainly be started on localhost.)
Can you share your code that builds the function description handle, and also the part of the code where you get the invalid parameter? Something must still be wrong here. (Perhaps also an RFC trace at level 3 would be helpful here.)
The intended implementation is actually quite straightforward:
- Sanitize the COMMAND parameter according to your security requirements. (E.g. check for path traversals or command concatenation.)
- If you find that the command is fine and should be allowed to start, start it in a separate ("detached") process. How this is done, is highly OS dependent. E.g. on Windows CreateProcess() or ShellExecute() can be used, depending on the requirements of the started program.
- If the command is not allowed or anything else goes wrong, fill the ERROR parameter and return. (An empty ERROR parameter is interpreted as successful execution on R/3 side.)
Best Regards, Ulrich