149{
163
164 DPRINT(
"PopAddRemoveSysCapsCallback(%p %p)\n",
166
176 else
178
180 {
183 }
184
185 if (Arrival)
186 {
188
189
200 0);
202 {
203 DPRINT1(
"ZwOpenFile() failed with status 0x%08lx\n",
Status);
205 }
213 {
214 DPRINT1(
"ObReferenceObjectByHandle() failed with status 0x%08lx\n",
Status);
217 }
220
221
226 0,
227 &Caps,
228 sizeof(Caps),
233 {
234 DPRINT1(
"IoBuildDeviceIoControlRequest() failed\n");
237 }
240 {
241 DPRINT(
"IOCTL_GET_SYS_BUTTON_CAPS pending\n");
244 }
246 {
247 DPRINT1(
"Sending IOCTL_GET_SYS_BUTTON_CAPS failed with status 0x%08x\n",
Status);
250 }
251
252 DPRINT(
"Device capabilities: 0x%x\n", Caps);
254 {
255 DPRINT(
"POWER button present\n");
257 }
258
260 {
261 DPRINT(
"SLEEP button present\n");
263 }
264
266 {
269 }
270
273 'IWOP');
274 if (!SysButtonContext)
275 {
276 DPRINT1(
"ExAllocatePoolWithTag() failed\n");
279 }
280
281
285 {
286 DPRINT1(
"IoAllocateWorkItem() failed\n");
290 }
294 SysButtonContext);
295
298 }
299 else
300 {
301 DPRINT1(
"Removal of a power capable device not implemented\n");
303 }
304}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
const GUID GUID_DEVICE_INTERFACE_ARRIVAL
const GUID GUID_DEVICE_INTERFACE_REMOVAL
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define RtlCompareMemory(s1, s2, l)
#define KeInitializeEvent(pEvt, foo, foo2)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define OBJ_KERNEL_HANDLE
POBJECT_TYPE IoFileObjectType
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
#define ExFreePoolWithTag(_P, _T)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
static VOID NTAPI PopGetSysButton(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
#define STATUS_REVISION_MISMATCH
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
enum _POP_POLICY_DEVICE_TYPE POP_POLICY_DEVICE_TYPE
SYSTEM_POWER_CAPABILITIES PopCapabilities
#define IOCTL_GET_SYS_BUTTON_CAPS
BOOLEAN PowerButtonPresent
BOOLEAN SystemBatteriesPresent
BOOLEAN SleepButtonPresent
PDEVICE_OBJECT DeviceObject
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ PVOID NotificationStructure
struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION * PDEVICE_INTERFACE_CHANGE_NOTIFICATION
#define ObDereferenceObject