srvsvc NetShareAdd and NetNameValidate RPCs ...

Richard Sharpe realrichardsharpe at
Wed Oct 17 11:09:58 MDT 2012

Hi folks,

We were trying to enhance NetShareAdd so that an appropriate error is
returned when adding the share fails for some reason, Eg, out of
resources, etc. We did this by allowing the add script to write an
error code to STDERR (or STDOUT, I forget.)

We tried returning error codes like WERR_NERR_NOROOM,
WERR_NERR_UNKNOWNDEVDIR, but none of these change the behavior of
Computer Manager. It simply fails without telling you that it failed
or why it failed, it seems. You simply do not get the new share added.

In the trace I notice that there is a call to NetNameValidate before
the call to NetShareAdd, and I wondered if this is the correct place
to actually perform verification that you have the resources to create
the share?

There seem to be little documentation on NetNameValidate that I can
find, however.

Richard Sharpe

More information about the samba-technical mailing list