Commit 64012fdb by Patrick Pokatilo

Replace LoadLibrary with GetModuleHandle, since kernel32 is loaded by default

As requested
parent a49e5bed
...@@ -173,10 +173,10 @@ int p_readlink(const char *link, char *target, size_t target_len) ...@@ -173,10 +173,10 @@ int p_readlink(const char *link, char *target, size_t target_len)
* it is not available in platforms older than Vista * it is not available in platforms older than Vista
*/ */
if (pGetFinalPath == NULL) { if (pGetFinalPath == NULL) {
HINSTANCE library = LoadLibrary("kernel32"); HMODULE module = GetModuleHandle("kernel32");
if (library != NULL) if (module != NULL)
pGetFinalPath = (fpath_func)GetProcAddress(library, "GetFinalPathNameByHandleW"); pGetFinalPath = (fpath_func)GetProcAddress(module, "GetFinalPathNameByHandleW");
if (pGetFinalPath == NULL) { if (pGetFinalPath == NULL) {
giterr_set(GITERR_OS, giterr_set(GITERR_OS,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment