* @brief Implementation of eb function (Physical Memory) * * @param Address * @param Value * @param HasError * @return BOOLEAN */
| 246 | * @return BOOLEAN |
| 247 | */ |
| 248 | BOOLEAN |
| 249 | ScriptEngineFunctionEbPa(UINT64 Address, BYTE Value, BOOL * HasError) |
| 250 | { |
| 251 | UNREFERENCED_PARAMETER(HasError); |
| 252 | |
| 253 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 254 | |
| 255 | if (!CheckAddressPhysical(Address)) |
| 256 | { |
| 257 | // |
| 258 | // Instead of indicating an error, just return false |
| 259 | // to assign it as a return result to a variable |
| 260 | // |
| 261 | // *HasError = TRUE; |
| 262 | |
| 263 | return FALSE; |
| 264 | } |
| 265 | |
| 266 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 267 | |
| 268 | #ifdef SCRIPT_ENGINE_USER_MODE |
| 269 | |
| 270 | ShowMessages("err, using physical address functions (eb_pa) is not possible in user-mode\n"); |
| 271 | return FALSE; |
| 272 | |
| 273 | #endif // SCRIPT_ENGINE_USER_MODE |
| 274 | |
| 275 | #ifdef SCRIPT_ENGINE_KERNEL_MODE |
| 276 | MemoryMapperWriteMemorySafeByPhysicalAddress(Address, (UINT64)&Value, sizeof(BYTE)); |
| 277 | #endif // SCRIPT_ENGINE_KERNEL_MODE |
| 278 | |
| 279 | return TRUE; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * @brief Check whether the address is valid or not |
no test coverage detected