summaryrefslogtreecommitdiff
path: root/source3/libmsrpc/libmsrpc_internal.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-10-17 16:44:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:01 -0500
commit846d52efaed2c3272c2327dcded76b2d335d53d2 (patch)
tree8c7049bf719814414ab246aa9bef3e365e7f93f3 /source3/libmsrpc/libmsrpc_internal.c
parentc246649e3d7fb828b6d1c9531dfea40c92e2e368 (diff)
downloadsamba-846d52efaed2c3272c2327dcded76b2d335d53d2.tar.gz
samba-846d52efaed2c3272c2327dcded76b2d335d53d2.tar.bz2
samba-846d52efaed2c3272c2327dcded76b2d335d53d2.zip
r11124: Commit Chris' fixes for libmsrpc after the rpc_client
rewrite. His comments: I've gotten the libmsrpc code to work with TRUNK. I've put the patch at: www.uoguelph.ca/~cnicholl/libmsrpc_trunk_v1.patch.gz It is from revision 11093. I also fixed a minor bug in the svcctl code, the timeout parameter for all the control functions was working in milliseconds instead of seconds. Also fixed bug in Makefile when building libmsrpc.a (This used to be commit d3a52900ec223316779e59a13cea87ecb500bccc)
Diffstat (limited to 'source3/libmsrpc/libmsrpc_internal.c')
-rw-r--r--source3/libmsrpc/libmsrpc_internal.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/libmsrpc/libmsrpc_internal.c b/source3/libmsrpc/libmsrpc_internal.c
index 2560fd602b..6a524cdb03 100644
--- a/source3/libmsrpc/libmsrpc_internal.c
+++ b/source3/libmsrpc/libmsrpc_internal.c
@@ -22,6 +22,33 @@
#include "libmsrpc.h"
#include "libmsrpc_internal.h"
+/*used to get a struct rpc_pipe_client* to be passed into rpccli* calls*/
+struct rpc_pipe_client *cac_GetPipe(CacServerHandle *hnd, int pi_idx) {
+ SMBCSRV *srv = NULL;
+ struct rpc_pipe_client *pipe_hnd = NULL;
+
+ if(!hnd)
+ return NULL;
+
+ if(hnd->_internal.pipes[pi_idx] == False) {
+ hnd->status = NT_STATUS_INVALID_HANDLE;
+ return NULL;
+ }
+
+ srv = cac_GetServer(hnd);
+ if(!srv) {
+ hnd->status = NT_STATUS_INVALID_CONNECTION;
+ return NULL;
+ }
+
+ pipe_hnd = srv->cli.pipe_list;
+
+ while(pipe_hnd != NULL && pipe_hnd->pipe_idx != pi_idx)
+ pipe_hnd = pipe_hnd->next;
+
+ return pipe_hnd;
+}
+
/*takes a string like HKEY_LOCAL_MACHINE\HARDWARE\ACPI and returns the reg_type code and then a pointer to the start of the path (HARDWARE)*/
int cac_ParseRegPath(char *path, uint32 *reg_type, char **key_name) {