[Webkit-unassigned] [Bug 51616] [Windows] WebkitGTK+ can't find webinspector and error page redirection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 10 13:59:25 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51616





--- Comment #1 from Bakhtiar Hasmanan <mr.tiar at gmail.com>  2011-01-10 13:59:25 PST ---
I found this trick http://stackoverflow.com/questions/2396328/get-hmodule-from-inside-a-dll and I use it like this (in FrameLoaderClientGtk.cpp):

....
#ifdef _WIN32
#  include <shlobj.h>
#  include <assert.h>

static HMODULE GetThisDllHandle()
{
  MEMORY_BASIC_INFORMATION info;
  size_t len = VirtualQueryEx(GetCurrentProcess(), (void*)GetThisDllHandle, &info, sizeof(info));
  assert(len == sizeof(info));
  return len ? (HMODULE)info.AllocationBase : NULL;
}

const gchar *
get_webkit_datadir(void)
{
    gchar *retval;
    retval = g_build_filename (g_win32_get_package_installation_directory_of_module (GetThisDllHandle()), "/share", NULL);
    return retval;
}

#undef DATA_DIR
#define DATA_DIR get_webkit_datadir ()
#endif

....

So far in Win32 it return the correct path, and it doesn't have "initialize once" limitation as DllMain()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list