diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c
index fde6412..3af58ed 100644
--- a/src/openvpn/win32.c
+++ b/src/openvpn/win32.c
@@ -1491,7 +1491,7 @@
 set_openssl_env_vars(void)
 {
     WCHAR install_path[MAX_PATH] = { 0 };
-    if (!get_openvpn_reg_value(NULL, install_path, _countof(install_path)))
+    if (!get_openvpn_reg_value(NULL, install_path, sizeof(install_path)))
     {
         const WCHAR *ssl_fallback_dir = L"C:\\Windows\\System32";
         /* if we cannot find installation path from the registry,
@@ -1585,8 +1585,8 @@
 
     /* Attempt to retrieve the trusted plugin directory path from the registry,
      * using installation path as a fallback */
-    if (!get_openvpn_reg_value(L"plugin_dir", plugin_dir, _countof(plugin_dir))
-        && !get_openvpn_reg_value(NULL, plugin_dir, _countof(plugin_dir)))
+    if (!get_openvpn_reg_value(L"plugin_dir", plugin_dir, sizeof(plugin_dir))
+        && !get_openvpn_reg_value(NULL, plugin_dir, sizeof(plugin_dir)))
     {
         msg(M_WARN, "Installation path could not be determined.");
     }
