~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to dll.cpp

  • Committer: weidai
  • Date: 2010-06-18 01:52:34 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:485
avoid SecBlock of arrays

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
                }
97
97
        }
98
98
 
 
99
        // try getting these directly using mangled names of new and delete operators
 
100
 
99
101
        hModule = GetModuleHandle("msvcrtd");
100
102
        if (!hModule)
101
103
                hModule = GetModuleHandle("msvcrt");
102
104
        if (hModule)
103
105
        {
104
 
                s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z");         // operator new
105
 
                s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z");   // operator delete
106
 
                return;
 
106
                // 32-bit versions
 
107
                s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z");
 
108
                s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z");
 
109
                if (s_pNew && s_pDelete)
 
110
                        return;
 
111
 
 
112
                // 64-bit versions
 
113
                s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPEAX_K@Z");
 
114
                s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPEAX@Z");
 
115
                if (s_pNew && s_pDelete)
 
116
                        return;
107
117
        }
108
118
 
109
119
        OutputDebugString("Crypto++ was not able to obtain new and delete function pointers.\n");