Fixed rail window key hash function to work with UINT32
@@ -1075,7 +1075,8 @@ static UINT xf_rail_server_local_move_size(RailClientContext* context,
Window child_window;
xfAppWindow* appWindow = NULL;
xfContext* xfc = (xfContext*) context->custom;
- appWindow = (xfAppWindow*) HashTable_GetItemValue(xfc->railWindows, (void *)&localMoveSize->windowId);
+ appWindow = (xfAppWindow*) HashTable_GetItemValue(xfc->railWindows,
+ (void*)&localMoveSize->windowId);
if (!appWindow)
return ERROR_INTERNAL_ERROR;
@@ -1211,6 +1212,11 @@ static BOOL rail_window_key_equals(void *key1, void* key2)
return *(UINT32*)key1 == *(UINT32*)key2;
}
+static UINT32 rail_window_key_hash(void* key)
+{
+ return *(UINT32*)key;
+}
+
static void rail_window_free(void* value)
{
xfAppWindow* appWindow = (xfAppWindow*) value;
@@ -1239,13 +1245,14 @@ int xf_rail_init(xfContext* xfc, RailClientContext* rail)
rail->ServerMinMaxInfo = xf_rail_server_min_max_info;
rail->ServerLanguageBarInfo = xf_rail_server_language_bar_info;
rail->ServerGetAppIdResponse = xf_rail_server_get_appid_response;
-
xfc->railWindows = HashTable_New(TRUE);
+
if (!xfc->railWindows)
return 0;
+
xfc->railWindows->keyCompare = rail_window_key_equals;
+ xfc->railWindows->hash = rail_window_key_hash;
xfc->railWindows->valueFree = rail_window_free;
-
xfc->railIconCache = RailIconCache_New(xfc->context.settings);
if (!xfc->railIconCache)
