diff options
author | Hans Breuer <hans@breuer.org> | 2008-06-13 08:36:26 +0000 |
---|---|---|
committer | Hans Breuer <hans@src.gnome.org> | 2008-06-13 08:36:26 +0000 |
commit | 8677ed959d6c91f278151133106dc192a0662d54 (patch) | |
tree | df61d8ba076483dd8edc364042b490073c67df50 /gdk/win32 | |
parent | e0c1ab3f39aff64d3b00a66263a8592243ea4076 (diff) | |
download | gtk+-8677ed959d6c91f278151133106dc192a0662d54.tar.gz |
check surface status after ceating a pdf. Avoids crashing when the target
2008-05-23 Hans Breuer <hans@breuer.org>
* gtk/gtkprintoperation.c : check surface status after ceating a pdf.
Avoids crashing when the target can not be written, bug #537685
* gdk/win32/gdkdisplay-win32.c : runtime linking of ProcessIdToSessionId
* gtk/gtkfilesystem.c : variadic macros are not supported with c89 and
it was not needed here anyway.
svn path=/trunk/; revision=20370
Diffstat (limited to 'gdk/win32')
-rw-r--r-- | gdk/win32/gdkdisplay-win32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 43dcb74575..1874c608e9 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -241,6 +241,8 @@ gdk_display_get_name (GdkDisplay *display) DWORD session_id; char *display_name; static const char *display_name_cache = NULL; + typedef BOOL (* PFN_ProcessIdToSessionId) (DWORD, DWORD *); + PFN_ProcessIdToSessionId processIdToSessionId; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); @@ -275,7 +277,8 @@ gdk_display_get_name (GdkDisplay *display) window_station_name = "WinSta0"; } - if (!ProcessIdToSessionId (GetCurrentProcessId (), &session_id)) + processIdToSessionId = (PFN_ProcessIdToSessionId) GetProcAddress (GetModuleHandle ("kernel32.dll"), "ProcessIdToSessionId"); + if (!processIdToSessionId || !processIdToSessionId (GetCurrentProcessId (), &session_id)) session_id = 0; display_name = g_strdup_printf ("%ld\\%s\\%s", |