mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 17:46:09 +00:00
Replace LoadLibrary with GetModuleHandle, since kernel32 is loaded by default
As requested
This commit is contained in:
parent
a49e5bed8d
commit
64012fdbe6
@ -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
|
||||
*/
|
||||
if (pGetFinalPath == NULL) {
|
||||
HINSTANCE library = LoadLibrary("kernel32");
|
||||
HMODULE module = GetModuleHandle("kernel32");
|
||||
|
||||
if (library != NULL)
|
||||
pGetFinalPath = (fpath_func)GetProcAddress(library, "GetFinalPathNameByHandleW");
|
||||
if (module != NULL)
|
||||
pGetFinalPath = (fpath_func)GetProcAddress(module, "GetFinalPathNameByHandleW");
|
||||
|
||||
if (pGetFinalPath == NULL) {
|
||||
giterr_set(GITERR_OS,
|
||||
|
Loading…
Reference in New Issue
Block a user