当前位置: 首页>>代码示例>>C++>>正文


C++ NdisReleaseSpinLock函数代码示例

本文整理汇总了C++中NdisReleaseSpinLock函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisReleaseSpinLock函数的具体用法?C++ NdisReleaseSpinLock怎么用?C++ NdisReleaseSpinLock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NdisReleaseSpinLock函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ndisprotAuditFreeMem

VOID
ndisprotAuditFreeMem(
	PVOID	Pointer
)
{
	PNPROTD_ALLOCATION	pAllocInfo;

	NdisAcquireSpinLock(&(ndisprotdMemoryLock));

	pAllocInfo = CONTAINING_RECORD(Pointer, NPROTD_ALLOCATION, UserData);

	if (pAllocInfo->Signature != NPROTD_MEMORY_SIGNATURE)
	{
		DEBUGP(DL_ERROR,
		 ("ndisprotAuditFreeMem: unknown buffer 0x%p!\n", Pointer));
		NdisReleaseSpinLock(&(ndisprotdMemoryLock));
#if DBG
		DbgBreakPoint();
#endif
		return;
	}

	pAllocInfo->Signature = (ULONG)'DEAD';
	if (pAllocInfo->Prev != (PNPROTD_ALLOCATION)NULL)
	{
		pAllocInfo->Prev->Next = pAllocInfo->Next;
	}
	else
	{
		ndisprotdMemoryHead = pAllocInfo->Next;
	}
	if (pAllocInfo->Next != (PNPROTD_ALLOCATION)NULL)
	{
		pAllocInfo->Next->Prev = pAllocInfo->Prev;
	}
	else
	{
		ndisprotdMemoryTail = pAllocInfo->Prev;
	}
	ndisprotdAllocCount--;
	NdisReleaseSpinLock(&(ndisprotdMemoryLock));

	NdisFreeMemory(pAllocInfo, 0, 0);
}
开发者ID:TLmaK0,项目名称:weppinhole,代码行数:44,代码来源:debug.c

示例2: FilterCancelOidRequest

VOID
FilterCancelOidRequest(
    IN NDIS_HANDLE	FilterModuleContext,
    IN PVOID		RequestId
)
{
    PNETGW_ADAPT pAdapter = (PNETGW_ADAPT)FilterModuleContext;
    PNDIS_OID_REQUEST OriginalRequest = NULL;

    NdisAcquireSpinLock(&pAdapter->Lock);

    OriginalRequest = pAdapter->m_IntReq.pOrigReq;
    if ((OriginalRequest != NULL) && (OriginalRequest->RequestId == RequestId)) {
        NdisReleaseSpinLock(&pAdapter->Lock);
        NdisFCancelOidRequest(pAdapter->FilterHandle, RequestId);
    }
    else
        NdisReleaseSpinLock(&pAdapter->Lock);
}
开发者ID:mnestratov,项目名称:natflt,代码行数:19,代码来源:request.c

示例3: NPF_StopUsingOpenInstance

VOID
NPF_StopUsingOpenInstance(
				  IN POPEN_INSTANCE pOpen
				  )
{
	NdisAcquireSpinLock(&pOpen->OpenInUseLock);
	ASSERT(pOpen->NumPendingIrps > 0);
	pOpen->NumPendingIrps --;
	NdisReleaseSpinLock(&pOpen->OpenInUseLock);
}
开发者ID:52M,项目名称:npcap,代码行数:10,代码来源:Openclos.c

示例4: ba_mpdu_blk_free

static void ba_mpdu_blk_free(struct rt_rtmp_adapter *pAd,
			     struct reordering_mpdu *mpdu_blk)
{
	ASSERT(mpdu_blk);

	NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
/*      blk_count--; */
	ba_enqueue(&pAd->mpdu_blk_pool.freelist, mpdu_blk);
	NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:10,代码来源:ba_action.c

示例5: ReceiverWaitForPacketReturn

/* Wait for NDIS to return any outstanding packets.  The caller must
   already have taken some appropriate measures to make sure that no
   more packets arrive in the meantime. */
void
ReceiverWaitForPacketReturn(PRECEIVER Receiver)
{
    LARGE_INTEGER interval;

    interval.QuadPart = -100000; /* 100ms in units of 100ns */

    NdisAcquireSpinLock(&Receiver->Common.Lock);
    while (Receiver->nRxInNdis) {
        TraceVerbose (("%d rx.\n", Receiver->nRxInNdis));

        NdisReleaseSpinLock(&Receiver->Common.Lock);
        KeDelayExecutionThread(KernelMode, FALSE, &interval);
        NdisAcquireSpinLock(&Receiver->Common.Lock);

        ReceiverSwizzle(Receiver);
    }
    NdisReleaseSpinLock(&Receiver->Common.Lock);
}
开发者ID:OpenXT,项目名称:xc-windows,代码行数:22,代码来源:receiver.c

示例6: ssh_interceptor_iodevice_cancel_queued_ioctl

void 
ssh_interceptor_iodevice_cancel_queued_ioctl(PDEVICE_OBJECT device,
                                             PIRP irp)
{
  SshInterceptorIoDevice io_dev;
  SshIoctlCancelFunction cancel_fn = NULL_FNPTR;
  void *cancel_context;
  SshIoctlCancelID cancel_id;
  Boolean cancelled = FALSE;
  PLIST_ENTRY entry;

  /* Cancel processing is protected by queue-specific lock, not by the (one 
     and only) system-wide Cancel lock */
  IoReleaseCancelSpinLock(irp->CancelIrql);

  io_dev = SSH_NTDEV_TO_SSHDEV(device);

  NdisAcquireSpinLock(&io_dev->ioctl_req_list_lock);
  entry = io_dev->active_ioctl_req_list.Flink;
  while (entry != &io_dev->active_ioctl_req_list)
    {
      SshIoDeviceIoctlRequest ioctl;
      SshIoDeviceIoctlHandler handler;

      ioctl = CONTAINING_RECORD(entry, 
                                SshIoDeviceIoctlRequestStruct, 
                                private_data.link);

      if (ioctl->private_data.irp == irp)
        {
          handler = ioctl->public_data.context;

          cancel_fn = handler->cancel_fn;
          cancel_context = handler->context;
          cancel_id = ioctl->public_data.cancel_id;
          
          break;
        }

      entry = entry->Flink;
    }
  NdisReleaseSpinLock(&io_dev->ioctl_req_list_lock);

  if (cancel_fn != NULL_FNPTR)
    {
      cancelled = (*cancel_fn)(cancel_context, cancel_id);
    }

  if (cancelled == FALSE)
    {
      /* We have a bug somewhere if we end up here */
      SSH_NOTREACHED;   
    }
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:54,代码来源:iodevice.c

示例7: RTMPRepeaterRemoveInvaildMacEntry

BOOLEAN RTMPRepeaterRemoveInvaildMacEntry(
	IN PRTMP_ADAPTER pAd,
	IN UCHAR idx,
	IN PUCHAR pAddr)
{
	USHORT HashIdx;
	INVAILD_TRIGGER_MAC_ENTRY *pEntry = NULL;
	INVAILD_TRIGGER_MAC_ENTRY *pPrevEntry, *pProbeEntry;

	NdisAcquireSpinLock(&pAd->ApCfg.ReptCliEntryLock);

	HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
	pEntry = &pAd->ApCfg.ReptControl.RepeaterInvaildEntry[idx];

	if (pEntry && pEntry->bInsert)
	{
		pPrevEntry = NULL;
		pProbeEntry = pAd->ApCfg.ReptControl.ReptInvaildHash[HashIdx];
		ASSERT(pProbeEntry);
		if (pProbeEntry != NULL)
		{
			/* update Hash list*/
			do
			{
				if (pProbeEntry == pEntry)
				{
					if (pPrevEntry == NULL)
					{
						pAd->ApCfg.ReptControl.ReptInvaildHash[HashIdx] = pEntry->pNext;
					}
					else
					{
						pPrevEntry->pNext = pEntry->pNext;
					}
					break;
				}
		
				pPrevEntry = pProbeEntry;
				pProbeEntry = pProbeEntry->pNext;
			} while (pProbeEntry);
		}
		/* not found !!!*/
		ASSERT(pProbeEntry != NULL);

		pAd->ApCfg.ReptControl.ReptInVaildMacSize--;
	}

	NdisZeroMemory(pEntry->MacAddr, MAC_ADDR_LEN);
	pEntry->bInsert = FALSE;

	NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);

	return TRUE;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:54,代码来源:ap_repeater.c

示例8: NPF_StartUsingBinding

BOOLEAN NPF_StartUsingBinding(
    IN POPEN_INSTANCE pOpen)
{
	ASSERT(pOpen != NULL);
	ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
	
	NdisAcquireSpinLock(&pOpen->AdapterHandleLock);

	if (pOpen->AdapterBindingStatus != ADAPTER_BOUND)
	{
		NdisReleaseSpinLock(&pOpen->AdapterHandleLock);
		return FALSE;
	}
	
	pOpen->AdapterHandleUsageCounter++;

	NdisReleaseSpinLock(&pOpen->AdapterHandleLock);
	
	return TRUE;
}
开发者ID:52M,项目名称:npcap,代码行数:20,代码来源:Openclos.c

示例9: circbuf_unlock

//------------------------------------------------------------------------------
void circbuf_unlock(tCircBufInstance* pInstance_p)
{
    tCircBufArchInstance*   pArchInstance;

    // Check parameter validity
    ASSERT(pInstance_p != NULL);

    pArchInstance = (tCircBufArchInstance*)pInstance_p->pCircBufArchInstance;

    NdisReleaseSpinLock(&pArchInstance->spinlock);
}
开发者ID:OpenAutomationTechnologies,项目名称:openPOWERLINK_V2,代码行数:12,代码来源:circbuf-winkernel.c

示例10: ssh_iodevice_buffer_alloc

__inline SshDeviceBuffer
ssh_iodevice_buffer_alloc(SshInterceptorIoDevice io_dev,
                          Boolean reliable)
{
  SshDeviceBuffer buf = NULL;
  PLIST_ENTRY entry;

  /* 1. Try to get a SshDeviceBuffer from a free list */
  entry = NdisInterlockedRemoveHeadList(&io_dev->free_list,
                                        &io_dev->free_list_lock);
  if (entry)
    buf = CONTAINING_RECORD(entry, SshDeviceBufferStruct, link);

  /* 2. If failed and this is a reliable message, try to replace
     an existing unreliable one */
  if ((buf == NULL) && (reliable))
    {
      NdisAcquireSpinLock(&io_dev->output_queue_lock);
      if (!IsListEmpty(&io_dev->unreliable_output_queue))
        {
          /* We found an existing unreliable message */
          entry = RemoveHeadList(&io_dev->unreliable_output_queue);

          /* We must remove the entry from output_queue too */
          buf = CONTAINING_RECORD(entry, SshDeviceBufferStruct,
                                  unreliable_list_link);

          SSH_ASSERT(buf != io_dev->current_read_buf);

          /* This removes the entry from output_queue */
          RemoveEntryList(&(buf->link));
        }
      NdisReleaseSpinLock(&io_dev->output_queue_lock);

      /* If found, we must delete the old message */
      if (buf != NULL)
        ssh_free(buf->addr);
    }

  /* 3. If still failed, try to allocate memory for a new
     SshDeviceBuffer */
  if ((buf == NULL) && (reliable))
    {
      buf = ssh_malloc(sizeof(*buf));
      if (buf)
        {
          /* This buffer will be deleted after use */
          buf->pre_allocated = 0;
        }
    }

  return buf;
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:53,代码来源:iodevice.c

示例11: ssh_interceptor_iodevice_cancel_queued_read

/*
  Cancel routine for queued read operations initiated by user-mode daemons.
*/
void 
ssh_interceptor_iodevice_cancel_queued_read(PDEVICE_OBJECT device,
                                            PIRP irp)
{
  SshInterceptorIoDevice io_dev;
  PLIST_ENTRY entry, next_entry;
  LIST_ENTRY  cancelled_irps;

  /* Cancel processing is protected by queue-specific lock, not by the (one 
     and only) system-wide Cancel lock */
  IoReleaseCancelSpinLock(irp->CancelIrql);

  io_dev = SSH_NTDEV_TO_SSHDEV(device);

  NdisInitializeListHead(&cancelled_irps);

  SSH_DEBUG(SSH_D_MIDSTART, 
            ("ssh_interceptor_iodevice_cancel_queued_read()"));

  /* Find and dequeue all canceled IRPs (not just the one given as argument).
     Complete the IRPs after releasing the spin lock. */
  NdisAcquireSpinLock(&io_dev->read_queue_lock);
  entry = io_dev->read_queue.Flink;
  while (entry && (entry != &io_dev->read_queue))
    {
      next_entry = entry->Flink;

      irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry);
      if (irp->Cancel)
        {
          RemoveEntryList(entry);
          InsertTailList(&cancelled_irps, entry);
        }

      entry = next_entry;
    }
  NdisReleaseSpinLock(&io_dev->read_queue_lock);

  while (!IsListEmpty(&cancelled_irps))
    {
      entry = RemoveHeadList(&cancelled_irps);

      irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry);

      irp->IoStatus.Status = STATUS_CANCELLED;
      irp->IoStatus.Information = 0;
      IoCompleteRequest(irp, IO_NO_INCREMENT);

      SSH_DEBUG(SSH_D_NICETOKNOW,
                ("IoCompleteRequest(irp = 0x%p, status = STATUS_CANCELLED)",
                irp));
    };
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:56,代码来源:iodevice.c

示例12: mtl_set_idd_mtu

/* set idd mtu */
mtl_set_idd_mtu(VOID *mtl_1, USHORT mtu)
{
	MTL	*mtl = (MTL*)mtl_1;

    D_LOG(D_ENTRY, ("mtl_set_idd_mtu: entry, mtu: 0x%x\n", mtu));

    /* get lock, set, release & return */
    NdisAcquireSpinLock(&mtl->lock);
    mtl->idd_mtu = mtu;
    NdisReleaseSpinLock(&mtl->lock);
    return(MTL_E_SUCC);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:13,代码来源:mtl_set.c

示例13: NeoUnlock

// Unlock
void NeoUnlock(NEO_LOCK *lock)
{
	NDIS_SPIN_LOCK *spin_lock;
	// Validate arguments
	if (lock == NULL)
	{
		return;
	}

	spin_lock = &lock->spin_lock;
	NdisReleaseSpinLock(spin_lock);
}
开发者ID:RexSi,项目名称:SoftEtherVPN,代码行数:13,代码来源:NDIS5.c

示例14: QueueDescriptorForRxIndication

VOID
QueueDescriptorForRxIndication(
	MTL	*mtl,
	MTL_AS	*as
	)
{
	NdisAcquireSpinLock(&mtl->RxIndicationFifo.lock);

	InsertTailList(&mtl->RxIndicationFifo.head, &as->link);

	NdisReleaseSpinLock(&mtl->RxIndicationFifo.lock);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:12,代码来源:mtl_rx.c

示例15: RTUSBBulkOutNullFrame

/*
	========================================================================
	
	Routine Description:

	Arguments:

	Return Value:

	Note: NULL frame use BulkOutPipeId = 0
	
	========================================================================
*/
VOID	RTUSBBulkOutNullFrame(
	IN	PRTMP_ADAPTER	pAd)
{
	PTX_CONTEXT	pNullContext = &(pAd->NullContext);
	PURB		pUrb;
	int 		ret = 0;
	unsigned long	IrqFlags;
	
	NdisAcquireSpinLock(&pAd->BulkOutLock[0], IrqFlags);
	if (pAd->BulkOutPending[0] == TRUE)
	{
		NdisReleaseSpinLock(&pAd->BulkOutLock[0], IrqFlags);
		return;
	}
	pAd->BulkOutPending[0] = TRUE;
	NdisReleaseSpinLock(&pAd->BulkOutLock[0], IrqFlags);

	// Increase Total transmit byte counter
	pAd->RalinkCounters.TransmittedByteCount +=  pNullContext->BulkOutSize;

	DBGPRINT_RAW(RT_DEBUG_INFO, "--->RTUSBBulkOutNullFrame \n");
	
	// Clear Null frame bulk flag
	RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL);


	// Init Tx context descriptor
	RTUSBInitTxDesc(pAd, pNullContext, 0, RTUSBBulkOutNullFrameComplete);
	pNullContext->IRPPending = TRUE;

	pUrb = pNullContext->pUrb;
	if((ret = rtusb_submit_urb(pUrb))!=0)
	{
		DBGPRINT(RT_DEBUG_ERROR,"Submit Tx URB failed %d\n", ret);
		return;
	}	
	
	DBGPRINT_RAW(RT_DEBUG_INFO, "<---RTUSBBulkOutNullFrame \n");
	return;
}
开发者ID:AxelLin,项目名称:Drv,代码行数:53,代码来源:rtusb_bulk.c


注:本文中的NdisReleaseSpinLock函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。