[NETAPI32]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 1 Sep 2015 14:09:51 +0000 (14:09 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 1 Sep 2015 14:09:51 +0000 (14:09 +0000)
- Correctly reallocate buffer in NetWkstaUserGetInfo. Fixes one of the many exceptions when running netapi32 tests with DPH.

svn path=/trunk/; revision=68897

reactos/dll/win32/netapi32/wksta.c

index 0813e25..ac18400 100644 (file)
@@ -310,7 +310,12 @@ NET_API_STATUS WINAPI NetWkstaUserGetInfo(LMSTR reserved, DWORD level,
                 (lstrlenW(ui->wkui0_username) + 1) * sizeof(WCHAR),
                 (LPVOID *) bufptr);
             if (nastatus != NERR_Success)
+            {
+                NetApiBufferFree(ui);
                 return nastatus;
+            }
+            ui = (PWKSTA_USER_INFO_0) *bufptr;
+            ui->wkui0_username = (LMSTR) (*bufptr + sizeof(WKSTA_USER_INFO_0));
         }
         break;
     }