Re: Problems with VirtualAlloc/Lock

2005-03-17 Thread Alexandre Julliard
Michael Ost <[EMAIL PROTECTED]> writes: > This should start allocating memory from below 0x4000, to windows > processes after the area between 0x4000, to 0x8000, is full, > right? That would be nice, but unfortunately it's not what it does. Also even if it worked it wouldn't help for

Re: Problems with VirtualAlloc/Lock

2005-03-16 Thread Michael Ost
On Wed, 2005-03-16 at 00:32, Alexandre Julliard wrote: > Michael Ost <[EMAIL PROTECTED]> writes: > > > Wine reports that apps have 2GB of VM in GlobalMemoryStatus, but they > > actually only have 1GB. Isn't that a Wine bug? > > Not really, you do have 2GB of VM, you just can't allocate all of it

Re: Problems with VirtualAlloc/Lock

2005-03-16 Thread Mike Hearn
On Tue, 15 Mar 2005 13:12:42 -0800, Michael Ost wrote: > What's involved in doing such a hack/syscall? Are there any patches that > make this change lying around somewhere that I could look at? I thought the flex-mmap patches in very recent kernels changed stuff so you could do this. I'd ask on th

Re: Problems with VirtualAlloc/Lock

2005-03-16 Thread Alexandre Julliard
Michael Ost <[EMAIL PROTECTED]> writes: > Wine reports that apps have 2GB of VM in GlobalMemoryStatus, but they > actually only have 1GB. Isn't that a Wine bug? Not really, you do have 2GB of VM, you just can't allocate all of it with VirtualAlloc(NULL) because of kernel limitations. You can stil

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Michael Ost
On Tue, 2005-03-15 at 11:12, Alexandre Julliard wrote: > Michael Ost <[EMAIL PROTECTED]> writes: > > > On Tue, 2005-03-15 at 01:09, Alexandre Julliard wrote: > > > That's a kernel limitation. If you hack the kernel to start allocating > > > from lower addresses (or implement the syscall we discuss

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Alexandre Julliard
Michael Ost <[EMAIL PROTECTED]> writes: > On Tue, 2005-03-15 at 01:09, Alexandre Julliard wrote: > > That's a kernel limitation. If you hack the kernel to start allocating > > from lower addresses (or implement the syscall we discussed to let us > > specify the mmap range) you can get the full 2GB

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Michael Ost
On Tue, 2005-03-15 at 01:09, Alexandre Julliard wrote: > Michael Ost <[EMAIL PROTECTED]> writes: > > will stop at 1,022,976k (1GB) on any wine machine. In winxp it goes up > > to 2GB, as it ought to. > > That's a kernel limitation. If you hack the kernel to start allocating > from lower addresses

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Uwe Bonnes
> "Alexandre" == Alexandre Julliard <[EMAIL PROTECTED]> writes: Alexandre> Michael Ost <[EMAIL PROTECTED]> writes: >> Yep, it does. Give it a try. As far as I can tell: >> >> int total = 0; for (;;) { LPVOID* leak = ::VirtualAlloc(NULL, >> 1048576, MEM_RESERVE, PROT_NOACCE

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Alexandre Julliard
Michael Ost <[EMAIL PROTECTED]> writes: > Yep, it does. Give it a try. As far as I can tell: > > int total = 0; > for (;;) { > LPVOID* leak = ::VirtualAlloc(NULL, 1048576, > MEM_RESERVE, PROT_NOACCESS); > if (leak) { > total += 1048576/1024; > printf("Allocated %ldk\r", total); >

Re: Problems with VirtualAlloc/Lock

2005-03-15 Thread Uwe Bonnes
> "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes: >> * VirtualLock does nothing in Wine Kuba> VirtualLock does nothing in win95,98,ME as well :) Kuba> I bet the correct behaviour for wine is to do anything in Kuba> VirtualLock only if you set windows version to NT/2000/XP. Did

Re: Problems with VirtualAlloc/Lock

2005-03-14 Thread Michael Ost
On Mon, 2005-03-14 at 20:13, you wrote: > > * VirtualLock does nothing in Wine > VirtualLock does nothing in win95,98,ME as well :) > > I bet the correct behaviour for wine is to do anything in VirtualLock > only if you set windows version to NT/2000/XP. Did you do it? Good point. But the setting

Re: Problems with VirtualAlloc/Lock

2005-03-14 Thread Kuba Ober
> * VirtualLock does nothing in Wine VirtualLock does nothing in win95,98,ME as well :) I bet the correct behaviour for wine is to do anything in VirtualLock only if you set windows version to NT/2000/XP. Did you do it? Anyway, mlock() seems to work fine, so this should be implementable. > * Wi

Re: Problems with VirtualAlloc/Lock

2005-03-14 Thread MIchael Ost
On Mon, 2005-03-14 at 13:16, Raphael wrote: > seems we have a bug report about that problem (behavior differences) > http://bugs.winehq.org/show_bug.cgi?id=890 I guess I am adding VirtualLock and VirtualAlloc to the list of APIs that don't work the same in Wine vs Windows. Bug #890 is about Virtu

Re: Problems with VirtualAlloc/Lock

2005-03-14 Thread Raphael
Hi, interesting seems we have a bug report about that problem (behavior differences) http://bugs.winehq.org/show_bug.cgi?id=890 Regards, Raphael pgphdqoXTIGCs.pgp Description: PGP signature

Problems with VirtualAlloc/Lock

2005-03-14 Thread MIchael Ost
There are major differences in the handling of virtual memory in Wine vs WinXP that are causing problems for my winelib application. Can someone provide background and/or workarounds for these issues? As near as I can tell the main differences are: * VirtualLock does nothing in Wine * Wine makes n