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


C++ DBGPRT_ERR_EX函数代码示例

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


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

示例1: DBGPRT_INFO

DWORD
CNdasIXServer::OnTaskStart()
{
	DBGPRT_INFO(_FT("Starting NdasIXServer.\n"));

	CLpxDatagramServer m_dgs;
	BOOL fSuccess = m_dgs.Initialize();
	if (!fSuccess) {
		DBGPRT_ERR_EX(_FT("CNdasIXServer init failed: "));
		return 255;
	}

	fSuccess = m_dgs.Receive(
		this,
		m_usListenPort,
		INFOX_MAX_DATAGRAM_PKT_SIZE,
		m_hTaskTerminateEvent);

	if (!fSuccess) {
		DBGPRT_ERR_EX(_FT("Listening IXServer at port %d failed: "), m_usListenPort);
		return 255;
	}

	return 0;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:25,代码来源:ndasix.cpp

示例2: DBGPRT_ERR_EX

BOOL
CLpxStreamListener::GetAcceptResult(
	OUT SOCKADDR_LPX* lpLocalAddr,
	OUT SOCKADDR_LPX* lpRemoteAddr, 
	OUT LPDWORD lpcbReceived, 
	OUT CONST BYTE** ppbData, 
	OUT LPDWORD lpdwFlags /* = NULL */)
{
	BOOL fSuccess = ::WSAGetOverlappedResult(
		m_sock,
		&m_ovReceive,
		lpcbReceived,
		TRUE,
		lpdwFlags);

	if (!fSuccess) {
		DBGPRT_ERR_EX(_FT("WSAGetOverlappedResult failed: "));
		return FALSE;
	}

	*ppbData = (CONST BYTE*) m_wsaReceiveBuffer.buf;

	SOCKADDR_LPX *pLocalAddr, *pRemoteAddr;
	INT iLocalAddrLen, iRemoteAddrLen;

	LPFN_GETACCEPTEXSOCKADDRS lpfnAcceptExSockaddrs = NULL;
	GUID GuidAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
	DWORD cbRead;
	INT iResult = ::WSAIoctl(m_sock, 
		SIO_GET_EXTENSION_FUNCTION_POINTER, 
		&GuidAcceptExSockaddrs, 
		sizeof(GuidAcceptExSockaddrs),
		&lpfnAcceptExSockaddrs, 
		sizeof(lpfnAcceptExSockaddrs), 
		&cbRead,
		NULL, 
		NULL);

	if (NULL == lpfnAcceptExSockaddrs) {
		DBGPRT_ERR_EX(_FT("Cannot load AcceptEx function: "));
		return FALSE;
	}

	lpfnAcceptExSockaddrs(
		m_wsaReceiveBuffer.buf, 
		m_wsaReceiveBuffer.len,
		sizeof(SOCKADDR_LPX) + 16,
		sizeof(SOCKADDR_LPX) + 16,
		(sockaddr**) &pLocalAddr,
		&iLocalAddrLen,
		(sockaddr**) &pRemoteAddr,
		&iRemoteAddrLen);

	*lpLocalAddr = *pLocalAddr;
	*lpRemoteAddr = *pRemoteAddr;

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:58,代码来源:lpxtrans.cpp

示例3: _ASSERTE

BOOL 
CLpxStreamConnection::Connect(
	CONST SOCKADDR_LPX* pRemoteAddr, 
	CONST BYTE* lpSendBuffer, 
	DWORD dwSendDataLen, 
	LPDWORD lpcbSent)
{
	_ASSERTE(INVALID_SOCKET != m_sock);

	ResetSendOverlapped();

	LPFN_CONNECTEX lpfnConnectEx = NULL;
	GUID GuidConnectEx = WSAID_CONNECTEX;
	DWORD cbRead;
	INT iResult = ::WSAIoctl(m_sock, 
		SIO_GET_EXTENSION_FUNCTION_POINTER, 
		&GuidConnectEx, 
		sizeof(GuidConnectEx),
		&lpfnConnectEx, 
		sizeof(lpfnConnectEx), 
		&cbRead,
		NULL, 
		NULL);

	if (NULL == lpfnConnectEx) {
		DBGPRT_ERR_EX(_FT("Cannot load ConnectEx function: "));
		return FALSE;
	}

	BOOL fSuccess = lpfnConnectEx(
		m_sock,
		(const sockaddr*) pRemoteAddr,
		sizeof(SOCKADDR_LPX),
		(PVOID) lpSendBuffer,
		dwSendDataLen,
		lpcbSent,
		&m_ovSend);

	if (fSuccess) {
		fSuccess = ::SetEvent(m_hSentEvent);
		_ASSERTE(fSuccess);
		return TRUE;
	}

	if (ERROR_IO_PENDING != ::WSAGetLastError()) {
		DBGPRT_ERR_EX(_FT("ConnectEx at sock %p failed: "), m_sock);
		return FALSE;
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:51,代码来源:lpxtrans.cpp

示例4: fSuccess

BOOL
CNdasLogicalDevice::Unplug()
{
	BOOL fSuccess(FALSE);

	ximeta::CAutoLock autolock(this);

	DBGPRT_INFO(_FT("Unplugging %s\n"), ToString());

	if (m_status == NDAS_LOGICALDEVICE_STATUS_NOT_INITIALIZED) 
	{
		::SetLastError(NDASHLPSVC_ERROR_NDAS_LOGICALDEVICE_NOT_INITIALIZED);
		return FALSE;
	}

	if (m_status != NDAS_LOGICALDEVICE_STATUS_MOUNTED &&
		m_status != NDAS_LOGICALDEVICE_STATUS_MOUNT_PENDING &&
		m_status != NDAS_LOGICALDEVICE_STATUS_UNMOUNT_PENDING) 
	{
		::SetLastError(NDASHLPSVC_ERROR_NDAS_LOGICALDEVICE_NOT_MOUNTED);
		return FALSE;
	}

	//
	// Remove target ejects the disk and the volume.
	//

	fSuccess = LsBusCtlRemoveTarget(m_NdasScsiLocation.SlotNo);
	if (!fSuccess) {
		DBGPRT_WARN_EX(_FT("LsBusCtlRemoveTarget failed: "));
	}

	// Intentional break
	::Sleep(100);

	//
	// BUG:
	// What happened when RemoveTarget succeeded and 
	// Unplugging LANSCSI port is failed?
	//

	fSuccess = LsBusCtlUnplug(m_NdasScsiLocation.SlotNo);
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("LsBusCtlUnplug failed: "));
		// last error from lsbusctl unplug
		return FALSE;
	}

	//
	// Change the status to unmounted
	//
	SetStatus(NDAS_LOGICALDEVICE_STATUS_UNMOUNTED);

	DBGPRT_INFO(_FT("Unplugged successfully at slot %s.\n"),
		CNdasScsiLocation(m_NdasScsiLocation).ToString());

	return TRUE;

}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:60,代码来源:ndaslogdev.cpp

示例5: autolock

BOOL
CNdasLogicalDevice::Initialize()
{
	ximeta::CAutoLock autolock(this);

	if (NDAS_LOGICALDEVICE_STATUS_NOT_INITIALIZED != m_status) {
		// Already initialized
		return TRUE;
	}

	if (NULL == m_hDisconnectedEvent) {
		m_hDisconnectedEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
		if (NULL == m_hDisconnectedEvent) {
			DBGPRT_ERR_EX(_FT("Disconnect event creation failed: "));
			return FALSE;
		}
	}

	if (NULL == m_hAlarmEvent) {
		m_hAlarmEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
		if (NULL == m_hAlarmEvent) {
			DBGPRT_ERR_EX(_FT("Alarm event creation failed: "));
			::CloseHandle(m_hDisconnectedEvent);
			return FALSE;
		}
	}

	ACCESS_MASK lastMountAccess = GetLastMountAccess();

	BOOL fRiskyMountFlag = GetRiskyMountFlag();

	if (fRiskyMountFlag) {
		m_fRiskyMount = fRiskyMountFlag;
	}

	if ((lastMountAccess > 0) && !IsRiskyMount()) {
		SetMountOnReady(lastMountAccess, FALSE);
	}

	SetStatus(NDAS_LOGICALDEVICE_STATUS_UNMOUNTED);

	DBGPRT_INFO(_FT("Logical Device %d initialized successfully.\n"), m_logicalDeviceId);

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:45,代码来源:ndaslogdev.cpp

示例6: autoLock

BOOL
CNdasDevice::InvalidateUnitDevice(DWORD dwUnitNo)
{
	ximeta::CAutoLock autoLock(this);

	DBGPRT_INFO(_FT("%s: Invalidating Unit Device %d\n"), ToString(), dwUnitNo);

	if (dwUnitNo >= MAX_NDAS_UNITDEVICE_COUNT) 
	{
		DBGPRT_INFO(_T("%s: Invalid Unit No: %d\n"), ToString(), dwUnitNo);
		::SetLastError(ERROR_INVALID_PARAMETER);
		return FALSE;
	}

	if (NDAS_DEVICE_STATUS_CONNECTED != GetStatus()) 
	{
		DBGPRT_INFO(_T("%s: Non-connected device ignored\n"), ToString());
		return FALSE;
	}

	BOOL fSuccess = UpdateDeviceInfo();
	if (!fSuccess)
	{
		DBGPRT_ERR_EX(_T("%s: Device is not available.\n"), ToString());
		return FALSE;
	}

	fSuccess = DestroyUnitDevice(dwUnitNo);
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("%s: Destroying unit device (%d) failed: "), ToString(), dwUnitNo);
		return FALSE;
	}

	fSuccess = CreateUnitDevice(dwUnitNo);
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("%s: Creating unit device (%d) failed: "), ToString(), dwUnitNo);
		return FALSE;
	}

	DBGPRT_INFO(_FT("%s: Unit Device (%d) recreated\n"), ToString(), dwUnitNo);

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:45,代码来源:ndasdev.cpp

示例7: DBGPRT_ERR_EX

BOOL 
CNdasDeviceHeartbeatListener::Initialize()
{
	BOOL fSuccess = m_dgramServer.Initialize();
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("CLpxDatagramServer init failed: "));
		return FALSE;
	}
	return CTask::Initialize();
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:11,代码来源:ndasheartbeat.cpp

示例8: sizeof

BOOL 
CNdasLogicalDevice::GetSharedWriteInfo(
	LPBOOL lpbSharedWrite, LPBOOL lpbPrimary)
{
	if (lpbSharedWrite) {
#ifdef NDAS_FEATURE_DISABLE_SHARED_WRITE
		*lpbSharedWrite = FALSE;
#else
		*lpbSharedWrite = TRUE;
#endif
	}

#ifdef NDAS_FEATURE_DISABLE_SHARED_WRITE
	// none for no shared write software
#else

	if (NULL == lpbPrimary) 
	{
		return TRUE;
	}

	BUSENUM_QUERY_INFORMATION BusEnumQuery = {0};
	BUSENUM_INFORMATION BusEnumInformation = {0};

	BusEnumQuery.InfoClass = INFORMATION_PDO;
	BusEnumQuery.Size = sizeof(BUSENUM_QUERY_INFORMATION);
	BusEnumQuery.SlotNo = m_NdasScsiLocation.SlotNo;

	BOOL fSuccess = ::LsBusCtlQueryInformation(
		&BusEnumQuery,
		sizeof(BUSENUM_QUERY_INFORMATION),
		&BusEnumInformation,
		sizeof(BUSENUM_INFORMATION));

	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("LanscsiQueryInformation failed at slot %d: "), 
			m_NdasScsiLocation.SlotNo);
		return FALSE;
	}

	if (ND_ACCESS_ISRW(BusEnumInformation.PdoInfo.GrantedAccess)) 
	{
		*lpbPrimary = TRUE;
	} else {
		*lpbPrimary = FALSE;
	}

#endif

	return TRUE;

}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:53,代码来源:ndaslogdev.cpp

示例9: _ASSERT

BOOL
CLpxSockAddrListChangeNotifier::Reset()
{
	BOOL fSuccess = ::ResetEvent(m_hEvent);
	_ASSERT(fSuccess);

	if (INVALID_SOCKET != m_sock) {
		::closesocket(m_sock);
	}

	// ::ZeroMemory(&m_overlapped, sizeof(WSAOVERLAPPED));
	m_overlapped.Internal =
	m_overlapped.InternalHigh =
	m_overlapped.Offset =
	m_overlapped.OffsetHigh = 0;
	m_overlapped.hEvent = m_hEvent;

	AutoSocket sock = ::WSASocket(
		AF_LPX, 
		SOCK_DGRAM, 
		LPXPROTO_DGRAM, 
		NULL, 
		0, 
		WSA_FLAG_OVERLAPPED);

	if (INVALID_SOCKET == (SOCKET) sock) {
		return FALSE;
	}

	int iError;
	DWORD cbBytesReturned;

	iError = ::WSAIoctl(
		sock,
		SIO_ADDRESS_LIST_CHANGE,
		NULL, 0,
		NULL, 0,
		&cbBytesReturned,
		&m_overlapped,
		NULL);

	if (0 != iError && WSA_IO_PENDING != ::WSAGetLastError()) { 
		// SOCKET_ERROR
		// TODO: Error Event Log from WSAGetLastError
		DBGPRT_ERR_EX(_FT("WSAIoctl SIO_ADDRESS_LIST_CHANGE failed: "));
		return FALSE;
	}

	m_sock = sock.Detach();

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:52,代码来源:lpxtrans.cpp

示例10: SendTo

BOOL
CLpxDatagramSocket::SendToSync(
	CONST SOCKADDR_LPX* pRemoteAddr,
	DWORD cbToSend, 
	CONST BYTE* lpbData, 
	DWORD dwSendFlags,
	LPDWORD lpcbSent)
{
	BOOL fSuccess = SendTo(pRemoteAddr, cbToSend, lpbData, dwSendFlags);
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("Send failed: "));
		return FALSE;
	}
	fSuccess = GetSendToResult(lpcbSent);
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("GetSendToResult failed: "));
		return FALSE;
	}
	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:22,代码来源:lpxtrans.cpp

示例11: XTLASSERT

BOOL 
CNdasDeviceComm::GetUnitDeviceInformation(PNDAS_UNITDEVICE_HARDWARE_INFO pUnitDevInfo)
{
	XTLASSERT(NULL != m_hNdas && "CNdasDeviceComm is not connected");
	XTLASSERT(pUnitDevInfo != NULL);

	BOOL fSuccess = NdasCommGetUnitDeviceHardwareInfo(m_hNdas, pUnitDevInfo);
	if (!fSuccess)
	{
		DBGPRT_ERR_EX(_FT("NdasCommGetUnitDeviceInfo failed: "));
		return FALSE;
	}

	return TRUE;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:15,代码来源:ndasdevcomm.cpp

示例12: DBGPRT_ERR_EX

BOOL 
CNdasUnitDeviceCreator::ReadDIBv1AndConvert(PNDAS_DIB_V2 pDIBv2)
{
	BOOL fSuccess = FALSE;
	NDAS_DIB DIBv1 = {0};
	PNDAS_DIB pDIBv1 = &DIBv1;

	fSuccess = m_devComm.ReadDiskBlock(
		reinterpret_cast<PBYTE>(pDIBv1), 
		NDAS_BLOCK_LOCATION_DIB_V1);

	if (!fSuccess) {
		DBGPRT_ERR_EX(_FT("Reading DIBv1 block failed: "));
		return FALSE;
	}

	//
	// If there is no DIB in the disk,
	// create a pseudo DIBv2
	//
	if (NDAS_DIB_SIGNATURE != pDIBv1->Signature ||
		IS_NDAS_DIBV1_WRONG_VERSION(*pDIBv1)) 
	{
		//
		// Create a pseudo DIBv2
		//
		InitializeDIBv2AsSingle(pDIBv2);		
		return TRUE;
	}

	//
	// Convert V1 to V2
	//
	fSuccess = ConvertDIBv1toDIBv2(
		pDIBv1, 
		pDIBv2, 
		m_udinfo.SectorCount.QuadPart);

	if (!fSuccess) {
		//
		// Create a pseudo DIBv2 again!
		//
		InitializeDIBv2AsSingle(pDIBv2);		
		return TRUE;
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:48,代码来源:ndasunitdevfactory.cpp

示例13: sizeof

DWORD
CNdasDeviceHeartbeatListener::OnTaskStart()
{
	BOOL fSuccess = m_dgramServer.Receive(
		this, 
		m_usListenPort, 
		sizeof(NDAS_DEVICE_HEARTBEAT),
		m_hTaskTerminateEvent);
	
	if (!fSuccess) 
	{
		DBGPRT_ERR_EX(_FT("Listening Heartbeat at port %d failed: "), m_usListenPort);
		return 255;
	}

	return 0;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:17,代码来源:ndasheartbeat.cpp


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