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
This commit is contained in:
Hans Breuer
2008-06-13 08:36:26 +00:00
committed by Hans Breuer
parent e0c1ab3f39
commit 8677ed959d
4 changed files with 27 additions and 3 deletions

View File

@ -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",