named pipe access
todd at edge.cis.McMaster.CA
Sat Jan 23 16:45:20 GMT 1999
On Fri, 22 Jan 1999, Luke Kenneth Casson Leighton wrote:
> clientutilARGH! no, definitely not clientutil.c, although you're close:
> clientgen.c instead. you will need to specify \PIPE\WHATEVERNAME not
ok, next question...
first of all, i'm working with the samba-2.0.0 source.
for now, i'm adding code to client/client.c to implement the named pipe
api commands so that i can test them quickly. i then run smbclient to
connect to the IPC$ share on the named pipe server to test these commands.
am i on the right track here? if this all works as i think it should,
perhaps i can add some general purpose named pipe api facility to
smbclient for others to use, and document how it's done.
to implement the api commands in client.c i create an appropriate
command message string according to the published api and then i call
cli_api_pipe() with this message string as the params argument.
i'm unsure about the arguments to cli_api_pipe() though. should i be
using the setup, setup_count, max_setup_count arguments? if so, why and
how? should i be passing my api command string in the params argument or
the data argument? can anyone give me a quick tutorial on this, or do i
just have to drill down through the source code and piece it all together.
here is some sample code showing how i'm trying to use cli_api_pipe():
#define PIPE_NAME "\\PIPE\\MYPIPE"
#define MAX_MESSAGE_LEN 1024
char *rparam = NULL;
char *rdata = NULL;
strncpy(message,"some valid named pipe api message",MAX_MESSAGE_LEN-1);
if (cli_api_pipe(cli, PIPE_NAME, strlen(PIPE_NAME),
NULL, 0, 0,
message, strlen(message)+1, MAX_MESSAGE_LEN,
NULL, 0, 0xFFFF,
currently, i'm getting this error return from cli_api_pipe():
cli_pipe: return critical error. Error was ERRDOS - 2142
include/smb.h:#define ERRunknownipc 2142
Todd Pfaff \ Email: pfaff at mcmaster.ca
Computing and Information Services \ Voice: (905) 525-9140 x22920
ABB 132 \ FAX: (905) 528-3773
McMaster University \
Hamilton, Ontario, Canada L8S 4M1 \
More information about the samba-technical