本文整理汇总了C++中RT_NOREF函数的典型用法代码示例。如果您正苦于以下问题:C++ RT_NOREF函数的具体用法?C++ RT_NOREF怎么用?C++ RT_NOREF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RT_NOREF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssertReturn
ClientId::rtStrFormat(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
const char *pszType, void const *pvValue,
int cchWidth, int cchPrecision, unsigned fFlags,
void *pvUser)
{
const ClientId *id = static_cast<const ClientId *>(pvValue);
size_t cb = 0;
AssertReturn(strcmp(pszType, "id") == 0, 0);
RT_NOREF(pszType);
RT_NOREF(cchWidth, cchPrecision, fFlags);
RT_NOREF(pvUser);
if (id == NULL)
{
return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
"<NULL>");
}
if (id->m_id.present())
{
const OptClientId::value_t &idopt = id->m_id.value();
cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
"[");
for (size_t i = 0; i < idopt.size(); ++i)
{
cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
"%s%02x", (i == 0 ? "" : ":"), idopt[i]);
}
cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
"] (");
}
cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
"%RTmac", &id->m_mac);
if (id->m_id.present())
{
cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
")");
}
return 0;
}
示例2: DECLCALLBACK
static DECLCALLBACK(int) usbProxyWinReset(PUSBPROXYDEV pProxyDev, bool fResetOnLinux)
{
RT_NOREF(fResetOnLinux);
PPRIV_USBW32 pPriv = USBPROXYDEV_2_DATA(pProxyDev, PPRIV_USBW32);
DWORD cbReturned;
int rc;
Assert(pPriv);
Log(("usbproxy: Reset %x\n", pPriv->hDev));
/* Here we just need to assert reset signalling on the USB device */
cbReturned = 0;
if (DeviceIoControl(pPriv->hDev, SUPUSB_IOCTL_USB_RESET, NULL, 0, NULL, 0, &cbReturned, NULL))
{
#if 0 /** @todo this needs to be enabled if windows chooses a default config. Test with the TrekStor GO Stick. */
pProxyDev->iActiveCfg = 1;
pProxyDev->cIgnoreSetConfigs = 2;
#else
pProxyDev->iActiveCfg = -1;
pProxyDev->cIgnoreSetConfigs = 0;
#endif
return VINF_SUCCESS;
}
rc = GetLastError();
if (rc == ERROR_DEVICE_REMOVED)
{
Log(("usbproxy: device %p unplugged!!\n", pPriv->hDev));
pProxyDev->fDetached = true;
}
return RTErrConvertFromWin32(rc);
}
示例3: DECLHIDDEN
DECLHIDDEN(size_t) rtStrFormatKernelAddress(char *pszBuf, size_t cbBuf, RTR0INTPTR uPtr, signed int cchWidth,
signed int cchPrecision, unsigned int fFlags)
{
#ifndef DEBUG
RT_NOREF(uPtr, cchWidth, cchPrecision);
# if R0_ARCH_BITS == 64
static const char s_szObfuscated[] = "0xXXXXXXXXXXXXXXXX";
# else
static const char s_szObfuscated[] = "0xXXXXXXXX";
# endif
size_t cbSrc = sizeof(s_szObfuscated);
const char *pszSrc = s_szObfuscated;
if (!(fFlags & RTSTR_F_SPECIAL))
{
pszSrc += 2;
cbSrc -= 2;
}
if (cbSrc <= cbBuf)
{
memcpy(pszBuf, pszSrc, cbSrc);
return cbSrc - 1;
}
AssertFailed();
memcpy(pszBuf, pszSrc, cbBuf);
pszBuf[cbBuf - 1] = '\0';
return cbBuf - 1;
#else /* DEBUG */
Assert(cbBuf >= 64);
return RTStrFormatNumber(pszBuf, uPtr, 16, cchWidth, cchPrecision, fFlags);
#endif /* DEBUG */
}
示例4: DECLCALLBACK
/**
* Receive thread loop.
*
* @returns VINF_SUCCESS
* @param hThreadSelf Thread handle to this thread.
* @param pvUser User argument.
*/
static DECLCALLBACK(int) drvTCPListenLoop(RTTHREAD hThreadSelf, void *pvUser)
{
RT_NOREF(hThreadSelf);
PDRVTCP pThis = (PDRVTCP)pvUser;
while (RT_LIKELY(!pThis->fShutdown))
{
RTSOCKET hTcpSockNew = NIL_RTSOCKET;
int rc = RTTcpServerListen2(pThis->hTcpServ, &hTcpSockNew);
if (RT_SUCCESS(rc))
{
if (pThis->hTcpSock != NIL_RTSOCKET)
{
LogRel(("DrvTCP%d: only single connection supported\n", pThis->pDrvIns->iInstance));
RTTcpServerDisconnectClient2(hTcpSockNew);
}
else
{
pThis->hTcpSock = hTcpSockNew;
/* Inform the poller about the new socket. */
drvTcpPollerKick(pThis, DRVTCP_WAKEUP_REASON_NEW_CONNECTION);
}
}
}
return VINF_SUCCESS;
}
示例5: VBoxDispDumpPSO
void VBoxDispDumpPSO(SURFOBJ *pso, char *s)
{
RT_NOREF(pso, s);
if (pso)
{
LOG(("Surface %s: %p\n"
" DHSURF dhsurf = %p\n"
" HSURF hsurf = %p\n"
" DHPDEV dhpdev = %p\n"
" HDEV hdev = %p\n"
" SIZEL sizlBitmap = %dx%d\n"
" ULONG cjBits = %p\n"
" PVOID pvBits = %p\n"
" PVOID pvScan0 = %p\n"
" LONG lDelta = %p\n"
" ULONG iUniq = %p\n"
" ULONG iBitmapFormat = %p\n"
" USHORT iType = %p\n"
" USHORT fjBitmap = %p",
s, pso, pso->dhsurf, pso->hsurf, pso->dhpdev, pso->hdev,
pso->sizlBitmap.cx, pso->sizlBitmap.cy, pso->cjBits, pso->pvBits,
pso->pvScan0, pso->lDelta, pso->iUniq, pso->iBitmapFormat, pso->iType, pso->fjBitmap));
}
else
{
LOG(("Surface %s: %p", s, pso));
}
}
示例6: VBoxNetIntIfRingWriteFrame
/**
* Writes a frame packet to the buffer.
*
* @returns VBox status code.
* @param pBuf The buffer.
* @param pRingBuf The ring buffer to read from.
* @param cSegs The number of segments.
* @param paSegs The segments.
*/
int VBoxNetIntIfRingWriteFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, size_t cSegs, PCINTNETSEG paSegs)
{
RT_NOREF(pBuf);
/*
* Validate input.
*/
AssertPtr(pBuf);
AssertPtr(pRingBuf);
AssertPtr(paSegs);
Assert(cSegs > 0);
/*
* Calc frame size.
*/
uint32_t cbFrame = 0;
for (size_t iSeg = 0; iSeg < cSegs; iSeg++)
cbFrame += paSegs[iSeg].cb;
Assert(cbFrame >= sizeof(RTMAC) * 2);
/*
* Allocate a frame, copy the data and commit it.
*/
PINTNETHDR pHdr = NULL;
void *pvFrame = NULL;
int rc = IntNetRingAllocateFrame(pRingBuf, cbFrame, &pHdr, &pvFrame);
if (RT_SUCCESS(rc))
{
vboxnetIntIfCopySG(pvFrame, cSegs, paSegs);
IntNetRingCommitFrame(pRingBuf, pHdr);
return VINF_SUCCESS;
}
return rc;
}
示例7: VBoxDispDrvDisableDirectDraw
VOID APIENTRY VBoxDispDrvDisableDirectDraw(DHPDEV dhpdev)
{
RT_NOREF(dhpdev);
LOGF_ENTER();
LOGF_LEAVE();
return;
}
示例8: vboxVhwaHlpPopulateSurInfo
int vboxVhwaHlpPopulateSurInfo(VBOXVHWA_SURFACEDESC *pInfo, PVBOXWDDM_ALLOCATION pSurf,
uint32_t fFlags, uint32_t cBackBuffers, uint32_t fSCaps,
D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
{
RT_NOREF(VidPnSourceId);
memset(pInfo, 0, sizeof(VBOXVHWA_SURFACEDESC));
#if 0
/**
* The following breaks 2D accelerated video playback because this method is called just after the surface was created
* and most its members are still 0.
*
* @todo: Not 100% sure this is the correct way. It looks like the SegmentId specifies where the memory
* for the surface is stored (VRAM vs. system memory) but because this method is only used
* to query some parameters (using VBOXVHWACMD_SURF_GETINFO) and this command doesn't access any surface memory
* on the host it should be safe.
*/
if (pSurf->AllocData.Addr.SegmentId != 1)
{
WARN(("invalid segment id!"));
return VERR_INVALID_PARAMETER;
}
#endif
pInfo->height = pSurf->AllocData.SurfDesc.height;
pInfo->width = pSurf->AllocData.SurfDesc.width;
pInfo->flags |= VBOXVHWA_SD_HEIGHT | VBOXVHWA_SD_WIDTH;
if (fFlags & VBOXVHWA_SD_PITCH)
{
pInfo->pitch = pSurf->AllocData.SurfDesc.pitch;
pInfo->flags |= VBOXVHWA_SD_PITCH;
pInfo->sizeX = pSurf->AllocData.SurfDesc.cbSize;
pInfo->sizeY = 1;
}
if (cBackBuffers)
{
pInfo->cBackBuffers = cBackBuffers;
pInfo->flags |= VBOXVHWA_SD_BACKBUFFERCOUNT;
}
else
pInfo->cBackBuffers = 0;
pInfo->Reserved = 0;
/** @todo color keys */
// pInfo->DstOverlayCK;
// pInfo->DstBltCK;
// pInfo->SrcOverlayCK;
// pInfo->SrcBltCK;
int rc = vboxVhwaHlpTranslateFormat(&pInfo->PixelFormat, pSurf->AllocData.SurfDesc.format);
AssertRC(rc);
if (RT_SUCCESS(rc))
{
pInfo->flags |= VBOXVHWA_SD_PIXELFORMAT;
pInfo->surfCaps = fSCaps;
pInfo->flags |= VBOXVHWA_SD_CAPS;
pInfo->offSurface = pSurf->AllocData.Addr.offVram;
}
return rc;
}
示例9: VBoxMRxCreateSrvCall
NTSTATUS VBoxMRxCreateSrvCall(PMRX_SRV_CALL pSrvCall, PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
{
PMRX_SRVCALLDOWN_STRUCTURE SrvCalldownStructure = (PMRX_SRVCALLDOWN_STRUCTURE)(pCallbackContext->SrvCalldownStructure);
RT_NOREF(pSrvCall);
Log(("VBOXSF: MRxCreateSrvCall: %p.\n", pSrvCall));
if (IoGetCurrentProcess() == RxGetRDBSSProcess())
{
Log(("VBOXSF: MRxCreateSrvCall: Called in context of RDBSS process\n"));
vbsfExecuteCreateSrvCall(pCallbackContext);
}
else
{
NTSTATUS Status;
Log(("VBOXSF: MRxCreateSrvCall: Dispatching to worker thread\n"));
Status = RxDispatchToWorkerThread(VBoxMRxDeviceObject, DelayedWorkQueue,
(PWORKER_THREAD_ROUTINE)vbsfExecuteCreateSrvCall,
pCallbackContext);
if (Status == STATUS_SUCCESS)
Log(("VBOXSF: MRxCreateSrvCall: queued\n"));
else
{
pCallbackContext->Status = Status;
SrvCalldownStructure->CallBack(pCallbackContext);
}
}
/* RDBSS expect this. */
return STATUS_PENDING;
}
示例10: rtSchedRunThread
/**
* Starts a worker thread and wait for it to complete.
*
* We cannot use RTThreadCreate since we're already owner of the RW lock.
*/
static int rtSchedRunThread(void *(*pfnThread)(void *pvArg), void *pvArg, bool fUsePriorityProxy)
{
/*
* Create the thread.
*/
pthread_t Thread;
int rc;
#ifndef RTTHREAD_POSIX_WITH_CREATE_PRIORITY_PROXY
RT_NOREF(fUsePriorityProxy);
#else
if ( fUsePriorityProxy
&& rtThreadPosixPriorityProxyStart())
rc = rtThreadPosixPriorityProxyCall(NULL, (PFNRT)rtSchedRunThreadCallback, 3, &Thread, pfnThread, pvArg);
else
#endif
rc = rtSchedRunThreadCallback(&Thread, pfnThread, pvArg);
if (RT_SUCCESS(rc))
{
/*
* Wait for the thread to finish.
*/
void *pvRet = (void *)-1;
do
{
rc = pthread_join(Thread, &pvRet);
} while (rc == EINTR);
if (rc)
return RTErrConvertFromErrno(rc);
return (int)(uintptr_t)pvRet;
}
return rc;
}
示例11: VBoxMRxFinalizeVNetRoot
NTSTATUS VBoxMRxFinalizeVNetRoot(IN PMRX_V_NET_ROOT pVNetRoot, IN PBOOLEAN ForceDisconnect)
{
RT_NOREF(pVNetRoot, ForceDisconnect);
Log(("VBOXSF: MRxFinalizeVNetRoot: V_NET_ROOT %p, NET_ROOT %p\n", pVNetRoot, pVNetRoot->pNetRoot));
return STATUS_SUCCESS;
}
示例12: VBoxDrvResetHW
/* Called to reset adapter to a given character mode. */
static BOOLEAN
VBoxDrvResetHW(PVOID HwDeviceExtension, ULONG Columns, ULONG Rows)
{
RT_NOREF(Columns, Rows);
PVBOXMP_DEVEXT pExt = (PVBOXMP_DEVEXT) HwDeviceExtension;
LOGF_ENTER();
if (pExt->iDevice==0) /* Primary device */
{
VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_DISABLED);
#if 0
/* ResetHW is not the place to do such cleanup. See MSDN. */
if (pExt->u.primary.pvReqFlush != NULL)
{
VbglR0GRFree((VMMDevRequestHeader *)pExt->u.primary.pvReqFlush);
pExt->u.primary.pvReqFlush = NULL;
}
VbglR0TerminateClient();
VBoxFreeDisplaysHGSMI(VBoxCommonFromDeviceExt(pExt));
#endif
}
else
{
LOG(("ignoring non primary device %d", pExt->iDevice));
}
LOGF_LEAVE();
/* Tell the system to use VGA BIOS to set the text video mode. */
return FALSE;
}
示例13: RT_NOREF
/**
* Queries information about the object using a specific view, internal version.
*
* @return IPRT status code.
* @param enmView View to use for querying information. Currently ignored.
*/
int DnDURIObject::queryInfoInternal(View enmView)
{
RT_NOREF(enmView);
int rc;
switch (m_enmType)
{
case Type_File:
AssertMsgReturn(RTFileIsValid(u.File.hFile), ("Object has invalid file handle\n"), VERR_INVALID_STATE);
rc = RTFileQueryInfo(u.File.hFile, &u.File.objInfo, RTFSOBJATTRADD_NOTHING);
break;
case Type_Directory:
AssertMsgReturn(RTDirIsValid(u.Dir.hDir), ("Object has invalid directory handle\n"), VERR_INVALID_STATE);
rc = RTDirQueryInfo(u.Dir.hDir, &u.Dir.objInfo, RTFSOBJATTRADD_NOTHING);
break;
default:
rc = VERR_NOT_IMPLEMENTED;
break;
}
return rc;
}
示例14: VBoxDrvGetVideoChildDescriptor
/* Called to enumerate child devices of our adapter, attached monitor(s) in our case */
static VP_STATUS
VBoxDrvGetVideoChildDescriptor(PVOID HwDeviceExtension, PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
PVIDEO_CHILD_TYPE VideoChildType, PUCHAR pChildDescriptor, PULONG pUId,
PULONG pUnused)
{
RT_NOREF(pChildDescriptor, pUnused);
PVBOXMP_DEVEXT pExt = (PVBOXMP_DEVEXT) HwDeviceExtension;
PAGED_CODE();
LOGF_ENTER();
if (ChildEnumInfo->ChildIndex>0)
{
if ((int)ChildEnumInfo->ChildIndex <= VBoxCommonFromDeviceExt(pExt)->cDisplays)
{
*VideoChildType = Monitor;
*pUId = ChildEnumInfo->ChildIndex;
LOGF_LEAVE();
return VIDEO_ENUM_MORE_DEVICES;
}
}
LOGF_LEAVE();
return ERROR_NO_MORE_DEVICES;
}
示例15: __prependHeader
static CRMessageOpcodes *
__prependHeader( CRPackBuffer *buf, unsigned int *len, unsigned int senderID )
{
int num_opcodes;
CRMessageOpcodes *hdr;
RT_NOREF(senderID);
CRASSERT( buf );
CRASSERT( buf->opcode_current < buf->opcode_start );
CRASSERT( buf->opcode_current >= buf->opcode_end );
CRASSERT( buf->data_current > buf->data_start );
CRASSERT( buf->data_current <= buf->data_end );
num_opcodes = buf->opcode_start - buf->opcode_current;
hdr = (CRMessageOpcodes *)
( buf->data_start - ( ( num_opcodes + 3 ) & ~0x3 ) - sizeof(*hdr) );
CRASSERT( (void *) hdr >= buf->pack );
hdr->header.type = CR_MESSAGE_OPCODES;
hdr->numOpcodes = num_opcodes;
*len = buf->data_current - (unsigned char *) hdr;
return hdr;
}