support code for HANDLE tables
Hello, I'm currently playing around with the rsabase.dll implementation. Since this is the first time I'm writing wine code, I've got some questions: Is there support code for managing HANDLE tables? Or does every dll implementation provide it's own functions for doing this? Or do HANDLEs of each and every kind have to be administered by wineserver? The current CVS version of rsabase just casts between pointers and HCRYPTPROVs. Is this just a quick and dirty hack or common practice? Greetings and thanks, Michael -- Michael Jung, MSc Be liberal in what you accept, Integrated Circuits and Systems Lab and conservative in what you send. University of Technology, Darmstadt -- Jonathan Postel, Internet Pioneer phone: +49(6151)16-6692 / email: mjung(a)iss.tu-darmstadt.de
Hi Michael, There are two client side handle table implementations in Wine that you might be interested in. One is in wininet.dll (dlls/wininet/internet.c) and the other is in msi.dll (dlls/msi/handle.c). They are pretty small, but the major flaw is that although the handle tables themselves are thread safe, the handles are not. Wine uses pointers as handles in a number of cases that cause trouble (eg. directory handles), but I'm not sure that having common code for all handles would be easy or desirable. The code in rsabase is called by code in advapi32.dll, which also uses the same method of casting pointers to make handles. Since Windows programs will almost never call to rsabase directly, if you want to fix handles, it's probably better to fix the advapi32 handle code first. I think, however, that it's probably more important to have an implementation of rsabase that does the cryptography correctly before fixing the handles problem. The handles can be fixed when we find an application that depends upon crypto handles working like real handles. Mike Michael Jung wrote:
Hello,
I'm currently playing around with the rsabase.dll implementation. Since this is the first time I'm writing wine code, I've got some questions: Is there support code for managing HANDLE tables? Or does every dll implementation provide it's own functions for doing this? Or do HANDLEs of each and every kind have to be administered by wineserver? The current CVS version of rsabase just casts between pointers and HCRYPTPROVs. Is this just a quick and dirty hack or common practice?
Greetings and thanks, Michael
Michael Jung <mjung(a)iss.tu-darmstadt.de> writes:
I'm currently playing around with the rsabase.dll implementation. Since this is the first time I'm writing wine code, I've got some questions: Is there support code for managing HANDLE tables? Or does every dll implementation provide it's own functions for doing this? Or do HANDLEs of each and every kind have to be administered by wineserver? The current CVS version of rsabase just casts between pointers and HCRYPTPROVs. Is this just a quick and dirty hack or common practice?
It can be common practice, it all depends on what Windows does. There isn't a standard mechanism for handles, various Windows handles use different mechanisms: some are just pointers, some are index in a table, some contain various flags, etc. So it's up to the individual dll to provide an implementation that is compatible with the way Windows implements that specific handle type. -- Alexandre Julliard julliard(a)winehq.org
participants (3)
-
Alexandre Julliard -
Michael Jung -
Mike McCormack