Checking which OS

Hi,

I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP or
WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock(); otherwise
something else is used. I compile my driver in XP, and then test it for XP.
It goes well. However, when I install the driver in WIN2K, I get BSOD.
It says

STOP: c0000263 {Driver Entry Point Not Found}
The \SystemRoot\system32\drivers\WV504.sys device driver could not locate
the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
Break instruction exception - code 80000003 (first chance)

WV504.sys is my driver.

Do I miss anything here?

Thanks

Ta H.


Learn how to choose, serve, and enjoy wine at Wine @ MSN.
http://wine.msn.com/

Use KeSynchronizeExecution. In all OSes. This would be the best solution.
:slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Ta H.”
To: “Windows System Software Devs Interest List”
Sent: Thursday, February 05, 2004 2:59 AM
Subject: [ntdev] Checking which OS

> Hi,
>
> I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP or
> WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock(); otherwise
> something else is used. I compile my driver in XP, and then test it for XP.
> It goes well. However, when I install the driver in WIN2K, I get BSOD.
> It says
>
> STOP: c0000263 {Driver Entry Point Not Found}
> The \SystemRoot\system32\drivers\WV504.sys device driver could not locate
> the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
> Break instruction exception - code 80000003 (first chance)
>
> WV504.sys is my driver.
>
> Do I miss anything here?
>
> Thanks
>
> Ta H.
>
> _________________________________________________________________
> Learn how to choose, serve, and enjoy wine at Wine @ MSN.
> http://wine.msn.com/
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

If you call XP+ function directly it is imported regardless of your code
logic. Verify it using “dumpbin /imports” for example. Imports are resolved
when PE file is loaded, not when a function is called.

Instead, you have to find address dynamically using
MmGetSystemRoutineAddress().

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@hotmail.com[SMTP:xxxxx@hotmail.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, February 05, 2004 12:59 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Checking which OS

Hi,

I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP or
WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock(); otherwise
something else is used. I compile my driver in XP, and then test it for
XP.
It goes well. However, when I install the driver in WIN2K, I get BSOD.

It says

STOP: c0000263 {Driver Entry Point Not Found}
The \SystemRoot\system32\drivers\WV504.sys device driver could not locate
the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
Break instruction exception - code 80000003 (first chance)

WV504.sys is my driver.

Do I miss anything here?

Thanks

Ta H.


Learn how to choose, serve, and enjoy wine at Wine @ MSN.
http://wine.msn.com/


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: michal.vodicka@st.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Use MmGetSystemRoutineAddress to find the function pointer for
KeAcquireInterruptSpinLock. If you have a hard coded call, this will
always bring in the import.

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
Sent: Wednesday, February 04, 2004 4:00 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Checking which OS

Hi,

I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP or

WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock(); otherwise
something else is used. I compile my driver in XP, and then test it for
XP.
It goes well. However, when I install the driver in WIN2K, I get
BSOD.
It says

STOP: c0000263 {Driver Entry Point Not Found}
The \SystemRoot\system32\drivers\WV504.sys device driver could not
locate
the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
Break instruction exception - code 80000003 (first chance)

WV504.sys is my driver.

Do I miss anything here?

Thanks

Ta H.


Learn how to choose, serve, and enjoy wine at Wine @ MSN.
http://wine.msn.com/


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Yeah, I know…

However, I am interested in finding out why I got such an error, and if
possible, finding a solution. It looks like to me since XP, there are quite
a few new kernel functions.

Thanks

Ta H.

From: “Maxim S. Shatskih”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: Re: [ntdev] Checking which OS
>Date: Thu, 5 Feb 2004 03:07:42 +0300
>
> Use KeSynchronizeExecution. In all OSes. This would be the best
>solution.
>:-)
>
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
>
>----- Original Message -----
>From: “Ta H.”
>To: “Windows System Software Devs Interest List”
>Sent: Thursday, February 05, 2004 2:59 AM
>Subject: [ntdev] Checking which OS
>
>
> > Hi,
> >
> > I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP or
> > WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock(); otherwise
> > something else is used. I compile my driver in XP, and then test it for
>XP.
> > It goes well. However, when I install the driver in WIN2K, I get
>BSOD.
> > It says
> >
> > STOP: c0000263 {Driver Entry Point Not Found}
> > The \SystemRoot\system32\drivers\WV504.sys device driver could not
>locate
> > the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
> > Break instruction exception - code 80000003 (first chance)
> >
> > WV504.sys is my driver.
> >
> > Do I miss anything here?
> >
> > Thanks
> >
> > Ta H.
> >
> >
> > Learn how to choose, serve, and enjoy wine at Wine @ MSN.
> > http://wine.msn.com/
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


There are now three new levels of MSN Hotmail Extra Storage! Learn more.
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1

Because W2K’s ntoskrnl does not contain the KeAcquireInterruptSpinLock
export entry.
It is the same as you try to import non-existent function from DLL.
Use MmGetSystemRoutineAddress to obtain the address of
KeAcquireInterruptSpinLock.
But its better to use KeSynchronizeExecution.

“Ta H.” wrote in message news:xxxxx@ntdev…
> Yeah, I know…
>
> However, I am interested in finding out why I got such an error, and if
> possible, finding a solution. It looks like to me since XP, there are
quite
> a few new kernel functions.
>
> Thanks
>
> Ta H.
>
>
> >From: “Maxim S. Shatskih”
> >Reply-To: “Windows System Software Devs Interest List”
> >
> >To: “Windows System Software Devs Interest List”
> >Subject: Re: [ntdev] Checking which OS
> >Date: Thu, 5 Feb 2004 03:07:42 +0300
> >
> > Use KeSynchronizeExecution. In all OSes. This would be the best
> >solution.
> >:-)
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >
> >----- Original Message -----
> >From: “Ta H.”
> >To: “Windows System Software Devs Interest List”
> >Sent: Thursday, February 05, 2004 2:59 AM
> >Subject: [ntdev] Checking which OS
> >
> >
> > > Hi,
> > >
> > > I try to use IoIsWdmVersionAvailable() to tell if the target OS is XP
or
> > > WIN2K. If it is XP, I will use KeAcquireInterruptSpinlock();
otherwise
> > > something else is used. I compile my driver in XP, and then test it
for
> >XP.
> > > It goes well. However, when I install the driver in WIN2K, I get
> >BSOD.
> > > It says
> > >
> > > STOP: c0000263 {Driver Entry Point Not Found}
> > > The \SystemRoot\system32\drivers\WV504.sys device driver could not
> >locate
> > > the entry point KeAcquireInterruptSpinLock in driver ntoskrnl.exe???.
> > > Break instruction exception - code 80000003 (first chance)
> > >
> > > WV504.sys is my driver.
> > >
> > > Do I miss anything here?
> > >
> > > Thanks
> > >
> > > Ta H.
> > >
> > >
> > > Learn how to choose, serve, and enjoy wine at Wine @ MSN.
> > > http://wine.msn.com/
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

> There are now three new levels of MSN Hotmail Extra Storage! Learn more.
> http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1
>
>