Author: akhaldi
Date: Sun Feb 26 17:09:21 2017
New Revision: 73944

URL: http://svn.reactos.org/svn/reactos?rev=73944&view=rev
Log:
[CREDUI] Sync with Wine Staging 2.2. CORE-12823

848f478 credui: Split domain from username in SspiPromptForCredentialsW.

Modified:
    trunk/reactos/dll/win32/credui/credui_main.c
    trunk/reactos/media/doc/README.WINE

Modified: trunk/reactos/dll/win32/credui/credui_main.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/credui/credui_main.c?rev=73944&r1=73943&r2=73944&view=diff
==============================================================================
--- trunk/reactos/dll/win32/credui/credui_main.c        [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/credui/credui_main.c        [iso-8859-1] Sun Feb 26 
17:09:21 2017
@@ -911,23 +911,45 @@
     if (!(ret = CredUIPromptForCredentialsW( cred_info, target, NULL, error, 
username,
                                              len_username, password, 
len_password, save, flags )))
     {
-        DWORD size = sizeof(*id);
-        WCHAR *ptr;
-
-        len_username = strlenW( username );
+        DWORD size = sizeof(*id), len_domain = 0;
+        WCHAR *ptr, *user = username, *domain = NULL;
+
+        if ((ptr = strchrW( username, '\\' )))
+        {
+            user = ptr + 1;
+            len_username = strlenW( user );
+            if (!strcmpiW( package, ntlmW ) || !strcmpiW( package, negotiateW 
))
+            {
+                domain = username;
+                len_domain = ptr - username;
+            }
+            *ptr = 0;
+        }
+        else len_username = strlenW( username );
         len_password = strlenW( password );
 
         size += (len_username + 1) * sizeof(WCHAR);
+        size += (len_domain + 1) * sizeof(WCHAR);
         size += (len_password + 1) * sizeof(WCHAR);
         if (!(id = HeapAlloc( GetProcessHeap(), 0, size ))) return 
ERROR_OUTOFMEMORY;
         ptr = (WCHAR *)(id + 1);
 
-        memcpy( ptr, username, (len_username + 1) * sizeof(WCHAR) );
+        memcpy( ptr, user, (len_username + 1) * sizeof(WCHAR) );
         id->User           = ptr;
         id->UserLength     = len_username;
         ptr += len_username + 1;
-        id->Domain         = NULL;
-        id->DomainLength   = 0;
+        if (len_domain)
+        {
+            memcpy( ptr, domain, (len_domain + 1) * sizeof(WCHAR) );
+            id->Domain         = ptr;
+            id->DomainLength   = len_domain;
+            ptr += len_domain + 1;
+        }
+        else
+        {
+            id->Domain         = NULL;
+            id->DomainLength   = 0;
+        }
         memcpy( ptr, password, (len_password + 1) * sizeof(WCHAR) );
         id->Password       = ptr;
         id->PasswordLength = len_password;

Modified: trunk/reactos/media/doc/README.WINE
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=73944&r1=73943&r2=73944&view=diff
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Feb 26 17:09:21 2017
@@ -57,7 +57,7 @@
 reactos/dll/win32/comctl32            # Synced to WineStaging-1.9.23
 reactos/dll/win32/comdlg32            # Synced to WineStaging-1.9.23
 reactos/dll/win32/compstui            # Synced to WineStaging-2.2
-reactos/dll/win32/credui              # Synced to WineStaging-1.9.16
+reactos/dll/win32/credui              # Synced to WineStaging-2.2
 reactos/dll/win32/crypt32             # Synced to WineStaging-1.9.23
 reactos/dll/win32/cryptdlg            # Synced to WineStaging-1.9.11
 reactos/dll/win32/cryptdll            # Synced to WineStaging-1.9.11


Reply via email to