Module: wine Branch: master Commit: 5f1b91e5688a85502c4bf6f19672b06f0d8d0337 URL: https://gitlab.winehq.org/wine/wine/-/commit/5f1b91e5688a85502c4bf6f19672b06...
Author: Vitaly Lipatov lav@etersoft.ru Date: Sun Nov 17 12:42:56 2019 +0300
secur32: Print name for EXTENDED_NAME_FORMAT argument.
---
dlls/secur32/secur32.c | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-)
diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index bb723e90004..f757ea6d34f 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -816,6 +816,33 @@ SECURITY_STATUS WINAPI EnumerateSecurityPackagesA(PULONG pcPackages, return ret; }
+ +static const char *debugstr_NameFormat( EXTENDED_NAME_FORMAT format ) +{ + static const char * const names[] = + { + "NameUnknown", + "NameFullyQualifiedDN", + "NameSamCompatible", + "NameDisplay", + NULL, + NULL, + "NameUniqueId", + "NameCanonical", + "NameUserPrincipal", + "NameCanonicalEx", + "NameServicePrincipal", + NULL, + "NameDnsDomain", + "NameGivenName", + "NameSurname" + }; + + if (format < ARRAY_SIZE(names) && names[format]) return names[format]; + return wine_dbg_sprintf( "%u", format ); +} + + /*********************************************************************** * GetComputerObjectNameA (SECUR32.@) * @@ -847,7 +874,7 @@ BOOLEAN WINAPI GetComputerObjectNameA( LPWSTR bufferW = NULL; ULONG sizeW = *nSize;
- TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s %p %p)\n", debugstr_NameFormat(NameFormat), lpNameBuffer, nSize);
if (lpNameBuffer) { if (!(bufferW = malloc(sizeW * sizeof(WCHAR)))) { @@ -879,7 +906,7 @@ BOOLEAN WINAPI GetComputerObjectNameW( NTSTATUS ntStatus; BOOLEAN status;
- TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s %p %p)\n", debugstr_NameFormat(NameFormat), lpNameBuffer, nSize);
if (NameFormat == NameUnknown) { @@ -1066,7 +1093,7 @@ BOOLEAN WINAPI GetUserNameExA( BOOLEAN rc; LPWSTR bufferW = NULL; ULONG sizeW = *nSize; - TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s %p %p)\n", debugstr_NameFormat(NameFormat), lpNameBuffer, nSize); if (lpNameBuffer) { bufferW = malloc(sizeW * sizeof(WCHAR)); if (bufferW == NULL) { @@ -1098,7 +1125,7 @@ BOOLEAN WINAPI GetUserNameExA( BOOLEAN WINAPI GetUserNameExW( EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize) { - TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s %p %p)\n", debugstr_NameFormat(NameFormat), lpNameBuffer, nSize);
switch (NameFormat) { @@ -1155,8 +1182,8 @@ BOOLEAN WINAPI TranslateNameA( EXTENDED_NAME_FORMAT DesiredNameFormat, LPSTR lpTranslatedName, PULONG nSize) { - FIXME("%p %d %d %p %p\n", lpAccountName, AccountNameFormat, - DesiredNameFormat, lpTranslatedName, nSize); + FIXME("%p %s %s %p %p\n", lpAccountName, debugstr_NameFormat(AccountNameFormat), + debugstr_NameFormat(DesiredNameFormat), lpTranslatedName, nSize); return FALSE; }
@@ -1165,8 +1192,8 @@ BOOLEAN WINAPI TranslateNameW( EXTENDED_NAME_FORMAT DesiredNameFormat, LPWSTR lpTranslatedName, PULONG nSize) { - FIXME("%p %d %d %p %p\n", lpAccountName, AccountNameFormat, - DesiredNameFormat, lpTranslatedName, nSize); + FIXME("%p %s %s %p %p\n", lpAccountName, debugstr_NameFormat(AccountNameFormat), + debugstr_NameFormat(DesiredNameFormat), lpTranslatedName, nSize); return FALSE; }