projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The Windows HANDLE type, despite being a `void *', does not actually
[u/mdw/putty]
/
windows
/
window.c
diff --git
a/windows/window.c
b/windows/window.c
index
0b928bd
..
d58111f
100644
(file)
--- a/
windows/window.c
+++ b/
windows/window.c
@@
-235,7
+235,7
@@
static void start_backend(void)
if (error) {
char *str = dupprintf("%s Error", appname);
sprintf(msg, "Unable to open connection to\n"
if (error) {
char *str = dupprintf("%s Error", appname);
sprintf(msg, "Unable to open connection to\n"
- "%.800s\n" "%s", cfg
.host
, error);
+ "%.800s\n" "%s", cfg
_dest(&cfg)
, error);
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
sfree(str);
exit(0);
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
sfree(str);
exit(0);
@@
-409,7
+409,7
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
i--;
p[i] = '\0';
do_defaults(p + 1, &cfg);
i--;
p[i] = '\0';
do_defaults(p + 1, &cfg);
- if (!
*cfg.host
&& !do_config()) {
+ if (!
cfg_launchable(&cfg)
&& !do_config()) {
cleanup_exit(0);
}
} else if (*p == '&') {
cleanup_exit(0);
}
} else if (*p == '&') {
@@
-554,7
+554,7
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
cmdline_run_saved(&cfg);
cmdline_run_saved(&cfg);
- if (!
*cfg.host
&& !do_config()) {
+ if (!
cfg_launchable(&cfg)
&& !do_config()) {
cleanup_exit(0);
}
cleanup_exit(0);
}
@@
-836,9
+836,7
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
sfree(handles);
sfree(handles);
- if (GetMessage(&msg, NULL, 0, 0) != 1)
- break;
- do {
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (msg.message == WM_QUIT)
goto finished; /* two-level break */
if (msg.message == WM_QUIT)
goto finished; /* two-level break */
@@
-852,7
+850,7
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
*/
if (must_close_session)
close_session();
*/
if (must_close_session)
close_session();
- }
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
+ }
/* The messages seem unreliable; especially if we're being tricky */
term_set_focus(term, GetForegroundWindow() == hwnd);
/* The messages seem unreliable; especially if we're being tricky */
term_set_focus(term, GetForegroundWindow() == hwnd);
@@
-1966,11
+1964,11
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
sa.nLength = sizeof(sa);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
sa.nLength = sizeof(sa);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
- filemap = CreateFileMapping(
(HANDLE) 0xFFFFFFFF
,
+ filemap = CreateFileMapping(
INVALID_HANDLE_VALUE
,
&sa,
PAGE_READWRITE,
0, sizeof(Config), NULL);
&sa,
PAGE_READWRITE,
0, sizeof(Config), NULL);
- if (filemap) {
+ if (filemap
&& filemap != INVALID_HANDLE_VALUE
) {
p = (Config *) MapViewOfFile(filemap,
FILE_MAP_WRITE,
0, 0, sizeof(Config));
p = (Config *) MapViewOfFile(filemap,
FILE_MAP_WRITE,
0, 0, sizeof(Config));