[jcifs] Creating DCE/RPC Requests

christofer.dutz at c-ware.de christofer.dutz at c-ware.de
Wed Jan 4 00:04:45 MST 2012


Hi,

I am currently digging into using the DCE/RPC parts of JCIFS. Unfortunately I am running into problems.
Iused midlc (Version 0.6.1) To generate a JCIFS compatible stub for the svcctl Service and am now trying to call it. Unfortunately I am getting "jcifs.dcerpc.DcerpcException: DCERPC_FAULT_PROTO_ERROR"

Here comes my code:

            rpc.policy_handle scHandle = new rpc.policy_handle();
            SvcCtl.OpenSCManager openSCManagerRpc = new SvcCtl.OpenSCManager(host, null, 0x0001 | 0x0002, scHandle);

            // Connection-oriented DCE/RPC over SMB named pipes.
            DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + host + "[\\PIPE\\svcctl]",
                    ConcurrentNtlmAuthenticator.getInstance().getNtlmPasswordAuthentication());
            try {
                handle.sendrecv(openSCManagerRpc);           <--The Exception is thrown when executing this line.
                if (openSCManagerRpc.retval != 0) {
                    throw new SmbException(openSCManagerRpc.retval, true);
                }
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    handle.close();
                } catch(IOException ioe) {
                    ioe.printStackTrace();
                }
            }

So what am I doing wrong? I would be really glad if you could help me get started, as Googling doesn't seem to get me very far (There seems to be almost no information on this available)

Chris


[ C h r i s t o f e r  D u t z ]

C-Ware IT-Service
Inhaber
Dipl. Inf. Christofer Dutz
Karlstraße. 104, 64285 Darmstadt

fon:  0 61 51 / 27315 - 61
fax:  0 61 51 / 27315 - 64
mobil:  0171 / 7 444 2 33
email:  christofer.dutz at c-ware.de

http://www.c-ware.de

FA Darmstadt: 07 813 60581


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20120104/ce09da0d/attachment.html>


More information about the jCIFS mailing list