server: Windows properties are actually generic params, not handles.

This commit is contained in:
Alexandre Julliard 2008-12-10 16:21:32 +01:00
parent 31282b3f63
commit 517b2f624d
5 changed files with 39 additions and 39 deletions

View File

@ -130,17 +130,17 @@ HANDLE WINAPI GetPropA( HWND hwnd, LPCSTR str )
*/
HANDLE WINAPI GetPropW( HWND hwnd, LPCWSTR str )
{
HANDLE ret = 0;
ULONG_PTR ret = 0;
SERVER_START_REQ( get_window_property )
{
req->window = wine_server_user_handle( hwnd );
if (!HIWORD(str)) req->atom = LOWORD(str);
else wine_server_add_data( req, str, strlenW(str) * sizeof(WCHAR) );
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
if (!wine_server_call_err( req )) ret = reply->data;
}
SERVER_END_REQ;
return ret;
return (HANDLE)ret;
}
@ -167,7 +167,7 @@ BOOL WINAPI SetPropW( HWND hwnd, LPCWSTR str, HANDLE handle )
SERVER_START_REQ( set_window_property )
{
req->window = wine_server_user_handle( hwnd );
req->handle = wine_server_obj_handle( handle );
req->data = (ULONG_PTR)handle;
if (!HIWORD(str)) req->atom = LOWORD(str);
else wine_server_add_data( req, str, strlenW(str) * sizeof(WCHAR) );
ret = !wine_server_call_err( req );
@ -195,18 +195,18 @@ HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str )
*/
HANDLE WINAPI RemovePropW( HWND hwnd, LPCWSTR str )
{
HANDLE ret = 0;
ULONG_PTR ret = 0;
SERVER_START_REQ( remove_window_property )
{
req->window = wine_server_user_handle( hwnd );
if (!HIWORD(str)) req->atom = LOWORD(str);
else wine_server_add_data( req, str, strlenW(str) * sizeof(WCHAR) );
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
if (!wine_server_call_err( req )) ret = reply->data;
}
SERVER_END_REQ;
return ret;
return (HANDLE)ret;
}
@ -224,7 +224,7 @@ INT WINAPI EnumPropsExA(HWND hwnd, PROPENUMPROCEXA func, LPARAM lParam)
{
char string[ATOM_BUFFER_SIZE];
if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
if (!(ret = func( hwnd, string, wine_server_ptr_handle(list[i].handle), lParam ))) break;
if (!(ret = func( hwnd, string, (HANDLE)(ULONG_PTR)list[i].data, lParam ))) break;
}
HeapFree( GetProcessHeap(), 0, list );
}
@ -246,7 +246,7 @@ INT WINAPI EnumPropsExW(HWND hwnd, PROPENUMPROCEXW func, LPARAM lParam)
{
WCHAR string[ATOM_BUFFER_SIZE];
if (!GlobalGetAtomNameW( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
if (!(ret = func( hwnd, string, wine_server_ptr_handle(list[i].handle), lParam ))) break;
if (!(ret = func( hwnd, string, (HANDLE)(ULONG_PTR)list[i].data, lParam ))) break;
}
HeapFree( GetProcessHeap(), 0, list );
}
@ -277,14 +277,14 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
args[3] = hwnd;
args[2] = SELECTOROF(segptr);
args[1] = OFFSETOF(segptr);
args[0] = LOWORD(wine_server_ptr_handle(list[i].handle));
args[0] = LOWORD(list[i].data);
}
else
{
args[3] = hwnd;
args[2] = 0;
args[1] = list[i].atom;
args[0] = LOWORD(wine_server_ptr_handle(list[i].handle));
args[0] = LOWORD(list[i].data);
}
WOWCallback16Ex( (DWORD)func, WCB16_PASCAL, sizeof(args), args, &result );
if (!(ret = LOWORD(result))) break;

View File

@ -144,7 +144,7 @@ typedef struct
{
atom_t atom;
short string;
obj_handle_t handle;
lparam_t data;
} property_data_t;
@ -3144,7 +3144,7 @@ struct set_window_property_request
struct request_header __header;
user_handle_t window;
atom_t atom;
obj_handle_t handle;
lparam_t data;
/* VARARG(name,unicode_str); */
};
struct set_window_property_reply
@ -3164,7 +3164,7 @@ struct remove_window_property_request
struct remove_window_property_reply
{
struct reply_header __header;
obj_handle_t handle;
lparam_t data;
};
@ -3179,7 +3179,7 @@ struct get_window_property_request
struct get_window_property_reply
{
struct reply_header __header;
obj_handle_t handle;
lparam_t data;
};

View File

@ -160,7 +160,7 @@ typedef struct
{
atom_t atom; /* property atom */
short string; /* was atom a string originally? */
obj_handle_t handle; /* handle stored in property */
lparam_t data; /* data stored in property */
} property_data_t;
/* structure to specify window rectangles */
@ -2302,7 +2302,7 @@ enum message_type
@REQ(set_window_property)
user_handle_t window; /* handle to the window */
atom_t atom; /* property atom (if no name specified) */
obj_handle_t handle; /* handle to store */
lparam_t data; /* data to store */
VARARG(name,unicode_str); /* property name */
@END
@ -2313,7 +2313,7 @@ enum message_type
atom_t atom; /* property atom (if no name specified) */
VARARG(name,unicode_str); /* property name */
@REPLY
obj_handle_t handle; /* handle stored in property */
lparam_t data; /* data stored in property */
@END
@ -2323,7 +2323,7 @@ enum message_type
atom_t atom; /* property atom (if no name specified) */
VARARG(name,unicode_str); /* property name */
@REPLY
obj_handle_t handle; /* handle stored in property */
lparam_t data; /* data stored in property */
@END

View File

@ -590,8 +590,8 @@ static void dump_varargs_properties( data_size_t size )
fputc( '{', stderr );
while (len > 0)
{
fprintf( stderr, "{atom=%04x,str=%d,handle=%04x}",
prop->atom, prop->string, prop->handle );
fprintf( stderr, "{atom=%04x,str=%d,data=%lx}",
prop->atom, prop->string, prop->data );
prop++;
if (--len) fputc( ',', stderr );
}
@ -2855,7 +2855,7 @@ static void dump_set_window_property_request( const struct set_window_property_r
{
fprintf( stderr, " window=%08x,", req->window );
fprintf( stderr, " atom=%04x,", req->atom );
fprintf( stderr, " handle=%04x,", req->handle );
fprintf( stderr, " data=%lx,", req->data );
fprintf( stderr, " name=" );
dump_varargs_unicode_str( cur_size );
}
@ -2870,7 +2870,7 @@ static void dump_remove_window_property_request( const struct remove_window_prop
static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
{
fprintf( stderr, " handle=%04x", req->handle );
fprintf( stderr, " data=%lx", req->data );
}
static void dump_get_window_property_request( const struct get_window_property_request *req )
@ -2883,7 +2883,7 @@ static void dump_get_window_property_request( const struct get_window_property_r
static void dump_get_window_property_reply( const struct get_window_property_reply *req )
{
fprintf( stderr, " handle=%04x", req->handle );
fprintf( stderr, " data=%lx", req->data );
}
static void dump_get_window_properties_request( const struct get_window_properties_request *req )

View File

@ -44,7 +44,7 @@ struct property
{
unsigned short type; /* property type (see below) */
atom_t atom; /* property atom */
obj_handle_t handle; /* property handle (user-defined storage) */
lparam_t data; /* property data (user-defined storage) */
};
enum property_type
@ -262,7 +262,7 @@ static int add_handle_to_array( struct user_handle_array *array, user_handle_t h
}
/* set a window property */
static void set_property( struct window *win, atom_t atom, obj_handle_t handle, enum property_type type )
static void set_property( struct window *win, atom_t atom, lparam_t data, enum property_type type )
{
int i, free = -1;
struct property *new_props;
@ -278,7 +278,7 @@ static void set_property( struct window *win, atom_t atom, obj_handle_t handle,
if (win->properties[i].atom == atom)
{
win->properties[i].type = type;
win->properties[i].handle = handle;
win->properties[i].data = data;
return;
}
}
@ -303,13 +303,13 @@ static void set_property( struct window *win, atom_t atom, obj_handle_t handle,
}
free = win->prop_inuse++;
}
win->properties[free].atom = atom;
win->properties[free].type = type;
win->properties[free].handle = handle;
win->properties[free].atom = atom;
win->properties[free].type = type;
win->properties[free].data = data;
}
/* remove a window property */
static obj_handle_t remove_property( struct window *win, atom_t atom )
static lparam_t remove_property( struct window *win, atom_t atom )
{
int i;
@ -320,7 +320,7 @@ static obj_handle_t remove_property( struct window *win, atom_t atom )
{
release_global_atom( NULL, atom );
win->properties[i].type = PROP_TYPE_FREE;
return win->properties[i].handle;
return win->properties[i].data;
}
}
/* FIXME: last error? */
@ -328,14 +328,14 @@ static obj_handle_t remove_property( struct window *win, atom_t atom )
}
/* find a window property */
static obj_handle_t get_property( struct window *win, atom_t atom )
static lparam_t get_property( struct window *win, atom_t atom )
{
int i;
for (i = 0; i < win->prop_inuse; i++)
{
if (win->properties[i].type == PROP_TYPE_FREE) continue;
if (win->properties[i].atom == atom) return win->properties[i].handle;
if (win->properties[i].atom == atom) return win->properties[i].data;
}
/* FIXME: last error? */
return 0;
@ -2358,11 +2358,11 @@ DECL_HANDLER(set_window_property)
atom_t atom = add_global_atom( NULL, &name );
if (atom)
{
set_property( win, atom, req->handle, PROP_TYPE_STRING );
set_property( win, atom, req->data, PROP_TYPE_STRING );
release_global_atom( NULL, atom );
}
}
else set_property( win, req->atom, req->handle, PROP_TYPE_ATOM );
else set_property( win, req->atom, req->data, PROP_TYPE_ATOM );
}
@ -2376,7 +2376,7 @@ DECL_HANDLER(remove_window_property)
if (win)
{
atom_t atom = name.len ? find_global_atom( NULL, &name ) : req->atom;
if (atom) reply->handle = remove_property( win, atom );
if (atom) reply->data = remove_property( win, atom );
}
}
@ -2391,7 +2391,7 @@ DECL_HANDLER(get_window_property)
if (win)
{
atom_t atom = name.len ? find_global_atom( NULL, &name ) : req->atom;
if (atom) reply->handle = get_property( win, atom );
if (atom) reply->data = get_property( win, atom );
}
}
@ -2418,7 +2418,7 @@ DECL_HANDLER(get_window_properties)
if (win->properties[i].type == PROP_TYPE_FREE) continue;
data->atom = win->properties[i].atom;
data->string = (win->properties[i].type == PROP_TYPE_STRING);
data->handle = win->properties[i].handle;
data->data = win->properties[i].data;
data++;
count--;
}