From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: Weird locking bug Date: Sat, 15 Jun 2002 23:42:28 Organization: Aspen Technology, Inc. Lines: 9 Message-ID: <3d0bd0e4.sandmann@clio.rice.edu> References: <3D067654 DOT 57A9B1B2 AT yahoo DOT com> <3d06d47a DOT sandmann AT clio DOT rice DOT edu> <3D077F39 DOT E6AE5D4A AT yahoo DOT com> NNTP-Posting-Host: dcloan.hou.aspentech.com X-Trace: selma.aspentech.com 1024202720 27223 10.32.115.107 (16 Jun 2002 04:45:20 GMT) X-Complaints-To: postmaster AT aspentech DOT com NNTP-Posting-Date: 16 Jun 2002 04:45:20 GMT X-NewsEditor: ED-1.5.8 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > > You didn't add the selector base address to the memory, so you are > > trying to lock the DOS memory area (a bug in the code). > _go32_dpmi_lock_code adds the CS base to the offset before calling > __dpmi_lock_linear_region. So it does, my mistake (thinking the direct dpmi call, not go32 version). The original code starts past the null page, but sends the entire CS selector limit as the size, so you would lock one page too many, causing failure.