Xref: news-dnh.mv.net comp.os.msdos.djgpp:1981 Path: news-dnh.mv.net!mv!news.sprintlink.net!in1.uu.net!usc!nic-nac.CSU.net!zippy.sonoma.edu!svincent From: svincent AT zippy DOT sonoma DOT edu (Sam Vincent) Newsgroups: comp.os.msdos.djgpp Subject: Re: Retrieving structures from the transfer buffer Date: 9 Sep 1995 21:56:28 GMT Organization: Information Resources and Technology Lines: 31 References: <42slau$3qg AT ixnews7 DOT ix DOT netcom DOT com> Nntp-Posting-Host: zippy.sonoma.edu To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp Lars Damerow (lars3 AT ix DOT netcom DOT com) wrote: : That's right, it's another stupid question from Lars Damerow!! :) : I'm trying to move information from the transfer buffer to a struct : variable using dosmemget. The struct is set up to match the data that a : VESA interrupt is putting in the buffer. So, this is what I'm trying: : __dpmi_regs r; : r.x.ax=0x4f00; : r.x.ss=r.x.sp=0; : r.x.di=__tb & 0x0f; : r.x.es=(__tb>>4) & 0xffff; : __dpmi_int (0x10,&r); : dosmemget(__tb, 256, &vesainfo); : vesainfo is the struct that I defined. I'm hoping that dosmemget will : just dump the data to the address of vesainfo and fill in the struct. : When this code is executed, however, vesainfo is filled with garbage. : What am I doing incorrectly? Is this even possible? I'm using version 2, : beta 2.. thanks! Well.. is your struct really defined correctly? Sometimes C compilers will align your data in your struct on even memory addresses.. or even paragraph addresses.. you need to tell it to PACK your struct data... (Ask someone else how to do this.. as I've never bothered to check for DJGPP)... -Sam