Date: Mon, 21 Apr 1997 09:44:57 +0300 (IDT) From: Eli Zaretskii To: Dim Zegebart cc: DJGPP Mail List Subject: Re: Some dpmi questions ? In-Reply-To: <3356BA7C.972@post.comstar.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 17 Apr 1997, Dim Zegebart wrote: > Just a couple of questions ;) Since nobody replied this for a long time, I will try my best. I suggest you send these questions to Charles Sandmann who is the author of most DPMI-related stuff in DJGPP, and ask him to help you, in case you have any further questions. > What is diference between _go32_dpmi_lock_data and > _dpmi_lock_linear_region ? Look at their sources in djlsr201 (on src/libc/go32/gopint.c), it's pretty obvious. In a nutshell, `__dpmi_lock_linear_region' needs a linear address, so you need to add the base address of the appropriate selector (DS for data, CS for code); the `_go32' variety does that for you. > *mem > [...] > mem=malloc(n*sizeof(typeof(mem))) > _go32_dpmi_lock_data(mem,n*sizeof(typeof(mem))) ???? How can I use > _dpmi_lock_linear_region here See above. You need to call `_my_ds()', get its base address, etc. > [...] > tmp=remalloc(mem,new_n*sizeof(typeof(mem))) > mem=tmp > _go32_dpmi_lock_data(mem,n*sizeof(typeof(mem))) ???? What happen > here? `realloc' may move the block. If it does, you need to lock the new one. > Do I have to 'unlock' first mem ? That depends on your application. If you want to lock as few memory as you can, you need to check whether `realloc' moved the block and if so, unlock the previous address. > What is the field 'handle' in _dpmi_meminfostructure It's needed to handle the memory which is sbrk'ed from the DPMI host. You will need to ask Charles for the details.