When assembling my program with debug information, it suddenly gives the following error when I try to run it:

---------------------------
myapp.exe - Entry Point Not Found
---------------------------
The procedure entry point GlobalMemoryStatusVlm could not be located in the dynamic link library KERNEL32.dll.
---------------------------
OK
---------------------------

And I don't even use "GlobalMemoryStatusVlm". In fact I don't even know what it does! When I look at the exe with a hex editor, it looks as if all the kernel32 API's have been imported (at least all their names come up in the file...) I have tried various kernel32.lib files, but nothing helped. Does anyone have any idea as to what the problem is?
Posted on 2003-02-14 09:19:37 by Qweerdy
I looked in the win32.hlp and the closest I got to the API was this:
The GlobalMemoryStatus function retrieves information about current available memory. The function returns information about both physical and virtual memory. This function supersedes the GetFreeSpace function.

VOID GlobalMemoryStatus(
LPMEMORYSTATUS lpBuffer // pointer to the memory status structure
);


Parameters

lpBuffer
Points to a MEMORYSTATUS structure in which information about current memory availability is returned. Before calling this function, the calling process should set the dwLength member of this structure.


Return Values
This function does not return a value.

Remarks
An application can use the GlobalMemoryStatus function to determine how much memory it can allocate without severely impacting other applications.
The information returned is volatile, and there is no guarantee that two sequential calls to this function will return the same information.

See Also
MEMORYSTATUS


Maybe the debug option adds everything (even unused APIs), and some more. Did you specify /ENTRY: when linking?
Posted on 2003-02-14 10:28:59 by scientica
Did you specify /ENTRY: when linking?


No... does that matter? Oh, and it looks like kernel32.dll is the only one that went all crazy with the imports.
Posted on 2003-02-14 10:33:41 by Qweerdy

---------------------------
myapp.exe - Entry Point Not Found
---------------------------

Maybee... :)
Posted on 2003-02-14 10:53:03 by scientica
I use /Zi on ml.exe and /debug for link.exe when building my debug exe's, and I have never seen that error. Strange... I think the vlm in that function name stands for "Very Large Memory" which means they are 64 bit functions.
Posted on 2003-02-14 10:55:00 by BubbaFate
Scientica:

I've seen that message before... it means it can't find a specified function in a DLL. Anyway, just to make sure I added a /ENTRY:start in the link command line, it didn't matter. It still gives the error.
Posted on 2003-02-14 10:57:19 by Qweerdy
Ok, maybee windows has decided that you shouln't comple the app today... (=sorry don't know what the error might be :()

(btw I found 1 match when searching the MSDN: http://www.microsoft.com/msj/defaultframe.asp?page=/msj/1197/nt5dll.htm&nav=/msj/1197/newnav.htm)
Windows NT 5.0 also adds the following other 64-bit memory APIs that work much as their 32-bit versions do: VirtualProtectVlm, VirtualQueryVlm, GlobalMemoryStatusVlm, and ReadProcessMemoryVlm /WriteProcessMemoryVlm.
Posted on 2003-02-14 11:04:06 by scientica
Well, I just reinstalled Masm32 8 and rebuilt the library files, and behold: the problem was solved! I still don't know how the broken lib got there though...
Posted on 2003-02-15 02:08:22 by Qweerdy