本文整理汇总了C++中LogFlowFunc函数的典型用法代码示例。如果您正苦于以下问题:C++ LogFlowFunc函数的具体用法?C++ LogFlowFunc怎么用?C++ LogFlowFunc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LogFlowFunc函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Initialize
//.........这里部分代码省略.........
nsCOMPtr<nsIEventQueue> eventQ;
rc = NS_GetMainEventQ(getter_AddRefs(eventQ));
if (NS_SUCCEEDED(rc))
{
PRBool isOnMainThread = PR_FALSE;
rc = eventQ->IsOnCurrentThread(&isOnMainThread);
if (NS_SUCCEEDED(rc) && isOnMainThread)
++gXPCOMInitCount;
}
AssertComRC(rc);
return rc;
}
Assert(RTThreadIsMain(RTThreadSelf()));
/* this is the first initialization */
gXPCOMInitCount = 1;
bool const fInitEventQueues = true;
/* prepare paths for registry files */
char szCompReg[RTPATH_MAX];
char szXptiDat[RTPATH_MAX];
int vrc = GetVBoxUserHomeDirectory(szCompReg, sizeof(szCompReg));
AssertRCReturn(vrc, NS_ERROR_FAILURE);
strcpy(szXptiDat, szCompReg);
vrc = RTPathAppend(szCompReg, sizeof(szCompReg), "compreg.dat");
AssertRCReturn(vrc, NS_ERROR_FAILURE);
vrc = RTPathAppend(szXptiDat, sizeof(szXptiDat), "xpti.dat");
AssertRCReturn(vrc, NS_ERROR_FAILURE);
LogFlowFunc(("component registry : \"%s\"\n", szCompReg));
LogFlowFunc(("XPTI data file : \"%s\"\n", szXptiDat));
#if defined (XPCOM_GLUE)
XPCOMGlueStartup(nsnull);
#endif
static const char *kAppPathsToProbe[] =
{
NULL, /* 0: will use VBOX_APP_HOME */
NULL, /* 1: will try RTPathAppPrivateArch() */
#ifdef RT_OS_LINUX
"/usr/lib/virtualbox",
"/opt/VirtualBox",
#elif RT_OS_SOLARIS
"/opt/VirtualBox/amd64",
"/opt/VirtualBox/i386",
#elif RT_OS_DARWIN
"/Application/VirtualBox.app/Contents/MacOS",
#endif
};
/* Find out the directory where VirtualBox binaries are located */
for (size_t i = 0; i < RT_ELEMENTS(kAppPathsToProbe); ++ i)
{
char szAppHomeDir[RTPATH_MAX];
if (i == 0)
{
/* Use VBOX_APP_HOME if present */
vrc = RTEnvGetEx(RTENV_DEFAULT, "VBOX_APP_HOME", szAppHomeDir, sizeof(szAppHomeDir), NULL);
if (vrc == VERR_ENV_VAR_NOT_FOUND)
continue;
开发者ID:quiquetux,项目名称:jokte-ba-as,代码行数:67,代码来源:initterm.cpp
示例2: DECLCALLBACK
DECLCALLBACK(int) VBoxClipboardWorker(void *pInstance, bool volatile *pfShutdown)
{
AssertPtr(pInstance);
LogFlowFunc(("pInstance=%p\n", pInstance));
/*
* Tell the control thread that it can continue
* spawning services.
*/
RTThreadUserSignal(RTThreadSelf());
const PVBOXCLIPBOARDCONTEXT pCtx = (PVBOXCLIPBOARDCONTEXT)pInstance;
AssertPtr(pCtx);
const PVBOXCLIPBOARDWINCTX pWinCtx = &pCtx->Win;
int rc;
/* The thread waits for incoming messages from the host. */
for (;;)
{
uint32_t u32Msg;
uint32_t u32Formats;
rc = VbglR3ClipboardGetHostMsg(pCtx->u32ClientID, &u32Msg, &u32Formats);
if (RT_FAILURE(rc))
{
if (rc == VERR_INTERRUPTED)
break;
LogFunc(("Error getting host message, rc=%Rrc\n", rc));
if (*pfShutdown)
break;
/* Wait a bit before retrying. */
RTThreadSleep(1000);
continue;
}
else
{
LogFlowFunc(("u32Msg=%RU32, u32Formats=0x%x\n", u32Msg, u32Formats));
switch (u32Msg)
{
case VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS:
{
/* The host has announced available clipboard formats.
* Forward the information to the window, so it can later
* respond to WM_RENDERFORMAT message. */
::PostMessage(pWinCtx->hWnd, VBOX_CLIPBOARD_WM_SET_FORMATS, 0, u32Formats);
break;
}
case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA:
{
/* The host needs data in the specified format. */
::PostMessage(pWinCtx->hWnd, VBOX_CLIPBOARD_WM_READ_DATA, 0, u32Formats);
break;
}
case VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT:
{
/* The host is terminating. */
LogRel(("Clipboard: Terminating ...\n"));
ASMAtomicXchgBool(pfShutdown, true);
break;
}
default:
{
LogFlowFunc(("Unsupported message from host, message=%RU32\n", u32Msg));
/* Wait a bit before retrying. */
RTThreadSleep(1000);
break;
}
}
}
if (*pfShutdown)
break;
}
LogFlowFuncLeaveRC(rc);
return rc;
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:85,代码来源:VBoxClipboard.cpp
示例3: LogFlowFunc
/**
* Issued by the QDrag object as soon as the current drop action has changed.
*
* @param dropAction New drop action to use.
*/
void UIDnDMIMEData::sltDropActionChanged(Qt::DropAction dropAction)
{
LogFlowFunc(("dropAction=0x%x\n", dropAction));
m_curAction = dropAction;
}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:10,代码来源:UIDnDMIMEData.cpp
示例4: ip_output0
/* This function will free m0! */
int
ip_output0(PNATState pData, struct socket *so, struct mbuf *m0, int urg)
{
register struct ip *ip;
register struct mbuf *m = m0;
register int hlen = sizeof(struct ip);
int len, off, error = 0;
struct ethhdr *eh = NULL;
uint8_t eth_dst[ETH_ALEN];
int rc = 1;
STAM_PROFILE_START(&pData->StatIP_output, a);
#ifdef LOG_ENABLED
LogFlowFunc(("ip_output: so = %R[natsock], m0 = %lx\n", so, (long)m0));
#else
NOREF(so);
#endif
M_ASSERTPKTHDR(m);
Assert(m->m_pkthdr.header);
#if 0 /* We do no options */
if (opt)
{
m = ip_insertoptions(m, opt, &len);
hlen = len;
}
#endif
ip = mtod(m, struct ip *);
LogFunc(("ip(src:%RTnaipv4, dst:%RTnaipv4)\n", ip->ip_src, ip->ip_dst));
/*
* Fill in IP header.
*/
ip->ip_v = IPVERSION;
ip->ip_off &= IP_DF;
ip->ip_id = RT_H2N_U16(ip_currid++);
ip->ip_hl = hlen >> 2;
ipstat.ips_localout++;
/* Current TCP/IP stack hasn't routing information at
* all so we need to calculate destination ethernet address
*/
rc = rt_lookup_in_cache(pData, ip->ip_dst.s_addr, eth_dst);
if (RT_FAILURE(rc))
goto exit_drop_package;
eh = (struct ethhdr *)(m->m_data - ETH_HLEN);
/*
* If small enough for interface, can just send directly.
*/
if ((u_int16_t)ip->ip_len <= if_mtu)
{
ip->ip_len = RT_H2N_U16((u_int16_t)ip->ip_len);
ip->ip_off = RT_H2N_U16((u_int16_t)ip->ip_off);
ip->ip_sum = 0;
ip->ip_sum = cksum(m, hlen);
if (!(m->m_flags & M_SKIP_FIREWALL)){
struct m_tag *t;
STAM_PROFILE_START(&pData->StatALIAS_output, b);
rc = LibAliasOut(pData->proxy_alias, mtod(m, char *), m_length(m, NULL));
if (rc == PKT_ALIAS_IGNORED)
{
Log(("NAT: packet was droppped\n"));
goto exit_drop_package;
}
STAM_PROFILE_STOP(&pData->StatALIAS_output, b);
}
else
开发者ID:mcenirm,项目名称:vbox,代码行数:71,代码来源:ip_output.c
示例5: usbProxySolarisUrbComplete
/**
* Reads a completed/error'd URB from the client driver (no waiting).
*
* @param pDevSol The Solaris device instance.
*/
static PVUSBURB usbProxySolarisUrbComplete(PUSBPROXYDEVSOL pDevSol)
{
LogFlowFunc((USBPROXY ":usbProxySolarisUrbComplete pDevSol=%p\n", pDevSol));
VBOXUSBREQ_URB UrbReq;
bzero(&UrbReq, sizeof(UrbReq));
int rc = usbProxySolarisIOCtl(pDevSol, VBOXUSB_IOCTL_REAP_URB, &UrbReq, sizeof(UrbReq));
if (RT_SUCCESS(rc))
{
if (UrbReq.pvUrbR3)
{
PUSBPROXYURBSOL pUrbSol = (PUSBPROXYURBSOL)UrbReq.pvUrbR3;
PVUSBURB pUrb = pUrbSol->pVUsbUrb;
if (RT_LIKELY(pUrb))
{
Assert(pUrb->u32Magic == VUSBURB_MAGIC);
/*
* Update the URB.
*/
if ( pUrb->enmType == VUSBXFERTYPE_ISOC
&& pUrb->enmDir == VUSBDIRECTION_IN)
{
size_t cbData = 0;
for (unsigned i = 0; i < UrbReq.cIsocPkts; i++)
{
pUrb->aIsocPkts[i].cb = UrbReq.aIsocPkts[i].cbActPkt;
cbData += UrbReq.aIsocPkts[i].cbActPkt;
pUrb->aIsocPkts[i].enmStatus = UrbReq.aIsocPkts[i].enmStatus;
}
LogFlow((USBPROXY ":usbProxySolarisUrbComplete ISOC cbData=%d cbActPktSum=%d\n", pUrb->cbData, cbData));
pUrb->cbData = cbData;
pUrb->enmStatus = UrbReq.enmStatus;
}
else
{
pUrb->cbData = UrbReq.cbData;
pUrb->enmStatus = UrbReq.enmStatus;
}
RTCritSectEnter(&pDevSol->CritSect);
/*
* Remove from the active list.
*/
if (pUrbSol->pNext)
pUrbSol->pNext->pPrev = pUrbSol->pPrev;
if (pUrbSol->pPrev)
pUrbSol->pPrev->pNext = pUrbSol->pNext;
else
{
Assert(pDevSol->pInFlightHead == pUrbSol);
pDevSol->pInFlightHead = pUrbSol->pNext;
}
/*
* Link it into the taxing list.
*/
pUrbSol->pNext = NULL;
pUrbSol->pPrev = pDevSol->pTaxingTail;
if (pDevSol->pTaxingTail)
pDevSol->pTaxingTail->pNext = pUrbSol;
else
pDevSol->pTaxingHead = pUrbSol;
pDevSol->pTaxingTail = pUrbSol;
RTCritSectLeave(&pDevSol->CritSect);
LogFlow((USBPROXY "usbProxySolarisUrbComplete: cb=%d EndPt=%#x enmDir=%d enmStatus=%s (%d) \n",
pUrb->cbData, pUrb->EndPt, pUrb->enmDir, pUrb->enmStatus == VUSBSTATUS_OK ? "OK" : "** Failed **", pUrb->enmStatus));
// if (pUrb->cbData < 2049)
// LogFlow((USBPROXY "%.*Rhxd\n", pUrb->cbData, pUrb->abData));
return pUrb;
}
}
}
else
{
if (rc != VERR_VUSB_DEVICE_NOT_ATTACHED)
LogRel((USBPROXY ":Reaping URB failed. rc=%Rrc\n", rc));
}
return NULL;
}
开发者ID:Klanly,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:91,代码来源:USBProxyDevice-solaris.cpp
示例6: parallelR3IrqClear
static void parallelR3IrqClear(PARALLELPORT *pThis)
{
LogFlowFunc(("%d 0\n", pThis->iIrq));
PDMDevHlpISASetIrqNoWait(pThis->CTX_SUFF(pDevIns), pThis->iIrq, 0);
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:5,代码来源:DevParallel.cpp
示例7: DECLCALLBACK
static DECLCALLBACK(int) drvscsiReqTransferEnqueue(VSCSILUN hVScsiLun,
void *pvScsiLunUser,
VSCSIIOREQ hVScsiIoReq)
{
int rc = VINF_SUCCESS;
PDRVSCSI pThis = (PDRVSCSI)pvScsiLunUser;
if (pThis->pDrvBlockAsync)
{
/* async I/O path. */
VSCSIIOREQTXDIR enmTxDir;
LogFlowFunc(("Enqueuing hVScsiIoReq=%#p\n", hVScsiIoReq));
enmTxDir = VSCSIIoReqTxDirGet(hVScsiIoReq);
switch (enmTxDir)
{
case VSCSIIOREQTXDIR_FLUSH:
{
rc = pThis->pDrvBlockAsync->pfnStartFlush(pThis->pDrvBlockAsync, hVScsiIoReq);
if ( RT_FAILURE(rc)
&& rc != VERR_VD_ASYNC_IO_IN_PROGRESS
&& pThis->cErrors++ < MAX_LOG_REL_ERRORS)
LogRel(("SCSI#%u: Flush returned rc=%Rrc\n",
pThis->pDrvIns->iInstance, rc));
break;
}
case VSCSIIOREQTXDIR_UNMAP:
{
PCRTRANGE paRanges;
unsigned cRanges;
rc = VSCSIIoReqUnmapParamsGet(hVScsiIoReq, &paRanges, &cRanges);
AssertRC(rc);
pThis->pLed->Asserted.s.fWriting = pThis->pLed->Actual.s.fWriting = 1;
rc = pThis->pDrvBlockAsync->pfnStartDiscard(pThis->pDrvBlockAsync, paRanges, cRanges, hVScsiIoReq);
if ( RT_FAILURE(rc)
&& rc != VERR_VD_ASYNC_IO_IN_PROGRESS
&& pThis->cErrors++ < MAX_LOG_REL_ERRORS)
LogRel(("SCSI#%u: Discard returned rc=%Rrc\n",
pThis->pDrvIns->iInstance, rc));
break;
}
case VSCSIIOREQTXDIR_READ:
case VSCSIIOREQTXDIR_WRITE:
{
uint64_t uOffset = 0;
size_t cbTransfer = 0;
size_t cbSeg = 0;
PCRTSGSEG paSeg = NULL;
unsigned cSeg = 0;
rc = VSCSIIoReqParamsGet(hVScsiIoReq, &uOffset, &cbTransfer,
&cSeg, &cbSeg, &paSeg);
AssertRC(rc);
if (enmTxDir == VSCSIIOREQTXDIR_READ)
{
pThis->pLed->Asserted.s.fReading = pThis->pLed->Actual.s.fReading = 1;
rc = pThis->pDrvBlockAsync->pfnStartRead(pThis->pDrvBlockAsync, uOffset,
paSeg, cSeg, cbTransfer,
hVScsiIoReq);
STAM_REL_COUNTER_ADD(&pThis->StatBytesRead, cbTransfer);
}
else
{
pThis->pLed->Asserted.s.fWriting = pThis->pLed->Actual.s.fWriting = 1;
rc = pThis->pDrvBlockAsync->pfnStartWrite(pThis->pDrvBlockAsync, uOffset,
paSeg, cSeg, cbTransfer,
hVScsiIoReq);
STAM_REL_COUNTER_ADD(&pThis->StatBytesWritten, cbTransfer);
}
if ( RT_FAILURE(rc)
&& rc != VERR_VD_ASYNC_IO_IN_PROGRESS
&& pThis->cErrors++ < MAX_LOG_REL_ERRORS)
LogRel(("SCSI#%u: %s at offset %llu (%u bytes left) returned rc=%Rrc\n",
pThis->pDrvIns->iInstance,
enmTxDir == VSCSIIOREQTXDIR_READ
? "Read"
: "Write",
uOffset,
cbTransfer, rc));
break;
}
default:
AssertMsgFailed(("Invalid transfer direction %u\n", enmTxDir));
}
if (rc == VINF_VD_ASYNC_IO_FINISHED)
{
if (enmTxDir == VSCSIIOREQTXDIR_READ)
pThis->pLed->Actual.s.fReading = 0;
else if (enmTxDir == VSCSIIOREQTXDIR_WRITE)
pThis->pLed->Actual.s.fWriting = 0;
else
AssertMsg(enmTxDir == VSCSIIOREQTXDIR_FLUSH, ("Invalid transfer direction %u\n", enmTxDir));
//.........这里部分代码省略.........
开发者ID:VirtualMonitor,项目名称:VirtualMonitor,代码行数:101,代码来源:DrvSCSI.cpp
示例8: LogFlowFuncEnter
HRESULT Guest::taskCopyFileToGuest(GuestTask *aTask)
{
LogFlowFuncEnter();
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
/*
* Do *not* take a write lock here since we don't (and won't)
* touch any class-specific data (of IGuest) here - only the member functions
* which get called here can do that.
*/
HRESULT rc = S_OK;
try
{
ComObjPtr<Guest> pGuest = aTask->pGuest;
/* Does our source file exist? */
if (!RTFileExists(aTask->strSource.c_str()))
{
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress,
Guest::tr("Source file \"%s\" does not exist, or is not a file"),
aTask->strSource.c_str());
}
else
{
RTFILE fileSource;
int vrc = RTFileOpen(&fileSource, aTask->strSource.c_str(),
RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
if (RT_FAILURE(vrc))
{
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress,
Guest::tr("Could not open source file \"%s\" for reading (%Rrc)"),
aTask->strSource.c_str(), vrc);
}
else
{
uint64_t cbSize;
vrc = RTFileGetSize(fileSource, &cbSize);
if (RT_FAILURE(vrc))
{
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress,
Guest::tr("Could not query file size of \"%s\" (%Rrc)"),
aTask->strSource.c_str(), vrc);
}
else
{
com::SafeArray<IN_BSTR> args;
com::SafeArray<IN_BSTR> env;
/*
* Prepare tool command line.
*/
char szOutput[RTPATH_MAX];
if (RTStrPrintf(szOutput, sizeof(szOutput), "--output=%s", aTask->strDest.c_str()) <= sizeof(szOutput) - 1)
{
/*
* Normalize path slashes, based on the detected guest.
*/
Utf8Str osType = mData.mOSTypeId;
if ( osType.contains("Microsoft", Utf8Str::CaseInsensitive)
|| osType.contains("Windows", Utf8Str::CaseInsensitive))
{
/* We have a Windows guest. */
RTPathChangeToDosSlashes(szOutput, true /* Force conversion. */);
}
else /* ... or something which isn't from Redmond ... */
{
RTPathChangeToUnixSlashes(szOutput, true /* Force conversion. */);
}
args.push_back(Bstr(szOutput).raw()); /* We want to write a file ... */
}
else
{
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress,
Guest::tr("Error preparing command line"));
}
ComPtr<IProgress> execProgress;
ULONG uPID;
if (SUCCEEDED(rc))
{
LogRel(("Copying file \"%s\" to guest \"%s\" (%u bytes) ...\n",
aTask->strSource.c_str(), aTask->strDest.c_str(), cbSize));
/*
* Okay, since we gathered all stuff we need until now to start the
* actual copying, start the guest part now.
*/
rc = pGuest->executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_CAT).raw(),
Bstr("Copying file to guest").raw(),
ComSafeArrayAsInParam(args),
ComSafeArrayAsInParam(env),
Bstr(aTask->strUserName).raw(),
Bstr(aTask->strPassword).raw(),
ExecuteProcessFlag_WaitForProcessStartOnly,
NULL, NULL,
execProgress.asOutParam(), &uPID);
//.........这里部分代码省略.........
开发者ID:quiquetux,项目名称:jokte-ba-as,代码行数:101,代码来源:GuestCtrlImplTasks.cpp
示例9: switch
int DnDManager::addMessage(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
{
int rc = VINF_SUCCESS;
switch (uMsg)
{
case DragAndDropSvc::HOST_DND_HG_EVT_ENTER:
{
clear();
LogFlowFunc(("HOST_DND_HG_EVT_ENTER\n"));
DO(("HOST_DND_HG_EVT_ENTER\n"));
/* Verify parameter count and types. */
if ( cParms != 7
|| paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* screen id */
|| paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* x-pos */
|| paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* y-pos */
|| paParms[3].type != VBOX_HGCM_SVC_PARM_32BIT /* default action */
|| paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT /* allowed actions */
|| paParms[5].type != VBOX_HGCM_SVC_PARM_PTR /* data */
|| paParms[6].type != VBOX_HGCM_SVC_PARM_32BIT /* size */)
rc = VERR_INVALID_PARAMETER;
else
{
m_fOpInProcess = true;
DnDGenericMessage *pMessage = new DnDGenericMessage(uMsg, cParms, paParms);
m_dndMessageQueue.append(pMessage);
}
break;
}
case DragAndDropSvc::HOST_DND_HG_EVT_MOVE:
{
LogFlowFunc(("HOST_DND_HG_EVT_MOVE\n"));
DO(("HOST_DND_HG_EVT_MOVE\n"));
/* Verify parameter count and types. */
if ( cParms != 7
|| paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* screen id */
|| paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* x-pos */
|| paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* y-pos */
|| paParms[3].type != VBOX_HGCM_SVC_PARM_32BIT /* default action */
|| paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT /* allowed actions */
|| paParms[5].type != VBOX_HGCM_SVC_PARM_PTR /* data */
|| paParms[6].type != VBOX_HGCM_SVC_PARM_32BIT /* size */)
rc = VERR_INVALID_PARAMETER;
else
{
m_fOpInProcess = true;
DnDGenericMessage *pMessage = new DnDGenericMessage(uMsg, cParms, paParms);
m_dndMessageQueue.append(pMessage);
}
break;
}
case DragAndDropSvc::HOST_DND_HG_EVT_LEAVE:
{
LogFlowFunc(("HOST_DND_HG_EVT_LEAVE\n"));
DO(("HOST_DND_HG_EVT_LEAVE\n"));
/* Verify parameter count and types. */
if (cParms != 0)
rc = VERR_INVALID_PARAMETER;
else
{
DnDGenericMessage *pMessage = new DnDGenericMessage(uMsg, cParms, paParms);
m_dndMessageQueue.append(pMessage);
}
m_fOpInProcess = false;
break;
}
case DragAndDropSvc::HOST_DND_HG_EVT_DROPPED:
{
LogFlowFunc(("HOST_DND_HG_EVT_DROPPED\n"));
DO(("HOST_DND_HG_EVT_DROPPED\n"));
/* Verify parameter count and types. */
if ( cParms != 7
|| paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* screen id */
|| paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* x-pos */
|| paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* y-pos */
|| paParms[3].type != VBOX_HGCM_SVC_PARM_32BIT /* default action */
|| paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT /* allowed actions */
|| paParms[5].type != VBOX_HGCM_SVC_PARM_PTR /* data */
|| paParms[6].type != VBOX_HGCM_SVC_PARM_32BIT /* size */)
rc = VERR_INVALID_PARAMETER;
else
{
DnDGenericMessage *pMessage = new DnDGenericMessage(uMsg, cParms, paParms);
m_dndMessageQueue.append(pMessage);
}
break;
}
case DragAndDropSvc::HOST_DND_HG_SND_DATA:
{
LogFlowFunc(("HOST_DND_HG_SND_DATA\n"));
DO(("HOST_DND_HG_SND_DATA\n"));
/* Verify parameter count and types. */
if ( cParms != 5
|| paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* screen id */
|| paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* format */
|| paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* format size */
|| paParms[3].type != VBOX_HGCM_SVC_PARM_PTR /* data */
|| paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT /* data size */)
rc = VERR_INVALID_PARAMETER;
//.........这里部分代码省略.........
开发者ID:leopucci,项目名称:VirtualMonitor,代码行数:101,代码来源:dndmanager.cpp
示例10: fvsnode_make_stale
/*
* Some sort of host operation on an vboxfs_node has failed or it has been
* deleted. Mark this node and any children as stale, deleting knowledge
* about any which do not have active vnodes or children
* This also handle deleting an inactive node that was already stale.
*/
static void
fvsnode_make_stale(struct vboxfs_node *node)
{
struct vboxfs_node *np;
int len;
avl_index_t where;
/*
* First deal with any children of a directory node.
* If a directory becomes stale, anything below it becomes stale too.
*/
if (!node->sf_is_stale && node->sf_type == VDIR) {
len = strlen(node->sf_path);
np = node;
while ((np = AVL_NEXT(&sfnodes, node)) != NULL) {
ASSERT(!n->sf_is_stale);
/*
* quit when no longer seeing children of node
*/
if (n->sf_sffs != node->sf_sffs ||
strncmp(node->sf_path, n->sf_path, len) != 0 ||
n->sf_path[len] != '/')
break;
/*
* Either mark the child as stale or destroy it
*/
if (n->sf_vnode == NULL && n->sf_children == 0) {
sfnode_destroy(n);
} else {
LogFlowFunc(("sffs_make_stale(%s) sub\n",
n->sf_path));
sfnode_clear_dir_list(n);
if (avl_find(&sfnodes, n, &where) == NULL)
panic("sfnode_make_stale(%s)"
" not in sfnodes", n->sf_path);
avl_remove(&sfnodes, n);
n->sf_is_stale = 1;
if (avl_find(&stale_sfnodes, n, &where) != NULL)
panic("sffs_make_stale(%s) duplicates",
n->sf_path);
avl_insert(&stale_sfnodes, n, where);
}
}
}
/*
* Now deal with the given node.
*/
if (node->sf_vnode == NULL && node->sf_children == 0) {
sfnode_destroy(node);
} else if (!node->sf_is_stale) {
LogFlowFunc(("sffs_make_stale(%s)\n", node->sf_path));
sfnode_clear_dir_list(node);
if (node->sf_parent)
sfnode_clear_dir_list(node->sf_parent);
if (avl_find(&sfnodes, node, &where) == NULL)
panic("sfnode_make_stale(%s) not in sfnodes",
node->sf_path);
avl_remove(&sfnodes, node);
node->sf_is_stale = 1;
if (avl_find(&stale_sfnodes, node, &where) != NULL)
panic("sffs_make_stale(%s) duplicates", node->sf_path);
avl_insert(&stale_sfnodes, node, where);
}
}
开发者ID:gonzoua,项目名称:freebsd-vboxfs,代码行数:75,代码来源:vboxvfs_sfnode.c
示例11: Log
status_t VBoxMouse::Start(const char *device, void *cookie)
{
#if 0
status_t err;
int rc;
uint32_t fFeatures = 0;
Log(("VBoxMouse::%s()\n", __FUNCTION__));
rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
if (RT_SUCCESS(rc))
rc = VbglR3SetMouseStatus(fFeatures
| VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
| VMMDEV_MOUSE_NEW_PROTOCOL);
if (!RT_SUCCESS(rc))
{
LogRel(("VBoxMouse: Error switching guest mouse into absolute mode: %d\n", rc));
return B_DEVICE_NOT_FOUND;
}
err = fServiceThreadID = spawn_thread(_ServiceThreadNub,
"VBoxMouse", B_NORMAL_PRIORITY, this);
if (err >= B_OK)
{
resume_thread(fServiceThreadID);
return B_OK;
}
else
LogRel(("VBoxMouse: Error starting service thread: 0x%08lx\n",
err));
// release the mouse
rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
if (RT_SUCCESS(rc))
rc = VbglR3SetMouseStatus(fFeatures
& ~VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
& ~VMMDEV_MOUSE_NEW_PROTOCOL);
return B_ERROR;
#endif
status_t err = B_OK;
int rc;
uint32_t fFeatures = 0;
LogFlowFunc(("device=%s cookie=%p\n", device, cookie));
rc = vboxMouseAcquire();
if (RT_SUCCESS(rc))
{
err = fServiceThreadID = spawn_thread(_ServiceThreadNub, "VBoxMouse", B_NORMAL_PRIORITY, this);
if (err >= B_OK)
{
resume_thread(fServiceThreadID);
return B_OK;
}
else
LogRel(("VBoxMouse::Start Error starting service thread: 0x%08lx\n", err));
vboxMouseRelease();
err = B_ERROR;
}
else
{
LogRel(("VBoxMouse::Start vboxMouseAcquire failed. rc=%d\n", rc));
err = B_DEVICE_NOT_FOUND;
}
return err;
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:68,代码来源:VBoxMouse.cpp
示例12: AssertPtrReturn
STDMETHODIMP VBoxDnDDropTarget::Drop(IDataObject *pDataObject,
DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
{
AssertPtrReturn(pDataObject, E_INVALIDARG);
AssertPtrReturn(pdwEffect, E_INVALIDARG);
#ifdef DEBUG
LogFlowFunc(("mFormatEtc.cfFormat=%RI16 (%s), pDataObject=0x%p, grfKeyState=0x%x, x=%ld, y=%ld\n",
mFormatEtc.cfFormat, VBoxDnDDataObject::ClipboardFormatToString(mFormatEtc.cfFormat),
pDataObject, grfKeyState, pt.x, pt.y));
#endif
HRESULT hr = S_OK;
if (mFormatEtc.cfFormat) /* Did we get a supported format yet? */
{
/* Make sure the data object's data format is still the same
* as we got it in DragEnter(). */
hr = pDataObject->QueryGetData(&mFormatEtc);
AssertMsg(SUCCEEDED(hr),
("Data format changed between DragEnter() and Drop(), cfFormat=%RI16 (%s), hr=%Rhrc\n",
mFormatEtc.cfFormat, VBoxDnDDataObject::ClipboardFormatToString(mFormatEtc.cfFormat),
hr));
}
int rc = VINF_SUCCESS;
if (SUCCEEDED(hr))
{
STGMEDIUM stgMed;
hr = pDataObject->GetData(&mFormatEtc, &stgMed);
if (SUCCEEDED(hr))
{
/*
* First stage: Prepare the access to the storage medium.
* For now we only support HGLOBAL stuff.
*/
PVOID pvData = NULL; /** @todo Put this in an own union? */
switch (mFormatEtc.tymed)
{
case TYMED_HGLOBAL:
pvData = GlobalLock(stgMed.hGlobal);
if (!pvData)
{
LogFlowFunc(("Locking HGLOBAL storage failed with %Rrc\n",
RTErrConvertFromWin32(GetLastError())));
rc = VERR_INVALID_HANDLE;
hr = E_INVALIDARG; /* Set special hr for OLE. */
}
break;
default:
AssertMsgFailed(("Storage medium type %RI32 supported\n",
mFormatEtc.tymed));
rc = VERR_NOT_SUPPORTED;
hr = DV_E_TYMED; /* Set special hr for OLE. */
break;
}
if (RT_SUCCESS(rc))
{
/* Second stage: Do the actual copying of the data object's data,
based on the storage medium type. */
switch (mFormatEtc.cfFormat)
{
case CF_UNICODETEXT:
{
AssertPtr(pvData);
size_t cbSize = GlobalSize(pvData);
LogFlowFunc(("CF_UNICODETEXT 0x%p got %zu bytes\n", pvData, cbSize));
if (cbSize)
{
char *pszText = NULL;
rc = RTUtf16ToUtf8((PCRTUTF16)pvData, &pszText);
if (RT_SUCCESS(rc))
{
mpvData = (void *)pszText;
mcbData = strlen(pszText) + 1; /* Include termination. */
/* Note: Don't free data of pszText, mpvData now owns it. */
}
}
break;
}
case CF_TEXT:
{
AssertPtr(pvData);
size_t cbSize = GlobalSize(pvData);
LogFlowFunc(("CF_TEXT 0x%p got %zu bytes\n", pvData, cbSize));
if (cbSize)
{
char *pszText = NULL;
rc = RTStrCurrentCPToUtf8(&pszText, (char *)pvData);
if (RT_SUCCESS(rc))
{
mpvData = (void *)pszText;
mcbData = strlen(pszText) + 1; /* Include termination. */
//.........这里部分代码省略.........
开发者ID:egraba,项目名称:vbox_openbsd,代码行数:101,代码来源:VBoxDnDDropTarget.cpp
示例13: LogFlowFunc
/* static */
const char* VBoxDnDDataObject::ClipboardFormatToString(CLIPFORMAT fmt)
{
#ifdef VBOX_DND_DEBUG_FORMATS
char szFormat[128];
if (GetClipboardFormatName(fmt, szFormat, sizeof(szFormat)))
LogFlowFunc(("wFormat=%RI16, szName=%s\n", fmt, szFormat));
#endif
switch (fmt)
{
case 1:
return "CF_TEXT";
case 2:
return "CF_BITMAP";
case 3:
return "CF_METAFILEPICT";
case 4:
return "CF_SYLK";
case 5:
return "CF_DIF";
case 6:
return "CF_TIFF";
case 7:
return "CF_OEMTEXT";
case 8:
return "CF_DIB";
case 9:
return "CF_PALETTE";
case 10:
return "CF_PENDATA";
case 11:
return "CF_RIFF";
case 12:
return "CF_WAVE";
case 13:
return "CF_UNICODETEXT";
case 14:
return "CF_ENHMETAFILE";
case 15:
return "CF_HDROP";
case 16:
return "CF_LOCALE";
case 17:
return "CF_DIBV5";
case 18:
return "CF_MAX";
case 49158:
return "FileName";
case 49159:
return "FileNameW";
case 49161:
return "DATAOBJECT";
case 49171:
return "Ole Private Data";
case 49314:
return "Shell Object Offsets";
case 49316:
return "File Contents";
case 49317:
return "File Group Descriptor";
case 49323:
return "Preferred Drop Effect";
case 49380:
return "Shell Object Offsets";
case 49382:
return "FileContents";
case 49383:
return "FileGroupDescriptor";
case 49389:
return "Preferred DropEffect";
case 49268:
return "Shell IDList Array";
case 49619:
return "RenPrivateFileAttachments";
default:
break;
}
return "unknown";
}
开发者ID:solooboroten,项目名称:VirtualBox-OSE,代码行数:82,代码来源:VBoxDnDDataObject.cpp
示例14: DECLCALLBACK
/**
* Thread function to wait for and process seamless mode change
* requests
*/
static DECLCALLBACK(int) VBoxSeamlessWorker(void *pInstance, bool volatile *pfShutdown)
{
AssertPtrReturn(pInstance, VERR_INVALID_POINTER);
LogFlowFunc(("pInstance=%p\n", pInstance));
/*
* Tell the control thread that it can continue
* spawning services.
*/
RTThreadUserSignal(RTThreadSelf());
PVBOXSEAMLESSCONTEXT pCtx = (PVBOXSEAMLESSCONTEXT)pInstance;
HANDLE gVBoxDriver = pCtx->pEnv->hDriver;
VBoxGuestFilterMaskInfo maskInfo;
DWORD cbReturned;
BOOL fWasScreenSaverActive = FALSE, fRet;
maskInfo.u32OrMask = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
maskInfo.u32NotMask = 0;
if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
{
DWORD dwErr = GetLastError();
LogRel(("Seamless: DeviceIOControl(CtlMask) failed with %ld, exiting ...\n", dwErr));
return RTErrConvertFromWin32(dwErr);
}
int rc = VINF_SUCCESS;
for (;;)
{
/* wait for a seamless change event */
VBoxGuestWaitEventInfo waitEvent;
waitEvent.u32TimeoutIn = 5000;
waitEvent.u32EventMaskIn = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL))
{
/* are we supposed to stop? */
if (*pfShutdown)
break;
/* did we get the right event? */
if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
{
/* We got at least one event. Read the requested resolution
* and try to set it until success. New events will not be seen
* but a new resolution will be read in this poll loop.
*/
for (;;)
{
/* get the seamless change request */
VMMDevSeamlessChangeRequest seamlessChangeRequest = {0};
vmmdevInitRequest((VMMDevRequestHeader*)&seamlessChangeRequest, VMMDevReq_GetSeamlessChangeRequest);
seamlessChangeRequest.eventAck = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
BOOL fSeamlessChangeQueried = DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(seamlessChangeRequest)), &seamlessChangeRequest, sizeof(seamlessChangeRequest),
&seamlessChangeRequest, sizeof(seamlessChangeRequest), &cbReturned, NULL);
if (fSeamlessChangeQueried)
{
LogFlowFunc(("Mode changed to %d\n", seamlessChangeRequest.mode));
switch(seamlessChangeRequest.mode)
{
case VMMDev_Seamless_Disabled:
if (fWasScreenSaverActive)
{
LogRel(("Seamless: Re-enabling the screensaver\n"));
fRet = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0);
if (!fRet)
LogRel(("Seamless: SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %ld\n", GetLastError()));
}
PostMessage(g_hwndToolWindow, WM_VBOX_SEAMLESS_DISABLE, 0, 0);
break;
case VMMDev_Seamless_Visible_Region:
fRet = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &fWasScreenSaverActive, 0);
if (!fRet)
LogRel(("Seamless: SystemParametersInfo SPI_GETSCREENSAVEACTIVE failed with %ld\n", GetLastError()));
if (fWasScreenSaverActive)
LogRel(("Seamless: Disabling the screensaver\n"));
fRet = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
if (!fRet)
LogRel(("Seamless: SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %ld\n", GetLastError()));
PostMessage(g_hwndToolWindow, WM_VBOX_SEAMLESS_ENABLE, 0, 0);
break;
case VMMDev_Seamless_Host_Window:
break;
default:
AssertFailed();
break;
}
break;
//.........这里部分代码省略.........
开发者ID:bhanug,项目名称:virtualbox,代码行数:101,代码来源:VBoxSeamless.cpp
示例15: PDMBOTHCBDECL
/**
* @callback_method_impl{FNIOMIOPORTOUT}
*/
PDMBOTHCBDECL(int) parallelIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
{
PARALLELPORT *pThis = PDMINS_2_DATA(pDevIns, PPARALLELPORT);
int rc = VINF_SUCCESS;
RT_NOREF_PV(pvUser);
if (cb == 1)
{
uint8_t u8 = u32;
Log2(("%s: port %#06x val %#04x\n", __FUNCTION__, uPort, u32));
uPort &= 7;
switch (uPort)
{
case 0:
#ifndef IN_RING3
NOREF(u8);
rc = VINF_IOM_R3_IOPORT_WRITE;
#else
pThis->regData = u8;
if (RT_LIKELY(pThis->pDrvHostParallelConnector))
{
LogFlowFunc(("Set data lines 0x%X\n", u8));
rc = pThis->pDrvHostParallelConnector->pfnWrite(pThis->pDrvHostParallelConnector, &u8, 1, PDM_PARALLEL_PORT_MODE_SPP);
AssertRC(rc);
}
#endif
break;
case 1:
break;
case 2:
/* Set the reserved bits to one */
u8 |= (LPT_CONTROL_BIT6 | LPT_CONTROL_BIT7);
if (u8 != pThis->regControl)
{
#ifndef IN_RING3
return VINF_IOM_R3_IOPORT_WRITE;
#else
if (RT_LIKELY(pThis->pDrvHostParallelConnector))
{
/* Set data direction. */
if (u8 & LPT_CONTROL_ENABLE_BIDIRECT)
rc = pThis->pDrvHostParallelConnector->pfnSetPortDirection(pThis->pDrvHostParallelConnector, false /* fForward */);
else
rc = pThis->pDrvHostParallelConnector->pfnSetPortDirection(pThis->pDrvHostParallelConnector, true /* fForward */);
AssertRC(rc);
u8 &= ~LPT_CONTROL_ENABLE_
|
请发表评论