Re: InterlockedExchangePointer() while lock held?

Tech-Archive recommends: Speed Up your PC by fixing your registry



if this is access to the CancelRoutine on a PIRP, IEP() is required
regardless of the lock behing held.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<BubbaGump> wrote in message
news:cj8nf29s8nd831iv8si58c4fkns2qcmb58@xxxxxxxxxx
Is it necessary to do interlocked exchanges while any type of lock is
held? The only reason I can think of is to ensure memory ordering,
but I got the impression that acquiring and releasing a lock already
takes care of that.

There's an InterlockedExchangePointer() in a sample in the WDM driver
book that accesses a field that looks like it's only ever accessed
while a lock is held, and I wondered if the exchange really had to be
interlocked in that case or if it was just a lazy way to avoid
declaring a temporary variable and typing 3 lines of code. I'm only
curious to understand the principle.



.



Relevant Pages

  • Re: PREfast and the Cancel Safe Queue sample
    ... if you annotate the function with __drv_acquiresResource it should let PFD know that the lock being acquired does not need to be released in the same context. ... Please do not send e-mail directly to this alias. ... > and does not restore the IRQL before it exits. ...
    (microsoft.public.development.device.drivers)
  • Re: KMDF DPC Synchronization
    ... KMDF does not do the IRQL raise, it will call KeAcquireSpinLock which will do the IRQL raise.... ... Please do not send e-mail directly to this alias. ... you cannot recursively acquire a spinlock on the same thread. ... Checking in WdfSpinlockRelease that the thread is same as acquired the lock, ...
    (microsoft.public.development.device.drivers)
  • Re: Disable lock
    ... You can un-check mark in the box for "On resume, Password protect." ... more lock this way) or enter a higher wait time before the lock. ... Please do not send email directly to this alias. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: When to disable/enable APCs?
    ... APC is sent) was discovered after NT was released. ... Please do not send e-mail directly to this alias. ... lock while still at passive level. ... you want to disable APCs before acquiring it. ...
    (microsoft.public.development.device.drivers)
  • Re: IP standby query
    ... For TCPIP services with just the alias strategy, ... First node that gets the lock gets to ... To simulate it, upi use the IFCONFIG ... WE0 is the interface name (IFCONFIG -a to get the list of interfaces on ...
    (comp.os.vms)