Skip to content

Commit 988d1d4

Browse files
bevanweissbarnson
authored andcommitted
util: correct usage of NetLocalGroupGetInfo in GroupExecute
Microsoft documentation doesn't list Level 0 as being a valid group info level to request for NetLocalGroupGetInfo. So we should only be requesting Level 1 instead. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
1 parent 1be4e09 commit 988d1d4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/ext/Util/ca/scagroup.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ HRESULT ScaGroupExecute(
427427
LPWSTR pwzBaseScriptKey = NULL;
428428
DWORD cScriptKey = 0;
429429

430-
LOCALGROUP_INFO_0 *pGroupInfo = NULL;
430+
LOCALGROUP_INFO_1 *pGroupInfo1 = NULL;
431431
LPWSTR pwzScriptKey = NULL;
432432
LPWSTR pwzActionData = NULL;
433433
LPWSTR pwzRollbackData = NULL;
@@ -472,7 +472,7 @@ HRESULT ScaGroupExecute(
472472
}
473473
}
474474

475-
er = ::NetLocalGroupGetInfo(pwzServerName, psg->wzName, 0, reinterpret_cast<LPBYTE*>(&pGroupInfo));
475+
er = ::NetLocalGroupGetInfo(pwzServerName, psg->wzName, 1, reinterpret_cast<LPBYTE*>(&pGroupInfo1));
476476
if (NERR_Success == er)
477477
{
478478
geGroupExists = GROUP_EXISTS_YES;
@@ -614,10 +614,10 @@ HRESULT ScaGroupExecute(
614614
ReleaseNullStr(pwzActionData);
615615
ReleaseNullStr(pwzRollbackData);
616616
ReleaseNullStr(pwzServerName);
617-
if (pGroupInfo)
617+
if (pGroupInfo1)
618618
{
619-
::NetApiBufferFree(static_cast<LPVOID>(pGroupInfo));
620-
pGroupInfo = NULL;
619+
::NetApiBufferFree(static_cast<LPVOID>(pGroupInfo1));
620+
pGroupInfo1 = NULL;
621621
}
622622
}
623623

@@ -627,10 +627,10 @@ HRESULT ScaGroupExecute(
627627
ReleaseStr(pwzActionData);
628628
ReleaseStr(pwzRollbackData);
629629
ReleaseStr(pwzServerName);
630-
if (pGroupInfo)
630+
if (pGroupInfo1)
631631
{
632-
::NetApiBufferFree(static_cast<LPVOID>(pGroupInfo));
633-
pGroupInfo = NULL;
632+
::NetApiBufferFree(static_cast<LPVOID>(pGroupInfo1));
633+
pGroupInfo1 = NULL;
634634
}
635635

636636
return hr;

0 commit comments

Comments
 (0)