JuliaLang/libuv — pull request #6 by stevengj (2013-03-02 01:11:24+00:00)
Title: make uv_dlopen(NULL, ...) work on Windows (like Unix)

On Unix, dlopen(NULL, ...) returns a handle to the symbols of the main program. To make the same thing work for Windows, you need to call [GetModuleHandle](http://msdn.microsoft.com/en-us/library/windows/desktop/ms683199%28v=vs.85%29.aspx) instead of [LoadLibraryEx](http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179%28v=vs.85%29.aspx) in this case. That is what the attached patch does.

(Context: in my PyCall module for Julia, we use `dlopen` to open the libpython library. But we want to use this from IPython where the Python process is already running, and in order to use the identical PyCall code we need to `dlopen(NULL)` to look up symbols in the main program.)