Git Product home page Git Product logo

vcrtl's Introduction

C++ Exceptions in Windows Drivers

This project implements parts of the Visual Studio runtime library that are needed for C++ exception handling. Currently, x86 and x64 platforms are supported.

Getting started

To use exceptions in your kernel-mode driver, first

C++ exceptions will magically work.

Features

The exception handling code was optimized to significantly reduce the required stack space. On x86, the stack usage is negligible, on x64, approximately 300 bytes are used during handler search, these are, however, reclaimed before the catch handler is called.

No dynamic allocations or thread-local storage is used, everything happens on the stack.

On x64, both FH3 and FH4 C++ exception ABI is supported. FH4 is much better than FH3, prefer it.

No string comparisons are done during exception dispatch.

Limitations

An exception must not leave the module in which it was thrown, otherwise the dispatcher will bug-check.

No SEH exception may pass through frames in which you do C++ exception handling (this includes functions with try/catch blocks or functions marked as noexcept, or functions with automatic variables with non-trivial destructors). This will be detected and you'll get a bug-check.

TODO

Although /GS is supported, the frame cookies aren't checked yet.

vcrtl's People

Contributors

avakar avatar killvxk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.