delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2016/03/16/08:10:53

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.no; s=s2048; t=1458129392; bh=+DeFy3HzHjjCQmyJx1cYRmZtYlQKJrKcTeq+AQWCwCk=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=H97Vraai7Fe5+CReo91QrHfL6jkO6O6ekpQYAHGsaaE3a9SbLeW7pCGBe4uNJKVJF/l7pNDtFFOCJYCzJR865DjMPYDB4jbm3PfAXcoB3bF17YLqd38tbWxzcGZPu7iw6P7u8azmZYhZOwI6MxkMVmTMqZYHmozjyDSyE7DHh5nKg3WjxziIzZn2gnlRDRf6HUllVQSw3vJgd7zblGAoSgKQloVrV8nXIzatL9pi6NFYAD29fftVIl0VTQ/JLGWbkhKOfyLwz8RwmhKxIObMN7jNiqcI5jzgVb50stepyPsLeknuR1RIUyhk7/cp8O4DIYqLcIYcX0IJrwBsBwg/cQ==
X-Yahoo-Newman-Id: 590303 DOT 69705 DOT bm AT smtp130 DOT mail DOT ir2 DOT yahoo DOT com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: N7WKlN0VM1khc773_NHijL_qLZ4y_RuOqfvFwgvMP9HcpBC
QDCewwo_wk_3ceqW0pLO1.7S7fmrGVLQ_jiAxiVIITyPMj4OHyl36Yi.P1CH
88yFpaEfXUkXhyWXEEKbRfTQTFu1jqa472KnAm.wa9KU2UyaAstX_.UAOoeK
4gRd82_F.wA.rOP8Kxk7nY7yi3UrGZP2VP62.KV60.xKk9fgSyVbsEvpOqHN
qeFw4fbeynadv806Exw6ZrxfGrhmoY1xs4StGUBINBeZHr5UUISrUhzp_9QQ
y49N5MAAVpHZJioI1WRhwdW1L.BO8Co1OgHXJ_JWqSwOlZFLoyAgJh2jmd3k
xRAH0eflDwEb8Jh7vKm50RnAt4Irr5Ua5Mg.iNiu.H6tgQaJLT8Xhekw1qeD
GazS_NNEjIejIpmVq6aidYfJcH4fe34CO4zhyVMjzKhRRLd_mRYSYNfZ1Adc
wdXW_JGS3pi.kRIkQjadyAtsGGIEw5x2z.BLa1Nbveh17n3h8hfCqOTgdBpA
3v0b66fmMtl9hbo7CziFm4Ybr6Q--
X-Yahoo-SMTP: 8zhYLGyswBB3AGU8c4pvFIFOfA--
Subject: Re: how to unlock locked memory
To: djgpp AT delorie DOT com
References: <nbs7v1$3da$1 AT usenet DOT news DOT interia DOT pl> <20160316000317 DOT 329b9cf8 AT _>
<ncbagh$v79$1 AT usenet DOT news DOT interia DOT pl>
From: "Gisle Vanem (gvanem AT yahoo DOT no) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Message-ID: <56E949FA.2070703@yahoo.no>
Date: Wed, 16 Mar 2016 12:56:42 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101
Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <ncbagh$v79$1@usenet.news.interia.pl>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Wiktor S. wrote:

>> So, you should be able to use __dpmi_unlock_linear_region()
>> by passing the same address and size as they were computed
>> in either _go32_dpmi_lock_code() or _go32_dpmi_lock_data().
>> Look at the code in gopint.c to see how this is done.
> 
> Thanks. Weird that there is no _go32_dpmi_unlock_code/data.

You can use '__dpmi_unlock_linear_region()'.
Example:

#include <dpmi.h>
#include <sys/segments.h>
#define DWORD unsigned long

static void _unlock (const void *addr, DWORD size)
{
  __dpmi_meminfo mem;
  DWORD base = 0;

  __dpmi_get_segment_base_address (_my_ds(), &base);
  mem.address = base + (DWORD)addr;
  mem.size    = size;
  __dpmi_unlock_linear_region (&mem);
}
----------

AFAICR, in djgpp both DS and CS have the same base-address.
Hence you can use this to unlock both data and code. But I give
you no guarantees though... I haven't tried this in years.

-- 
--gv

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019