Lines Matching defs:pVM

79 static DECLCALLBACK(void) cfgmR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
84 static void cfgmR3FreeValue(PVM pVM, PCFGMLEAF pLeaf);
91 * @param pVM The VM handle, if tree associated with one.
95 static void *cfgmR3MemAlloc(PVM pVM, MMTAG enmTag, size_t cb)
97 if (pVM)
98 return MMR3HeapAlloc(pVM, enmTag, cb);
107 * @param pVM The VM handle, if tree associated with one.
110 static void cfgmR3MemFree(PVM pVM, void *pv)
112 if (pVM)
123 * @param pVM The VM handle, if tree associated with one.
127 static char *cfgmR3StrAlloc(PVM pVM, MMTAG enmTag, size_t cbString)
129 if (pVM)
130 return (char *)MMR3HeapAlloc(pVM, enmTag, cbString);
139 * @param pVM The VM handle, if tree associated with one.
142 static void cfgmR3StrFree(PVM pVM, char *pszString)
144 if (pVM)
162 if (!pNode->pVM)
166 pNode->pVM = NULL;
178 * @param pVM Pointer to VM which configuration has not yet been loaded.
185 VMMR3DECL(int) CFGMR3Init(PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser)
192 pVM->cfgm.s.pRoot = NULL;
197 int rc = DBGFR3InfoRegisterInternal(pVM, "cfgm", "Dumps a part of the CFGM tree. The argument indicates where to start.",
204 PCFGMNODE pRoot = (PCFGMNODE)MMR3HeapAllocZ(pVM, MM_TAG_CFGM, sizeof(*pRoot));
207 pRoot->pVM = pVM;
209 pVM->cfgm.s.pRoot = pRoot;
215 rc = pfnCFGMConstructor(pVM->pUVM, pVM, pvUser);
217 rc = CFGMR3ConstructDefaultTree(pVM);
221 CFGMR3Dump(CFGMR3GetRoot(pVM));
234 * @param pVM Pointer to the VM.
237 VMMR3DECL(int) CFGMR3Term(PVM pVM)
239 CFGMR3RemoveNode(pVM->cfgm.s.pRoot);
240 pVM->cfgm.s.pRoot = NULL;
249 * @param pVM Pointer to the VM.
251 VMMR3DECL(PCFGMNODE) CFGMR3GetRoot(PVM pVM)
253 return pVM->cfgm.s.pRoot;
261 * @param pVM Pointer to the VM.
266 PVM pVM = pUVM->pVM;
267 AssertReturn(pVM, NULL);
268 return pVM->cfgm.s.pRoot;
293 * @returns NULL if pNode is Root or pVM is not correct.
295 * @param pVM The VM handle, used as token that the caller is trusted.
298 VMMR3DECL(PCFGMNODE) CFGMR3GetParentEx(PVM pVM, PCFGMNODE pNode)
300 if (pNode && pNode->pVM == pVM)
905 return VMSetError(pNode->pVM, VERR_CFGM_CONFIG_UNKNOWN_VALUE, RT_SRC_POS,
923 return VMSetError(pNode->pVM, VERR_CFGM_CONFIG_UNKNOWN_NODE, RT_SRC_POS,
943 * @param pVM Pointer to the VM.
946 VMMR3DECL(int) CFGMR3ConstructDefaultTree(PVM pVM)
952 PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
1317 VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
1332 pNew->pVM = pUVM ? pUVM->pVM : NULL;
1356 PCFGMNODE pNewRoot = CFGMR3CreateTree(pRoot->pVM ? pRoot->pVM->pUVM : NULL);
1466 AssertReturn(pNode->pVM == pSubTree->pVM, VERR_INVALID_PARAMETER);
1518 AssertReturn(pNewRoot->pVM == pRoot->pVM, VERR_INVALID_PARAMETER);
1751 PCFGMNODE pNew = (PCFGMNODE)cfgmR3MemAlloc(pNode->pVM, MM_TAG_CFGM, sizeof(*pNew) + cchName);
1757 pNew->pVM = pNode->pVM;
1893 PCFGMLEAF pNew = (PCFGMLEAF)cfgmR3MemAlloc(pNode->pVM, MM_TAG_CFGM, sizeof(*pNew) + cchName);
1956 else if ( pNode->pVM /* might be a different tree */
1957 && pNode == pNode->pVM->cfgm.s.pRoot)
1958 pNode->pVM->cfgm.s.pRoot = NULL;
1994 cfgmR3FreeValue(pNode->pVM, pLeaf);
1997 cfgmR3MemFree(pNode->pVM, pLeaf);
2008 * @param pVM Used to select the heap.
2011 static void cfgmR3FreeValue(PVM pVM, PCFGMLEAF pLeaf)
2018 cfgmR3MemFree(pVM, pLeaf->Value.Bytes.pau8);
2024 cfgmR3StrFree(pVM, pLeaf->Value.String.psz);
2047 AssertReturn(!pRoot->pVM || pRoot != pRoot->pVM->cfgm.s.pRoot, VERR_ACCESS_DENIED);
2096 char *pszStringCopy = (char *)cfgmR3StrAlloc(pNode->pVM, MM_TAG_CFGM_STRING, cchString + 1);
2114 cfgmR3StrFree(pNode->pVM, pszStringCopy);
2160 if (!pNode->pVM)
2163 pszString = MMR3HeapAPrintfVU(pNode->pVM->pUVM, MM_TAG_CFGM_STRING, pszFormat, va);
2178 cfgmR3StrFree(pNode->pVM, pszString);
2250 void *pvCopy = cfgmR3MemAlloc(pNode->pVM, MM_TAG_CFGM_STRING, cbBytes);
2267 cfgmR3MemFree(pNode->pVM, pvCopy);
3055 char *pszString = cfgmR3StrAlloc(pNode->pVM, MM_TAG_CFGM_USER, cbString);
3062 cfgmR3StrFree(pNode->pVM, pszString);
3088 Assert(pNode || !pszDef); /* We need pVM if we need to duplicate the string later. */
3101 char *pszString = cfgmR3StrAlloc(pNode->pVM, MM_TAG_CFGM_USER, cbSrc);
3120 *ppszString = cfgmR3StrAlloc(pNode->pVM, MM_TAG_CFGM_USER, cbDef);
3149 * @param pVM Pointer to the VM.
3153 static DECLCALLBACK(void) cfgmR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
3158 PCFGMNODE pRoot = pVM->cfgm.s.pRoot;