I was looking at http://bugs.winehq.org/show_bug.cgi?id=19861 and it seemed pretty easy to fix.
In my opinion, the warning should either go in server/file.c - file_set_error() or in server/fd.c - open_fd().
open_fd() is pretty much the only place where open() is called, so it's a good candidate.
On the other hand, having the check in file_set_error() might detect the condition in more instances, but it might also impact performance (file_set_error() is called really often; having lots of code in one branch might make the compiler generate slower code).
The warning would go on the ENFILE/EMFILE branches, and maybe also print the value of getrlimit(RLIMIT_NOFILE) and suggest a fix (editing /etc/security/limits.conf).
Octavian