Author: fireball
Date: Tue Jul 28 15:50:45 2009
New Revision: 42267
URL:
http://svn.reactos.org/svn/reactos?rev=42267&view=rev
Log:
Giannis Adamopoulos
- Implement table growing in add_atom_entry, grow_handle_table and add_handle_to_array.
- Uncomment all_windows_from_point and get_window_children_from_point.
Modified:
branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c
branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c
branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] Tue Jul 28
15:50:45 2009
@@ -138,10 +138,11 @@
if (new_size > MAX_ATOMS) new_size = MAX_ATOMS;
if (new_size > table->count)
{
- //new_table = ExAllocatePool(PagedPool, sizeof(*table->handles) *
new_size);
- //RtlCopyMemory(new_table, table, sizeof(*table->handles));
- //new_table = realloc( table->handles, sizeof(*table->handles) *
new_size );
- UNIMPLEMENTED;
+ new_table = ExAllocatePool(PagedPool, sizeof(*table->handles) *
new_size);
+ RtlCopyMemory(new_table, table, sizeof(*table->handles));
+ new_table = ExReallocPool(table->handles ,
+ sizeof(*table->handles) * new_size,
+ sizeof(*table->handles) * table->count);
}
if (!new_table)
{
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1] Tue Jul 28
15:50:45 2009
@@ -184,12 +184,13 @@
/* grow a handle table */
static int grow_handle_table( struct handle_table *table )
{
-#if 0
struct handle_entry *new_entries;
int count = min( table->count * 2, MAX_HANDLE_ENTRIES );
if (count == table->count ||
- !(new_entries = realloc( table->entries, count * sizeof(struct handle_entry)
)))
+ !(new_entries = ExReallocPool( table->entries,
+ count * sizeof(struct handle_entry) ,
+ table->count * sizeof(struct handle_entry))))
{
set_error( STATUS_INSUFFICIENT_RESOURCES );
return 0;
@@ -197,10 +198,6 @@
table->entries = new_entries;
table->count = count;
return 1;
-#else
- UNIMPLEMENTED;
- return 0;
-#endif
}
/* allocate the first free entry in the handle table */
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1] Tue Jul 28
15:50:45 2009
@@ -240,7 +240,9 @@
if (array->count >= array->total)
{
int new_total = max( array->total * 2, 32 );
- user_handle_t *new_array = realloc( array->handles, new_total *
sizeof(*new_array) );
+ user_handle_t *new_array = ExReallocPool(array->handles,
+ new_total * sizeof(user_handle_t),
+ array->total *
sizeof(user_handle_t));
if (!new_array)
{
ExFreePool( array->handles );
@@ -688,7 +690,6 @@
}
/* return list of all windows containing point (in absolute coords) */
-#if 0
static int all_windows_from_point( struct window *top, int x, int y, struct
user_handle_array *array )
{
struct window *ptr;
@@ -718,7 +719,6 @@
if (!add_handle_to_array( array, top->handle )) return 0;
return 1;
}
-#endif
/* return the thread owning a window */
PTHREADINFO get_window_thread( user_handle_t handle )
@@ -1981,7 +1981,6 @@
/* get a list of the window children that contain a given point */
DECL_HANDLER(get_window_children_from_point)
{
-#if 0
struct user_handle_array array;
struct window *parent = get_window( req->parent );
data_size_t len;
@@ -1997,9 +1996,6 @@
len = min( get_reply_max_size((void*)req), array.count * sizeof(user_handle_t) );
if (len) set_reply_data_ptr( (void*)req, array.handles, len );
else ExFreePool( array.handles );
-#else
- UNIMPLEMENTED;
-#endif
}