Storport - Conflict w/InterlockedIncrement/Decrement & ASSERT

I need to use InterlockedIncrement/Decrement in my Storport driver. Based on the i2o sample includes I cannot - I need ntddk.h. But that conflicts with miniport.h. If I use ntddk.h instead of miniport.h then I have a problem using ASSERT (unresolved external symbol __imp_RtlAssert). Any ideas?

Copy/paste the declaration from ntddk.h and then enjoy that they are compiler intrinsics.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
>I need to use InterlockedIncrement/Decrement in my Storport driver. Based on the i2o sample includes I cannot - I need ntddk.h. But that conflicts with miniport.h. If I use ntddk.h instead of miniport.h then I have a problem using ASSERT (unresolved external symbol __imp_RtlAssert). Any ideas?
>

What version of the WDK includes are you using? I know that these two
should mix in the last couple of WDK’s since virtual storports can use this.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntdev…
>I need to use InterlockedIncrement/Decrement in my Storport driver. Based
>on the i2o sample includes I cannot - I need ntddk.h. But that conflicts
>with miniport.h. If I use ntddk.h instead of miniport.h then I have a
>problem using ASSERT (unresolved external symbol imp_RtlAssert). Any
>ideas?
>
>
>
________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4330 (20090812)
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

Information from ESET NOD32 Antivirus, version of virus signature database 4330 (20090812) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

HI,

you can implement your own version of the same . below link might be helpful
if you decided to implement your own.

refer :
http://blogs.msdn.com/doronh/archive/2006/12/06/creating-your-own-interlockedxxx-operation.aspx


From:
Sent: Thursday, August 13, 2009 1:21 AM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement &
ASSERT

> I need to use InterlockedIncrement/Decrement in my Storport driver. Based
> on the i2o sample includes I cannot - I need ntddk.h. But that conflicts
> with miniport.h. If I use ntddk.h instead of miniport.h then I have a
> problem using ASSERT (unresolved external symbol __imp_RtlAssert). Any
> ideas?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

There are 2 drawbacks to my blogpost with this specific problem
1 he still needs access to InterlockedCompareExchange from the wdm headers
2 rolling your own interlocked operations for ones that the compiler has intrinsics for will probably lead to less efficient code. The compiler will most likely not emit a ICE loop for InterlockedIncrement (although it will for InterlockedOr and others if you capture the return value as i blogged about as well)

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Vijay Pothireddy
Sent: Thursday, August 13, 2009 7:40 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement & ASSERT

HI,

you can implement your own version of the same . below link might be helpful
if you decided to implement your own.

refer :
http://blogs.msdn.com/doronh/archive/2006/12/06/creating-your-own-interlockedxxx-operation.aspx

--------------------------------------------------
From:
Sent: Thursday, August 13, 2009 1:21 AM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement &
ASSERT

> I need to use InterlockedIncrement/Decrement in my Storport driver. Based
> on the i2o sample includes I cannot - I need ntddk.h. But that conflicts
> with miniport.h. If I use ntddk.h instead of miniport.h then I have a
> problem using ASSERT (unresolved external symbol __imp_RtlAssert). Any
> ideas?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

In which case the solution is to isolate the code that is dependent on
Wdm.h/ntddk.h in its own compilation unit. And then enter a bug
somewhere that might get the storage team to fix this.

Mark Roddy

On Thu, Aug 13, 2009 at 8:14 AM, Doron Holan wrote:
> There are 2 drawbacks to my blogpost with this specific problem
> 1 he still needs access to InterlockedCompareExchange from the wdm headers
> 2 rolling your own interlocked operations for ones that the compiler has intrinsics for will probably lead to less efficient code. The compiler will most likely not emit a ICE loop for InterlockedIncrement (although it will for InterlockedOr and others if you capture the return value as i blogged about as well)
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: Vijay Pothireddy
> Sent: Thursday, August 13, 2009 7:40 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement & ASSERT
>
>
> HI,
>
> you can implement your own version of the same . below link might be helpful
> if you decided to implement your own.
>
> refer :
> http://blogs.msdn.com/doronh/archive/2006/12/06/creating-your-own-interlockedxxx-operation.aspx
>
>
> --------------------------------------------------
> From:
> Sent: Thursday, August 13, 2009 1:21 AM
> To: “Windows System Software Devs Interest List”
> Subject: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement &
> ASSERT
>
>> I need to use InterlockedIncrement/Decrement in my Storport driver. ?Based
>> on the i2o sample includes I cannot - I need ntddk.h. ?But that conflicts
>> with miniport.h. ?If I use ntddk.h instead of miniport.h then I have a
>> problem using ASSERT (unresolved external symbol __imp_RtlAssert). ?Any
>> ideas?
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Someone said a virtual storport mp has access to wdm.h already (i do not know offhand though)

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Mark Roddy
Sent: Thursday, August 13, 2009 8:42 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement & ASSERT

In which case the solution is to isolate the code that is dependent on
Wdm.h/ntddk.h in its own compilation unit. And then enter a bug
somewhere that might get the storage team to fix this.

Mark Roddy

On Thu, Aug 13, 2009 at 8:14 AM, Doron Holan wrote:
> There are 2 drawbacks to my blogpost with this specific problem
> 1 he still needs access to InterlockedCompareExchange from the wdm headers
> 2 rolling your own interlocked operations for ones that the compiler has intrinsics for will probably lead to less efficient code. The compiler will most likely not emit a ICE loop for InterlockedIncrement (although it will for InterlockedOr and others if you capture the return value as i blogged about as well)
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: Vijay Pothireddy
> Sent: Thursday, August 13, 2009 7:40 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement & ASSERT
>
>
> HI,
>
> you can implement your own version of the same . below link might be helpful
> if you decided to implement your own.
>
> refer :
> http://blogs.msdn.com/doronh/archive/2006/12/06/creating-your-own-interlockedxxx-operation.aspx
>
>
> --------------------------------------------------
> From:
> Sent: Thursday, August 13, 2009 1:21 AM
> To: “Windows System Software Devs Interest List”
> Subject: [ntdev] Storport - Conflict w/InterlockedIncrement/Decrement &
> ASSERT
>
>> I need to use InterlockedIncrement/Decrement in my Storport driver. Based
>> on the i2o sample includes I cannot - I need ntddk.h. But that conflicts
>> with miniport.h. If I use ntddk.h instead of miniport.h then I have a
>> problem using ASSERT (unresolved external symbol __imp_RtlAssert). Any
>> ideas?
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer