Ok… The C++ issue was a red herring… I hate this kind of problem. I
have narrowed it down some floating point code which was a macro and
different for win 98… Go figure. I do floating point in my driver, and I
thought I read on win 98 that I had to configure the FP registers. Can
anyone clarify? Here is my macro definition:
Thanks,
Justin
Windows 98 explodes on the ‘fninit’
#if _WIN32_WINNT>=0x0500 // Windows 2000 +
#define STOREFLOATSTATE KFLOATING_SAVE FloatSave; \
KeSaveFloatingPointState(&FloatSave);
#else // Win98
#define STOREFLOATSTATE KFLOATING_SAVE FloatSave; \
KeSaveFloatingPointState(&FloatSave); \
USHORT floatcontrol = 0x027F; \
_asm fninit \
_asm fldcw floatcontrol
#endif
#define RESTOREFLOATSTATE KeRestoreFloatingPointState(&FloatSave);
At 12:46 PM 10/15/2002, you wrote:
Also,
If I plug the device in post boot… it works just fine.-Justin
<----------------------------->
It is allocating the pointer with no trouble. The functions for memory
that I am calling exist in wdm.h (98 DDK as well).-Justin
At 11:55 AM 10/15/2002, you wrote:
>You have to modify these operators to fit for your win98 driver. I have
>not done win95/win98 development since 1996 so I forget most of things.
>You have to find memory allocation API in VxD. You can get wdm version by
>calling IoIsWdmVersionAvailable.
>
>Bi
>-----Original Message-----
>From: Justin Frodsham [mailto:zeppelin@io.com]
>Sent: Tuesday, October 15, 2002 2:42 PM
>To: NT Developers Interest List
>Subject: [ntdev] RE: Boot time C++ Win 98 explosion (ok in 2000/xp)
>
>Uh… as I mentioned my code works in NT. I already have the code you
>show. I think It would have crashed on NT if I didn’t. This is a
>finished driver that is being back ported to win 98.
>
>-Justin
>
>
>
>
>
>
>
>
>
>At 11:20 AM 10/15/2002, you wrote:
>
>>You must provide your own new operator or use DriverStudio’s.
>>Remember you have to specify which pool (paged or nonpaged).
>>
>>new operator is quite easy to provide.
>>
>>For NT
>>
>>inline void * __cdecl operator new(unsigned int nSize, POOL_TYPE iType,
>>ULONG tag)
>>{
>> return nSize ? ExAllocatePoolWithTag(iType, nSize, tag) : NULL;
>>}
>>
>>inline void * __cdecl operator new(unsigned int nSize, POOL_TYPE iType)
>>{
>> return nSize ? ExAllocatePool(iType, nSize) : NULL;
>>}
>>
>>inline void __cdecl operator delete(void* p)
>>{
>> if (p) ExFreePool(p);
>>}
>>
>>inline void __cdecl operator delete (void* p)
>>{
>> if (p) ExFreePool(p);
>>}
>>
>>Cheers
>>
>>Bi
>>
>>-----Original Message-----
>>From: Justin Frodsham [mailto:zeppelinmailto:zeppelin@io.com]
>>>Sent: Tuesday, October 15, 2002 2:19 PM
>>>To: NT Developers Interest List
>>>Subject: [ntdev] Boot time C++ Win 98 explosion (ok in 2000/xp)
>>>
>>>Hi all,
>>> In my adddevice() routine I do a var=new CLASS();. In 2000 and XP I
>>> get
>>>a pointer and the constructer gets called no problem. However, after
>>>getting my pointer and setting the stack in 98 ( at boot BTW ) the call to
>>>the constructor generates a windows protection error. I have softice
>>>loaded and it doesnt even trap the problem. I hit “step into” on the call
>>>statement, and boom. I want to repeat one more time, this works perfect
>>>on XP/2000. Does anyone know where I can find that elusive numega c++
>>>whitepaper? I have seen references to it, but can find it.
>>>
>>>Thanks,
>>>Justin
>>>
>>>—
>>>You are currently subscribed to ntdev as: xxxxx@appstream.com
>>>To unsubscribe send a blank email to %%email.unsub%%
>>>—
>>>You are currently subscribed to ntdev as: zeppelin@io.com
>>>To unsubscribe send a blank email to %%email.unsub%%
>>—
>>You are currently subscribed to ntdev as: xxxxx@appstream.com
>>To unsubscribe send a blank email to %%email.unsub%%
>>
>>—
>>You are currently subscribed to ntdev as: zeppelin@io.com
>>To unsubscribe send a blank email to %%email.unsub%%
>
>—
>You are currently subscribed to ntdev as: zeppelin@io.com
>To unsubscribe send a blank email to %%email.unsub%%</mailto:zeppelin>