Changeset 105155 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 5, 2024 2:44:07 AM (8 months ago)
- svn:sync-xref-src-repo-rev:
- 163791
- Location:
- trunk/src/VBox/Runtime/r3/win
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/nocrt-startup-common-win.cpp
r98103 r105155 148 148 else 149 149 { 150 # if 1 /* This dynamic stupidity is because of stupid AV heuristics. */ 151 static decltype(NtProtectVirtualMemory) *s_pfnNtProtectVirtualMemory = NULL; 152 if (!s_pfnNtProtectVirtualMemory) 153 s_pfnNtProtectVirtualMemory 154 = (decltype(NtProtectVirtualMemory) *)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), 155 "NtProtectVirtualMemory"); 156 if (!s_pfnNtProtectVirtualMemory) 157 { 158 RT_BREAKPOINT(); 159 continue; 160 } 161 # else 162 # define s_pfnNtProtectVirtualMemory NtProtectVirtualMemory 163 # endif 164 150 165 /* The section is not writable, so temporarily make it writable. */ 151 166 PVOID pvAligned = pbToZero - ((uintptr_t)pbToZero & PAGE_OFFSET_MASK); … … 154 169 ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; 155 170 ULONG fOldProt = fNewProt; 156 NTSTATUS rcNt = NtProtectVirtualMemory(NtCurrentProcess(), &pvAligned, &cbAligned, fNewProt, &fOldProt);171 NTSTATUS rcNt = s_pfnNtProtectVirtualMemory(NtCurrentProcess(), &pvAligned, &cbAligned, fNewProt, &fOldProt); 157 172 if (NT_SUCCESS(rcNt)) 158 173 { 159 174 memset(pbToZero, 0, cbToZero); 160 175 161 rcNt = NtProtectVirtualMemory(NtCurrentProcess(), &pvAligned, &cbAligned, fOldProt, &fNewProt);176 rcNt = s_pfnNtProtectVirtualMemory(NtCurrentProcess(), &pvAligned, &cbAligned, fOldProt, &fNewProt); 162 177 } 163 178 else -
trunk/src/VBox/Runtime/r3/win/nocrt-startup-exe-win.cpp
r98103 r105155 82 82 */ 83 83 for (;;) 84 #if 1 /* Using NtTerminateProcess triggers heuristics in some annoying AV scanner. */ 85 TerminateProcess(NtCurrentProcess(), rcExit); 86 #else 84 87 NtTerminateProcess(NtCurrentProcess(), rcExit); 88 #endif 85 89 } 86 90
Note:
See TracChangeset
for help on using the changeset viewer.