MCPcopy Create free account
hub / github.com/acl-dev/acl / winapi_hook

Function winapi_hook

lib_fiber/cpp/src/winapi_hook.cpp:74–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72static pthread_once_t __once = PTHREAD_ONCE_INIT;
73
74bool winapi_hook() {
75 if (pthread_once(&__once, winapi_hook_once) != 0) {
76 return false;
77 }
78
79#if 0
80 // just test socket hook
81 SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
82 if (s == INVALID_SOCKET) {
83 printf("create socket error\r\n");
84 return false;
85 } else {
86 printf("create socket ok\r\n");
87 char buf[8192];
88 //int ret = recv(s, buf, sizeof(buf), 0);
89 int ret = acl_socket_read(s, buf, sizeof(buf), -1, NULL, NULL);
90 printf(">>>recv ret=%d\r\n", ret);
91 }
92#endif
93
94 return __hook_ok;
95}
96
97#else
98

Callers 8

acl_fiber_server_mainFunction · 0.85
winapi_hookMethod · 0.85
schedule_guiMethod · 0.85
schedule_withMethod · 0.85
InitFiberMethod · 0.85
InitFiberMethod · 0.85
InitInstanceFunction · 0.85
InitFiberMethod · 0.85

Calls 3

pthread_onceFunction · 0.85
acl_socket_readFunction · 0.85
socketFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…