Rizin
unix-like reverse engineering framework and cli tools
detect-wakeup.c File Reference
#include "uv.h"
#include "internal.h"
#include "winapi.h"

Go to the source code of this file.

Functions

static void uv__register_system_resume_callback (void)
 
void uv__init_detect_system_wakeup (void)
 
static ULONG CALLBACK uv__system_resume_callback (PVOID Context, ULONG Type, PVOID Setting)
 

Function Documentation

◆ uv__init_detect_system_wakeup()

void uv__init_detect_system_wakeup ( void  )

Definition at line 28 of file detect-wakeup.c.

28  {
29  /* Try registering system power event callback. This is the cleanest
30  * method, but it will only work on Win8 and above.
31  */
33 }
static void uv__register_system_resume_callback(void)
Definition: detect-wakeup.c:44

References uv__register_system_resume_callback().

Referenced by uv_init().

◆ uv__register_system_resume_callback()

static void uv__register_system_resume_callback ( void  )
static

Definition at line 44 of file detect-wakeup.c.

44  {
46  _HPOWERNOTIFY registration_handle;
47 
49  return;
50 
52  recipient.Context = NULL;
53  (*pPowerRegisterSuspendResumeNotification)(DEVICE_NOTIFY_CALLBACK,
54  &recipient,
55  &registration_handle);
56 }
#define NULL
Definition: cris-opc.c:27
static ULONG CALLBACK uv__system_resume_callback(PVOID Context, ULONG Type, PVOID Setting)
Definition: detect-wakeup.c:35
_PDEVICE_NOTIFY_CALLBACK_ROUTINE Callback
Definition: winapi.h:4698
sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification
Definition: winapi.c:43
#define DEVICE_NOTIFY_CALLBACK
Definition: winapi.h:4679
PVOID _HPOWERNOTIFY
Definition: winapi.h:4702

References _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS::Callback, _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS::Context, DEVICE_NOTIFY_CALLBACK, NULL, pPowerRegisterSuspendResumeNotification, and uv__system_resume_callback().

Referenced by uv__init_detect_system_wakeup().

◆ uv__system_resume_callback()

static ULONG CALLBACK uv__system_resume_callback ( PVOID  Context,
ULONG  Type,
PVOID  Setting 
)
static

Definition at line 35 of file detect-wakeup.c.

37  {
40 
41  return 0;
42 }
Definition: swift.c:7
void uv__wake_all_loops(void)
Definition: core.c:162
#define PBT_APMRESUMESUSPEND
Definition: winapi.h:4687
#define PBT_APMRESUMEAUTOMATIC
Definition: winapi.h:4683

References PBT_APMRESUMEAUTOMATIC, PBT_APMRESUMESUSPEND, and uv__wake_all_loops().

Referenced by uv__register_system_resume_callback().