From: ajps AT mail DOT telepac DOT pt (aperes) Newsgroups: comp.os.msdos.djgpp Subject: Re: SIGSEGV Date: Fri, 10 Sep 1999 21:11:08 GMT Lines: 64 Message-ID: <37d96949.2829314@news.telepac.pt> References: NNTP-Posting-Host: 194.65.181.92 X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Thu, 9 Sep 1999 13:28:34 +0200 (IST), Eli Zaretskii wrote: > Thank for your help... but i can't do what i want! I have read the all FAQ file (specialy the section 18), I have try many things, but the result is a computer crash I need invoke a function of a sound driver (int 66h). To do this I must pass the ADRESS of a sound structure. The sound structure is: typedef struct_typ { unsigned char *sound; // MUST BE OFFSET SEGMENT IN 1MB ADRESS SPACE. (I DON'T KNOW DO THIS...) unsigned shor sndlen; // lenght of audio sample. < 64k short *IsPlaying; //Adress of play status flag.REAL PTR OFFSET:SEGMENT!!.( I DON'T KNOW DO THIS...) short frequency; //Playback frequency } sndstruct; The function is: INPUT AX=0x688; ESI = points to flat model adress in the first 1MB to the sound struct. What i have tried: sndstruct the_sound; __dpmi_regs r; ..................... s_ptr = (unsigned char *) malloc(size_of_file); linear_adress = 16 * __dpmi_allocate_dos_memory((size_of_file+15) >> 4, selector); dosmemput(s_ptr, size_of_file, linear_adress); the_sound.sound = linear_adress; (It's correct?) the_sound.sndlen = size_of_file; the_sound.Isplaying = ? (I don't know how to do...REAL PTR OFF:SEG!!) the_sound.frequency = 10000; .................. /* pass the struct to adress in the first 1MB as required movedata(_my_ds(), (int) &the_sound, _dos_ds, __tb, sizeof(the_sound)); r.x.ax = 0x688; r.d.esi = __tb; __dpmi_int(0x66, &r); .... RESULT: COMPUTER CRASH! Excuse me the length of this message, my terrible english. Thanks in advance! Aperes