Bug 556415 - Crash on Windows 2000 in g_winhttp_vfs_init()

2008-11-12  Tor Lillqvist  <tml@novell.com>

	Bug 556415 - Crash on Windows 2000 in g_winhttp_vfs_init()

	* win32/gwinhttpvfs.h: Move the set of function pointers to
	winhttp.dll into a separate struct GWinHttpDllFuncs. Just have a
	pointer to that in the GWinHttpVfsClass.
	
	* win32/gwinhttpvfs.c: Move the lookup of functions from
	winhttp.dll into a function of its own, that stores the pointers
	in a separate GWinHttpDllFuncs variable. Add two bookeeping
	booleans lookup_done and funcs_found.

	Don't call g_io_extension_point_implement() to register the
	winhttp extension unless winhttp.dll has been successfully loaded
	and the required functions found in it.

	* win32/gwinhttp*.c: Adjust calls of the functions looked up from
	winhttp.dll correspondingly.


svn path=/trunk/; revision=7648
This commit is contained in:
Tor Lillqvist
2008-11-12 17:52:39 +00:00
committed by Tor Lillqvist
parent d442b59022
commit 2f575b95ac
6 changed files with 123 additions and 60 deletions

View File

@@ -65,9 +65,9 @@ g_winhttp_file_input_stream_finalize (GObject *object)
winhttp_stream = G_WINHTTP_FILE_INPUT_STREAM (object);
if (winhttp_stream->request != NULL)
G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpCloseHandle (winhttp_stream->request);
G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->funcs->pWinHttpCloseHandle (winhttp_stream->request);
if (winhttp_stream->connection != NULL)
G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpCloseHandle (winhttp_stream->connection);
G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->funcs->pWinHttpCloseHandle (winhttp_stream->connection);
G_OBJECT_CLASS (g_winhttp_file_input_stream_parent_class)->finalize (object);
}
@@ -125,7 +125,7 @@ g_winhttp_file_input_stream_read (GInputStream *stream,
if (!winhttp_stream->request_sent)
{
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpSendRequest
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->funcs->pWinHttpSendRequest
(winhttp_stream->request,
NULL, 0,
NULL, 0,
@@ -146,7 +146,7 @@ g_winhttp_file_input_stream_read (GInputStream *stream,
winhttp_stream->request_sent = TRUE;
}
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpReadData
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->funcs->pWinHttpReadData
(winhttp_stream->request, buffer, count, &bytes_read))
{
_g_winhttp_set_error (error, GetLastError (), "GET request");