diff --git a/Contrib/Library/LibraryLocal/LibraryLocal.cpp b/Contrib/Library/LibraryLocal/LibraryLocal.cpp index 9a29c37c..aba75ba1 100644 --- a/Contrib/Library/LibraryLocal/LibraryLocal.cpp +++ b/Contrib/Library/LibraryLocal/LibraryLocal.cpp @@ -6,12 +6,15 @@ */ -#include +#include "../../../Source/Platform.h" + #include #include #include +#include #include "../../../Source/ResourceEditor.h" +#include "../../../Source/ResourceVersionInfo.h" #include "../../../Source/winchar.h" using namespace std; @@ -141,8 +144,8 @@ int main(int argc, char* argv[]) mode = argv[1]; filename = argv[2]; - char buf[MAX_PATH]; - GetCurrentDirectory(MAX_PATH, buf); + char buf[1024]; + getcwd(buf, 1024); filepath = buf; if ((filename.substr(0, 1).compare("\\") != 0) && (filename.substr(1, 1).compare(":") != 0)) { @@ -184,14 +187,15 @@ int main(int argc, char* argv[]) // Validate filename - WIN32_FIND_DATA wfd; - HANDLE hFind = FindFirstFile(filepath.c_str(), &wfd); + ifstream fs(filepath.c_str()); - if (hFind != INVALID_HANDLE_VALUE) + if (fs.is_open()) { filefound = 1; - FindClose(hFind); + fs.close(); } + + // Work int versionfound = 0; DWORD low = 0, high = 0; diff --git a/Source/Platform.h b/Source/Platform.h index c0f98a01..b99f5451 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -550,6 +550,10 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; # define HKEY_DYN_DATA ((HKEY)0x80000006) #endif +#ifndef KEY_WOW64_64KEY +# define KEY_WOW64_64KEY 0x100 +#endif + // show modes #ifndef SW_SHOWNORMAL