From: "Marcus" Newsgroups: comp.os.msdos.djgpp Subject: SV: System hangs when I exit my program Date: Wed, 16 Feb 2000 03:14:46 +0100 Organization: Telenordia Lines: 58 Message-ID: <88d197$8q8$1@cubacola.tninet.se> References: <88a80u$nm8$1 AT cubacola DOT tninet DOT se> NNTP-Posting-Host: cns2-210-200.cm.starport.se X-Trace: cubacola.tninet.se 950667367 9032 193.150.210.200 (16 Feb 2000 02:16:06 GMT) X-Complaints-To: abuse AT algo DOT net NNTP-Posting-Date: 16 Feb 2000 02:16:06 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Here is the mouse.cpp file again in plain text. Why does it make my program hang on shutdown? #include #include #include #include "mouse.h" static __dpmi_regs callback_regs; static _go32_dpmi_seginfo callback_info; bool initmouse(void) { __dpmi_regs regs; regs.x.ax = 0; __dpmi_int(0x33, ®s); if(regs.x.ax != 0xFFFF) return false; callback_info.pm_offset = (long)mousecallback; if (_go32_dpmi_allocate_real_mode_callback_retf(&callback_info, &callback_regs)) return false; regs.x.ax = 0xC; regs.x.cx = 63; regs.x.es = callback_info.rm_segment; regs.x.dx = callback_info.rm_offset; __dpmi_int(0x33, ®s); _go32_dpmi_lock_data(&callback_info, sizeof(callback_info)); _go32_dpmi_lock_data(&callback_regs, sizeof(callback_regs)); ok_mouse = true; return true; } void uninitmouse(void) { __dpmi_regs regs; regs.x.ax = 0xC; regs.x.cx = 0; regs.x.es = 0; regs.x.dx = 0; _go32_dpmi_set_protected_mode_interrupt_vector(0x33, &old_mouse_handler); _go32_dpmi_free_real_mode_callback(&mouse_handler); ok_mouse = false; } void mousecallback(__dpmi_regs *regs) { // Some code here } -- /regards Marcus