Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #1707

Re: High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description

Subject Re: High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description
Newsgroups comp.os.os2.programmer.misc
References <u6mo43$1l03t$1@dont-email.me>
From Dave Yeo <dave.r.yeo@gmail.com>
Message-ID <UHJjM.1404$JLp4.426@fx46.iad> (permalink)
Date 2023-06-18 13:22 -0700

Show all headers | View raw


Andi B. wrote:
> Hi,
> I wanted to implement high memory usage in pmprintf package cause it
> eats up all my lower shared memory in one use case. As far as I see this
> does not work.
>
> Is it possible to give high mem to another process via DosGiveSharedMem
> and queue? As I understand the pmprintf caller (pmprintf.dll) allocates
> the high memory and put a string into it. The pointer to the string is
> transfered to the monitor program (pmprintf.exe - the server) via a
> queue (DosOpenQueue). But the server always get a null pointer instead
> the pointer to the string.
>
> Any ideas?
>

Isn't the problem that some 16bit API is involved? Looking at os2safe.h 
(GCC/libc), I see this,
```
/*
  * Note! The DOS queue API does not work with data, but with addresses, 
request
  * numbers, priorities and process IDs.  I.e. the data address you give
  * DosWriteQueue is NOT used to memcpy() what it points to into some 
internal
  * buffer that is then queued.  Instead that address is converted to 
16-bit and
  * placed on the queue.
  *
  * This means that the data pointer passed to DosWriteQueue CANNOT be a 
high
  * address!  (The wrappers below makes sure all the other pointer 
parameters
  * can be pointing to high memory, though.)
  */
#define DosCreateQueue          SafeDosCreateQueue
#define DosOpenQueue            SafeDosOpenQueue
#define DosPeekQueue            SafeDosPeekQueue
#define DosQueryQueue           SafeDosQueryQueue
#define DosReadQueue            SafeDosReadQueue
```
Dave

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description "Andi B." <andi.b@gmx.net> - 2023-06-18 13:00 +0200
  Re: High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description Dave Yeo <dave.r.yeo@gmail.com> - 2023-06-18 13:22 -0700
    Re: High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description "Andi B." <andi.b@gmx.net> - 2023-06-19 10:01 +0200
      Re: High memory usage with queue (DosAllocSharedMem, DosGiveSharedMem) - OBJ_ANY usage description Dave Yeo <dave.r.yeo@gmail.com> - 2023-06-19 11:27 -0700

csiph-web