Changeset 2024 for Whitix/trunk
- Timestamp:
- 04/02/09 21:26:47 (3 years ago)
- Files:
-
- 1 modified
-
Whitix/trunk/fs/icfs/info.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/trunk/fs/icfs/info.c
r1943 r2024 28 28 DWORD copied; 29 29 30 copied=MIN(size-*position, (DWORD)strlen( iEnt->sVal)-*position);31 32 memcpy(data, iEnt->sVal+*position, copied);30 copied=MIN(size-*position, (DWORD)strlen(*iEnt->sVal)-*position); 31 32 memcpy(data, (*iEnt->sVal)+*position, copied); 33 33 34 34 *position+=copied; … … 54 54 int ret; 55 55 56 if (iEnt-> readFunc == NULL)56 if (iEnt->entry.readFunc == NULL) 57 57 return -EPERM; 58 58 59 ret = iEnt-> readFunc(data, size, *position);59 ret = iEnt->entry.readFunc(data, size, *position); 60 60 61 61 if (ret >= 0) … … 140 140 SYMBOL_EXPORT(IcFsAddIntEntry); 141 141 142 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char* str, DWORD permissions)142 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char** str, DWORD permissions) 143 143 { 144 144 struct KeFsEntry* entry; … … 203 203 newEnt = IcEntryAlloc(); 204 204 newEnt->type = ICFS_TYPE_FUNC; 205 newEnt-> readFunc = readFunc;206 newEnt-> writeFunc = writeFunc;205 newEnt->entry.readFunc = readFunc; 206 newEnt->entry.writeFunc = writeFunc; 207 207 208 208 entry->file = newEnt; … … 247 247 248 248 /* Process an array of IC attributes and add them to a particular directory. */ 249 int IcAddAttributes(struct KeObject* object, struct IcAttribute* attributes )249 int IcAddAttributes(struct KeObject* object, struct IcAttribute* attributes, int objOffset) 250 250 { 251 251 char* base; 252 int objOffset; 253 254 if (!object->parent || !object->parent->type || !object->dir) 252 253 if (!object->parent || !object->dir) 255 254 return -EFAULT; 256 257 objOffset = object->parent->type->offset; 258 259 if (objOffset < 0) 260 { 261 KePrint(KERN_DEBUG "icfs: invalid object offset in type.\n"); 262 return -EFAULT; 263 } 264 265 base = ((char*)object - objOffset); 255 256 base = ((char*)object) - objOffset; 266 257 267 258 /* Go through the array and register each element.*/ … … 284 275 285 276 case ICFS_TYPE_STR: 286 IcFsAddStrEntry(object->dir, attributes->name, *(char**)(base+attributes->offset), 287 permissions); 277 { 278 char** p = (char**)(base+attributes->offset); 279 IcFsAddStrEntry(object->dir, attributes->name, p, permissions); 280 break; 281 } 282 283 case ICFS_TYPE_FUNC: 284 IcFsAddFuncEntry(object->dir, attributes->name, attributes->readFunc, 285 attributes->writeFunc); 288 286 break; 289 287
