summaryrefslogtreecommitdiffstats
path: root/Source/bindexplib.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2015-06-19 20:12:43 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 15:11:01 (GMT)
commit8ea69dfef1e81a9811fe8a3d7198580dd21cb48f (patch)
treea95ecffd5be71b03d50c84dc175700efdabd07d2 /Source/bindexplib.cxx
parent2963cb2a559fd27edd53b7fb7036cba0adc8b9ca (diff)
downloadCMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.zip
CMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.tar.gz
CMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.tar.bz2
bindexplib: Build source as part of CMakeLib
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r--Source/bindexplib.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 8328213..f14d301 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -71,10 +71,12 @@
*----------------------------------------------------------------------
*/
+#include <cmsys/Encoding.hxx>
#include <windows.h>
#include <stdio.h>
#include <string>
#include <fstream>
+#include <iostream>
/*
+ * Utility func, strstr with size
@@ -89,7 +91,7 @@ const char* StrNStr(const char* start, const char* find, size_t &size) {
}
len = strlen(find);
- while (hint = (const char*) memchr(start, find[0], size-len+1)) {
+ while ((hint = (const char*) memchr(start, find[0], size-len+1))) {
size -= (hint - start);
if (!strncmp(hint, find, len))
return hint;
@@ -169,7 +171,7 @@ HaveExportedObjects(PIMAGE_FILE_HEADER pImageFileHeader,
void
DumpExternalsObjects(PIMAGE_SYMBOL pSymbolTable,
PIMAGE_SECTION_HEADER pSectionHeaders,
- FILE *fout, unsigned cSymbols)
+ FILE *fout, DWORD_PTR cSymbols)
{
unsigned i;
PSTR stringTable;
@@ -295,14 +297,15 @@ DumpObjFile(PIMAGE_FILE_HEADER pImageFileHeader, FILE *fout)
*----------------------------------------------------------------------
*/
void
-DumpFile(LPSTR filename, FILE *fout)
+DumpFile(const char* filename, FILE *fout)
{
HANDLE hFile;
HANDLE hFileMapping;
LPVOID lpFileBase;
PIMAGE_DOS_HEADER dosHeader;
- hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+ hFile = CreateFileW(cmsys::Encoding::ToWide(filename).c_str(),
+ GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hFile == INVALID_HANDLE_VALUE) {