Prevent access violation when running on newer OS versions.
Prevent access violation when running on newer OS versions.

git-svn-id: d0012d95395fdfd88d17aa6805032f35142cef86@38366 ddf9c79f-3887-47c2-86f8-040505c24a32

andycb/PiSharp