diff options
Diffstat (limited to 'src/VBox/Runtime/r3/win/symlink-win.cpp')
-rw-r--r-- | src/VBox/Runtime/r3/win/symlink-win.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/VBox/Runtime/r3/win/symlink-win.cpp b/src/VBox/Runtime/r3/win/symlink-win.cpp index 30332539..52f5c410 100644 --- a/src/VBox/Runtime/r3/win/symlink-win.cpp +++ b/src/VBox/Runtime/r3/win/symlink-win.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2010 Oracle Corporation + * Copyright (C) 2010-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -29,8 +29,10 @@ * Header Files * *******************************************************************************/ #define LOG_GROUP RTLOGGROUP_SYMLINK +#include <Windows.h> #include <iprt/symlink.h> +#include "internal-r3-win.h" #include <iprt/assert.h> #include <iprt/err.h> @@ -40,7 +42,6 @@ #include <iprt/string.h> #include "internal/path.h" -#include <Windows.h> /******************************************************************************* @@ -133,13 +134,9 @@ RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYM static bool s_fTried = FALSE; if (!s_fTried) { - HMODULE hmod = LoadLibrary("KERNEL32.DLL"); - if (hmod) - { - PFNCREATESYMBOLICLINKW pfn = (PFNCREATESYMBOLICLINKW)GetProcAddress(hmod, "CreateSymbolicLinkW"); - if (pfn) - s_pfnCreateSymbolicLinkW = pfn; - } + PFNCREATESYMBOLICLINKW pfn = (PFNCREATESYMBOLICLINKW)GetProcAddress(g_hModKernel32, "CreateSymbolicLinkW"); + if (pfn) + s_pfnCreateSymbolicLinkW = pfn; s_fTried = true; } if (!s_pfnCreateSymbolicLinkW) |