KeAcquireSpinLockRaiseToDpc RRS feed

  • General discussion

  • Hi All,

    I am facing an issue with KeAcquireSpinLock routine. I am using an ARM 32 WIn 10 Operating system. Whenever I am using this function in my network driver, control will go to the file wdm.h, there the definition of rouitne is 

    #define KeAcquireSpinLock(SpinLock, OldIrql) \
        *(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock).

    But i read from MSDN site that KeAcquireSpinLockRaiseToDpc routine we cannot use in 32 bit os. So can anyone help me what equivalent routine we need to use in ARM 32.? or is there any other option. I am not understanding why microsoft has made a similar routine defenition for ARM 32 and ARM64, but different one for X86.

    Awaiting all guys positive response on this.

    Thanks & Regards, 

    • Edited by wlan_qwerty Thursday, October 15, 2015 8:44 AM
    Thursday, October 15, 2015 5:52 AM

All replies

  • Thank you very much Pavel for your quick response.

    I will use NDIS spinlocks. But still i wanted to ask you, if i want to use the same kernel routine, do you have any idea for ARM32 which rotine i can use.?

    Thanks & Regards

    Thursday, October 15, 2015 7:05 AM
  • It looks like MSDN is out of date. Keep calling KeAcquireSpinLock, what it does underneath the covers is important to understand, but not absolutely paramount. does your driver link? I would imagine it does.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, October 16, 2015 5:14 AM
  • Hi all,

    Thanks for all your replies. But I have a question here. Even though i am using NdisAcquireSpinlock in my driver, internally it is calling KeAcquireSpinLock which in turns calling KeAcquireSpinLockRaiseToDpc. which is causing a crash or deadlock in my environment. Can anyone suggest me what might be the problem or how can i resolve it. As i mentioned earlier i am using 32  bit ARM platform where msdn doc says, we cannot use KeAcquireSpinLockRaiseToDpc on 32 bit platform.

    Thanks & Regards, 

    Wednesday, October 28, 2015 5:11 AM
  • acquiring the spinlock should not cause a crash in and of itself. a bugcheck in this path is usually do to referencing invalid memory for the address of the lock or storing it in pageable memory. what is the output of !analyze -v with correct symbols?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 28, 2015 5:56 AM
  • Hi Doron,

    Sorry for delay in reply.

    Actually, KeAcquireSpinLockRaiseToDpc  function is making some failure in my driver. I am not sure how this API is getting called. I am using NDIS APIS only. When i set breakpoint in my function, internally it is calling KeAcquireSpinLockRaiseToDpc .Once KeAcquireSpinLockRaiseToDpc  function is hit, sometimes windbg is hanging. Some times I am getting a crash message from my WLAN driver. I am not sure is that behaviour is due to KeAcquireSpinLockRaiseToDpc  API or something else.  Could you please confirm that we can use KeAcquireSpinLockRaiseToDpc  API in ARM 32 machine also. Do you have tested any WLAN driver on Win10 ARM platform?

    Tuesday, November 17, 2015 12:52 PM
  • Hi Pavel,

    Yes you are correct. Sometimes windbg is hanging, and sometimes i am getting crash in my driver, if i keep on pressing g in windbg.

    When i set the breakpoint before the function, internally it is going to KeAcquireRaiseToDpc function. I don't know why. And Msdn doc says, this API is not supported in 32 bit OS. May be it should be corrected i doc.


    Tuesday, November 17, 2015 1:41 PM