Lines Matching defs:pPrep

80 static int      krdrRTFileGenericUnmap(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments);
82 static int krdrRTFileGenericProtect(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fUnprotectOrProtect);
84 static int krdrRTFileGenericRefresh(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments);
86 static int krdrRTFileGenericMap(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fFixed);
155 PKRDRFILEPREP pPrep = krdrRTFileFindPrepExact(pRdrFile, pvBase);
157 if (!pPrep)
160 rc = krdrRTFileGenericUnmap(pRdr, pPrep, cSegments, paSegments);
166 if (pPrep != &pRdrFile->aPreps[pRdrFile->cPreps])
167 *pPrep = pRdrFile->aPreps[pRdrFile->cPreps];
174 static int krdrRTFileGenericUnmap(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments)
176 krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 1 /* unprotect */);
177 RTMemPageFree(pPrep->pv, pPrep->cb);
186 PKRDRFILEPREP pPrep = krdrRTFileFindPrepExact(pRdrFile, pvBase);
187 if (!pPrep)
190 return krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, fUnprotectOrProtect);
214 static int krdrRTFileGenericProtect(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fUnprotectOrProtect)
262 pv = (KU8 *)pPrep->pv + paSegments[i].RVA;
276 PKRDRFILEPREP pPrep = krdrRTFileFindPrepExact(pRdrFile, pvBase);
277 if (!pPrep)
279 return krdrRTFileGenericRefresh(pRdr, pPrep, cSegments, paSegments);
284 static int krdrRTFileGenericRefresh(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments)
293 rc = krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 1 /* unprotect */);
296 krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 0 /* protect */);
304 memset(pPrep->pv, 0, pPrep->cb);
319 pv = (KU8 *)pPrep->pv + paSegments[i].RVA;
328 rc2 = krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 0 /* protect */);
340 PKRDRFILEPREP pPrep = &pRdrFile->aPreps[pRdrFile->cPreps];
362 pPrep->cb = (KSIZE)cbTotal;
363 if (pPrep->cb != cbTotal)
365 pPrep->cb = (pPrep->cb + (cbPage - 1)) & ~(cbPage- 1);
370 pPrep->pv = fFixed ? *ppvBase : NULL;
371 rc = krdrRTFileGenericMap(pRdr, pPrep, cSegments, paSegments, fFixed);
374 *ppvBase = pPrep->pv;
383 static int krdrRTFileGenericMap(PKRDR pRdr, PKRDRFILEPREP pPrep, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fFixed)
391 pPrep->pv = RTMemPageAlloc(pPrep->cb);
392 if (!pPrep->pv)
406 pv = (KU8 *)pPrep->pv + paSegments[i].RVA;
417 rc = krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 0 /* protect */);
420 krdrRTFileGenericProtect(pRdr, pPrep, cSegments, paSegments, 1 /* unprotect */);
424 RTMemPageFree(pPrep->pv, pPrep->cb);