aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/embeddable-dll-service/README.md
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2022-02-15 13:12:20 +0100
committerSimon Rozman <simon@rozman.si>2022-03-28 12:40:20 +0200
commit1a3f183e980c8f2baf0889723c864c911f5d2447 (patch)
treeb4718524771fed5b611ca107f4e41ca47826d9e8 /embeddable-dll-service/README.md
parentbuild: bump to go1.18 (diff)
downloadwireguard-windows-1a3f183e980c8f2baf0889723c864c911f5d2447.tar.xz
wireguard-windows-1a3f183e980c8f2baf0889723c864c911f5d2447.zip
embeddable-dll-service: correctness in README
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to '')
-rw-r--r--embeddable-dll-service/README.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/embeddable-dll-service/README.md b/embeddable-dll-service/README.md
index 25a7c3e8..a326dc70 100644
--- a/embeddable-dll-service/README.md
+++ b/embeddable-dll-service/README.md
@@ -24,11 +24,12 @@ is absolutely essential; do not forget it.
##### 2. Have your program's main function handle the `/service` switch:
```c
-if (!wcscmp(wargv[1], L"/service") && wargc == 3) {
+if (wargc == 3 && !wcscmp(wargv[1], L"/service")) {
HMODULE tunnel_lib = LoadLibrary("tunnel.dll");
if (!tunnel_lib)
abort();
- tunnel_proc_t tunnel_proc = (tunnel_proc_t)GetProcAddress(tunnel_lib, "WireGuardTunnelService");
+ BOOL (_cdecl *tunnel_proc)(_In_ LPCWSTR conf_file);
+ *(FARPROC*)&tunnel_proc = GetProcAddress(tunnel_lib, "WireGuardTunnelService");
if (!tunnel_proc)
abort();
return tunnel_proc(wargv[2]);