libmsrpc for Samba 3

Chris Nicholls cnicholl at uoguelph.ca
Wed Jul 20 17:24:16 GMT 2005


>
> Yeah.  I've done this too.  Like I said, before I prefer
>
>     hPrinter = OpenPrinter( hServer, printername )
>
> over
>
>     pdu.in.printername = strdup( printername );
>     OpenPrinter( hServer, &pdu );
>     hPrinter = pdu.out.handle;
>
> There are wonderful advantages to control block
> parmaeters, but thunking down to one makes it harder
> for the application write IMO.  You have to dig
> multiple levels to figure out what
>
>     OpenPrinter ( SERVER_HND, OPEN_PRINTER_STRUCT );
>
> actually needs.  I said before that 0 - 3 parameters is
> ideal and 5 is the max.  So in essense we are not disagreeing.
>
I normally have the same preference, but I can see there being functions 
that will need more than 5 parameters, some of them inputs and some of 
them outputs.  I like the control block style mostly because it 
consolidates the outputs and there will definately be some functions 
that have multiple outputs.

Perhaps something else that should be considered is exactly how many 
functions will have that many parameters relative to the functions that 
only have 1-5 parameters. Control blocks seem well suited for functions 
that have many parameters but  might be a bit much for functions that 
only have 2 or 3 for example.  In the case of libmsrpc, I think all the 
functions will have at least 2 paramaters (a server handle plus some input).

Chris


More information about the samba-technical mailing list