Skip to content

Commit 1a3f183

Browse files
committed
embeddable-dll-service: correctness in README
Signed-off-by: Simon Rozman <[email protected]>
1 parent 6432784 commit 1a3f183

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

embeddable-dll-service/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ is absolutely essential; do not forget it.
2424
##### 2. Have your program's main function handle the `/service` switch:
2525

2626
```c
27-
if (!wcscmp(wargv[1], L"/service") && wargc == 3) {
27+
if (wargc == 3 && !wcscmp(wargv[1], L"/service")) {
2828
HMODULE tunnel_lib = LoadLibrary("tunnel.dll");
2929
if (!tunnel_lib)
3030
abort();
31-
tunnel_proc_t tunnel_proc = (tunnel_proc_t)GetProcAddress(tunnel_lib, "WireGuardTunnelService");
31+
BOOL (_cdecl *tunnel_proc)(_In_ LPCWSTR conf_file);
32+
*(FARPROC*)&tunnel_proc = GetProcAddress(tunnel_lib, "WireGuardTunnelService");
3233
if (!tunnel_proc)
3334
abort();
3435
return tunnel_proc(wargv[2]);

0 commit comments

Comments
 (0)