http://bugs.winehq.org/show_bug.cgi?id=8241
--- Comment #30 from Louis Lenders xerox_xerox2000@yahoo.co.uk 2009-05-24 03:34:33 --- Created an attachment (id=21282) --> (http://bugs.winehq.org/attachment.cgi?id=21282) test passing in some flags
Here's my $00.2 for what its worth. I followed Paul Vriens' suggestion to pass in various flag combinations, see attached test. These tests pass fine on winXP.
From what I can see from the tests you cannot remove the following flags:
GMEM_SHARE, GMEM_DDESHARE and GMEM_DISCARDABLE. This will make the test fail.
As for the flags GMEM_LOWER, GMEM_NOCOMPACT, GMEM_NOTBANKED, and GMEM_NOTIFY:
They are either removed by GlobalAlloc on windows, or GlobalFlags just can't detect them (see for example http://techref.massmind.org/techref/os/win/api/win32/func/src/f43_16.htm , there are only three flags listed there) In either way, as you said they are never used in wine's code , just remove them i'd say.
As for GMEM_NODISCARD, i havent got a clue. My guess would be that GlobalFlags does not check presence of this flag, anyway, i don't think there's a way to test if the flag is removed in GlobalAlloc, or Globalflags doesn't detect it. I'd say just don't remove it.
So my suggestion would be remove GMEM_LOWER, GMEM_NOCOMPACT, GMEM_NOTBANKED, and GMEM_NOTIFY. Then your bug is fixed.