crypt32: CryptProtectData/CryptUnprotectData take 2
Kees Cook
kees at outflux.net
Wed Apr 6 01:01:04 CDT 2005
On Wed, Apr 06, 2005 at 10:29:37AM +0900, Mike McCormack wrote:
> The best way to write a test is to look at some of the test cases that
> are there already. Write and run the test under Windows, and make sure
> it passes on Windows first. The test is something like this:
Ah! Whoops, I didn't think to try that originally. I was just about to
send my new patch too. [time passes...]
> /* try with incorrect parameters */
> ok(!CryptProtectData(NULL,NULL,NULL,NULL,NULL,0,NULL), "crypt
> protect data should fail\n");
> ok(GetLastError() == ERROR_INVALID_PARAMETER, "error returned
> incorrect\n");
Ah-ha, I need to make calls to SetLastError then. I wasn't doing that
either. Okay, 3rd time's the charm. This patch includes full
documentation, as well as the test suite which passes both on Wine and
Windows.
--
Kees Cook @outflux.net
More information about the wine-devel
mailing list