[jcifs] Remote Execution and SVCCTL
michaelm at managesoft.com
Thu Sep 16 05:47:15 GMT 2004
HI Mike, et al.
I have converted the the required methods from svcctl.idl into MIDL format and have ran the idlc compiler to generate svcctl.java. The converted IDL is attacthed to this email. I also wrote a test progam (extending from svcctl.java) which does essentially the following:
policy_handle handle = new policy_handle();
handle.uuid = new uuid_t();
OpenSCManagerW scmanager = new OpenSCManagerW("\\\\" + servername, null, 0x02000000, handle);
System.out.println( scmanager.retval + ": rtme_low" + handle.uuid.time_low );
The above seems to work fine because i get a value from handle.uuid.time_low, plus the return val is zero. Ethereal looks good too. The Problem arises when I try and call openServiceW(). Note, for the scmanager argument, I use handle from above (which i know presume is a handle to the remote scmanager). Im guessing the SERVICE_ACCESS argument (at the moment i have it set it to zero, need to find out the real values for these constants from the windows header files?)
Here T try to get open the remote windows Telnet service..
OpenServiceW service = new OpenServiceW(handle, "Telent", 0);
The above causes an unknown Fault Exception returned from remote system. So im not sure what is happening. When I try call(1, service) its seems to get further but stills bombs out.
Im not so privy to the internal workings of jaraparc, so im not sure what the first argument of the call() method refers too.????? Usually is just set to 0.
Another thing, the midl interface for OpenServiceW() is as follows:
/* Function 0x10 */
int OpenServiceW([in] policy_handle *scmanager_handle,
[in,string,unique] wchat_t *ServiceName,
[in] uint32_t access_mask);
Note that all the arguments are all [in] arguments, so how am I meant to get a handle to the service from this method???
Any help would be VERY much appreciated!.
-------------- next part --------------
HTML attachment scrubbed and removed
More information about the jcifs