Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr>
---
dlls/userenv/userenv_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c
index 045bac0..e53e0fe 100644
--- a/dlls/userenv/userenv_main.c
+++ b/dlls/userenv/userenv_main.c
@@ -433,8 +433,11 @@ BOOL WINAPI GetUserProfileDirectoryW( HANDLE hToken, LPWSTR lpProfileDir,
return FALSE;
}
- len = 0;
- GetTokenInformation( hToken, TokenUser, NULL, 0, &len );
+ if (GetTokenInformation( hToken, TokenUser, NULL, 0, &len ))
+ {
+ SetLastError( ERROR_SUCCESS );
+ return FALSE;
+ }
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FALSE;
if (!(t = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE;
if (!GetTokenInformation( hToken, TokenUser, t, len, &len )) goto done;
--
2.10.0.windows.1