Alexandre Julliard (@julliard) commented about server/d3dkmt.c:
- if (new_capacity > max_capacity) new_capacity = max_capacity;
- if (new_capacity <= old_capacity) return NULL; /* exhausted handle capacity */
- if (!(tmp = realloc( objects, new_capacity * sizeof(*objects) ))) return NULL;
- memset( tmp + old_capacity, 0, (new_capacity - old_capacity) * sizeof(*tmp) );
- objects = tmp;
- objects_end = tmp + new_capacity;
- objects_next = tmp + old_capacity;
- return objects_next;
+}
+/* allocate a d3dkmt object with a global handle */ +static NTSTATUS alloc_object_handle( struct d3dkmt_object *object ) +{
It's not useful to return NTSTATUS from these functions if you are not making use of it.
You should either return an error code (as unsigned int rather than NTSTATUS) and propagate it properly, or even better, use set_error() and then return a success/failure boolean.