[comp.windows.ms] Expanded Memory Q, DLLs and getenv

adam@cfi.COM (adam) (12/15/88)

Hi there:

Does anyone out there know where to find info on having windows applications
access expanded/extended memory? The only piece of info I could find was a
function called LimitEMSPages(), which tells me how to _limit_ access, but not 
how to _get_ access in the first place.  Are there Windows calls to do this, or
do I have to do this in assembler (INT 67H; blech!), or is EMS access done 
transparently by Windows?

If you can answer that, I have another question:

How does one access environment variables from a dynamic link library, given
that getenv() is not allowed? is this possible?

Thanks for all answers.

=====================================================================
"Yes ma'am, I do Windows."
-- 
Adam Marx, The Consumer Financial Institute, Waltham, MA 617-899-6500
{decvax!yale|allegra|ihnp4|ucbvax!cbosgd}!ima!cfisun!adam
adam@CFI.COM

Charlie@umn-cs.CS.UMN.EDU (Charles Anderson) (12/17/88)

In article <360@thebeach.UUCP> adam@cfi.COM () writes:
|
|Hi there:
|
|Does anyone out there know where to find info on having windows applications
|access expanded/extended memory? The only piece of info I could find was a
|function called LimitEMSPages(), which tells me how to _limit_ access, but not 
|how to _get_ access in the first place.  Are there Windows calls to do this, or
|do I have to do this in assembler (INT 67H; blech!), or is EMS access done 
|transparently by Windows?
	If you have the emm driver loaded YES, look in the about box (hit
alt-f, alt-b) and if should tell you free memory and expanded memory.
Windows need LIM 4.0 EXPANDED memory, extended will work with win/386, and
I think with 286 but I'm not sure.
|
|If you can answer that, I have another question:
|
|How does one access environment variables from a dynamic link library, given
|that getenv() is not allowed? is this possible?
	The closest thing windows has to environment variables are the entrys
in the win.ini file which your read with GetProfileString (or Int)
and can write back out with WriteProfileString.
|
|Thanks for all answers.
	Your welcome.
|
|=====================================================================
|"Yes ma'am, I do Windows."
|-- 
|Adam Marx, The Consumer Financial Institute, Waltham, MA 617-899-6500
|{decvax!yale|allegra|ihnp4|ucbvax!cbosgd}!ima!cfisun!adam
|adam@CFI.COM

inews sucks donkey dung!

--
Charlie Anderson - caa@midgard.mn.org

--
Charlie Anderson - caa@midgard.mn.org

dennis@se-sd.sandiego.ncr.com (Dennis Foster) (12/17/88)

In article <360@thebeach.UUCP> adam@cfi.COM () writes:
>
>Does anyone out there know where to find info on having windows applications
>access expanded/extended memory? The only piece of info I could find was a
>function called LimitEMSPages(), which tells me how to _limit_ access, but not 
>how to _get_ access in the first place.  Are there Windows calls to do this, or
>do I have to do this in assembler (INT 67H; blech!), or is EMS access done 
>transparently by Windows?
>

Just use GlobalAlloc!  If you are running on a system that has expanded memory
and enough is available, you'll get it (by default).  If you want to allocate
conventional memory, you need to include the GMEM_NOT_BANKED bit on your
call to GlobalAlloc.