projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The WinSock library is now loaded at run-time, which means we can
[u/mdw/putty]
/
winstore.c
diff --git
a/winstore.c
b/winstore.c
index
90d262f
..
553f474
100644
(file)
--- a/
winstore.c
+++ b/
winstore.c
@@
-3,7
+3,6
@@
* defined in storage.h.
*/
* defined in storage.h.
*/
-#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@
-61,12
+60,14
@@
static void unmungestr(const char *in, char *out, int outlen)
return;
}
return;
}
-void *open_settings_w(const char *sessionname)
+void *open_settings_w(const char *sessionname
, char **errmsg
)
{
HKEY subkey1, sesskey;
int ret;
char *p;
{
HKEY subkey1, sesskey;
int ret;
char *p;
+ *errmsg = NULL;
+
if (!sessionname || !*sessionname)
sessionname = "Default Settings";
if (!sessionname || !*sessionname)
sessionname = "Default Settings";
@@
-76,13
+77,18
@@
void *open_settings_w(const char *sessionname)
ret = RegCreateKey(HKEY_CURRENT_USER, puttystr, &subkey1);
if (ret != ERROR_SUCCESS) {
sfree(p);
ret = RegCreateKey(HKEY_CURRENT_USER, puttystr, &subkey1);
if (ret != ERROR_SUCCESS) {
sfree(p);
+ *errmsg = dupprintf("Unable to create registry key\n"
+ "HKEY_CURRENT_USER%s", puttystr);
return NULL;
}
ret = RegCreateKey(subkey1, p, &sesskey);
sfree(p);
RegCloseKey(subkey1);
return NULL;
}
ret = RegCreateKey(subkey1, p, &sesskey);
sfree(p);
RegCloseKey(subkey1);
- if (ret != ERROR_SUCCESS)
+ if (ret != ERROR_SUCCESS) {
+ *errmsg = dupprintf("Unable to create registry key\n"
+ "HKEY_CURRENT_USER%s\\%s", puttystr, p);
return NULL;
return NULL;
+ }
return (void *) sesskey;
}
return (void *) sesskey;
}