Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 230 of file secext.c.
Referenced by GetUserNameExA().
{ BOOLEAN status; WCHAR samname[UNLEN + 1 + MAX_COMPUTERNAME_LENGTH + 1]; LPWSTR out; DWORD len; DPRINT("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); switch (NameFormat) { case NameSamCompatible: { /* This assumes the current user is always a local account */ len = MAX_COMPUTERNAME_LENGTH + 1; if (GetComputerNameW(samname, &len)) { out = samname + lstrlenW(samname); *out++ = '\\'; len = UNLEN + 1; if (GetUserNameW(out, &len)) { status = (lstrlenW(samname) < *nSize); if (status) { lstrcpyW(lpNameBuffer, samname); *nSize = lstrlenW(samname); } else { SetLastError(ERROR_MORE_DATA); *nSize = lstrlenW(samname) + 1; } } else status = FALSE; } else status = FALSE; } break; case NameUnknown: case NameFullyQualifiedDN: case NameDisplay: case NameUniqueId: case NameCanonical: case NameUserPrincipal: case NameCanonicalEx: case NameServicePrincipal: case NameDnsDomain: SetLastError(ERROR_NONE_MAPPED); status = FALSE; break; default: SetLastError(ERROR_INVALID_PARAMETER); status = FALSE; } return status; }