Help! Floating Point Calculation inside Kernel Mode.

Discussion in 'Windows Vista Drivers' started by aze2cool, May 4, 2006.

  1. aze2cool

    aze2cool Guest

    Hello there,

    I know it is not good and dangerous to use floating point arithmetics inside
    kernel mode. Under tight schedule, I have no choice to port my algorithm
    (that written mainly in floating point arithmetics on several functions) into
    kernel mode without much modification of the code. I found that the result
    came out from kernel mode is not same as the result came out from the user
    mode. I have used these nested functions, KeSaveFloatingPointState and
    KeRestoreFloatingPointState, but with no help at all. To use these functions,
    am I supposing to nest anywhere that is using floating point arithmetics?
    Says you have a function A that will call function B and C, functions B and
    C all have floating point arithmetics. For this case, am I just put functions
    B and C between KeSaveFloatingPointState and KeRestoreFloatingPointState or I
    have to do same thing for function B and C too?

    Is there any way that I can use floating point arithmetics safely for device

    Many thanks in advanced.
    aze2cool, May 4, 2006
    1. Advertisements

  2. Says you have a function A that will call function B and C, functions B and
    Maxim S. Shatskih, May 4, 2006
    1. Advertisements

  3. aze2cool

    aze2cool Guest

    Thank for reply.

    I just nested the function which will call "functions" with floating piont
    arithmetics. Too bad, it gave very strange/unexpected results! Any clue?

    Is this possible to move this process running at user mode as service to
    serve the device driver? And how am I going to do acheive that?

    Thanks again!
    aze2cool, May 5, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.