* @brief Implementation of ed function (Physical Memory) * * @param Address * @param Value * @param HasError * @return BOOLEAN */
| 204 | * @return BOOLEAN |
| 205 | */ |
| 206 | BOOLEAN |
| 207 | ScriptEngineFunctionEdPa(UINT64 Address, DWORD Value, BOOL * HasError) |
| 208 | { |
| 209 | UNREFERENCED_PARAMETER(HasError); |
| 210 | |
| 211 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 212 | |
| 213 | if (!CheckAddressPhysical(Address)) |
| 214 | { |
| 215 | // |
| 216 | // Instead of indicating an error, just return false |
| 217 | // to assign it as a return result to a variable |
| 218 | // |
| 219 | // *HasError = TRUE; |
| 220 | |
| 221 | return FALSE; |
| 222 | } |
| 223 | |
| 224 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 225 | |
| 226 | #ifdef SCRIPT_ENGINE_USER_MODE |
| 227 | |
| 228 | ShowMessages("err, using physical address functions (ed_pa) is not possible in user-mode\n"); |
| 229 | return FALSE; |
| 230 | |
| 231 | #endif // SCRIPT_ENGINE_USER_MODE |
| 232 | |
| 233 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 234 | MemoryMapperWriteMemorySafeByPhysicalAddress(Address, (UINT64)&Value, sizeof(DWORD)); |
| 235 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 236 | |
| 237 | return TRUE; |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * @brief Implementation of eb function (Physical Memory) |
no test coverage detected