Maybe you know this, but this patch does too many things and will need to be split before sending to wine-patches.
PropertyStore_SetNamedValue leaks a copy of the value when a new propstore_named_value can't be allocated.
+ if (!psps && !cb) /* special case: empty storage */
Is it really not enough to have a size of 0? The buffer has to be NULL as well?
+ /* MSDN mandates generic error codes */
MSDN's lists of error codes aren't necessarily exhaustive.