Server Calls
Wine invokes wineserver calls throughout the code. However, these calls should not be spread across all the DLLs:
- there's no need for that
it will help some new projects, like a Wine kernel module to speed up wineserver implementation (see KernelHandleSupport)
- it makes the architecture and the portability of the code (for example with ReactOS) way easier
Running this little script:
#!/bin/bash
printf "Call Krn NT\n"
for i in dlls/*; do
if [ -d $i ]; then
count1=`grep -s wine_server_call $i/*.[cyl] | wc -l`
if [ $count1 -ne 0 ]; then
count2=`grep -s wine_server_call_err $i/*.[cyl] | wc -l`
printf "%3d: %-3d %-3d %s\n" $count1 $count2 $(($count1 - $count2)) `basename $i`;
fi
fi
done
from the $(WINE) directory will count every invocation to the wine server in the code. It splits also invocation from the NT form (simply returning a NT status) or the Kernel form (the NT status is converted into a Kernel error code and stored with SetLastError()).
Current status (in Git as of 2012-01-12) is:
Call |
Kernel |
NT |
|
55 |
49* |
6 |
kernel32 |
152 |
0 |
162 |
ntdll |
5 |
0 |
5 |
ntoskrnl.exe |
145 |
91 |
54 |
user32 |
1 |
0 |
1 |
user.exe16 |
9 |
2 |
7 |
winex11.drv |
18 |
1 |
17 |
ws2_32(winsock) |
(*): need to distinguish in kernel the console related calls (good), from the other ones (that should be moved to ntdll)
Short term goal is to:
remove server calls from psapi DONE
ensure that calls from user (and its driver X11) are only for the windowing interface in the server
Long term goal is to:
- remove server calls from kernel and replace them with C calls into ntdll (except the console related ones, which shall remain in kernel32)
- remove server calls from ws2_32(winsock) (this will likely require a Transport Driver Interface (TDI) in ntdll)
