簡體   English   中英

如何使用 DPMI 將 memory 分配到特定的虛擬地址?

[英]How to allocate memory to a specific virtual address with DPMI?

我想用 DPMI 將 memory 分配給特定的虛擬地址,並像這樣清除它:

mov edi, 0x400000  ; Base address.
mov ecx, 0x2000    ; Number of bytes to allocate.
???
cld
mov al, 0
rep stosb  ; Clear the allocated memory.

我該怎么做,即我應該寫什么??? 部分?

看起來這在 DPMI 中沒有 API 。

僅供參考 Windows 3.11 與 Win32s 也無法將 PE.exe 文件加載到任意基地址。 (It requires the PE.exe file to have relocations.) If there was a DPMI API for memory allocation an arbitrary virtual address, then probably Windows 3.11 with Win32s would use a similar API in Windows 3.11 386 enhanced mode to load PE.exe files到任意基地址。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM