28 typedef struct _SERVICE_TRIGGERS_CONTEXT
32 struct _ES_TRIGGER_CONTEXT *TriggerContext;
40 NTSTATUS status = STATUS_SUCCESS;
41 SC_HANDLE serviceHandle;
43 if (!(serviceHandle =
PhOpenService(Context->ServiceItem->Name->Buffer, SERVICE_QUERY_CONFIG)))
44 return NTSTATUS_FROM_WIN32(GetLastError());
47 CloseServiceHandle(serviceHandle);
61 if (uMsg == WM_INITDIALOG)
66 SetProp(hwndDlg, L
"Context", (HANDLE)context);
72 if (uMsg == WM_DESTROY)
73 RemoveProp(hwndDlg, L
"Context");
84 LPPROPSHEETPAGE propSheetPage = (LPPROPSHEETPAGE)lParam;
88 context->ServiceItem = serviceItem;
89 context->TriggersLv = triggersLv = GetDlgItem(hwndDlg,
IDC_TRIGGERS);
100 PhShowWarning(hwndDlg, L
"Unable to query service trigger information: %s",
113 switch (LOWORD(wParam))
116 if (context->TriggerContext)
120 if (context->TriggerContext)
124 if (context->TriggerContext)
132 LPNMHDR header = (LPNMHDR)lParam;
134 switch (header->code)
138 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT,
FALSE);
143 ULONG win32Result = 0;
145 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
151 MB_ICONERROR | MB_RETRYCANCEL,
152 L
"Unable to change service trigger information: %s",
156 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_INVALID);
163 case LVN_ITEMCHANGED:
165 if (header->hwndFrom == context->TriggersLv && context->TriggerContext)
173 if (header->hwndFrom == context->TriggersLv && context->TriggerContext)