Xref: utzoo comp.sys.amiga.tech:917 comp.sys.amiga:19756 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!mtunx!chinet!mcdchg!clyde!watmath!watdcsu!debate2 From: debate2@watdcsu.waterloo.edu (Dave Oh) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: DiskObject Message-ID: <4773@watdcsu.waterloo.edu> Date: 4 Jun 88 22:25:11 GMT Article-I.D.: watdcsu.4773 References: <4725@watdcsu.waterloo.edu> <54486@sun.uucp> <4751@watdcsu.waterloo.edu> <2135@ur-tut.UUCP> <6148@well.UUCP> Reply-To: debate2@watdcsu.waterloo.edu (Dave Oh) Distribution: na Organization: U. of Waterloo, Ontario Lines: 54 In article <6148@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: >In article <2135@ur-tut.UUCP> dpvc@tut.cc.rochester.edu.UUCP (Davide P. Cervone) writes: >>In article <4751@watdcsu.waterloo.edu> debate2@watdcsu.waterloo.edu (Dave Oh) writes: >>>The GetDiskObject call returns a pointer to FAST ram, for gadget, diskobject >>>and image... I've tried to CopyMem(&dobj->do_Gadget.GadgetRender,&nimage, >>>sizeof(struct Image)); and I get a lock up! Even in Manx SDB. > > Try this: > > CopyMem (&dobj -> do_Gadget.GadgetRender, > &nimage, >--> (LONG) sizeof (struct Image)); > > This is probably what's killing you. > I tried the above and after looking at the struct dobj after the CopyMem, my dobj pointers get wacked out of place and I get crazy values for do_type etc. What could be doing this? I'll show you the bit of code around the CopyMem: IDisk(DiskName) char *DiskName; { struct DiskObject *gdisk; struct DiskList *DiskLst; struct Image *Img; char Buffer[36]; strcpy(Buffer,DiskName); strcat(Buffer,":Disk"); printf("\nName: %s\n",Buffer); gdisk=GetDiskObject(Buffer); if(gdisk==0) printf("---- Cannot Open %s.info file. ----\n",Buffer); else { Img = (struct Image *) AllocRemember(&miscMemList,sizeof(struct Image),CHIPRAM); CopyMem(&gdisk->do_Gadget.GadgetRender,&Img,(LONG)sizeof(struct Image)); gdisk->do_Gadget.GadgetRender = (APTR)Img; printf("version: %d\nType: %d\nXpos: %d\nYpos: %d\nStack: %d\n", gdisk->do_Version, gdisk->do_Type, gdisk->do_CurrentX, gdisk->do_CurrentY, gdisk->do_StackSize); } } Please help and thanx in advance. :::> Dave Oh uucp: debate2@watdcsu.waterloo.edu