Microsoft KB Archive/88433

{|
 * width="100%"|

PRB: _vmalloc Fails When Running 386MAX

 * }

Q88433

7.00 | 1.00 1.50 MS-DOS | WINDOWS kbprg kbprb -- The information in this article applies to: - Microsoft C/C++ for MS-DOS, version 7.0 - Microsoft Visual C++ for Windows, versions 1.0 and 1.5 -- SYMPTOMS ======== The function 0Fh (Resize Memory Block) of the 386MAX XMS handler seems to always return a value indicating that there is not enough extended memory. This happens when 386MAX version 6.02 or an earlier version of the 386MAX memory manager is installed and the swaparea parameter to _vheapinit contains only the _VM_XMS value. CAUSE ===== The function 0Fh (Resize Memory Block) of the 386MAX XMS handler seems to always return a value indicating that there is not enough extended memory. RESOLUTION ========== There are three ways to work around the problem: - Bitwise OR (|) the third parameter of the _vheapinit call with either _VM_EMS or _VM_DISK. This will allow _vmalloc to access expanded memory or disk space. - Substitute the 386MAX XMS handler with another. For example, run the program under Windows, or remove 386MAX and use HIMEM.SYS. - Upgrade to 386MAX version 6.02b or later. Qualitas has confirmed this to be a problem in 386MAX version 6.02 and in earlier versions. This problem was corrected in 386MAX version 6.02a. To obtain an updated version of 386MAX, use a modem to call the Qualitas BBS at (301) 907-8030. Your 386MAX serial number is required as part of the BBS login procedure. Request the updated version of 386MAX by leaving a message for the BBS sysop. MORE INFORMATION ================ Sample Code --- /* Compile options needed: None */ #include #include #include void main { _vmhnd_t handle; if ( !_vheapinit( 0, _VM_ALLDOS, _VM_XMS) ) { printf( &quot;Could not initialize virtual memory manager.\n&quot; ); exit( -1 ); } printf( &quot;Requesting 100 bytes of virtual memory.\n&quot; ); if ( (handle = _vmalloc( 100 )) == _VM_NULL ) { _vheapterm; printf(&quot;Allocation failed\n&quot;); exit( -1 ); } _vheapterm; } Additional reference words: 7.00 1.00 1.50 KBCategory: kbprg kbprb KBSubcategory: VirtualMem

Keywords : kb16bitonly kbVirtualMem

Issue type :

Technology : kbVCsearch kbAudDeveloper kbPTProdChange kbvc150 kbvc100 kbZNotKeyword3 kbCVC700DOS