mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
[TASKMGR] CachedGetUserFromSid(): Fix user name length on cache hit
This commit is contained in:
parent
353b544047
commit
f91144364b
1 changed files with 2 additions and 2 deletions
|
@ -144,16 +144,16 @@ CachedGetUserFromSid(
|
||||||
if (EqualSid((PSID)&pEntry->Data, pSid))
|
if (EqualSid((PSID)&pEntry->Data, pSid))
|
||||||
{
|
{
|
||||||
wcsncpy(pUserName, pEntry->pszName, cwcUserName);
|
wcsncpy(pUserName, pEntry->pszName, cwcUserName);
|
||||||
*pcwcUserName = cwcUserName;
|
*pcwcUserName = wcslen(pUserName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We didn't find the SID in the list, get the name conventional */
|
/* We didn't find the SID in the list, get the name conventional */
|
||||||
SidToUserName(pSid, pUserName, cwcUserName);
|
SidToUserName(pSid, pUserName, cwcUserName);
|
||||||
|
*pcwcUserName = wcslen(pUserName);
|
||||||
|
|
||||||
/* Allocate a new entry */
|
/* Allocate a new entry */
|
||||||
*pcwcUserName = wcslen(pUserName);
|
|
||||||
cwcUserName = *pcwcUserName + 1;
|
cwcUserName = *pcwcUserName + 1;
|
||||||
cbSid = GetLengthSid(pSid);
|
cbSid = GetLengthSid(pSid);
|
||||||
pEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(SIDTOUSERNAME) + cbSid + cwcUserName * sizeof(WCHAR));
|
pEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(SIDTOUSERNAME) + cbSid + cwcUserName * sizeof(WCHAR));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue