http://bugs.winehq.org/show_bug.cgi?id=13302
Summary: GetProcessMemoryInfo is unimplemented Product: Wine Version: 1.0-rc1 Platform: PC URL: http://forum.winehq.org/viewtopic.php?t=946 OS/Version: Linux Status: NEW Keywords: testcase Severity: enhancement Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
From wine-users:
I have made a simple program, but results from both windows and wine are quite different. Is this a bug in my program or in wine? Any advice is appreciated :)
/* result under windows: { } [successed: 1085440]{ }
result under wine(linux): { } [successed: 0]{ */
#include <windows.h> #include "psapi.h" #include <stdio.h> #include <stdlib.h>
#pragma comment ( lib, "psapi.lib" )
void GetCurrentProcessMemory () { PROCESS_MEMORY_COUNTERS pmc;
printf("{\n}");
bool ret=GetProcessMemoryInfo ( GetCurrentProcess() , &pmc, sizeof ( pmc ) );
if (ret) printf("\n[successed: %d]", (int)pmc.WorkingSetSize); else printf("\n<failed>");
printf("{\n}");
}
void main() { GetCurrentProcessMemory(); }
For anyone interested in implementing, see: http://source.winehq.org/source/dlls/psapi/psapi_main.c#L520 http://source.winehq.org/source/dlls/ntdll/process.c#L211