Programming 版 (精华区)
发信人: zpw (zhao), 信区: Programming
标 题: FAQ FOR VXD(十四)
发信站: 紫 丁 香 (Tue Jul 28 14:22:55 1998), 转信
ow do I share memory between a Win32 application and a VxD?
Under Windows 95, VxDs and Win32 applications share the same linear address
space. Therefore, you can allocate memory in a VxD and pass the linear
address to a Win32 application directly. The address space of an
application includes both private and shared regions. If a VxD needs to
access memory allocated in a Win32 application, the memory must be in a
shared (global) region, or the VxD must be running in thread context from
which the memory was originally allocated. Use the Schedule_Thread_Event
service to change contexts if necessary.
If a VxD needs to access application memory at interrupt time, the memory
must be page locked. There are no Win32 services for page locking memory,
but the VxD may lock the pages. Use the VMM service _LinPageLock, setting
the last parameter (flags) to PAGEMAPGLOBAL. The service returns an address
for the specified page that may is usable from any memory context. Use
_LinPageUnLock to unlock the memory.
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: yaoyu.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.231毫秒