typedef struct SCMDIFFSTATE { .... bool fIgnoreTrailingWhite; bool fIgnoreLeadingWhite; .... } SCMDIFFSTATE; /* Pointer to a diff state. */ typedef SCMDIFFSTATE *PSCMDIFFSTATE; /* Compare two lines */ DECLINLINE(bool) scmDiffCompare(PSCMDIFFSTATE pState, ....) { .... if (pState->fIgnoreTrailingWhite //<== || pState->fIgnoreTrailingWhite) //<== return scmDiffCompareSlow(....); .... }
/* @file * VBox frontends: Qt4 GUI ("VirtualBox") */ QString UIWizardExportApp::uri(bool fWithFile) const { .... case SunCloud: { ... QString uri("SunCloud://"); .... if (!field("username").toString().isEmpty() || //<== !field("username").toString().isEmpty()) //<== uri = QString("%1@").arg(uri); .... } case S3: { QString uri("S3://"); .... if (!field("username").toString().isEmpty() || !field("password").toString().isEmpty()) uri = QString("%1@").arg(uri); .... } .... }
/* Verify string cache compare function. */ static bool supR3HardenedWinVerifyCacheIsMatch(....) { .... wcLeft = wcLeft != '/' ? RT_C_TO_LOWER(wcLeft) : '\\'; wcLeft = wcRight != '/' ? RT_C_TO_LOWER(wcRight) : '\\'; //<== if (wcLeft != wcRight) return false; .... }
/* @file * DevPCI - PCI BUS Device. */ static void pciR3Piix3Reset(PIIX3State *d) { .... pci_conf[0x82] = 0x02; pci_conf[0xa0] = 0x08; //<== pci_conf[0xa0] = 0x08; //<== pci_conf[0xa2] = 0x00; pci_conf[0xa3] = 0x00; pci_conf[0xa4] = 0x00; pci_conf[0xa5] = 0x00; pci_conf[0xa6] = 0x00; pci_conf[0xa7] = 0x00; pci_conf[0xa8] = 0x0f; .... }
static const uint8_t g_acDaysInMonths[12] = { /*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static const uint8_t g_acDaysInMonthsLeap[12] = { /*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static PRTTIME rtTimeNormalizeInternal(PRTTIME pTime) { .... unsigned cDaysInMonth = fLeapYear ? g_acDaysInMonthsLeap[pTime->u8Month - 1] //<== : g_acDaysInMonthsLeap[pTime->u8Month - 1]; //<== .... }
/* Skips white spaces, including escaped new-lines. */ static void vbcppProcessSkipWhiteAndEscapedEol(PSCMSTREAM pStrmInput) { .... if (ch == '\r' || ch == '\n') { .... } else if (RT_C_IS_SPACE(ch)) { ch = chPrev; //<== ch = ScmStreamGetCh(pStrmInput); //<== Assert(ch == chPrev); } else break; .... }
chPrev = ch; ch = ScmStreamGetCh(pStrmInput); Assert(ch == chPrev);
/* Okay, we were loaded manually. Call the GDI functions. */ pixelformat = ChoosePixelFormat( hdc, ppfd ); /* doing this twice is normal Win32 magic */ pixelformat = ChoosePixelFormat( hdc, ppfd );
/* @file * VBoxFBOverlay implementation int */ VBoxVHWAImage::reset(VHWACommandList * pCmdList) { .... if (pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 32 || pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 24) { AssertFailed(); pCmd->u.out.ErrInfo = -1; return VINF_SUCCESS; } .... }
/* Deals with a cache miss in rtDwarfAbbrev_Lookup. */ static PCRTDWARFABBREV rtDwarfAbbrev_LookupMiss(....) { .... uint32_t uPrevCode = 0; for (;;) { /* Read the 'header'. Skipping zero code bytes. */ uint32_t const uCurCode =rtDwarfCursor_GetULeb128AsU32(....); if (pRet && (uCurCode == 0 || uCurCode < uPrevCode)) //<== break; /* probably end of unit. */ .... } .... }
/* @file * VBoxVideo Display D3D User mode dll */ static HRESULT APIENTRY vboxWddmDDevCreateResource(....) { .... for (UINT i = 0; i < pResource->SurfCount; ++i) { .... if (SUCCEEDED(hr)) { .... } else { for (UINT j = 0; i < j; ++j) { .... } break; } } .... }
/*Get the current power source of the host system. */ static DECLCALLBACK(int) drvACPIQueryPowerSource(....) { .... /* running on battery? */ if (powerStatus.ACLineStatus == 0 /* Offline */ || powerStatus.ACLineStatus == 255 /* Unknown */ && (powerStatus.BatteryFlag & 15)) { *pPowerSource = PDM_ACPI_POWER_SOURCE_BATTERY; } .... }
/* Called by the Console when it's done saving the VM state into *the snapshot (if online) and reconfiguring the hard disks. */ STDMETHODIMP SessionMachine::EndTakingSnapshot(BOOL aSuccess) { .... if (fOnline) //no need to test for whether the saved state file is shared: //an online snapshot means that a new saved state file was //created, which we must clean up now RTFileDelete(mConsoleTaskData.mSnapshot->....); machineLock.acquire(); //<== mConsoleTaskData.mSnapshot->uninit(); machineLock.release(); .... }
static int vbglR3DnDGHProcessRequestPendingMessage(....) { .... rc = Msg.hdr.result; if (RT_SUCCESS(rc)) rc = Msg.uScreenId.GetUInt32(puScreenId); AssertRC(rc); .... }
/* @file * VBox WDDM Miniport driver */ static NTSTATUS APIENTRY DxgkDdiRenderNew(CONST HANDLE hContext, DXGKARG_RENDER *pRender) { .... NTSTATUS Status = STATUS_SUCCESS; //<== __try { .... NTSTATUS Status = STATUS_SUCCESS; //<== .... } __except (EXCEPTION_EXECUTE_HANDLER) { Status = STATUS_INVALID_PARAMETER; WARN(("invalid parameter")); } return Status; }
/* @file * DevSMC - SMC device emulation. */ static struct AppleSMCData data[] = { {6, "REV ", "\0x01\0x13\0x0f\0x00\0x00\0x03"}, //<== {32,"OSK0", osk }, {32,"OSK1", osk+32 }, {1, "NATJ", "\0" }, {1, "MSSP", "\0" }, {1, "MSSD", "\0x3" }, //<== {1, "NTOK", "\0"}, {0, NULL, NULL } };
class ATL_NO_VTABLE SessionMachine : public Machine { .... HRESULT mRemoveSavedState; .... } HRESULT SessionMachine::init(Machine *aMachine) { .... /* default is to delete saved state on * Saved -> PoweredOff transition */ mRemoveSavedState = true; .... } HRESULT SessionMachine::i_setMachineState(....) { .... if (mRemoveSavedState) { .... } .... }
template<class C> class ConsoleEventBuffer { public: .... C get() { C c; if (full || curg != curp) { c = buf[curg]; ++curg %= sz; //<== full = false; } return c; } .... };
/* Stops a possibly running service. */ static int suplibOsStopService(void) { /* Assume it didn't exist, so we'll create the service. */ int rc; SC_HANDLE hSMgr = OpenSCManager(....); .... if (hSMgr) { .... rc = VINF_SUCCESS; .... } return rc; }
/* @file * VBoxMMR - Multimedia Redirection */ void ReadTSMF(uint32_t u32ChannelHandle, uint32_t u32HGCMClientId, uint32_t u32SizeAvailable) { .... PBYTE pBuffer = (PBYTE)malloc(u32SizeAvailable + sizeof(....)); .... delete [] pBuffer; .... }
void Appliance::i_importMachines(....) { .... /* Iterate through all virtual systems of that appliance */ size_t i = 0; for (it = reader.m_llVirtualSystems.begin(), it1 = m->virtualSystemDescriptions.begin(); it != reader.m_llVirtualSystems.end(), //<== it1 != m->virtualSystemDescriptions.end(); ++it, ++it1, ++i) {....} .... }
/* @file * VBox OpenGL GLSL related get functions */ void SERVER_DISPATCH_APIENTRY crServerDispatchGetAttachedShaders(....) { .... for (i=0; i<*pLocal; ++i); //<== ids[i] = crStateGLSLShaderHWIDtoID(ids[i]); .... }
/* Opens a loader cache entry. */ DECLHIDDEN(int) supHardNtLdrCacheOpen(const char *pszName, ....) { .... uint32_t i = 0; while (i < RT_ELEMENTS(g_apszSupNtVpAllowedDlls)) if (!strcmp(pszName, g_apszSupNtVpAllowedDlls[i])) break; .... }
/** @file * VBox WDDM Miniport driver */ VBOXCMDVBVA_HDR* VBoxCmdVbvaSubmitLock(....) { if (VBoxVBVAExGetSize(&pVbva->Vbva) < cbCmd) { WARN(("....")); NULL; //<== } if (!VBoxVBVAExBufferBeginUpdate(....) { WARN(("VBoxVBVAExBufferBeginUpdate failed!")); return NULL; } .... }
/*@file *IPRT-Binary Image Loader, The Memory/Debugger Oriented Parts.*/ RTDECL(int) RTLdrOpenInMemory(....) { if (RT_SUCCESS(rc)) { .... } else pfnDtor(pvUser), //<== *phLdrMod = NIL_RTLDRMOD; }
Source: https://habr.com/ru/post/237393/
All Articles