[jcifs] jcifs/jarapac errors trying to get apolicy_handle/SCmanager connection

Michael B Allen mba2000 at ioplex.com
Thu Nov 25 19:21:09 GMT 2004

Marcus Crafter said:
> Hi All,
> Hope all is going well.
> We've been doing some work with the jcifs/jarapac libraries, attempting
> to connect to get a policy_handle via the SC manager on two particular
> hosts, and are coming up with the following errors, different on each
> system:
> Received connection exception (Unable to find suitable provider for
> "ncacn_np:[\PIPE\svcctl]".)

So is it exported by the end point mapper? I don't know how to check that
in windows but there are tools that will list everything exported by the
end point mapper like this rpcdump utility:


> (this particular box is a windows 2000 server system)
> and
> Received connection exception (Timeout waiting for response from server:
> (this is an XP system)

You know the jCIFS client (and thus Jarapac named pipe RPC transport) only
supports NetBIOS transport on port 139 and not RAW on port 445. That might
be a factor in both cases (it shouldn't though).

> Interestingly, on a windows 2003 server system, it works as expected.
> Essentially, we're attempting to install a service on these systems via
> the SC manager.
> Any thoughts as to what these errors mean and where we might start
> looking for further information? Or perhaps what further information we
> could provide to help find out what might be going on?

Unfortunately, you may be aware that the Jarapc/JCIFS MSRPC code is highly
experimental. Currently we are just writing test programs and have not
implemented most of the desired calls or decided how to actually expose
the functionality in the form of a user friendly API. If you choose to use
the code it will be necessary to become familiar with things that would
likely answer the questions you have just asked (e.g. windows networking
protocol fundamentals, midl, ndr, packet captures, etc).

The easiest and simplest to do what you want (and probably the only way to
do it right) you need to write a Win32 program using the SC manager calls
necessary to perform the desired operation. Then take a packet capture of
that. Then write your Jarapac/JCIFS MSRPC test program starting with the
SC manager midl in jarapac/examples (I specifically explored those calls
after Michael asked about this a few weeks ago). Then take a capture of
that and open them side by side in Ethereal.

Finally, it is vitally important that you're using the latest combo if
midlc, jarapac, and jcifs. Every release has fixed a critical problem or
has been a major improvement.

I think MIDLC, Jarapac, and jCIFS are up to the task now but if you run
into a problem don't heasitate to ask. I might not have a good answer or I
might just be busy but I might have a quick answer that could save you a
lot of time. For example, I can look at a raw hexdump / MSDN API
documentation / Samba4 IDL and determine the midl likel to generate the
right NDR. So if you run into an encoding / decoding error that you're not
sure about, post your midl input and a hexdump (or better send me a
capture) and I'll try to decode it for you.


More information about the jcifs mailing list