This seems like such a simple issue but I cannot find an elegant solution. I've traced my driver down to a call to MmUnmapIoSpace, which produces a BugCheck 0xC2 {7,,,} message.

Is there a way to test if a particular area is mapped within a windows driver before calling MmUnmapIoSpace? I've checked if the pointer is NULL but it doesn't seem to be working.

I don't seem to see any documented/undocumented functions to test whether or not a call to MmUnmapIoSpace will produce a 0xC2 bugcheck.

Any fool-proof way to test this without holding a bunch of booleans or the like?

有帮助吗?

解决方案

No, there is no function to check. Instead, I just wrapped the pointer in a struct which held a boolean that indicated if it had already been mapped.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top