The problem seems to be that the struct berval, i think it was supposed to use struct WLDAP32_berval and no berval. If you change every occurrence of WLDAP32_berval for dlls/wldap32 to berval it seems to work, i think the developer changed the name of the struct and forgot to change it on the functions that use it.