Changeset 773 in dev for trunk/ab5.0/abdev/ab_common/src/Environment.cpp
- Timestamp:
- Jan 15, 2011, 6:04:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Environment.cpp
r763 r773 35 35 } 36 36 throw; 37 }38 39 BOOL EnableLFH(HANDLE hHeap)40 {41 ULONG enableLFH = 2;42 return HeapSetInformation(hHeap, HeapCompatibilityInformation, &enableLFH, sizeof enableLFH);43 37 } 44 38 … … 84 78 return E_NOTIMPL; 85 79 } 80 81 BOOL ActiveBasic::Common::EnableNX() 82 { 83 typedef BOOL (WINAPI* PFNSETDEP)(DWORD); 84 85 HMODULE hmodKernel = GetModuleHandle(TEXT("KERNEL32.DLL")); 86 if (PFNSETDEP pfnSetDEP = reinterpret_cast<PFNSETDEP>(GetProcAddress(hmodKernel, "SetProcessDEPPolicy"))) 87 { 88 return pfnSetDEP(PROCESS_DEP_ENABLE); 89 } 90 else 91 { 92 return FALSE; 93 } 94 } 95 96 void ActiveBasic::Common::SetHeapOptions() 97 { 98 // SetDllDirectory(_T("")); 99 HMODULE hmodKernel = GetModuleHandle(TEXT("KERNEL32.DLL")); 100 101 typedef BOOL (WINAPI* HSI)(HANDLE, HEAP_INFORMATION_CLASS ,PVOID, SIZE_T); 102 HSI pHsi = reinterpret_cast<HSI>(GetProcAddress(hmodKernel, "HeapSetInformation")); 103 if (!pHsi) 104 { 105 return; 106 } 107 108 ULONG enableLFH = 2; 109 pHsi(GetProcessHeap(), HeapCompatibilityInformation, &enableLFH, sizeof enableLFH); 110 111 #ifndef HeapEnableTerminationOnCorruption 112 # define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1 113 #endif 114 115 pHsi(NULL, HeapEnableTerminationOnCorruption, NULL, 0); 116 }
Note:
See TracChangeset
for help on using the changeset viewer.