Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handle security if object name cannot be retrieved #2318

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions phlib/secedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ ISecurityInformation *PhSecurityInformation_Create(
info->RefCount = 1;

info->WindowHandle = WindowHandle;
info->ObjectName = PhCreateString(ObjectName);
info->ObjectType = PhCreateString(ObjectType);
info->ObjectName = ObjectName ? PhCreateString(ObjectName) : PhReferenceEmptyString();
info->ObjectType = ObjectType ? PhCreateString(ObjectType) : PhReferenceEmptyString();
DartVanya marked this conversation as resolved.
Show resolved Hide resolved
info->OpenObject = OpenObject;
info->CloseObject = CloseObject;
info->GetObjectSecurity = GetObjectSecurity;
info->SetObjectSecurity = SetObjectSecurity;
info->Context = Context;
info->IsPage = IsPage;

if (PhGetAccessEntries(ObjectType, &info->AccessEntriesArray, &info->NumberOfAccessEntries))
if (PhGetAccessEntries(info->ObjectType->Buffer, &info->AccessEntriesArray, &info->NumberOfAccessEntries))
{
info->AccessEntries = PhAllocateZero(sizeof(SI_ACCESS) * info->NumberOfAccessEntries);

Expand Down
6 changes: 3 additions & 3 deletions plugins/ExtendedTools/objmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ VOID NTAPI EtpObjectManagerSearchControlCallback(
else
oldSelect = PhReferenceObject(context->CurrentPath);

PhSetDialogItemText(context->WindowHandle, IDC_OBJMGR_PATH, PhGetString(oldSelect));
PhSetWindowText(context->PathControlHandle, PhGetString(oldSelect));
PhDereferenceObject(oldSelect);

WCHAR string[PH_INT32_STR_LEN_1];
Expand Down Expand Up @@ -2815,7 +2815,7 @@ VOID EtpObjectEntryDeleteProcedure(
PhClearReference(&entry->BaseDirectory);
}

VOID EtpLoadComboBoxHistoryToSettings(
VOID EtpLoadComboBoxHistoryFromSettings(
_In_ PET_OBJECT_CONTEXT Context
)
{
Expand Down Expand Up @@ -3010,7 +3010,7 @@ INT_PTR CALLBACK WinObjDlgProc(
if (PhIsNullOrEmptyString(Target)) // HACK
Target = PH_AUTO(PhCreateString2(&EtObjectManagerRootDirectoryObject));

EtpLoadComboBoxHistoryToSettings(context);
EtpLoadComboBoxHistoryFromSettings(context);

context->DisableSelChanged = TRUE;
EtpObjectManagerOpenTarget(context, Target);
Expand Down
Loading