Changeset 3584 for trunk/kStuff/kLdr/testcase/tst-3-driver.c
- Timestamp:
- Sep 3, 2007, 12:46:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kLdr/testcase/tst-3-driver.c
r3579 r3584 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include <kLdr.h>32 31 #include "tst.h" 32 #include <k/kErr.h> 33 33 34 #include <stdarg.h> 34 35 #include <stdio.h> … … 86 87 * Callback for resolving the Tst3Ext import. 87 88 */ 88 static int GetImport(PKLDRMOD pMod, uint32_t iImport, uint32_t iSymbol, const char *pchSymbol, size_tcchSymbol,89 const char *pszVersion, PKLDRADDR puValue, uint32_t*pfKind, void *pvUser)89 static int GetImport(PKLDRMOD pMod, KU32 iImport, KU32 iSymbol, const char *pchSymbol, KSIZE cchSymbol, 90 const char *pszVersion, PKLDRADDR puValue, KU32 *pfKind, void *pvUser) 90 91 { 91 92 if (*pfKind != KLDRSYMKIND_REQ_FLAT) … … 95 96 || !strncmp(pchSymbol, "_Tst3Ext", strlen("_Tst3Ext"))) 96 97 { 97 *puValue = ( uintptr_t)&Tst3Ext;98 *puValue = (KUPTR)&Tst3Ext; 98 99 *pfKind = KLDRSYMKIND_CODE | (sizeof(pfKind) == 4 ? KLDRSYMKIND_32BIT : KLDRSYMKIND_64BIT); 99 100 return 0; … … 124 125 /* get bits. */ 125 126 cbImage = kLdrModSize(pMod); 126 pvBits = malloc(( size_t)cbImage + 0xfff);127 pvBits = malloc((KSIZE)cbImage + 0xfff); 127 128 if (pvBits) 128 129 { 129 void *pvBits2 = (void *)( (( uintptr_t)pvBits + 0xfff) & ~(uintptr_t)0xfff );130 131 KLDRADDR BaseAddress = ( uintptr_t)pvBits2;130 void *pvBits2 = (void *)( ((KUPTR)pvBits + 0xfff) & ~(KUPTR)0xfff ); 131 132 KLDRADDR BaseAddress = (KUPTR)pvBits2; 132 133 rc = kLdrModGetBits(pMod, pvBits2, BaseAddress, GetImport, NULL); 133 134 if (!rc) … … 143 144 if (!rc) 144 145 { 145 int (*pfnEntryPoint)(int) = (int (*)(int)) (( uintptr_t)EntryPoint);146 int (*pfnEntryPoint)(int) = (int (*)(int)) ((KUPTR)EntryPoint); 146 147 rc = pfnEntryPoint(42); 147 148 if (rc == 42)
Note:
See TracChangeset
for help on using the changeset viewer.