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


C++ LtDebugPrint函数代码示例

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


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

示例1: LpxTdiIoCallDriver

NTSTATUS
LpxTdiIoCallDriver(
    IN		PDEVICE_OBJECT		DeviceObject,
    IN OUT	PIRP				Irp,
	IN		PIO_STATUS_BLOCK	IoStatusBlock,
	IN		PKEVENT				Event,
	IN		PLARGE_INTEGER		TimeOut
    )
{
	NTSTATUS		ntStatus;
	NTSTATUS		wait_status;
//	LARGE_INTEGER	timeout;

	//
	//	set a expire time to IRP.
	//	LPX takes whole charge of IRP completion.
	//	LPX will measure time-out.
	//	Do not wait with time-out here.
	//	BSOD may occur if you do.
	//
	//	added by hootch 02092004
	if(TimeOut)
		SET_IRP_EXPTIME(Irp, CurrentTime().QuadPart + TimeOut->QuadPart);
	else
		SET_IRP_EXPTIME(Irp, 0);

	ntStatus = IoCallDriver(
				DeviceObject,
				Irp
				);

	if(ntStatus == STATUS_PENDING) {
		if(Event) {
			wait_status = KeWaitForSingleObject(
					Event,
					Executive,
					KernelMode,
					FALSE,
					NULL
					);

			if(wait_status != STATUS_SUCCESS) {
				LtDebugPrint(1, ("[LpxTdi] LpxTdiIoCallDriver: Wait for event Failed.\n"));
				return STATUS_CONNECTION_DISCONNECTED; // STATUS_TIMEOUT;
			}
		} else {
			return ntStatus;
		}
	}

    ntStatus = IoStatusBlock->Status;

	return ntStatus;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:54,代码来源:lpxtdi.c

示例2: LpxTdiQueryInformation

NTSTATUS
LpxTdiQueryInformation(
	IN	PFILE_OBJECT		ConnectionFileObject,
    IN  ULONG				QType,
	IN  PVOID				Buffer,
	IN  ULONG				BufferLen
	)
{
	NTSTATUS			status;
	KEVENT				event;
	PDEVICE_OBJECT	    deviceObject;
	PIRP				irp;
	IO_STATUS_BLOCK		ioStatusBlock;
	PMDL				mdl;


	if (QType != TDI_QUERY_CONNECTION_INFO)
		return STATUS_NOT_IMPLEMENTED;

	if (BufferLen != sizeof(TDI_CONNECTION_INFO))
		return STATUS_INVALID_PARAMETER;

	LtDebugPrint (3, ("[LpxTdi] LpxTdiQueryInformation: Entered\n"));

	KeInitializeEvent( &event, NotificationEvent, FALSE );

	deviceObject = IoGetRelatedDeviceObject( ConnectionFileObject );

	irp = TdiBuildInternalDeviceControlIrp( TDI_QUERY_INFORMATION,
											deviceObject,
											connectionFileObject,
											&event,
											&ioStatusBlock );

	if (irp == NULL) {
	
		LtDebugPrint( 1, ("[LpxTdi] LpxTdiQueryInformation: Can't Build IRP.\n") );
		return STATUS_INSUFFICIENT_RESOURCES;
	}

	mdl = IoAllocateMdl( Buffer,
						 BufferLen,
						 FALSE,
						 FALSE,
						 irp );

	if (mdl == NULL) {

		LtDebugPrint( 1, ("[LpxTdi] LpxTdiQueryInformation: Can't Allocate MDL.\n") );
		IoFreeIrp( irp );
		return STATUS_INSUFFICIENT_RESOURCES;
	}

	MmBuildMdlForNonPagedPool( mdl );

	TdiBuildQueryInformation( irp,
							  deviceObject,
							  ConnectionFileObject, 
							  LpxTdiQueryInformationCompletionRoutine,
							  NULL,
							  QType,
							  mdl );

	status = LpxTdiIoCallDriver( deviceObject, irp, NULL, NULL, TRUE );

#if DBG

	if (status != STATUS_SUCCESS) {
	
		LtDebugPrint(1, ("[LpxTdi]LpxTdiQueryInformation: Failed. STATUS=%08lx\n", status));
	}

#endif

	return status;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:76,代码来源:lpxtdi.c


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