本文整理汇总了C++中KDPrintM函数的典型用法代码示例。如果您正苦于以下问题:C++ KDPrintM函数的具体用法?C++ KDPrintM怎么用?C++ KDPrintM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KDPrintM函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetBufferLockPendingRequests
static
NTSTATUS
GetBufferLockPendingRequests(
IN PBUFFLOCK_CONTROL BuffLockCtl,
IN PLANSCSI_SESSION LSS,
IN PLU_HWDATA LuHwData,
OUT PULONG PendingRequests,
IN PLARGE_INTEGER TimeOut
){
NTSTATUS status;
TARGET_DATA targetData;
ULONG requestCount;
status = LspTextTartgetData(
LSS,
FALSE,
LuHwData->LanscsiTargetID,
&targetData,
TimeOut);
if(!NT_SUCCESS(status)) {
KDPrintM(DBG_OTHER_ERROR, ("LspTextTartgetData() failed.\n", status));
return status;
}
KDPrintM(DBG_OTHER_TRACE, ("TargetData:%u\n", targetData));
//
// Match the signature.
// If not match, it might be interference by anonymous application.
//
requestCount = (ULONG)(targetData & TARGETDATA_REQUEST_COUNT_MASK);
UpdateRequestCount(BuffLockCtl, requestCount, PendingRequests);
return status;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:34,代码来源:lockmgmt.c
示例2: LstransReceive
NTSTATUS
LstransReceive(
IN PLSTRANS_CONNECTION_FILE ConnectionFile,
IN PUCHAR RecvBuffer,
IN ULONG RecvLength,
IN ULONG Flags,
OUT PLONG Result,
IN OUT PVOID CompletionContext,
IN PLARGE_INTEGER TimeOut
) {
ASSERT(ConnectionFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransReceive) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransReceive(
ConnectionFile->ConnectionFileObject,
RecvBuffer,
RecvLength,
Flags,
Result,
CompletionContext,
TimeOut
);
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:32,代码来源:lstransport.c
示例3: LstransRegisterDisconnectHandler
NTSTATUS
LstransRegisterDisconnectHandler(
IN PLSTRANS_ADDRESS_FILE AddressFile,
IN PVOID EventHandler,
IN PVOID EventContext
) {
ASSERT(AddressFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!AddressFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("AddressFile No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!AddressFile->Protocol->LstransFunc.LstransDisconnect) {
return STATUS_NOT_IMPLEMENTED;
}
return AddressFile->Protocol->LstransFunc.LstransRegisterDisconHandler(
AddressFile->AddressFileObject,
EventHandler,
EventContext
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:25,代码来源:lstransport.c
示例4: LstransReceive
NTSTATUS
LstransReceive(
IN PLSTRANS_CONNECTION_FILE ConnectionFile,
IN PUCHAR RecvBuffer,
IN ULONG RecvLength,
IN ULONG Flags,
IN PLARGE_INTEGER TimeOut,
OUT PLONG Result,
IN PLSTRANS_OVERLAPPED OverlappedData
) {
ASSERT(ConnectionFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransReceive) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransReceive( // call to LpxTdiRecv_LSTrans
ConnectionFile->ConnectionFileObject,
RecvBuffer,
RecvLength,
Flags,
TimeOut,
Result,
OverlappedData
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:32,代码来源:lstransport.c
示例5: LstransSendDatagram
NTSTATUS
LstransSendDatagram(
IN PLSTRANS_ADDRESS_FILE AddressFile,
IN PTA_LSTRANS_ADDRESS RemoteAddress,
IN PUCHAR SendBuffer,
IN ULONG SendLength,
IN ULONG Flags,
OUT PLONG Result,
IN PLSTRANS_OVERLAPPED OverlappedData
) {
ASSERT(AddressFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!AddressFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!AddressFile->Protocol->LstransFunc.LstransSendDatagram) {
return STATUS_NOT_IMPLEMENTED;
}
return AddressFile->Protocol->LstransFunc.LstransSendDatagram(
AddressFile->AddressFileObject,
RemoteAddress,
SendBuffer,
SendLength,
Flags,
Result,
OverlappedData
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:32,代码来源:lstransport.c
示例6: LstransConnect
NTSTATUS
LstransConnect(
IN PLSTRANS_CONNECTION_FILE ConnectionFile,
IN PTA_LSTRANS_ADDRESS RemoteAddress,
IN PLARGE_INTEGER TimeOut,
IN PLSTRANS_OVERLAPPED OverlappedData
) {
ASSERT(ConnectionFile);
ASSERT(RemoteAddress);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("ConnectionFile No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransConnect) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransConnect(
ConnectionFile->ConnectionFileObject,
RemoteAddress,
TimeOut,
OverlappedData
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:29,代码来源:lstransport.c
示例7: LstransListen
NTSTATUS
LstransListen(
IN PLSTRANS_CONNECTION_FILE ConnectionFile,
IN PVOID CompletionContext,
IN PULONG Flags,
IN PLARGE_INTEGER TimeOut
) {
ASSERT(ConnectionFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("ConnectionFile No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransListen) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransListen(
ConnectionFile->ConnectionFileObject,
CompletionContext,
Flags,
TimeOut
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:27,代码来源:lstransport.c
示例8: LstransAssociate
NTSTATUS
LstransAssociate(
IN PLSTRANS_ADDRESS_FILE AddressFile,
IN PLSTRANS_CONNECTION_FILE ConnectionFile
) {
ASSERT(AddressFile);
ASSERT(ConnectionFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!AddressFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("AddressFile No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("ConnectionFile No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(ConnectionFile->Protocol != AddressFile->Protocol) {
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransAssociate) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransAssociate(
ConnectionFile->ConnectionFileObject,
AddressFile->AddressFileHandle
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:33,代码来源:lstransport.c
示例9: LstransCloseAddress
NTSTATUS
LstransCloseAddress(
IN PLSTRANS_ADDRESS_FILE AddressFile
) {
NTSTATUS status;
ASSERT(AddressFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!AddressFile->Protocol) {
// KDPrintM(DBG_TRANS_ERROR, ("Protocol NULL!\n"));
// Maybe this addressfile is already closed.
return STATUS_INVALID_PARAMETER;
}
if(!AddressFile->Protocol->LstransFunc.LstransCloseAddress) {
KDPrintM(DBG_TRANS_ERROR, ("LstransCloseAddress not implemented.\n"));
return STATUS_NOT_IMPLEMENTED;
}
status = AddressFile->Protocol->LstransFunc.LstransCloseAddress(
AddressFile->AddressFileHandle,
AddressFile->AddressFileObject
);
AddressFile->AddressFileHandle = NULL;
AddressFile->AddressFileObject = NULL;
AddressFile->Protocol = NULL;
return status;
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:31,代码来源:lstransport.c
示例10: DraidListnerDelAddress
VOID
DraidListnerDelAddress(
PTDI_ADDRESS_LPX Addr
) {
PDRAID_GLOBALS DraidGlobals;
PLIST_ENTRY listEntry;
KIRQL oldIrql;
PDRAID_LISTEN_CONTEXT ListenContext;
if (!g_DraidGlobals) {
KDPrintM(DBG_LURN_INFO, ("DRAID is not running\n"));
return;
}
DraidGlobals = g_DraidGlobals;
// Find matching address and just mark active flag false because Wait event may be in use.
ACQUIRE_SPIN_LOCK(&DraidGlobals->ListenContextSpinlock, &oldIrql);
for (listEntry = DraidGlobals->ListenContextList.Flink;
listEntry != &DraidGlobals->ListenContextList;
listEntry = listEntry->Flink)
{
ListenContext = CONTAINING_RECORD (listEntry, DRAID_LISTEN_CONTEXT, Link);
if (RtlCompareMemory(ListenContext->Addr.Node,
Addr->Node, 6) == 6) {
KDPrintM(DBG_LURN_INFO, ("Found matching address\n"));
ListenContext->Destroy = TRUE;
KeSetEvent(&DraidGlobals->NetChangedEvent, IO_NO_INCREMENT, FALSE);
break;
}
}
RELEASE_SPIN_LOCK(&DraidGlobals->ListenContextSpinlock, oldIrql);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:33,代码来源:draid.c
示例11: LsuWriteLogErrorEntry
VOID
LsuWriteLogErrorEntry(
IN PDEVICE_OBJECT DeviceObject,
IN PLSU_ERROR_LOG_ENTRY ErrorLogEntry
){
if(KeGetCurrentIrql() > PASSIVE_LEVEL) {
PIO_WORKITEM workitem;
PLSU_ERRORLOGCTX context;
context = ExAllocatePoolWithTag(NonPagedPool, sizeof(LSU_ERRORLOGCTX), LSU_POOLTAG_ERRORLOGWORKER);
if(context == NULL) {
KDPrintM(DBG_OTHER_ERROR, ("Allocating context failed.\n"));
return;
}
RtlCopyMemory(&context->ErrorLogEntry, ErrorLogEntry, sizeof(LSU_ERROR_LOG_ENTRY));
workitem = IoAllocateWorkItem(DeviceObject);
if(workitem == NULL) {
KDPrintM(DBG_OTHER_ERROR, ("IoAllocateWorkItem() failed.\n"));
return;
}
context->IoWorkItem = workitem;
IoQueueWorkItem(workitem, WriteErrorLogWorker, DelayedWorkQueue, context);
} else {
_WriteLogErrorEntry(DeviceObject, ErrorLogEntry);
}
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:34,代码来源:lsutils.c
示例12: LstransSetInformation
NTSTATUS
LstransSetInformation(
IN PLSTRANS_CONNECTION_FILE ConnectionFile,
IN ULONG SetType,
IN PVOID Buffer,
IN ULONG BufferLen
){
ASSERT(ConnectionFile);
KDPrintM(DBG_TRANS_TRACE, ("entered.\n"));
if(!ConnectionFile->Protocol) {
KDPrintM(DBG_TRANS_TRACE, ("No protocol.\n"));
return STATUS_INVALID_PARAMETER;
}
if(!ConnectionFile->Protocol->LstransFunc.LstransSetInformation) {
return STATUS_NOT_IMPLEMENTED;
}
return ConnectionFile->Protocol->LstransFunc.LstransSetInformation( // call to LpxTdiSetInformation_LSTrans
ConnectionFile->ConnectionFileObject,
SetType,
Buffer,
BufferLen
);
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:26,代码来源:lstransport.c
示例13: LspReleaseLock
NTSTATUS
LspReleaseLock(
IN PLANSCSI_SESSION LSS,
IN ULONG LockNo,
IN PBYTE LockData,
IN PLARGE_INTEGER TimeOut
){
NTSTATUS status;
LANSCSI_PDUDESC pduDesc;
BYTE pduResponse;
if(LSS->HWProtoVersion <= LSIDEPROTO_VERSION_1_0) {
NDAS_ASSERT( FALSE );
return STATUS_NOT_SUPPORTED;
}
pduResponse = LANSCSI_RESPONSE_SUCCESS;
RtlZeroMemory(&pduDesc, sizeof(LANSCSI_PDUDESC));
pduDesc.Command = VENDOR_OP_FREE_MUTEX;
pduDesc.Param8[3] = (UCHAR)LockNo;
pduDesc.TimeOut = IF_NULL_TIMEOUT_THEN_DEFAULT(LSS, TimeOut);
status = LspVendorRequest(
LSS,
&pduDesc,
&pduResponse
);
if(NT_SUCCESS(status)) {
if(pduResponse != LANSCSI_RESPONSE_SUCCESS) {
KDPrintM(DBG_LURN_ERROR, ("Releasing lock #%u denied by NDAS device\n", LockNo));
status = STATUS_LOCK_NOT_GRANTED;
} else {
KDPrintM(DBG_LURN_TRACE, ("Released lock #%u\n", LockNo));
}
//
// Convert Network endian to the host endian here.
//
if(LockData) {
UINT32 lockData = NTOHL(pduDesc.Param32[1]);
//
// NDAS chip 1.1 returns the increased lock counter.
// Decrease it for the chip version abstraction.
//
if(LSS->HWVersion == LANSCSIIDE_VERSION_1_1) {
lockData --;
}
if(LSS->HWProtoVersion == LSIDEPROTO_VERSION_1_1) {
*(PUINT32)LockData = lockData;
}
}
}
return status;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:60,代码来源:ndasproto.c
示例14: LsuWriteBlocks
NTSTATUS
LsuWriteBlocks(
IN PLANSCSI_SESSION LSS,
IN PBYTE Buffer,
IN UINT64 LogicalBlockAddress,
IN ULONG TransferBlocks,
IN ULONG BlockBytes,
IN ULONG PduFlags
) {
NTSTATUS status;
LANSCSI_PDUDESC PduDesc;
BYTE PduResponse;
LSS_INITIALIZE_PDUDESC(LSS, &PduDesc, IDE_COMMAND, WIN_WRITE, PduFlags, LogicalBlockAddress, TransferBlocks, TransferBlocks * BlockBytes, Buffer, NULL);
status = LspRequest(
LSS,
&PduDesc,
&PduResponse
);
if(!NT_SUCCESS(status)) {
KDPrintM(DBG_OTHER_ERROR,
("Error: logicalBlockAddress = %I64x, transferBlocks = %x\n",
LogicalBlockAddress, TransferBlocks));
} else if(PduResponse != LANSCSI_RESPONSE_SUCCESS) {
KDPrintM(DBG_OTHER_ERROR,
("Error: logicalBlockAddress = %I64x, transferBlocks = %x PduResponse:%x\n",
LogicalBlockAddress, TransferBlocks, PduResponse));
status = STATUS_REQUEST_NOT_ACCEPTED;
}
return status;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:35,代码来源:lsutils.c
示例15: LurnDestroy
NTSTATUS
LurnDestroy(
PLURELATION_NODE Lurn
) {
NTSTATUS ntStatus;
KDPrintM(DBG_LURN_ERROR, ("In. Lurn %p\n", Lurn));
ASSERT(Lurn);
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
if(!Lurn->LurnInterface) {
KDPrintM(DBG_LURN_ERROR, ("LURN->LurnInterface NULL!\n"));
return STATUS_INVALID_PARAMETER;
}
if(!Lurn->LurnInterface->LurnFunc.LurnDestroy) {
return STATUS_NOT_IMPLEMENTED;
}
ntStatus = Lurn->LurnInterface->LurnFunc.LurnDestroy(
Lurn
);
ASSERT(NT_SUCCESS(ntStatus));
Lurn->LurnStatus = LURN_STATUS_DESTROYING;
return ntStatus;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:27,代码来源:lslurn.c
示例16: EnterBufferLockIoIdle
NTSTATUS
EnterBufferLockIoIdle(
IN PBUFFLOCK_CONTROL BuffLockCtl,
IN PLANSCSI_SESSION LSS,
IN PLU_HWDATA LuHwData
){
NTSTATUS status;
KDPrintM(DBG_OTHER_INFO, (
"Enter buffer lock IO idle.\n"));
if(BuffLockCtl->BufferLockConrol == FALSE) {
return STATUS_SUCCESS;
}
// Release the buffer lock
status = NdasReleaseBufferLock(BuffLockCtl, LSS, LuHwData
, NULL, NULL, TRUE, 0);
if(!NT_SUCCESS(status)) {
KDPrintM(DBG_OTHER_ERROR, (
" ReleaseNdasBufferLock() failed. STATUS=%08lx.\n",
status));
}
// Indicate IO idle state.
BuffLockCtl->IoIdle = TRUE;
return status;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:29,代码来源:lockmgmt.c
示例17: LurnInitialize
NTSTATUS
LurnInitialize(
PLURELATION_NODE Lurn,
PLURELATION Lur,
PLURELATION_NODE_DESC LurnDesc
) {
NTSTATUS status;
KDPrintM(DBG_LURN_ERROR, ("In. Lurn : %p, Lur : %p, LurnDesc : %p\n", Lurn, Lur, LurnDesc));
ASSERT(Lurn);
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
if(Lur && LurnDesc)
{
// normal initialize
if(LurnDesc->LurnType < 0 || LurnDesc->LurnType >= LurnInterfaceCnt ) {
KDPrintM(DBG_LURN_ERROR, ("Error in Lurn Type %x\n", LurnDesc->LurnType));
return STATUS_INVALID_PARAMETER;
}
//
// set default values.
// Do not zero pointers to children.
//
KeInitializeSpinLock(&Lurn->LurnSpinLock);
Lurn->LurnType = LurnDesc->LurnType;
Lurn->Lur = Lur;
Lurn->LurnChildrenCnt = LurnDesc->LurnChildrenCnt;
Lurn->LurnInterface = LurnInterfaceList[LurnDesc->LurnType];
Lurn->StartBlockAddr = LurnDesc->StartBlockAddr;
Lurn->EndBlockAddr = LurnDesc->EndBlockAddr;
Lurn->UnitBlocks = LurnDesc->UnitBlocks;
Lurn->AccessRight = LurnDesc->AccessRight;
LurnSetDefaultConfiguration(Lurn);
LurnModifyConfiguration(Lurn, LurnDesc);
} else {
// revive mode
KDPrintM(DBG_LURN_ERROR, ("Revive Lurn : %08x\n", Lurn));
}
if(!Lurn->LurnInterface->LurnFunc.LurnInitialize) {
KDPrintM(DBG_LURN_ERROR, ("lurntype %x interface not implements LurnInitialize furnction\n", LurnDesc->LurnType ));
return STATUS_NOT_IMPLEMENTED;
}
status = Lurn->LurnInterface->LurnFunc.LurnInitialize(
Lurn,
LurnDesc
);
if(NT_SUCCESS(status)) {
Lurn->LurnStatus = LURN_STATUS_RUNNING;
}
KDPrintM(DBG_LURN_ERROR, ("return 0x%08lx : Idx:%d\n", status, Lurn->LurnId));
return status;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:60,代码来源:lslurn.c
示例18: LspUpgradeUserIDWithWriteAccess
NTSTATUS
LspUpgradeUserIDWithWriteAccess(
PLANSCSI_SESSION LSS
) {
ASSERT(LSS);
if(!LSS->LanscsiProtocol) {
return STATUS_INVALID_PARAMETER;
}
if (LSS->HWVersion == LANSCSIIDE_VERSION_2_5) {
if (HAS_USER_WRITE_ACCESS(LSS->UserID)) {
KDPrintM(DBG_PROTO_ERROR, ("LanscsiSession(%p) has the write-access UserID(%08lx).\n", LSS->UserID));
return STATUS_UNSUCCESSFUL;
}
} else {
if(LSS->UserID & 0xffff0000) {
KDPrintM(DBG_PROTO_ERROR, ("LanscsiSession(%p) has the write-access UserID(%08lx).\n", LSS->UserID));
return STATUS_UNSUCCESSFUL;
}
}
if (LSS->HWVersion == LANSCSIIDE_VERSION_2_5) {
LSS->UserID = MAKE_USER_ID(DEFAULT_USER_NUM , USER_PERMISSION_EW);
} else {
LSS->UserID = LSS->UserID | (LSS->UserID << 16);
}
return STATUS_SUCCESS;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:30,代码来源:lsproto.c
示例19: LockCacheAllLocksLost
VOID
LockCacheAllLocksLost(
IN PLU_HWDATA LuHwData
){
ULONG lockId;
for(lockId = 0; lockId < NDAS_NR_MAX_GPLOCK; lockId ++) {
if(LuHwData->DevLockStatus[lockId].Acquired) {
LockCacheSetDevLockLoss(LuHwData, lockId);
#if DBG
if(lockId == LURNDEVLOCK_ID_BUFFLOCK) {
KDPrintM( DBG_OTHER_ERROR, ("Lost Buf lock #%d\n", lockId) );
} else {
KDPrintM(DBG_OTHER_ERROR, ("Lost lock #%d\n", lockId));
}
#endif
}
}
#if DBG
if(LuHwData->LostLockCount == 0) {
KDPrintM(DBG_OTHER_ERROR, ("No Lost lock\n"));
}
#endif
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:27,代码来源:lockmgmt.c
示例20: DraidCreateListenContext
PDRAID_LISTEN_CONTEXT
DraidCreateListenContext(
PDRAID_GLOBALS DraidGlobals,
PLPX_ADDRESS Addr
) {
KIRQL oldIrql;
BOOLEAN AlreadyExist;
PLIST_ENTRY listEntry;
PDRAID_LISTEN_CONTEXT ListenContext;
//
// Check address is already in the listen context list
//
ACQUIRE_SPIN_LOCK(&DraidGlobals->ListenContextSpinlock, &oldIrql);
AlreadyExist = FALSE;
for (listEntry = DraidGlobals->ListenContextList.Flink;
listEntry != &DraidGlobals->ListenContextList;
listEntry = listEntry->Flink)
{
ListenContext = CONTAINING_RECORD (listEntry, DRAID_LISTEN_CONTEXT, Link);
if (!ListenContext->Destroy && RtlCompareMemory(ListenContext->Addr.Node,
Addr->Node, 6) == 6) {
KDPrintM(DBG_LURN_INFO, ("New LPX address already exist.Ignoring.\n"));
AlreadyExist = TRUE;
break;
}
}
RELEASE_SPIN_LOCK(&DraidGlobals->ListenContextSpinlock, oldIrql);
if (AlreadyExist) {
return NULL;
}
//
// Alloc listen context
//
ListenContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(DRAID_LISTEN_CONTEXT),
DRAID_LISTEN_CONTEXT_POOL_TAG);
if (!ListenContext) {
KDPrintM(DBG_LURN_INFO, ("Failed to alloc listen context\n"));
return NULL;
}
RtlZeroMemory(ListenContext, sizeof(DRAID_LISTEN_CONTEXT));
KeInitializeEvent(
&ListenContext->TdiListenContext.CompletionEvent,
NotificationEvent,
FALSE
);
InitializeListHead(&ListenContext->Link);
RtlCopyMemory(ListenContext->Addr.Node, Addr->Node, 6);
ListenContext->Addr.Port = HTONS(DRIX_ARBITER_PORT_NUM_BASE);
ExInterlockedInsertTailList(&DraidGlobals->ListenContextList,
&ListenContext->Link,
&DraidGlobals->ListenContextSpinlock
);
return ListenContext;
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:59,代码来源:draid.c
注:本文中的KDPrintM函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论