View Single Post
Old 19 September 2012, 18:00   #34
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,940
I think calling c:assign is too ugly solution..

assign dismount: internally calls RemDosEntry() which is as simple as:
Code:
    dl = DeviceNode head
    while(dl->dol_Next)
    {
        struct DosList *dl2 = BADDR(dl->dol_Next);
        if(dl2 == dlist)
	{
	    dl->dol_Next = dlist->dol_Next;
	    break;
	}
	dl = dl2;
    }
(Forbid state required of course)

You should first find the correct device node and then exit the loop because doslist may have changed and "DeviceNode = (struct DeviceNode *)BADDR(DeviceNode->dn_Next) ;" may access random memory.

It is not safe to scan doslist without forbid state. (and forbid in this code would be broken anyway during packet calls)

But I don't think this is the cause for crash.
Toni Wilen is offline  
 
Page generated in 0.07252 seconds with 9 queries