kernel32: Moved MemManInfo16 to toolhelp16.c.
authorAlexandre Julliard <julliard@winehq.org>
Mon, 28 Sep 2009 17:57:28 +0000 (19:57 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 28 Sep 2009 17:57:28 +0000 (19:57 +0200)
dlls/kernel32/global16.c
dlls/kernel32/toolhelp16.c

index 42d481634fd2ff38f93f12673822b86d8d8b84b4..e572c3d09f21a276d1d4c1453a88ac82014a5e8c 100644 (file)
@@ -1062,40 +1062,14 @@ BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
 }
 
 
-/***********************************************************************
- *           MemManInfo   (TOOLHELP.72)
- */
-BOOL16 WINAPI MemManInfo16( MEMMANINFO *info )
-{
-    MEMORYSTATUS status;
-
-    /*
-     * Not unsurprisingly although the documentation says you
-     * _must_ provide the size in the dwSize field, this function
-     * (under Windows) always fills the structure and returns true.
-     */
-    GlobalMemoryStatus( &status );
-    info->wPageSize            = getpagesize();
-    info->dwLargestFreeBlock   = status.dwAvailVirtual;
-    info->dwMaxPagesAvailable  = info->dwLargestFreeBlock / info->wPageSize;
-    info->dwMaxPagesLockable   = info->dwMaxPagesAvailable;
-    info->dwTotalLinearSpace   = status.dwTotalVirtual / info->wPageSize;
-    info->dwTotalUnlockedPages = info->dwTotalLinearSpace;
-    info->dwFreePages          = info->dwMaxPagesAvailable;
-    info->dwTotalPages         = info->dwTotalLinearSpace;
-    info->dwFreeLinearSpace    = info->dwMaxPagesAvailable;
-    info->dwSwapFilePages      = status.dwTotalPageFile / info->wPageSize;
-    return TRUE;
-}
-
 /***********************************************************************
  *           GetFreeMemInfo   (KERNEL.316)
  */
 DWORD WINAPI GetFreeMemInfo16(void)
 {
-    MEMMANINFO info;
-    MemManInfo16( &info );
-    return MAKELONG( info.dwTotalLinearSpace, info.dwMaxPagesAvailable );
+    MEMORYSTATUS status;
+    GlobalMemoryStatus( &status );
+    return MAKELONG( status.dwTotalVirtual/getpagesize(), status.dwAvailVirtual/getpagesize() );
 }
 
 /***********************************************************************
index c6931d28e36bb56d017345c523c5031538551d35..a98971ad42086e5b83b5b1791606827c67fa1276 100644 (file)
@@ -64,6 +64,31 @@ BOOL16 WINAPI TaskFindHandle16( TASKENTRY *lpte, HTASK16 hTask )
     return TaskNext16( lpte );
 }
 
+/***********************************************************************
+ *           MemManInfo   (TOOLHELP.72)
+ */
+BOOL16 WINAPI MemManInfo16( MEMMANINFO *info )
+{
+    MEMORYSTATUS status;
+
+    /*
+     * Not unsurprisingly although the documentation says you
+     * _must_ provide the size in the dwSize field, this function
+     * (under Windows) always fills the structure and returns true.
+     */
+    GlobalMemoryStatus( &status );
+    info->wPageSize            = getpagesize();
+    info->dwLargestFreeBlock   = status.dwAvailVirtual;
+    info->dwMaxPagesAvailable  = info->dwLargestFreeBlock / info->wPageSize;
+    info->dwMaxPagesLockable   = info->dwMaxPagesAvailable;
+    info->dwTotalLinearSpace   = status.dwTotalVirtual / info->wPageSize;
+    info->dwTotalUnlockedPages = info->dwTotalLinearSpace;
+    info->dwFreePages          = info->dwMaxPagesAvailable;
+    info->dwTotalPages         = info->dwTotalLinearSpace;
+    info->dwFreeLinearSpace    = info->dwMaxPagesAvailable;
+    info->dwSwapFilePages      = status.dwTotalPageFile / info->wPageSize;
+    return TRUE;
+}
 
 /***********************************************************************
  *             NotifyRegister (TOOLHELP.73)