werror.h enriched with few more error code (DRSUAPI related)

Kamen Mazdrashki kamen.mazdrashki at postpath.com
Mon Sep 28 14:22:28 MDT 2009


On Fri, Sep 18, 2009 at 16:35, Kamen Mazdrashki <kamen.mazdrashki at postpath.com> wrote:
> On Thu, Sep 17, 2009 at 08:25, Guenther Deschner <gd at samba.org> wrote:
> > Hi Kamen,
> >
> > On Thu, Sep 17, 2009 at 06:10:41AM +0300, Kamen Mazdrashki wrote:
> >> Hi,
> >>
> >> Attached is a list of patches to reformat werror.h file a little bit.
> >> I've completed first part of my plan, which is (in short):
> >> 1. Use only numeric values for error codes 2. Use values in hex
> >> format (there are few exceptions) though 3. Fix ambiguous error names
> >>
> >> What I plan to do next is:
> >> 4. using a python script - extract all error codes published by MS
> >> 5.Add errors that does not exist in werror.h to the file
> >>
> >> Next is code refactoring:
> >> 6. Find out duplicate errors with different name. Refactor code base
> >> to use the Generated WERR_ name.
> >
> > Ok, you should be able to proceed with 4.) now :-)
> Here a list of patches to:
> 1. fix werror.h file - there were few errors with mistaken names
>   Please look at comments in every patch for clarification 2. Generated
> error codes and their descriptions are merged into werror.h and
> doserr.c files between placeholders (for future use)
> Also, the python script was mainly rewritten - suddenly I realized I am
> doing not so smart processing in the script, as I was trying to replace
> error codes directly in werror.h and doserr.c It is much more
> convenient just not to generate codes that already exists, right :). So
> I did it.
> Another good think about the script is now it is doing a lot more
> verifications.
> Verify new error codes generated do not collide with previously defined
> error with same name, but different value (this is reported as critical
> error).
> Verify also if there are error codes with same name, but different
> value - this led to patches to rename few errors.
> Not so important verifications are also implemented.
> Oh, one think I almost forgot about - currently the python script
> extracts all error which names begin with:
> ['ERROR_', 'NERR_', 'FRS_', 'RPC_', 'EPT_', 'OR_', 'WAIT_TIMEOUT'] But
> only the 'ERROR_' prefix is replaced with 'WERR_' prefix.
> The rest of errors are just prefixed with 'WERR_' and capitalized.
> This leads to errors like: WERR_NERR_DCNOTFOUND (my favorite) I know
> lots of people don’t think this is a good idea, but I really do think
> it is the right thing to be done (mostly for creating more clear code
> and for usability)
> So, here is my favorite error - DC_NOT_FOUND error.
> There are two erros:
> If we just merge them, we shall get:
> If someone happens to need to return DCNotFound error, which one should
> he/she use?
> But in case we have:
> WERR_DC_NOT_FOUND and WERR_NERR_DCNOTFOUND I think there should be much
> less confusion which one is to be used (and again, this improve
> autocompletion feature usability a lot)

Just to remind you all about pending "win32 error" patches :)

Today we discussed with Anatoliy for pushing those patches in the master.
However, we think it will be better to have a wider approval from most of
team members as error code definitions concerns all of us.

Just one reminder - changes introduced in patches should be harmless.
I.e. no regression is to be expected.
By using the python script you can view two types of report:
 - list of Error codes with same names but different values - those
   I've fixed in the patches
 - list of Error codes with same values but different names.
   Those are left 'as is' and Error code names from MS WSPP are 
   added - thus making an aliases for same error

So please, take a look, review, comment, vote, etc.

I really need those patches pushed so I can use error codes in 
further DRSUAPI testing.

Kamen Mazdrashki
kamen.mazdrashki at postpath.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32_errors.tar.bz2
Type: application/octet-stream
Size: 85122 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090928/8a54cd72/attachment.obj>

More information about the samba-technical mailing list