[PATCH 11/12] (resend) LookupAccountNameW() - refactor to eliminate code duplication

Paul Bryan Roberts pbronline-wine at yahoo.co.uk
Tue Oct 21 01:30:16 CDT 2008


LookupAccountNameW() has a stubbed but non-empty, incomplete, buggy
implementation.  It fails a number of unit tests but Wine code relies on
this.

This is series of patches that provide what may be a reasonable first
pass implementation of LookupAccountNameA() and LookupAccountNameW() that:

    - passes existing units tests for LookupAccountName
    - works for well known SIDs
    - works for 'first user account'
    - allows progress towards the resolution of Bug 14334

 From the beginning it was clear the the well-known and not so
well-known SID cases were not entirely disjoint in terms of how they
returned information.  Each patch tried to make this clear.  The
previous patch fixed the last of the failing conformance test so now it
is possible to rearrange the implementation to eliminate the code
duplication.

This relies on testing the SID pointer for NULL, which is the real 
reason for using heap memory for this structure.  This should make it 
easier to add more (complex) cases later as necessary.

The old fixme becomes a trace and new fixmes mark the not yet handled cases.

This patch also replace strlen() et al with lstrlen().  Dunno if that's
a good idea.

What this patch does not do is change the order.  The implementation
checks for the first user account after checking all well known SIDs.
Not very efficient - turn on trace to see why.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0011-LookupAccountNameW-refactor-to-eliminate-code-dupl.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081021/fe9018e7/attachment-0001.txt 


More information about the wine-patches mailing list