Michael Jung mjung@iss.tu-darmstadt.de writes:
Changelog: CPAcquireContext: Set last error to ERROR_SUCCESS in case of success.
There are very few functions that set last error on success, do you have a test demonstrating that Windows does it in this case?
On Tuesday 09 November 2004 20:21, Alexandre Julliard wrote:
Michael Jung mjung@iss.tu-darmstadt.de writes:
Changelog: CPAcquireContext: Set last error to ERROR_SUCCESS in case of success.
There are very few functions that set last error on success, do you have a test demonstrating that Windows does it in this case?
The test is in dlls/advapi32/tests/crypt.c, line 117. It passes at least on WinXP SP2. What I don't know is if this should be set in advapi32/CryptAcquireContext or in rsaenh/CPAcquireContext. However, setting it in rsaenh can do no harm.
Greetings, Michael
Michael Jung mjung@iss.tu-darmstadt.de writes:
The test is in dlls/advapi32/tests/crypt.c, line 117. It passes at least on WinXP SP2.
OK great, I missed that one.
What I don't know is if this should be set in advapi32/CryptAcquireContext or in rsaenh/CPAcquireContext. However, setting it in rsaenh can do no harm.
Famous last words... It definitely matters where it's done, because we can use various native/builtin combinations, so we have to do it where Windows does.
On Tuesday 09 November 2004 20:52, Alexandre Julliard wrote:
Michael Jung mjung@iss.tu-darmstadt.de writes:
The test is in dlls/advapi32/tests/crypt.c, line 117. It passes at least on WinXP SP2.
OK great, I missed that one.
What I don't know is if this should be set in advapi32/CryptAcquireContext or in rsaenh/CPAcquireContext. However, setting it in rsaenh can do no harm.
Famous last words... It definitely matters where it's done, because we can use various native/builtin combinations, so we have to do it where Windows does.
I agree that if this is done on Windows in advapi32, we have to do it there, too. What I meant to say was the following:
There are basically two possibilities: 1.) It's done in rsaenh. Then we are ok. 2.) It's done in advapi32: Then it doesn't matter if we already have set it in rsaenh, because it will be overwritten.
Greetings, Michael
Michael Jung mjung@iss.tu-darmstadt.de writes:
I agree that if this is done on Windows in advapi32, we have to do it there, too. What I meant to say was the following:
There are basically two possibilities: 1.) It's done in rsaenh. Then we are ok. 2.) It's done in advapi32: Then it doesn't matter if we already have set it in rsaenh, because it will be overwritten.
But if Windows doesn't set it in rsaenh, then we are just hiding a bug. And of course there's always the possibility that native advapi32 somehow depends on rsaenh not doing it; I know it's unlikely, but the point is we can't just do things differently and assume that it will work.
On Tuesday 09 November 2004 21:24, Alexandre Julliard wrote:
Michael Jung mjung@iss.tu-darmstadt.de writes:
I agree that if this is done on Windows in advapi32, we have to do it there, too. What I meant to say was the following:
There are basically two possibilities: 1.) It's done in rsaenh. Then we are ok. 2.) It's done in advapi32: Then it doesn't matter if we already have set it in rsaenh, because it will be overwritten.
But if Windows doesn't set it in rsaenh, then we are just hiding a bug. And of course there's always the possibility that native advapi32 somehow depends on rsaenh not doing it; I know it's unlikely, but the point is we can't just do things differently and assume that it will work.
The attached program produces the following output on my WinXP SP2:
Loaded rsaenh.dll successfully! Got CPAcquireContext address! Success! Last error: 00000000
So it seems that rsaenh is setting last error to ERROR_SUCCESS. If you wan't to try the program, make sure that there is a default key container named with your login name on your system. Otherwise CPAcquireContext will fail.
Greetings, Michael
Michael Jung mjung@iss.tu-darmstadt.de writes:
The attached program produces the following output on my WinXP SP2:
Loaded rsaenh.dll successfully! Got CPAcquireContext address! Success! Last error: 00000000
Cool, thanks for taking the time to do this. I'll put the patch in.