本文整理汇总了C++中RT_OFFSETOF函数的典型用法代码示例。如果您正苦于以下问题:C++ RT_OFFSETOF函数的具体用法?C++ RT_OFFSETOF怎么用?C++ RT_OFFSETOF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RT_OFFSETOF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RTDECL
RTDECL(bool) RTThreadPreemptIsPending(RTTHREAD hThread)
{
Assert(hThread == NIL_RTTHREAD); RT_NOREF1(hThread);
/*
* Read the globals and check if they are useful.
*/
/** @todo Should we check KPRCB.InterruptRequest and KPRCB.DpcInterruptRequested (older kernels). */
uint32_t const offQuantumEnd = g_offrtNtPbQuantumEnd;
uint32_t const cbQuantumEnd = g_cbrtNtPbQuantumEnd;
uint32_t const offDpcQueueDepth = g_offrtNtPbDpcQueueDepth;
if (!offQuantumEnd && !cbQuantumEnd && !offDpcQueueDepth)
return false;
Assert((offQuantumEnd && cbQuantumEnd) || (!offQuantumEnd && !cbQuantumEnd));
/*
* Disable interrupts so we won't be messed around.
*/
bool fPending;
RTCCUINTREG fSavedFlags = ASMIntDisableFlags();
#ifdef RT_ARCH_X86
PKPCR pPcr = (PKPCR)__readfsdword(RT_OFFSETOF(KPCR,SelfPcr));
uint8_t *pbPrcb = (uint8_t *)pPcr->Prcb;
#elif defined(RT_ARCH_AMD64)
/* HACK ALERT! The offset is from windbg/vista64. */
PKPCR pPcr = (PKPCR)__readgsqword(RT_OFFSETOF(KPCR,Self));
uint8_t *pbPrcb = (uint8_t *)pPcr->CurrentPrcb;
#else
# error "port me"
#endif
/* Check QuantumEnd. */
if (cbQuantumEnd == 1)
{
uint8_t volatile *pbQuantumEnd = (uint8_t volatile *)(pbPrcb + offQuantumEnd);
fPending = *pbQuantumEnd == TRUE;
}
else if (cbQuantumEnd == sizeof(uint32_t))
{
uint32_t volatile *pu32QuantumEnd = (uint32_t volatile *)(pbPrcb + offQuantumEnd);
fPending = *pu32QuantumEnd != 0;
}
else
fPending = false;
/* Check DpcQueueDepth. */
if ( !fPending
&& offDpcQueueDepth)
{
uint32_t volatile *pu32DpcQueueDepth = (uint32_t volatile *)(pbPrcb + offDpcQueueDepth);
fPending = *pu32DpcQueueDepth > 0;
}
ASMSetFlags(fSavedFlags);
return fPending;
}
示例2: VMMR3DECL
/**
* Initializes the interpreted execution manager.
*
* This must be called after CPUM as we're quering information from CPUM about
* the guest and host CPUs.
*
* @returns VBox status code.
* @param pVM The cross context VM structure.
*/
VMMR3DECL(int) IEMR3Init(PVM pVM)
{
for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
{
PVMCPU pVCpu = &pVM->aCpus[idCpu];
pVCpu->iem.s.offVM = -RT_OFFSETOF(VM, aCpus[idCpu].iem.s);
pVCpu->iem.s.offVMCpu = -RT_OFFSETOF(VMCPU, iem.s);
pVCpu->iem.s.pCtxR3 = CPUMQueryGuestCtxPtr(pVCpu);
pVCpu->iem.s.pCtxR0 = VM_R0_ADDR(pVM, pVCpu->iem.s.pCtxR3);
pVCpu->iem.s.pCtxRC = VM_RC_ADDR(pVM, pVCpu->iem.s.pCtxR3);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cInstructions, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"Instructions interpreted", "/IEM/CPU%u/cInstructions", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cPotentialExits, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"Potential exits", "/IEM/CPU%u/cPotentialExits", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cRetAspectNotImplemented, STAMTYPE_U32_RESET, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"VERR_IEM_ASPECT_NOT_IMPLEMENTED", "/IEM/CPU%u/cRetAspectNotImplemented", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cRetInstrNotImplemented, STAMTYPE_U32_RESET, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"VERR_IEM_INSTR_NOT_IMPLEMENTED", "/IEM/CPU%u/cRetInstrNotImplemented", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cRetInfStatuses, STAMTYPE_U32_RESET, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"Informational statuses returned", "/IEM/CPU%u/cRetInfStatuses", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cRetErrStatuses, STAMTYPE_U32_RESET, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
"Error statuses returned", "/IEM/CPU%u/cRetErrStatuses", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cbWritten, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
"Approx bytes written", "/IEM/CPU%u/cbWritten", idCpu);
STAMR3RegisterF(pVM, &pVCpu->iem.s.cPendingCommit, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
"Times RC/R0 had to postpone instruction committing to ring-3", "/IEM/CPU%u/cPendingCommit", idCpu);
/*
* Host and guest CPU information.
*/
if (idCpu == 0)
{
pVCpu->iem.s.enmCpuVendor = CPUMGetGuestCpuVendor(pVM);
pVCpu->iem.s.enmHostCpuVendor = CPUMGetHostCpuVendor(pVM);
}
else
{
pVCpu->iem.s.enmCpuVendor = pVM->aCpus[0].iem.s.enmCpuVendor;
pVCpu->iem.s.enmHostCpuVendor = pVM->aCpus[0].iem.s.enmHostCpuVendor;
}
/*
* Mark all buffers free.
*/
uint32_t iMemMap = RT_ELEMENTS(pVCpu->iem.s.aMemMappings);
while (iMemMap-- > 0)
pVCpu->iem.s.aMemMappings[iMemMap].fAccess = IEM_ACCESS_INVALID;
}
return VINF_SUCCESS;
}
示例3: RTDECL
RTDECL(int) RTAsn1ContentAllocZ(PRTASN1CORE pAsn1Core, size_t cb, PCRTASN1ALLOCATORVTABLE pAllocator)
{
AssertReturn(pAllocator != NULL, VERR_WRONG_ORDER);
AssertReturn(cb > 0 && cb < _1G, VERR_INVALID_PARAMETER);
AssertPtr(pAsn1Core);
AssertReturn(!(pAsn1Core->fFlags & RTASN1CORE_F_ALLOCATED_CONTENT), VERR_INVALID_STATE);
/* Initialize the temporary allocation tracker. */
RTASN1ALLOCATION Allocation;
Allocation.cbAllocated = 0;
Allocation.cReallocs = 0;
Allocation.uReserved0 = 0;
Allocation.pAllocator = pAllocator;
/* Make the allocation. */
uint32_t cbAlloc = RT_OFFSETOF(RTASN1MEMCONTENT, au64Content) + (uint32_t)cb;
PRTASN1MEMCONTENT pHdr;
int rc = pAllocator->pfnAlloc(pAllocator, &Allocation, (void **)&pHdr, cbAlloc);
if (RT_SUCCESS(rc))
{
Assert(Allocation.cbAllocated >= cbAlloc);
pHdr->Allocation = Allocation;
pAsn1Core->cb = (uint32_t)cb;
pAsn1Core->uData.pv = &pHdr->au64Content[0];
pAsn1Core->fFlags |= RTASN1CORE_F_ALLOCATED_CONTENT;
}
return rc;
}
示例4: vboxNetAdpCreate
int vboxNetAdpCreate(PINTNETTRUNKFACTORY pIfFactory, PVBOXNETADP *ppNew)
{
int rc;
unsigned i;
PVBOXNETADPGLOBALS pGlobals = (PVBOXNETADPGLOBALS)((uint8_t *)pIfFactory - RT_OFFSETOF(VBOXNETADPGLOBALS, TrunkFactory));
for (i = 0; i < RT_ELEMENTS(pGlobals->aAdapters); i++)
{
RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;
PVBOXNETADP pThis = &pGlobals->aAdapters[i];
if (vboxNetAdpCheckAndSetState(pThis, kVBoxNetAdpState_Invalid, kVBoxNetAdpState_Transitional))
{
/* Found an empty slot -- use it. */
uint32_t cRefs = ASMAtomicIncU32(&pThis->cRefs);
Assert(cRefs == 1);
RTMAC Mac;
vboxNetAdpComposeMACAddress(pThis, &Mac);
rc = vboxNetAdpOsCreate(pThis, &Mac);
*ppNew = pThis;
RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp);
vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available);
RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp);
return rc;
}
}
/* All slots in adapter array are busy. */
return VERR_OUT_OF_RESOURCES;
}
示例5: VBOXUSBTOOL_DECL
VBOXUSBTOOL_DECL(NTSTATUS) VBoxUsbToolGetStringDescriptor(PDEVICE_OBJECT pDevObj, char *pszResult, ULONG cbResult,
int iIndex, int LangId, ULONG dwTimeoutMs)
{
char aBuf[MAXIMUM_USB_STRING_LENGTH];
AssertCompile(sizeof (aBuf) <= UINT8_MAX);
UCHAR cbBuf = (UCHAR)sizeof (aBuf);
PUSB_STRING_DESCRIPTOR pDr = (PUSB_STRING_DESCRIPTOR)&aBuf;
Assert(pszResult);
*pszResult = 0;
memset(pDr, 0, cbBuf);
pDr->bLength = cbBuf;
pDr->bDescriptorType = USB_STRING_DESCRIPTOR_TYPE;
NTSTATUS Status = VBoxUsbToolGetDescriptor(pDevObj, pDr, cbBuf, USB_STRING_DESCRIPTOR_TYPE, iIndex, LangId, dwTimeoutMs);
if (NT_SUCCESS(Status))
{
if (pDr->bLength >= sizeof (USB_STRING_DESCRIPTOR))
{
int rc = RTUtf16ToUtf8Ex(pDr->bString, (pDr->bLength - RT_OFFSETOF(USB_STRING_DESCRIPTOR, bString)) / sizeof(RTUTF16),
&pszResult, cbResult, NULL /*pcch*/);
if (RT_SUCCESS(rc))
{
USBLibPurgeEncoding(pszResult);
Status = STATUS_SUCCESS;
}
else
Status = STATUS_UNSUCCESSFUL;
}
else
Status = STATUS_INVALID_PARAMETER;
}
return Status;
}
示例6: rtFsExtLoadBlkGrpDesc
/**
* Loads the block descriptor of the given block group from the medium.
*
* @returns IPRT status code.
* @param pThis EXT filesystem instance data.
* @param iBlkGrp Block group number to load.
*/
static int rtFsExtLoadBlkGrpDesc(PRTFILESYSTEMEXT pThis, uint32_t iBlkGrp)
{
int rc = VINF_SUCCESS;
PRTFILESYSTEMEXTBLKGRP pBlkGrpDesc = pThis->pBlkGrpDesc;
uint64_t offRead = (pThis->iSbBlock + 1) * pThis->cbBlock;
BlockGroupDesc BlkDesc;
size_t cbBlockBitmap;
cbBlockBitmap = pThis->cBlocksPerGroup / 8;
if (pThis->cBlocksPerGroup % 8)
cbBlockBitmap++;
if (!pBlkGrpDesc)
{
size_t cbBlkDesc = RT_OFFSETOF(RTFILESYSTEMEXTBLKGRP, abBlockBitmap[cbBlockBitmap]);
pBlkGrpDesc = (PRTFILESYSTEMEXTBLKGRP)RTMemAllocZ(cbBlkDesc);
if (!pBlkGrpDesc)
return VERR_NO_MEMORY;
}
rc = RTVfsFileReadAt(pThis->hVfsFile, offRead, &BlkDesc, sizeof(BlkDesc), NULL);
if (RT_SUCCESS(rc))
{
pBlkGrpDesc->offStart = pThis->iSbBlock + (uint64_t)iBlkGrp * pThis->cBlocksPerGroup * pThis->cbBlock;
pBlkGrpDesc->offLast = pBlkGrpDesc->offStart + pThis->cBlocksPerGroup * pThis->cbBlock;
rc = RTVfsFileReadAt(pThis->hVfsFile, BlkDesc.offBlockBitmap * pThis->cbBlock,
&pBlkGrpDesc->abBlockBitmap[0], cbBlockBitmap, NULL);
}
pThis->pBlkGrpDesc = pBlkGrpDesc;
return rc;
}
示例7: DECLCALLBACK
/**
* @copydoc RAWPCIFACTORY::pfnCreateAndConnect
*/
static DECLCALLBACK(int) vboxPciFactoryCreateAndConnect(PRAWPCIFACTORY pFactory,
uint32_t u32HostAddress,
uint32_t fFlags,
PRAWPCIPERVM pVmCtx,
PRAWPCIDEVPORT *ppDevPort,
uint32_t *pfDevFlags)
{
PVBOXRAWPCIGLOBALS pGlobals = (PVBOXRAWPCIGLOBALS)((uint8_t *)pFactory - RT_OFFSETOF(VBOXRAWPCIGLOBALS, RawPciFactory));
int rc;
LogFlow(("vboxPciFactoryCreateAndConnect: PCI=%x fFlags=%#x\n", u32HostAddress, fFlags));
Assert(pGlobals->cFactoryRefs > 0);
rc = vboxPciGlobalsLock(pGlobals);
AssertRCReturn(rc, rc);
/* First search if there's no existing instance with same host device
* address - if so - we cannot continue.
*/
if (vboxPciFindInstanceLocked(pGlobals, u32HostAddress) != NULL)
{
rc = VERR_RESOURCE_BUSY;
goto unlock;
}
rc = vboxPciNewInstance(pGlobals, u32HostAddress, fFlags, pVmCtx, ppDevPort, pfDevFlags);
unlock:
vboxPciGlobalsUnlock(pGlobals);
return rc;
}
示例8: DECLCALLBACK
/**
* Implements the SUPDRV component factor interface query method.
*
* @returns Pointer to an interface. NULL if not supported.
*
* @param pSupDrvFactory Pointer to the component factory registration structure.
* @param pSession The session - unused.
* @param pszInterfaceUuid The factory interface id.
*/
static DECLCALLBACK(void *) vboxNetAdpQueryFactoryInterface(PCSUPDRVFACTORY pSupDrvFactory, PSUPDRVSESSION pSession, const char *pszInterfaceUuid)
{
PVBOXNETADPGLOBALS pGlobals = (PVBOXNETADPGLOBALS)((uint8_t *)pSupDrvFactory - RT_OFFSETOF(VBOXNETADPGLOBALS, SupDrvFactory));
/*
* Convert the UUID strings and compare them.
*/
RTUUID UuidReq;
int rc = RTUuidFromStr(&UuidReq, pszInterfaceUuid);
if (RT_SUCCESS(rc))
{
if (!RTUuidCompareStr(&UuidReq, INTNETTRUNKFACTORY_UUID_STR))
{
ASMAtomicIncS32(&pGlobals->cFactoryRefs);
return &pGlobals->TrunkFactory;
}
#ifdef LOG_ENABLED
else
Log(("VBoxNetAdp: unknown factory interface query (%s)\n", pszInterfaceUuid));
#endif
}
else
Log(("VBoxNetAdp: rc=%Rrc, uuid=%s\n", rc, pszInterfaceUuid));
return NULL;
}
示例9: GMMR3DECL
/**
* Performs a GMMR0FreePages request.
* This will call VMSetError on failure.
*
* @returns VBox status code.
* @param pVM The cross context VM structure.
* @param pReq Pointer to the request (returned by GMMR3FreePagesPrepare).
* @param cActualPages The number of pages actually freed.
*/
GMMR3DECL(int) GMMR3FreePagesPerform(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cActualPages)
{
/*
* Adjust the request if we ended up with fewer pages than anticipated.
*/
if (cActualPages != pReq->cPages)
{
AssertReturn(cActualPages < pReq->cPages, VERR_GMM_ACTUAL_PAGES_IPE);
if (!cActualPages)
return VINF_SUCCESS;
pReq->cPages = cActualPages;
pReq->Hdr.cbReq = RT_OFFSETOF(GMMFREEPAGESREQ, aPages[cActualPages]);
}
/*
* Do the job.
*/
int rc = VMMR3CallR0(pVM, VMMR0_DO_GMM_FREE_PAGES, 0, &pReq->Hdr);
if (RT_SUCCESS(rc))
return rc;
AssertRC(rc);
return VMSetError(pVM, rc, RT_SRC_POS,
N_("GMMR0FreePages failed to free %u pages"),
pReq->cPages);
}
示例10: DECLCALLBACK
DECLCALLBACK(int) vboxUhgsmiBaseEscBufferSubmit(PVBOXUHGSMI pHgsmi, PVBOXUHGSMI_BUFFER_SUBMIT aBuffers, uint32_t cBuffers)
{
/* we no chromium will not submit more than three buffers actually,
* for simplicity allocate it statically on the stack */
struct
{
VBOXDISPIFESCAPE_UHGSMI_SUBMIT SubmitInfo;
VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE aBufInfos[3];
} Buf;
if (!cBuffers || cBuffers > RT_ELEMENTS(Buf.aBufInfos) + 1)
{
WARN(("invalid cBuffers!"));
return VERR_INVALID_PARAMETER;
}
HANDLE hSynch = VBOXUHGSMIESCBASE_GET_BUFFER(aBuffers[0].pBuf)->hSynch;
if (!hSynch)
{
WARN(("the fist buffer is not command!"));
return VERR_INVALID_PARAMETER;
}
PVBOXUHGSMI_PRIVATE_BASE pPrivate = VBOXUHGSMIBASE_GET(pHgsmi);
Buf.SubmitInfo.EscapeHdr.escapeCode = VBOXESC_UHGSMI_SUBMIT;
Buf.SubmitInfo.EscapeHdr.u32CmdSpecific = cBuffers;
for (UINT i = 0; i < cBuffers; ++i)
{
VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *pSubmInfo = &Buf.SubmitInfo.aBuffers[i];
PVBOXUHGSMI_BUFFER_SUBMIT pBufInfo = &aBuffers[i];
PVBOXUHGSMI_BUFFER_PRIVATE_ESC_BASE pBuf = VBOXUHGSMIESCBASE_GET_BUFFER(pBufInfo->pBuf);
pSubmInfo->hAlloc = pBuf->Alloc.hAlloc;
if (pBufInfo->fFlags.bEntireBuffer)
{
pSubmInfo->Info.offData = 0;
pSubmInfo->Info.cbData = pBuf->BasePrivate.Base.cbBuffer;
}
else
{
pSubmInfo->Info.offData = pBufInfo->offData;
pSubmInfo->Info.cbData = pBufInfo->cbData;
}
}
int rc = vboxCrHgsmiPrivateEscape(pPrivate, &Buf.SubmitInfo, RT_OFFSETOF(VBOXDISPIFESCAPE_UHGSMI_SUBMIT, aBuffers[cBuffers]), FALSE);
if (RT_SUCCESS(rc))
{
DWORD dwResult = WaitForSingleObject(hSynch, INFINITE);
if (dwResult == WAIT_OBJECT_0)
return VINF_SUCCESS;
WARN(("wait failed, (0x%x)", dwResult));
return VERR_GENERAL_FAILURE;
}
else
{
WARN(("vboxCrHgsmiPrivateEscape failed, rc (%d)", rc));
}
return VERR_GENERAL_FAILURE;
}
示例11: rtDirNativeOpen
int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf)
{
NOREF(pszPathBuf); /* only used on windows */
/*
* Convert to a native path and try opendir.
*/
char const *pszNativePath;
int rc = rtPathToNative(&pszNativePath, pDir->pszPath, NULL);
if (RT_SUCCESS(rc))
{
pDir->pDir = opendir(pszNativePath);
if (pDir->pDir)
{
/*
* Init data.
*/
pDir->fDataUnread = false;
memset(&pDir->Data, 0, RT_OFFSETOF(RTDIR, Data.d_name)); /* not strictly necessary */
memset(&pDir->Data.d_name[0], 0, pDir->cbMaxName);
}
else
rc = RTErrConvertFromErrno(errno);
rtPathFreeNative(pszNativePath, pDir->pszPath);
}
return rc;
}
示例12: rtldrOpenWithReader
/**
* Open part with reader.
*
* @returns iprt status code.
* @param pReader The loader reader instance which will provide the raw image bits.
* @param fFlags Reserved, MBZ.
* @param enmArch Architecture specifier.
* @param phMod Where to store the handle.
*/
int rtldrOpenWithReader(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phMod)
{
/*
* Read and verify the file signature.
*/
union
{
char ach[4];
uint16_t au16[2];
uint32_t u32;
} uSign;
int rc = pReader->pfnRead(pReader, &uSign, sizeof(uSign), 0);
if (RT_FAILURE(rc))
return rc;
#ifndef LDR_WITH_KLDR
if ( uSign.au16[0] != IMAGE_DOS_SIGNATURE
&& uSign.u32 != IMAGE_NT_SIGNATURE
&& uSign.u32 != IMAGE_ELF_SIGNATURE
&& uSign.au16[0] != IMAGE_LX_SIGNATURE)
{
Log(("rtldrOpenWithReader: %s: unknown magic %#x / '%.4s\n", pReader->pfnLogName(pReader), uSign.u32, &uSign.ach[0]));
return VERR_INVALID_EXE_SIGNATURE;
}
#endif
uint32_t offHdr = 0;
if (uSign.au16[0] == IMAGE_DOS_SIGNATURE)
{
rc = pReader->pfnRead(pReader, &offHdr, sizeof(offHdr), RT_OFFSETOF(IMAGE_DOS_HEADER, e_lfanew));
if (RT_FAILURE(rc))
return rc;
if (offHdr <= sizeof(IMAGE_DOS_HEADER))
{
Log(("rtldrOpenWithReader: %s: no new header / invalid offset %#RX32\n", pReader->pfnLogName(pReader), offHdr));
return VERR_INVALID_EXE_SIGNATURE;
}
rc = pReader->pfnRead(pReader, &uSign, sizeof(uSign), offHdr);
if (RT_FAILURE(rc))
return rc;
if ( uSign.u32 != IMAGE_NT_SIGNATURE
&& uSign.au16[0] != IMAGE_LX_SIGNATURE
&& uSign.au16[0] != IMAGE_LE_SIGNATURE
&& uSign.au16[0] != IMAGE_NE_SIGNATURE)
{
Log(("rtldrOpenWithReader: %s: unknown new magic %#x / '%.4s\n", pReader->pfnLogName(pReader), uSign.u32, &uSign.ach[0]));
return VERR_INVALID_EXE_SIGNATURE;
}
}
/*
* Create image interpreter instance depending on the signature.
*/
if (uSign.u32 == IMAGE_NT_SIGNATURE)
#ifdef LDR_WITH_PE
rc = rtldrPEOpen(pReader, fFlags, enmArch, offHdr, phMod);
#else
rc = VERR_PE_EXE_NOT_SUPPORTED;
#endif
else if (uSign.u32 == IMAGE_ELF_SIGNATURE)
示例13: vringSetNotification
void vringSetNotification(PVPCISTATE pState, PVRING pVRing, bool fEnabled)
{
uint16_t tmp;
PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns),
pVRing->addrUsed + RT_OFFSETOF(VRINGUSED, uFlags),
&tmp, sizeof(tmp));
if (fEnabled)
tmp &= ~ VRINGUSED_F_NO_NOTIFY;
else
tmp |= VRINGUSED_F_NO_NOTIFY;
PDMDevHlpPhysWrite(pState->CTX_SUFF(pDevIns),
pVRing->addrUsed + RT_OFFSETOF(VRINGUSED, uFlags),
&tmp, sizeof(tmp));
}
示例14: vringReadUsedIndex
uint16_t vringReadUsedIndex(PVPCISTATE pState, PVRING pVRing)
{
uint16_t tmp;
PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns),
pVRing->addrUsed + RT_OFFSETOF(VRINGUSED, uIndex),
&tmp, sizeof(tmp));
return tmp;
}
示例15: dbgfR3LineDup
/**
* Duplicates a line.
*
* @returns VBox status code.
* @param pVM The VM handle.
* @param pLine The line to duplicate.
*/
static PDBGFLINE dbgfR3LineDup(PVM pVM, PCDBGFLINE pLine)
{
size_t cb = strlen(pLine->szFilename) + RT_OFFSETOF(DBGFLINE, szFilename[1]);
PDBGFLINE pDup = (PDBGFLINE)MMR3HeapAlloc(pVM, MM_TAG_DBGF_LINE_DUP, cb);
if (pDup)
memcpy(pDup, pLine, cb);
return pDup;
}