Re: Using math.h in driver



Answer the first question, why are trying to use floating point in the
kernel at all? Yes you can do it if you are careful to call
KeSaveFloatingPointState and KeRestoreFloatingPointState at the right
places, but there is rarely a good reason to use a floating point value. So
what are you doing that requires this?


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Kee Seng" <wakeup@xxxxxxxxxxxxxxxx> wrote in message
news:OY%23hQj4GGHA.1088@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Thanks for the reply. Since the ceil() function is not defined, is it
> possible to define something similar? I'm thinking of using a float to
> long conversion to do it. I remember seeing something about how to set the
> conversion mode that is employed by the system, but cannot really recall
> now. Anyone can help? Or anyone got any other suggestion on how to emulate
> a ceil() function in kernel?
>
> Thanks
>
> KS
>
> "Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
> news:OzJEJM4GGHA.2940@xxxxxxxxxxxxxxxxxxxxxxx
>> First you are trying to use floating point in a driver, this is possible
>> but rarely a great idea. Second, this function is not defined for the
>> kernel, so you cannot use it.
>>
>> Be aware that a number of the include files in the DDK are there for
>> building user space programs only, not for the drivers.
>>
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Remove StopSpam from the email to reply
>>
>>
>>
>> "Kee Seng" <wakeup@xxxxxxxxxxxxxxxx> wrote in message
>> news:e$e%23dJ4GGHA.2940@xxxxxxxxxxxxxxxxxxxxxxx
>>> Hi,
>>>
>>> I was trying to use the ceil() function defined in <Math.h> in my
>>> driver, and when I compile using DDK 3790.1830, I'm getting an error
>>> which says
>>> error LNK2019: unresolved external symbol __imp__ceil referenced in
>>> function _xxxxxxxxx
>>>
>>> Is there any LIB file or #defines that I need to include before I can
>>> use the ceil() function?
>>>
>>> Thanks
>>>
>>> KS
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Help to evaluate the system crash resistance method
    ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... > them if not all, it is a standard kernel exception handling mechnism, the ... Neither of these is a small task such as tweaking an IDT ... >> Don Burn (MVP, Windows DDK) ...
    (microsoft.public.windowsxp.device_driver.dev)
  • Re: filter driver for disk.sys
    ... The utility works to perfection on other OS such as 98,2k & XP, but when it is run on the Vista OS it donot wipes. ... The outcome was the development of a kernel mode driver. ... Don Burn (MVP, Windows DDK) ...
    (microsoft.public.development.device.drivers)
  • Re: Writing device drivers in Delphi.
    ... doesn't really have much meaning in a driver. ... - floating point stuff: fine if wrapped appropriately. ... because it just doesn't fit in the kernel model ... microsoft stack. ...
    (borland.public.delphi.non-technical)
  • Re: Marvell Yukon 88E8036 not recognized on Fedora Core 4
    ... floating around but I have not found a solution that ... that is the same network adapter my brother has on his laptop. ... He had to download the driver from syskonnect/marvell and he has to recompile it every time he updates the kernel. ...
    (Fedora)
  • Re: Can we use cpp to write WDM driver ?
    ... restrictions most class libraries and other things do not work. ... Most people who use C++ in the kernel use it extremely limited mode. ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)