PATCH: EnumProps16 do not enumerate non strings
Marcus Meissner
meissner at suse.de
Fri Jul 22 10:10:44 CDT 2005
On Fri, Jul 22, 2005 at 12:08:58PM +0200, Alexandre Julliard wrote:
> Marcus Meissner <meissner at suse.de> writes:
>
> > In 2001 when windows/property.c moved to dlls/user/property.c additionaly
> > EnumProps16 gained the ability to enumerate non-string atoms.
> >
> > This brings a 16 bit application I have here to crash in
> > repne scansb es:(di), so it clearly expects get only strings.
> >
> > Ciao, Marcus
> >
> > Changelog:
> > Do not enumerate non-strings in EnumProp16.
>
> That ability was added specifically for 16-bit apps, so I don't think
> it should be removed. Probably the problem is because of some Wine
> internal property. Can you find out which property is causing trouble?
Ok, after #winehackers discussion the first hunk of the fix and
the second hunk ... I try harder to pass a string down to userland.
Ciao, Marcus
Changelog:
Fixed call to get_window_properties().
Try harder to supply a string for 16 bit userland.
Index: dlls/user/property.c
===================================================================
RCS file: /home/wine/wine/dlls/user/property.c,v
retrieving revision 1.13
diff -u -r1.13 property.c
--- dlls/user/property.c 11 May 2005 19:01:10 -0000 1.13
+++ dlls/user/property.c 22 Jul 2005 15:08:42 -0000
@@ -55,7 +58,7 @@
SERVER_START_REQ( get_window_properties )
{
req->window = hwnd;
- wine_server_add_data( req, data, total * sizeof(*data) );
+ wine_server_set_reply ( req, data, total * sizeof(*data) );
if (!wine_server_call( req )) res = reply->total;
}
SERVER_END_REQ;
@@ -272,20 +277,24 @@
for (i = 0; i < count; i++)
{
+ args[3] = hwnd;
+ args[0] = LOWORD(list[i].handle);
if (list[i].string) /* it was a string originally */
{
if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
- args[3] = hwnd;
args[2] = SELECTOROF(segptr);
args[1] = OFFSETOF(segptr);
- args[0] = LOWORD(list[i].handle);
}
else
{
- args[3] = hwnd;
- args[2] = 0;
- args[1] = list[i].atom;
- args[0] = LOWORD(list[i].handle);
+ /* Perhaps this was a string originally too. */
+ if (GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) {
+ args[2] = SELECTOROF(segptr);
+ args[1] = OFFSETOF(segptr);
+ } else {
+ args[2] = 0;
+ args[1] = list[i].atom;
+ }
}
WOWCallback16Ex( (DWORD)func, WCB16_PASCAL, sizeof(args), args, &result );
if (!(ret = LOWORD(result))) break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20050722/f6a94ad9/attachment.pgp
More information about the wine-devel
mailing list