本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}