Lines Matching refs:hk
50 static int wpa_config_read_blobs(struct wpa_config *config, HKEY hk) in wpa_config_read_blobs() argument
58 ret = RegOpenKeyEx(hk, TEXT("blobs"), 0, KEY_QUERY_VALUE, &bhk); in wpa_config_read_blobs()
119 static int wpa_config_read_reg_dword(HKEY hk, const TCHAR *name, int *_val) in wpa_config_read_reg_dword() argument
125 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) &val, &buflen); in wpa_config_read_reg_dword()
136 static char * wpa_config_read_reg_string(HKEY hk, const TCHAR *name) in wpa_config_read_reg_string() argument
143 ret = RegQueryValueEx(hk, name, NULL, NULL, NULL, &buflen); in wpa_config_read_reg_string()
150 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) val, &buflen); in wpa_config_read_reg_string()
163 static int wpa_config_read_global_uuid(struct wpa_config *config, HKEY hk) in wpa_config_read_global_uuid() argument
168 str = wpa_config_read_reg_string(hk, TEXT("uuid")); in wpa_config_read_global_uuid()
182 HKEY hk) in wpa_config_read_global_os_version() argument
187 str = wpa_config_read_reg_string(hk, TEXT("os_version")); in wpa_config_read_global_os_version()
201 static int wpa_config_read_global(struct wpa_config *config, HKEY hk) in wpa_config_read_global() argument
206 wpa_config_read_reg_dword(hk, TEXT("ap_scan"), &config->ap_scan); in wpa_config_read_global()
207 wpa_config_read_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_read_global()
209 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_read_global()
211 wpa_config_read_reg_dword(hk, in wpa_config_read_global()
215 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_read_global()
217 wpa_config_read_reg_dword(hk, TEXT("update_config"), in wpa_config_read_global()
220 if (wpa_config_read_reg_dword(hk, TEXT("eapol_version"), in wpa_config_read_global()
231 hk, TEXT("ctrl_interface")); in wpa_config_read_global()
234 if (wpa_config_read_global_uuid(config, hk)) in wpa_config_read_global()
236 wpa_config_read_reg_dword(hk, TEXT("auto_uuid"), &config->auto_uuid); in wpa_config_read_global()
238 hk, TEXT("device_name")); in wpa_config_read_global()
240 hk, TEXT("manufacturer")); in wpa_config_read_global()
242 hk, TEXT("model_name")); in wpa_config_read_global()
244 hk, TEXT("serial_number")); in wpa_config_read_global()
247 hk, TEXT("device_type")); in wpa_config_read_global()
253 hk, TEXT("config_methods")); in wpa_config_read_global()
254 if (wpa_config_read_global_os_version(config, hk)) in wpa_config_read_global()
256 wpa_config_read_reg_dword(hk, TEXT("wps_cred_processing"), in wpa_config_read_global()
258 wpa_config_read_reg_dword(hk, TEXT("wps_cred_add_sae"), in wpa_config_read_global()
263 hk, TEXT("p2p_ssid_postfix")); in wpa_config_read_global()
264 wpa_config_read_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_read_global()
268 wpa_config_read_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_read_global()
270 wpa_config_read_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_read_global()
272 wpa_config_read_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_read_global()
274 wpa_config_read_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_read_global()
277 wpa_config_read_reg_dword(hk, TEXT("okc"), &config->okc); in wpa_config_read_global()
278 wpa_config_read_reg_dword(hk, TEXT("pmf"), &val); in wpa_config_read_global()
280 if (wpa_config_read_reg_dword(hk, TEXT("extended_key_id"), in wpa_config_read_global()
294 static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw, in wpa_config_read_network() argument
303 ret = RegOpenKeyEx(hk, netw, 0, KEY_QUERY_VALUE, &nhk); in wpa_config_read_network()
383 static int wpa_config_read_networks(struct wpa_config *config, HKEY hk) in wpa_config_read_networks() argument
391 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_ENUMERATE_SUB_KEYS, in wpa_config_read_networks()
454 HKEY hk; in wpa_config_read() local
473 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_QUERY_VALUE, &hk); in wpa_config_read()
481 if (wpa_config_read_global(config, hk)) in wpa_config_read()
484 if (wpa_config_read_networks(config, hk)) in wpa_config_read()
487 if (wpa_config_read_blobs(config, hk)) in wpa_config_read()
492 RegCloseKey(hk); in wpa_config_read()
503 static int wpa_config_write_reg_dword(HKEY hk, const TCHAR *name, int val, in wpa_config_write_reg_dword() argument
510 RegDeleteValue(hk, name); in wpa_config_write_reg_dword()
514 ret = RegSetValueEx(hk, name, 0, REG_DWORD, (LPBYTE) &_val, in wpa_config_write_reg_dword()
526 static int wpa_config_write_reg_string(HKEY hk, const char *name, in wpa_config_write_reg_string() argument
537 RegDeleteValue(hk, _name); in wpa_config_write_reg_string()
547 ret = RegSetValueEx(hk, _name, 0, REG_SZ, (BYTE *) _val, in wpa_config_write_reg_string()
563 static int wpa_config_write_global(struct wpa_config *config, HKEY hk) in wpa_config_write_global() argument
566 wpa_config_write_reg_string(hk, "ctrl_interface", in wpa_config_write_global()
570 wpa_config_write_reg_dword(hk, TEXT("eapol_version"), in wpa_config_write_global()
573 wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan, in wpa_config_write_global()
575 wpa_config_write_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_write_global()
577 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_write_global()
579 wpa_config_write_reg_dword(hk, in wpa_config_write_global()
583 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_write_global()
585 wpa_config_write_reg_dword(hk, TEXT("update_config"), in wpa_config_write_global()
592 wpa_config_write_reg_string(hk, "uuid", buf); in wpa_config_write_global()
594 wpa_config_write_reg_dword(hk, TEXT("auto_uuid"), config->auto_uuid, in wpa_config_write_global()
596 wpa_config_write_reg_string(hk, "device_name", config->device_name); in wpa_config_write_global()
597 wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer); in wpa_config_write_global()
598 wpa_config_write_reg_string(hk, "model_name", config->model_name); in wpa_config_write_global()
599 wpa_config_write_reg_string(hk, "model_number", config->model_number); in wpa_config_write_global()
600 wpa_config_write_reg_string(hk, "serial_number", in wpa_config_write_global()
606 wpa_config_write_reg_string(hk, "device_type", buf); in wpa_config_write_global()
608 wpa_config_write_reg_string(hk, "config_methods", in wpa_config_write_global()
614 wpa_config_write_reg_string(hk, "os_version", vbuf); in wpa_config_write_global()
616 wpa_config_write_reg_dword(hk, TEXT("wps_cred_processing"), in wpa_config_write_global()
618 wpa_config_write_reg_dword(hk, TEXT("wps_cred_add_sae"), in wpa_config_write_global()
622 wpa_config_write_reg_string(hk, "p2p_ssid_postfix", in wpa_config_write_global()
624 wpa_config_write_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_write_global()
628 wpa_config_write_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_write_global()
631 wpa_config_write_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_write_global()
633 wpa_config_write_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_write_global()
635 wpa_config_write_reg_dword(hk, TEXT("ap_isolate"), in wpa_config_write_global()
637 wpa_config_write_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_write_global()
640 wpa_config_write_reg_dword(hk, TEXT("okc"), config->okc, 0); in wpa_config_write_global()
641 wpa_config_write_reg_dword(hk, TEXT("pmf"), config->pmf, 0); in wpa_config_write_global()
643 wpa_config_write_reg_dword(hk, TEXT("external_sim"), in wpa_config_write_global()
650 static int wpa_config_delete_subkeys(HKEY hk, const TCHAR *key) in wpa_config_delete_subkeys() argument
656 ret = RegOpenKeyEx(hk, key, 0, KEY_ENUMERATE_SUB_KEYS | DELETE, &nhk); in wpa_config_delete_subkeys()
699 static void write_str(HKEY hk, const char *field, struct wpa_ssid *ssid) in write_str() argument
704 wpa_config_write_reg_string(hk, field, value); in write_str()
709 static void write_int(HKEY hk, const char *field, int value, int def) in write_int() argument
715 wpa_config_write_reg_string(hk, field, val); in write_int()
719 static void write_bssid(HKEY hk, struct wpa_ssid *ssid) in write_bssid() argument
724 wpa_config_write_reg_string(hk, "bssid", value); in write_bssid()
729 static void write_psk(HKEY hk, struct wpa_ssid *ssid) in write_psk() argument
734 wpa_config_write_reg_string(hk, "psk", value); in write_psk()
739 static void write_proto(HKEY hk, struct wpa_ssid *ssid) in write_proto() argument
750 wpa_config_write_reg_string(hk, "proto", value); in write_proto()
755 static void write_key_mgmt(HKEY hk, struct wpa_ssid *ssid) in write_key_mgmt() argument
766 wpa_config_write_reg_string(hk, "key_mgmt", value); in write_key_mgmt()
771 static void write_pairwise(HKEY hk, struct wpa_ssid *ssid) in write_pairwise() argument
782 wpa_config_write_reg_string(hk, "pairwise", value); in write_pairwise()
787 static void write_group(HKEY hk, struct wpa_ssid *ssid) in write_group() argument
798 wpa_config_write_reg_string(hk, "group", value); in write_group()
803 static void write_auth_alg(HKEY hk, struct wpa_ssid *ssid) in write_auth_alg() argument
814 wpa_config_write_reg_string(hk, "auth_alg", value); in write_auth_alg()
820 static void write_eap(HKEY hk, struct wpa_ssid *ssid) in write_eap() argument
829 wpa_config_write_reg_string(hk, "eap", value); in write_eap()
836 static void write_wep_key(HKEY hk, int idx, struct wpa_ssid *ssid) in write_wep_key() argument
843 wpa_config_write_reg_string(hk, field, value); in write_wep_key()
850 static int wpa_config_write_network(HKEY hk, struct wpa_ssid *ssid, int id) in wpa_config_write_network() argument
857 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_CREATE_SUB_KEY, &nhk); in wpa_config_write_network()
976 static int wpa_config_write_blob(HKEY hk, struct wpa_config_blob *blob) in wpa_config_write_blob() argument
982 ret = RegCreateKeyEx(hk, TEXT("blobs"), 0, NULL, 0, KEY_WRITE, NULL, in wpa_config_write_blob()
1013 HKEY hk; in wpa_config_write() local
1028 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_SET_VALUE | DELETE, &hk); in wpa_config_write()
1036 if (wpa_config_write_global(config, hk)) { in wpa_config_write()
1042 wpa_config_delete_subkeys(hk, TEXT("networks")); in wpa_config_write()
1046 if (wpa_config_write_network(hk, ssid, id)) in wpa_config_write()
1050 RegDeleteKey(hk, TEXT("blobs")); in wpa_config_write()
1052 if (wpa_config_write_blob(hk, blob)) in wpa_config_write()
1056 RegCloseKey(hk); in wpa_config_write()