]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commit
Added a function called from DriverEntry where... 8.2.1
authorEric Mackay <mackayem@amazon.com>
Mon, 17 Jul 2017 10:31:39 +0000 (11:31 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 17 Jul 2017 10:32:22 +0000 (11:32 +0100)
commit153a308b497e992a8c61ee6a4dec739a6b5b65ea
tree0747c53ae2d44f358a97b4371dbcdcc3bcada172
parentc2db574381266b4476ff38f3517655e1eacabb9c
Added a function called from DriverEntry where...

we can safely read registry keys and convert strings at PASSIVE_LEVEL

The MSDN documentation for various registry key access and string
conversion functions requires the caller to be at PASSIVE_LEVEL.
One of the reasons for this is that the string conversion tables used by
functions such as RtlAnsiStringToUnicodeString are stored in paged pool
memory. Both the page fault handler and the process scheduler run at
DISPATCH_LEVEL, therefore you must not touch memory at DISPATCH_LEVEL that
could be paged out. A process running at DISPATCH_LEVEL cannot be
preempted for the page fault handler to run.

To aid Static Driver Verifier code analysis and inform developers, I have
added SAL annotations that indicate PASSIVE_LEVEL is required on certain
registry access functions.

Signed-off-by: Eric Mackay <mackayem@amazon.com>
Re-based onto master and adjusted for style. Note this involved fixing
whitespace issues in frontend.c.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Backported to staging-8.2

Signed-off-by: Owen Smth <owen.smith@citrix.com>
src/xenvbd/driver.c
src/xenvbd/driver.h
src/xenvbd/frontend.c
src/xenvbd/registry.c
src/xenvbd/registry.h