[jcifs] RE: Remote Execution and SVCCTL

Philippe Ombredanne pombredanne at nexb.com
Wed Sep 15 20:15:50 GMT 2004

Michael Melhem,
I did not see the code attached, and would like to look into it if I can
Could you send the IDL and Java?

BTW in the code below:
OpenServiceW service = new OpenServiceW(handle, "Telent", 0);
should be :
OpenServiceW service = new OpenServiceW(handle, "Telnet", 0);


philippe ombredanne | nexB - Open IT Asset Management
1 650 799 0949 | pombredanne at nexb.com
-----Original Message-----
From: Michael Melhem [mailto:michaelm at managesoft.com] 
Sent: Wednesday, September 15, 2004 10:47 PM
To: mba2000 at ioplex.com; pombredanne at nexb.com; jcifs at lists.samba.org
Subject: Remote Execution and SVCCTL

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);
call(0, scmanager);

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);
call(0, service);

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!.


More information about the jcifs mailing list