X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: zandro_arceo AT support DOT trendmicro DOT com (IeperNaum) Newsgroups: comp.os.msdos.djgpp Subject: Re: Try this... Date: 5 Mar 2002 18:40:12 -0800 Organization: http://groups.google.com/ Lines: 64 Message-ID: References: <65f8aa920cde3ff34e24773b5831c770 DOT 62691 AT mygate DOT mailgate DOT org> NNTP-Posting-Host: 202.138.160.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1015382413 1156 127.0.0.1 (6 Mar 2002 02:40:13 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 6 Mar 2002 02:40:13 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Joel Saunders" wrote in message news:<65f8aa920cde3ff34e24773b5831c770 DOT 62691 AT mygate DOT mailgate DOT org>... > #include > #include > #include > #include > #include > unsigned char SChar; > int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY; > static __dpmi_regs callback_regs; > static _go32_dpmi_seginfo info; > void Int_2F_Handler(_go32_dpmi_registers *r); > main() > { > unsigned short Offset, Segment; > Offset = _farpeekw(_dos_ds, 0xBC); > Segment = _farpeekw(_dos_ds, 0xBD); > printf("\nOld 0DH Segment%X\nOld 0DH Offset%X\n", Segment, > Offset); > __dpmi_regs r; > info.pm_offset = (long)Int_2F_Handler; > _go32_dpmi_allocate_real_mode_callback_iret(&info, > &callback_regs); > _go32_dpmi_set_real_mode_interrupt_vector(0x2F, &info); > r.x.ax = 0x252F; > r.x.ds = info.rm_segment; > r.x.dx = info.rm_offset; > __dpmi_int(0x21, &r); > Offset = _farpeekw(_dos_ds, 0xBC); > Segment = _farpeekw(_dos_ds, 0xBD); > printf("\nNew 0DH Segment%X\nNew 0DH Offset%X\n", Segment, > Offset); > > /* __djgpp_exception_toggle(); */ /* Only needed if > exceptions linked */ > r.x.ax = 0x3100; > r.x.dx = 16; > __dpmi_int(0x21, &r); > } > void Int_2F_Handler(_go32_dpmi_registers *r) > { > /* Your code here */ > } thanks. that was nice. but please be patient with me. i am just new to djgpp. i am planning to create a network director. that is why i need to hook int 2F. i have made this to work on turbo c. however, some modules that some of my coworkers worked on were written in djgpp. that's why i need to port the existing code into djgpp for integration with these modules. however, things were behaving differently than what i was expecting. i was expecting that returning non-zero in the handler indicates that the interrupt will be chained to the next handler in the chain. but after executing code in the handler, it hangs the system. please help. or if there is an existing djgpp network redirector code, can anybody send me one? thanks again for your help.