[comp.windows.ms] Memory, more memory!

mms00786@uxa.cso.uiuc.edu (10/23/89)

Hello. I just ran into a memory roadblock (Sorry if thirty three solutions have
been discussed in the past, I missed them!)

I am writing a dedicated MS Windows application, to be run on one machine in
our lab. It has gobs of memory, about 4Meg I think, most of it EMS. The 
problem is that if I try to GlobalAlloc 384K of memory, I get a out of
memory error!

I therefore conclude only one thing - that GlobalAlloc does not know about
EMS memory. Is that true? Do I have to resort to assembly calls to EMS
functions? (BTW, I need to allocate 384K in 16K chunks at most, so I know
its not running into problems trying to allocate across segment boundaries).

So is this EMS memory accessible to my program without resorting to assembly?
I also tried using the function LimitEMSPages (wKbytes) as described in the
readme file provided with the SDK - this however gave me a unresolved external
error!!

Any information on how to allocate the requisite memory will be very much 
appreciated.

Thanks in advance,

Milan
mms00786@uxa.cso.uiuc.edu
.

brent@well.UUCP (Brent Southard) (10/25/89)

In article <246400030@uxa.cso.uiuc.edu> mms00786@uxa.cso.uiuc.edu writes:
>
>I therefore conclude only one thing - that GlobalAlloc does not know about
>EMS memory. Is that true? Do I have to resort to assembly calls to EMS
>functions? 

Yes, you do.

Your application may make calls to the EMS driver which concern the SMALL
page frame only.  Messing with large frame EMS will screw with Windows'
memory management.  The functions you may call are numbered 1-15, and 18.
Unfortunately, Microsoft did not include a function interface in their
libraries.  I've written one, but I don't think my company would appreciate
me distributing it. :(

>I also tried using the function LimitEMSPages (wKbytes) as described in the
>readme file provided with the SDK - this however gave me a unresolved external
>error!!

Hmm.  The function may not be prototyped in windows.h.  Be sure you declare
it as a FAR PASCAL function in your prototype.

Hope this helps.
-brent

-- 
brent southard  (313) 656-8349   |   usenet:  ...!well!brent
ImageTech Corp  (313) 362-3141   |   

"When frog licking is outlawed, only outlaws will lick frogs."