grpc
third_party
libuv
src
win
detect-wakeup.c
Go to the documentation of this file.
1
#include "
uv.h
"
2
#include "
internal.h
"
3
#include "
winapi.h
"
4
5
static
void
uv__register_system_resume_callback
(
void
);
6
7
void
uv__init_detect_system_wakeup
(
void
) {
8
/* Try registering system power event callback. This is the cleanest
9
* method, but it will only work on Win8 and above.
10
*/
11
uv__register_system_resume_callback
();
12
}
13
14
static
ULONG CALLBACK
uv__system_resume_callback
(PVOID Context,
15
ULONG
Type
,
16
PVOID
Setting
) {
17
if
(
Type
==
PBT_APMRESUMESUSPEND
||
Type
==
PBT_APMRESUMEAUTOMATIC
)
18
uv__wake_all_loops
();
19
20
return
0;
21
}
22
23
static
void
uv__register_system_resume_callback
(
void
) {
24
_DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
recipient;
25
_HPOWERNOTIFY
registration_handle;
26
27
if
(
pPowerRegisterSuspendResumeNotification
== NULL)
28
return
;
29
30
recipient.
Callback
=
uv__system_resume_callback
;
31
recipient.
Context
= NULL;
32
(*pPowerRegisterSuspendResumeNotification)(
DEVICE_NOTIFY_CALLBACK
,
33
&recipient,
34
®istration_handle);
35
}
_DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS::Callback
_PDEVICE_NOTIFY_CALLBACK_ROUTINE Callback
Definition:
winapi.h:4691
_DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS::Context
PVOID Context
Definition:
winapi.h:4692
_HPOWERNOTIFY
PVOID _HPOWERNOTIFY
Definition:
winapi.h:4695
winapi.h
PBT_APMRESUMEAUTOMATIC
#define PBT_APMRESUMEAUTOMATIC
Definition:
winapi.h:4676
_DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
Definition:
winapi.h:4690
Type
Definition:
bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:182
pPowerRegisterSuspendResumeNotification
sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification
Definition:
winapi.c:43
uv__system_resume_callback
static ULONG CALLBACK uv__system_resume_callback(PVOID Context, ULONG Type, PVOID Setting)
Definition:
detect-wakeup.c:14
DEVICE_NOTIFY_CALLBACK
#define DEVICE_NOTIFY_CALLBACK
Definition:
winapi.h:4672
uv.h
uv__register_system_resume_callback
static void uv__register_system_resume_callback(void)
Definition:
detect-wakeup.c:23
gen_settings_ids.Setting
Setting
Definition:
gen_settings_ids.py:26
uv__wake_all_loops
void uv__wake_all_loops(void)
Definition:
win/core.c:162
uv__init_detect_system_wakeup
void uv__init_detect_system_wakeup(void)
Definition:
detect-wakeup.c:7
internal.h
PBT_APMRESUMESUSPEND
#define PBT_APMRESUMESUSPEND
Definition:
winapi.h:4680
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:16