Changeset 3567 for trunk/kStuff/kLdr/kLdrHlpMem.c
- Timestamp:
- Aug 27, 2007, 9:54:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kLdr/kLdrHlpMem.c
r3537 r3567 52 52 static void *g_pvStub = NULL; 53 53 /** The size of the stub object - 0 if no stub. */ 54 static size_tg_cbStub = 0;54 static KSIZE g_cbStub = 0; 55 55 56 56 #elif defined(__WIN__) … … 107 107 * @param enmProt The new protection. Copy-on-write is invalid. 108 108 */ 109 int kldrHlpPageAlloc(void **ppv, size_tcb, KLDRPROT enmProt, unsigned fFixed)109 int kldrHlpPageAlloc(void **ppv, KSIZE cb, KLDRPROT enmProt, unsigned fFixed) 110 110 { 111 111 #ifdef __OS2__ … … 162 162 * @param enmProt The new protection. Copy-on-write is invalid. 163 163 */ 164 int kldrHlpPageProtect(void *pv, size_tcb, KLDRPROT enmProt)164 int kldrHlpPageProtect(void *pv, KSIZE cb, KLDRPROT enmProt) 165 165 { 166 166 #ifdef __OS2__ … … 184 184 if (rc) 185 185 return rc; 186 pv = (void *)(( uintptr_t)pv + 0x1000);186 pv = (void *)((KUPTR)pv + 0x1000); 187 187 cb -= 0x1000; 188 188 } … … 215 215 * @param cb The byte count requested from kldrHlpPageAlloc(). 216 216 */ 217 int kldrHlpPageFree(void *pv, size_tcb)217 int kldrHlpPageFree(void *pv, KSIZE cb) 218 218 { 219 219 #ifdef __OS2__ … … 223 223 * Deal with any portion overlapping with the stub. 224 224 */ 225 uintptr_t offStub = (uintptr_t)pv - (uintptr_t)g_pvStub;225 KUPTR offStub = (KUPTR)pv - (KUPTR)g_pvStub; 226 226 if (offStub < g_cbStub) 227 227 { 228 228 /* decommit the pages in the stub. */ 229 size_tcbStub = KLDR_MIN(g_cbStub - offStub, cb);229 KSIZE cbStub = KLDR_MIN(g_cbStub - offStub, cb); 230 230 rc = DosSetMem(pv, cbStub, PAG_DECOMMIT); 231 231 if (rc) … … 236 236 if (!DosSetMem(pv, 0x1000, PAG_DECOMMIT)) 237 237 rc = 0; 238 pv = (void *)(( uintptr_t)pv + 0x1000);238 pv = (void *)((KUPTR)pv + 0x1000); 239 239 cbStub -= 0x1000; 240 240 cb -= 0x1000; … … 251 251 if (!cb) 252 252 return 0; 253 pv = (void *)(( uintptr_t)pv + cbStub);253 pv = (void *)((KUPTR)pv + cbStub); 254 254 } 255 255 }
Note:
See TracChangeset
for help on using the changeset viewer.