Date: Sun, 12 Jan 1997 15:24:44 +0200 (IST) From: Eli Zaretskii To: Peter Berdeklis cc: djgpp AT delorie DOT com Subject: Re: Help! __dpmi_lock_linear_region wont! In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 9 Jan 1997, Peter Berdeklis wrote: > I'm trying to lock some DOS memory for a real mode interrupt handler and a > bunch of DMA buffers, but every call to __dpmi_lock_linear_region returns > a -1. Why? AFAIK, DOS memory is always locked anyway. So why do you want to lock it? > vector_mem.handle = 0; // should be don't care for this call, right? > vector_mem.size = handler_size; > vector_mem.address = real_mode_int_segment << 4; // dos memory always in > // paragraphs so offset=0, > // right? > > if( __dpmi_lock_linear_region( &vector_mem ) == -1 ) > exit(-1); // region not locked, exit > } `real_mode_int_segment' isn't a valid protected-mode address (else you could just dereference it as a pointer, instead of the farptr, dosmemget and such, right?), that's why the call fails (I think).