Changeset 33269 in vbox for trunk/src/recompiler
- Timestamp:
- Oct 20, 2010 3:42:28 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66829
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/VBoxREMWrapper.cpp
r31636 r33269 339 339 /** Pointer to the memory containing the loaded REM2 object/DLL. */ 340 340 static void *g_pvREM2 = NULL; 341 /** The size of the memory g_pvREM2 is pointing to. */ 342 static size_t g_cbREM2 = 0; 341 343 # ifdef VBOX_WITHOUT_REM_LDR_CYCLE 342 344 /** Loader handle of the VBoxVMM DLL. */ … … 402 404 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL } 403 405 }; 406 static const REMPARMDESC g_aArgsPTR_SIZE_T[] = 407 { 408 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 409 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 410 }; 404 411 static const REMPARMDESC g_aArgsVM[] = 405 412 { … … 1085 1092 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 1086 1093 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL } 1087 };1088 static const REMPARMDESC g_aArgsRTMemPageFree[] =1089 {1090 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL },1091 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }1092 1094 }; 1093 1095 static const REMPARMDESC g_aArgsRTStrPrintf[] = … … 1320 1322 { "RTMemReallocTag", (void *)(uintptr_t)&RTMemReallocTag, &g_aArgsRTMemReallocTag[0], RT_ELEMENTS(g_aArgsRTMemReallocTag), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL }, 1321 1323 { "RTMemExecAllocTag", (void *)(uintptr_t)&RTMemExecAllocTag, &g_aArgsSIZE_TTag[0], RT_ELEMENTS(g_aArgsSIZE_TTag), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL }, 1322 { "RTMemExecFree", (void *)(uintptr_t)&RTMemExecFree, &g_aArgsPTR [0], RT_ELEMENTS(g_aArgsPTR),REMFNDESC_FLAGS_RET_VOID, 0, NULL },1324 { "RTMemExecFree", (void *)(uintptr_t)&RTMemExecFree, &g_aArgsPTR_SIZE_T[0], RT_ELEMENTS(g_aArgsPTR_SIZE_T), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1323 1325 { "RTMemFree", (void *)(uintptr_t)&RTMemFree, &g_aArgsPTR[0], RT_ELEMENTS(g_aArgsPTR), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1324 1326 { "RTMemPageAllocTag", (void *)(uintptr_t)&RTMemPageAllocTag, &g_aArgsSIZE_TTag[0], RT_ELEMENTS(g_aArgsSIZE_TTag), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL }, 1325 { "RTMemPageFree", (void *)(uintptr_t)&RTMemPageFree, &g_aArgs RTMemPageFree[0], RT_ELEMENTS(g_aArgsRTMemPageFree),REMFNDESC_FLAGS_RET_VOID, 0, NULL },1327 { "RTMemPageFree", (void *)(uintptr_t)&RTMemPageFree, &g_aArgsPTR_SIZE_T[0], RT_ELEMENTS(g_aArgsPTR_SIZE_T), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1326 1328 { "RTMemProtect", (void *)(uintptr_t)&RTMemProtect, &g_aArgsRTMemProtect[0], RT_ELEMENTS(g_aArgsRTMemProtect), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1327 1329 { "RTStrPrintf", (void *)(uintptr_t)&RTStrPrintf, &g_aArgsRTStrPrintf[0], RT_ELEMENTS(g_aArgsRTStrPrintf), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(size_t), NULL }, … … 1998 2000 if (RT_SUCCESS(rc)) 1999 2001 { 2000 g_pvREM2 = RTMemExecAlloc(RTLdrSize(g_ModREM2)); 2002 g_cbREM2 = RTLdrSize(g_ModREM2); 2003 g_pvREM2 = RTMemExecAlloc(g_cbREM); 2001 2004 if (g_pvREM2) 2002 2005 { … … 2028 2031 return rc; 2029 2032 } 2030 RTMemExecFree(g_pvREM2); 2033 2034 RTMemExecFree(g_pvREM2, g_cbREM2); 2035 g_pvREM2 = NULL; 2031 2036 } 2037 g_cbREM2 = 0; 2032 2038 RTLdrClose(g_ModREM2); 2033 2039 g_ModREM2 = NIL_RTLDRMOD; … … 2049 2055 RTLdrClose(g_ModREM2); 2050 2056 g_ModREM2 = NIL_RTLDRMOD; 2051 RTMemExecFree(g_pvREM2 );2057 RTMemExecFree(g_pvREM2, g_cbREM2); 2052 2058 g_pvREM2 = NULL; 2059 g_cbREM2 = 0; 2053 2060 2054 2061 /* clear the pointers. */ … … 2069 2076 g_pExecMemHead = pCur->pNext; 2070 2077 memset(pCur, 0xcc, pCur->cb); 2071 RTMemExecFree(pCur );2078 RTMemExecFree(pCur, pCur->cb); 2072 2079 } 2073 2080 # endif
Note:
See TracChangeset
for help on using the changeset viewer.