|  | @@ -125,7 +125,7 @@ void *open_settings_w(const char *sessionname, char **errmsg)
 | 
											
												
													
														|  |  void write_setting_s(void *handle, const char *key, const char *value)
 |  |  void write_setting_s(void *handle, const char *key, const char *value)
 | 
											
												
													
														|  |  {
 |  |  {
 | 
											
												
													
														|  |      if (handle)
 |  |      if (handle)
 | 
											
												
													
														|  | -	RegSetValueEx((HKEY) handle, key, 0, REG_SZ, value,
 |  | 
 | 
											
												
													
														|  | 
 |  | +	RegSetValueEx((HKEY) handle, key, 0, REG_SZ, (CONST BYTE *)value,
 | 
											
												
													
														|  |  		      1 + strlen(value));
 |  |  		      1 + strlen(value));
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -183,7 +183,7 @@ char *read_setting_s(void *handle, const char *key)
 | 
											
												
													
														|  |      allocsize = size+1;         /* allow for an extra NUL if needed */
 |  |      allocsize = size+1;         /* allow for an extra NUL if needed */
 | 
											
												
													
														|  |      ret = snewn(allocsize, char);
 |  |      ret = snewn(allocsize, char);
 | 
											
												
													
														|  |      if (RegQueryValueEx((HKEY) handle, key, 0,
 |  |      if (RegQueryValueEx((HKEY) handle, key, 0,
 | 
											
												
													
														|  | -			&type, ret, &size) != ERROR_SUCCESS ||
 |  | 
 | 
											
												
													
														|  | 
 |  | +			&type, (BYTE *)ret, &size) != ERROR_SUCCESS ||
 | 
											
												
													
														|  |  	type != REG_SZ) {
 |  |  	type != REG_SZ) {
 | 
											
												
													
														|  |          sfree(ret);
 |  |          sfree(ret);
 | 
											
												
													
														|  |          return NULL;
 |  |          return NULL;
 | 
											
										
											
												
													
														|  | @@ -396,7 +396,8 @@ int verify_host_key(const char *hostname, int port,
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      readlen = len;
 |  |      readlen = len;
 | 
											
												
													
														|  |      otherstr = snewn(len, char);
 |  |      otherstr = snewn(len, char);
 | 
											
												
													
														|  | -    ret = RegQueryValueEx(rkey, regname, NULL, &type, otherstr, &readlen);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    ret = RegQueryValueEx(rkey, regname, NULL,
 | 
											
												
													
														|  | 
 |  | +                          &type, (BYTE *)otherstr, &readlen);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA &&
 |  |      if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA &&
 | 
											
												
													
														|  |  	!strcmp(keytype, "rsa")) {
 |  |  	!strcmp(keytype, "rsa")) {
 | 
											
										
											
												
													
														|  | @@ -409,7 +410,7 @@ int verify_host_key(const char *hostname, int port,
 | 
											
												
													
														|  |  	char *oldstyle = snewn(len + 10, char);	/* safety margin */
 |  |  	char *oldstyle = snewn(len + 10, char);	/* safety margin */
 | 
											
												
													
														|  |  	readlen = len;
 |  |  	readlen = len;
 | 
											
												
													
														|  |  	ret = RegQueryValueEx(rkey, justhost, NULL, &type,
 |  |  	ret = RegQueryValueEx(rkey, justhost, NULL, &type,
 | 
											
												
													
														|  | -			      oldstyle, &readlen);
 |  | 
 | 
											
												
													
														|  | 
 |  | +			      (BYTE *)oldstyle, &readlen);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	if (ret == ERROR_SUCCESS && type == REG_SZ) {
 |  |  	if (ret == ERROR_SUCCESS && type == REG_SZ) {
 | 
											
												
													
														|  |  	    /*
 |  |  	    /*
 | 
											
										
											
												
													
														|  | @@ -455,7 +456,7 @@ int verify_host_key(const char *hostname, int port,
 | 
											
												
													
														|  |  	     * wrong, and hyper-cautiously do nothing.
 |  |  	     * wrong, and hyper-cautiously do nothing.
 | 
											
												
													
														|  |  	     */
 |  |  	     */
 | 
											
												
													
														|  |  	    if (!strcmp(otherstr, key))
 |  |  	    if (!strcmp(otherstr, key))
 | 
											
												
													
														|  | -		RegSetValueEx(rkey, regname, 0, REG_SZ, otherstr,
 |  | 
 | 
											
												
													
														|  | 
 |  | +		RegSetValueEx(rkey, regname, 0, REG_SZ, (BYTE *)otherstr,
 | 
											
												
													
														|  |  			      strlen(otherstr) + 1);
 |  |  			      strlen(otherstr) + 1);
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -515,7 +516,7 @@ void store_host_key(const char *hostname, int port,
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      if (RegCreateKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
 |  |      if (RegCreateKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys",
 | 
											
												
													
														|  |  		     &rkey) == ERROR_SUCCESS) {
 |  |  		     &rkey) == ERROR_SUCCESS) {
 | 
											
												
													
														|  | -	RegSetValueEx(rkey, regname, 0, REG_SZ, key, strlen(key) + 1);
 |  | 
 | 
											
												
													
														|  | 
 |  | +	RegSetValueEx(rkey, regname, 0, REG_SZ, (BYTE *)key, strlen(key) + 1);
 | 
											
												
													
														|  |  	RegCloseKey(rkey);
 |  |  	RegCloseKey(rkey);
 | 
											
												
													
														|  |      } /* else key does not exist in registry */
 |  |      } /* else key does not exist in registry */
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -575,7 +576,7 @@ static HANDLE access_random_seed(int action)
 | 
											
												
													
														|  |      if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) ==
 |  |      if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) ==
 | 
											
												
													
														|  |  	ERROR_SUCCESS) {
 |  |  	ERROR_SUCCESS) {
 | 
											
												
													
														|  |  	int ret = RegQueryValueEx(rkey, "RandSeedFile",
 |  |  	int ret = RegQueryValueEx(rkey, "RandSeedFile",
 | 
											
												
													
														|  | -				  0, &type, seedpath, &size);
 |  | 
 | 
											
												
													
														|  | 
 |  | +				  0, &type, (BYTE *)seedpath, &size);
 | 
											
												
													
														|  |  	if (ret != ERROR_SUCCESS || type != REG_SZ)
 |  |  	if (ret != ERROR_SUCCESS || type != REG_SZ)
 | 
											
												
													
														|  |  	    seedpath[0] = '\0';
 |  |  	    seedpath[0] = '\0';
 | 
											
												
													
														|  |  	RegCloseKey(rkey);
 |  |  	RegCloseKey(rkey);
 | 
											
										
											
												
													
														|  | @@ -711,7 +712,7 @@ static int transform_jumplist_registry
 | 
											
												
													
														|  |      value_length = 200;
 |  |      value_length = 200;
 | 
											
												
													
														|  |      old_value = snewn(value_length, char);
 |  |      old_value = snewn(value_length, char);
 | 
											
												
													
														|  |      ret = RegQueryValueEx(pjumplist_key, reg_jumplist_value, NULL, &type,
 |  |      ret = RegQueryValueEx(pjumplist_key, reg_jumplist_value, NULL, &type,
 | 
											
												
													
														|  | -                          old_value, &value_length);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                          (BYTE *)old_value, &value_length);
 | 
											
												
													
														|  |      /* When the passed buffer is too small, ERROR_MORE_DATA is
 |  |      /* When the passed buffer is too small, ERROR_MORE_DATA is
 | 
											
												
													
														|  |       * returned and the required size is returned in the length
 |  |       * returned and the required size is returned in the length
 | 
											
												
													
														|  |       * argument. */
 |  |       * argument. */
 | 
											
										
											
												
													
														|  | @@ -719,7 +720,7 @@ static int transform_jumplist_registry
 | 
											
												
													
														|  |          sfree(old_value);
 |  |          sfree(old_value);
 | 
											
												
													
														|  |          old_value = snewn(value_length, char);
 |  |          old_value = snewn(value_length, char);
 | 
											
												
													
														|  |          ret = RegQueryValueEx(pjumplist_key, reg_jumplist_value, NULL, &type,
 |  |          ret = RegQueryValueEx(pjumplist_key, reg_jumplist_value, NULL, &type,
 | 
											
												
													
														|  | -                              old_value, &value_length);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                              (BYTE *)old_value, &value_length);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      if (ret == ERROR_FILE_NOT_FOUND) {
 |  |      if (ret == ERROR_FILE_NOT_FOUND) {
 | 
											
										
											
												
													
														|  | @@ -793,7 +794,7 @@ static int transform_jumplist_registry
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          /* Save the new list to the registry. */
 |  |          /* Save the new list to the registry. */
 | 
											
												
													
														|  |          ret = RegSetValueEx(pjumplist_key, reg_jumplist_value, 0, REG_MULTI_SZ,
 |  |          ret = RegSetValueEx(pjumplist_key, reg_jumplist_value, 0, REG_MULTI_SZ,
 | 
											
												
													
														|  | -                            new_value, piterator_new - new_value);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                            (BYTE *)new_value, piterator_new - new_value);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          sfree(old_value);
 |  |          sfree(old_value);
 | 
											
												
													
														|  |          old_value = new_value;
 |  |          old_value = new_value;
 |