On Tue, Oct 7, 2008 at 11:17 AM, Andrey Turkin andrey.turkin@gmail.com wrote:
+ if (TargetInformation->NetbiosServerName) len += sizeof(WCHAR) * MultiByteToWideChar(CP_ACP, 0, TargetInformation->NetbiosServerName, -1, NULL, 0);
That is a seriously long line. Please try to keep line lengths close to 80 cols.
+ if (!TargetInformation || !Size || !Credentials ||
+ !(TargetInformation->NetbiosServerName || TargetInformation->DnsServerName || TargetInformation->NetbiosDomainName
+ || TargetInformation->DnsDomainName ||TargetInformation->DnsTreeName))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
I don't think you should make such an implementation without at least some simple tests.