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();
}
brown wrote:> 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 :) > bool ret=GetProcessMemoryInfo ( GetCurrentProcess() , &pmc,It's not implemented in Wine: http://source.winehq.org/source/dlls/psapi/psapi_main.c#L520 calls http://source.winehq.org/source/dlls/ntdll/process.c#L211 You should use other functions available form kernel32 instead.
vitamin wrote:> > brown wrote: > > NTSTATUS ns = NtQuerySystemInformation ( SystemProcessInformation, pspi, dSize, NULL ); > > > > > You didn't read what I said - that function you trying to use is not implemented (that class in not implemented - just a stub). And I even linked it so you can see. And I told you to use other API available from kernel32.I really read it, but I don't have a clue how to do it with kernel32 APIs. :? austin987 wrote:> I filed a bug for you: > http://bugs.winehq.org/show_bug.cgi?id=13302Thanks, although I'm not sure if it can be defined as a bug. :)