From 488b0125d3cf1dfa6aae26dadbdb93f62cd9cc73 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 29 Oct 2015 18:23:24 +0100 Subject: [PATCH] Use platform independent version of GetProcAddress On Windows CE GetProcAddress takes its parameter as a wide-char string. Unfortunately no such equivalent (e.g. GetProcAddressW) exists on regular Windows. Thus the use of the wrapper from winapi. --- src/operations.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/operations.cpp b/src/operations.cpp index f34b0761..ab2afaf0 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -101,6 +101,7 @@ using std::wstring; // See MinGW's windef.h # define WINVER 0x501 # endif +# include # include # include # include @@ -686,8 +687,8 @@ namespace ); PtrCreateHardLinkW create_hard_link_api = PtrCreateHardLinkW( - ::GetProcAddress( - ::GetModuleHandle(TEXT("kernel32.dll")), "CreateHardLinkW")); + boost::detail::winapi::get_proc_address( + boost::detail::winapi::GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW")); typedef BOOLEAN (WINAPI *PtrCreateSymbolicLinkW)( /*__in*/ LPCWSTR lpSymlinkFileName, @@ -696,8 +697,8 @@ namespace ); PtrCreateSymbolicLinkW create_symbolic_link_api = PtrCreateSymbolicLinkW( - ::GetProcAddress( - ::GetModuleHandle(TEXT("kernel32.dll")), "CreateSymbolicLinkW")); + boost::detail::winapi::get_proc_address( + boost::detail::winapi::GetModuleHandleW(L"kernel32.dll"), "CreateSymbolicLinkW")); #endif