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()
120 static int wpa_config_read_reg_dword(HKEY hk, const TCHAR *name, int *_val) in wpa_config_read_reg_dword() argument
126 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) &val, &buflen); in wpa_config_read_reg_dword()
137 static char * wpa_config_read_reg_string(HKEY hk, const TCHAR *name) in wpa_config_read_reg_string() argument
144 ret = RegQueryValueEx(hk, name, NULL, NULL, NULL, &buflen); in wpa_config_read_reg_string()
151 ret = RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE) val, &buflen); in wpa_config_read_reg_string()
164 static int wpa_config_read_global_uuid(struct wpa_config *config, HKEY hk) in wpa_config_read_global_uuid() argument
169 str = wpa_config_read_reg_string(hk, TEXT("uuid")); in wpa_config_read_global_uuid()
183 HKEY hk) in wpa_config_read_global_os_version() argument
188 str = wpa_config_read_reg_string(hk, TEXT("os_version")); in wpa_config_read_global_os_version()
202 static int wpa_config_read_global(struct wpa_config *config, HKEY hk) in wpa_config_read_global() argument
207 wpa_config_read_reg_dword(hk, TEXT("ap_scan"), &config->ap_scan); in wpa_config_read_global()
208 wpa_config_read_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_read_global()
210 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_read_global()
212 wpa_config_read_reg_dword(hk, in wpa_config_read_global()
216 wpa_config_read_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_read_global()
218 wpa_config_read_reg_dword(hk, TEXT("update_config"), in wpa_config_read_global()
221 if (wpa_config_read_reg_dword(hk, TEXT("eapol_version"), in wpa_config_read_global()
232 hk, TEXT("ctrl_interface")); in wpa_config_read_global()
235 if (wpa_config_read_global_uuid(config, hk)) 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()
261 hk, TEXT("p2p_ssid_postfix")); in wpa_config_read_global()
262 wpa_config_read_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_read_global()
266 wpa_config_read_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_read_global()
268 wpa_config_read_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_read_global()
270 wpa_config_read_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_read_global()
272 wpa_config_read_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_read_global()
275 wpa_config_read_reg_dword(hk, TEXT("okc"), &config->okc); in wpa_config_read_global()
276 wpa_config_read_reg_dword(hk, TEXT("pmf"), &val); in wpa_config_read_global()
283 static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw, in wpa_config_read_network() argument
292 ret = RegOpenKeyEx(hk, netw, 0, KEY_QUERY_VALUE, &nhk); in wpa_config_read_network()
372 static int wpa_config_read_networks(struct wpa_config *config, HKEY hk) in wpa_config_read_networks() argument
380 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_ENUMERATE_SUB_KEYS, in wpa_config_read_networks()
443 HKEY hk; in wpa_config_read() local
462 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_QUERY_VALUE, &hk); in wpa_config_read()
470 if (wpa_config_read_global(config, hk)) in wpa_config_read()
473 if (wpa_config_read_networks(config, hk)) in wpa_config_read()
476 if (wpa_config_read_blobs(config, hk)) in wpa_config_read()
481 RegCloseKey(hk); in wpa_config_read()
492 static int wpa_config_write_reg_dword(HKEY hk, const TCHAR *name, int val, in wpa_config_write_reg_dword() argument
499 RegDeleteValue(hk, name); in wpa_config_write_reg_dword()
503 ret = RegSetValueEx(hk, name, 0, REG_DWORD, (LPBYTE) &_val, in wpa_config_write_reg_dword()
515 static int wpa_config_write_reg_string(HKEY hk, const char *name, in wpa_config_write_reg_string() argument
526 RegDeleteValue(hk, _name); in wpa_config_write_reg_string()
536 ret = RegSetValueEx(hk, _name, 0, REG_SZ, (BYTE *) _val, in wpa_config_write_reg_string()
552 static int wpa_config_write_global(struct wpa_config *config, HKEY hk) in wpa_config_write_global() argument
555 wpa_config_write_reg_string(hk, "ctrl_interface", in wpa_config_write_global()
559 wpa_config_write_reg_dword(hk, TEXT("eapol_version"), in wpa_config_write_global()
562 wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan, in wpa_config_write_global()
564 wpa_config_write_reg_dword(hk, TEXT("fast_reauth"), in wpa_config_write_global()
566 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), in wpa_config_write_global()
568 wpa_config_write_reg_dword(hk, in wpa_config_write_global()
572 wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), in wpa_config_write_global()
574 wpa_config_write_reg_dword(hk, TEXT("update_config"), in wpa_config_write_global()
581 wpa_config_write_reg_string(hk, "uuid", buf); in wpa_config_write_global()
583 wpa_config_write_reg_string(hk, "device_name", config->device_name); in wpa_config_write_global()
584 wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer); in wpa_config_write_global()
585 wpa_config_write_reg_string(hk, "model_name", config->model_name); in wpa_config_write_global()
586 wpa_config_write_reg_string(hk, "model_number", config->model_number); in wpa_config_write_global()
587 wpa_config_write_reg_string(hk, "serial_number", in wpa_config_write_global()
593 wpa_config_write_reg_string(hk, "device_type", buf); in wpa_config_write_global()
595 wpa_config_write_reg_string(hk, "config_methods", in wpa_config_write_global()
601 wpa_config_write_reg_string(hk, "os_version", vbuf); in wpa_config_write_global()
603 wpa_config_write_reg_dword(hk, TEXT("wps_cred_processing"), in wpa_config_write_global()
607 wpa_config_write_reg_string(hk, "p2p_ssid_postfix", in wpa_config_write_global()
609 wpa_config_write_reg_dword(hk, TEXT("p2p_group_idle"), in wpa_config_write_global()
613 wpa_config_write_reg_dword(hk, TEXT("bss_max_count"), in wpa_config_write_global()
616 wpa_config_write_reg_dword(hk, TEXT("filter_ssids"), in wpa_config_write_global()
618 wpa_config_write_reg_dword(hk, TEXT("max_num_sta"), in wpa_config_write_global()
620 wpa_config_write_reg_dword(hk, TEXT("disassoc_low_ack"), in wpa_config_write_global()
623 wpa_config_write_reg_dword(hk, TEXT("okc"), config->okc, 0); in wpa_config_write_global()
624 wpa_config_write_reg_dword(hk, TEXT("pmf"), config->pmf, 0); in wpa_config_write_global()
626 wpa_config_write_reg_dword(hk, TEXT("external_sim"), in wpa_config_write_global()
633 static int wpa_config_delete_subkeys(HKEY hk, const TCHAR *key) in wpa_config_delete_subkeys() argument
639 ret = RegOpenKeyEx(hk, key, 0, KEY_ENUMERATE_SUB_KEYS | DELETE, &nhk); in wpa_config_delete_subkeys()
682 static void write_str(HKEY hk, const char *field, struct wpa_ssid *ssid) in write_str() argument
687 wpa_config_write_reg_string(hk, field, value); in write_str()
692 static void write_int(HKEY hk, const char *field, int value, int def) in write_int() argument
698 wpa_config_write_reg_string(hk, field, val); in write_int()
702 static void write_bssid(HKEY hk, struct wpa_ssid *ssid) in write_bssid() argument
707 wpa_config_write_reg_string(hk, "bssid", value); in write_bssid()
712 static void write_psk(HKEY hk, struct wpa_ssid *ssid) in write_psk() argument
717 wpa_config_write_reg_string(hk, "psk", value); in write_psk()
722 static void write_proto(HKEY hk, struct wpa_ssid *ssid) in write_proto() argument
733 wpa_config_write_reg_string(hk, "proto", value); in write_proto()
738 static void write_key_mgmt(HKEY hk, struct wpa_ssid *ssid) in write_key_mgmt() argument
749 wpa_config_write_reg_string(hk, "key_mgmt", value); in write_key_mgmt()
754 static void write_pairwise(HKEY hk, struct wpa_ssid *ssid) in write_pairwise() argument
765 wpa_config_write_reg_string(hk, "pairwise", value); in write_pairwise()
770 static void write_group(HKEY hk, struct wpa_ssid *ssid) in write_group() argument
781 wpa_config_write_reg_string(hk, "group", value); in write_group()
786 static void write_auth_alg(HKEY hk, struct wpa_ssid *ssid) in write_auth_alg() argument
797 wpa_config_write_reg_string(hk, "auth_alg", value); in write_auth_alg()
803 static void write_eap(HKEY hk, struct wpa_ssid *ssid) in write_eap() argument
812 wpa_config_write_reg_string(hk, "eap", value); in write_eap()
818 static void write_wep_key(HKEY hk, int idx, struct wpa_ssid *ssid) in write_wep_key() argument
825 wpa_config_write_reg_string(hk, field, value); in write_wep_key()
831 static int wpa_config_write_network(HKEY hk, struct wpa_ssid *ssid, int id) in wpa_config_write_network() argument
838 ret = RegOpenKeyEx(hk, TEXT("networks"), 0, KEY_CREATE_SUB_KEY, &nhk); in wpa_config_write_network()
947 static int wpa_config_write_blob(HKEY hk, struct wpa_config_blob *blob) in wpa_config_write_blob() argument
953 ret = RegCreateKeyEx(hk, TEXT("blobs"), 0, NULL, 0, KEY_WRITE, NULL, in wpa_config_write_blob()
984 HKEY hk; in wpa_config_write() local
999 ret = RegOpenKeyEx(WPA_KEY_ROOT, buf, 0, KEY_SET_VALUE | DELETE, &hk); in wpa_config_write()
1007 if (wpa_config_write_global(config, hk)) { in wpa_config_write()
1013 wpa_config_delete_subkeys(hk, TEXT("networks")); in wpa_config_write()
1017 if (wpa_config_write_network(hk, ssid, id)) in wpa_config_write()
1021 RegDeleteKey(hk, TEXT("blobs")); in wpa_config_write()
1023 if (wpa_config_write_blob(hk, blob)) in wpa_config_write()
1027 RegCloseKey(hk); in wpa_config_write()