From d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 12 Jul 2005 04:23:32 +0000 Subject: port to MSVC .NET 2005 beta 2 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- fipstest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fipstest.cpp') diff --git a/fipstest.cpp b/fipstest.cpp index a9245c8..e5f0859 100644 --- a/fipstest.cpp +++ b/fipstest.cpp @@ -19,7 +19,7 @@ unsigned long g_macFileLocation = 0; const byte * CRYPTOPP_API GetActualMacAndLocation(unsigned int &macSize, unsigned int &fileLocation) { - macSize = g_actualMac.size(); + macSize = (unsigned int)g_actualMac.size(); fileLocation = g_macFileLocation; return g_actualMac; } @@ -261,7 +261,7 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule IMAGE_NT_HEADERS *phnt = (IMAGE_NT_HEADERS *)((byte *)h + ph->e_lfanew); IMAGE_SECTION_HEADER *phs = IMAGE_FIRST_SECTION(phnt); DWORD nSections = phnt->FileHeader.NumberOfSections; - DWORD currentFilePos = 0; + size_t currentFilePos = 0; while (nSections--) { @@ -274,13 +274,13 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule unsigned int sectionSize = STDMIN(phs->SizeOfRawData, phs->Misc.VirtualSize); const byte *sectionMemStart = memBase + phs->VirtualAddress; unsigned int sectionFileStart = phs->PointerToRawData; - unsigned int subSectionStart = 0, nextSubSectionStart; + size_t subSectionStart = 0, nextSubSectionStart; do { const byte *subSectionMemStart = sectionMemStart + subSectionStart; - unsigned int subSectionFileStart = sectionFileStart + subSectionStart; - unsigned int subSectionSize = sectionSize - subSectionStart; + size_t subSectionFileStart = sectionFileStart + subSectionStart; + size_t subSectionSize = sectionSize - subSectionStart; nextSubSectionStart = 0; unsigned int entriesToReadFromDisk[] = {IMAGE_DIRECTORY_ENTRY_IMPORT, IMAGE_DIRECTORY_ENTRY_IAT}; @@ -301,7 +301,7 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule // skip over the MAC verifier.Put(subSectionMemStart, expectedModuleMac - subSectionMemStart); verifier.Put(expectedModuleMac + macSize, subSectionSize - macSize - (expectedModuleMac - subSectionMemStart)); - macFileLocation = subSectionFileStart + (expectedModuleMac - subSectionMemStart); + macFileLocation = (unsigned long)(subSectionFileStart + (expectedModuleMac - subSectionMemStart)); } else verifier.Put(subSectionMemStart, subSectionSize); -- cgit v1.2.1