Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOT_ENOUGH_MEMORY error when mapping a file

Status
Not open for further replies.

linksasp

Programmer
Apr 5, 2001
2
AU
We have an application running on a Citrix Metaframe 1.8 for Windows 2000 server (SP2) + HOTFIX.

Inside this application, we call a menu option that attempts to open a file and import some data.
If this data file is located on the local hard drive of the citrix server, the import routine runs fine.
If the data file is located on another Windows 2000 server within the Citrix environment
(eg. <\\SERVER2\DATA\DATAFILE.TXT>) the import runs
without error.

If the data file is located on the client's drive and the import run on the file <\\client\c$\DATA\DATAFILE.TXT>, we get an error.

The software has been written to use the Win32API to open the file.

The DLL that does the file opening performs the following functions in order:

lFileHandle = CreateFile(&quot;\\client\c$\data\datafile.txt&quot;, GENERIC_READ, 0,
SecAttributes, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)

Then, the CreateFileMapping funtion is called:

lFileMap = CreateFileMapping(lFileHandle, SecAttributes, PAGE_READONLY, 0,0, sFileMapName)

This function returns an error. NOT_ENOUGH_MEMORY.

As this is a Win32API call, I would have thought it would be fine to work across a client mapped drive as it is essentially just a network share.

If this is not the case, what are the limitations on
programmatically opening files on client mapped drives?

Any assistance would be appreciated.
 
Client Drive Mapping under MetaFrame is a feature of the ICA protocol, and may use proprietary APIs in addition to the Win32 ones.

I think the variable you need is %clientdrive%. Beyond this, I'm a little hazy!

Hope this helps you

 
Just a thought.... but how have you configured the servers ?

Are the servers drives being remapped (IE to M N etc) to enable local clients to map their client drives to reflect their local mappings ? (IE C as Network &quot;C&quot;, A as Network &quot;A&quot;)

This if enabled could be part of your problem... Steve Marshall
Group IT
Technical Support Supervisor
(aka General Meddler)
The Expro Group
Reading
UK
 
Yes, the drives are being remapped. The file is opened ok, it's just the CreateFileMapping function that fails. I have a feeling that the NOT_ENOUGH_MEMORY failure is not true. I think it's some other sort of failure that the system can't resolve and just picks that error code by default. My real question should be &quot;has anyone ever had
problems with the CreateFileMapping function in this scenario&quot;?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top