Re: crypt32.dll: Initialize provider pointer to null before calling CryptAcquireContextW()

View: New views
3 Messages — Rating Filter:   Alert me  

Re: crypt32.dll: Initialize provider pointer to null before calling CryptAcquireContextW()

by Juan Lang-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Paul,

I imagine this is to avoid checking prov if CryptAcquireContextW
fails.  In that case, wouldn't it be better to check the return value
of CryptAcquireContextW?
--Juan



Re: crypt32.dll: Initialize provider pointer to null before calling CryptAcquireContextW()

by Paul Chitescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 04 November 2009 11:45:38 pm Juan Lang wrote:
> Hi Paul,
>
> I imagine this is to avoid checking prov if CryptAcquireContextW
> fails.  In that case, wouldn't it be better to check the return value
> of CryptAcquireContextW?
> --Juan

Checking the return value of CryptAcquireContextW() is also possible but I
took the path of minimal change in the source.

Besides, I consider passing pointers to uninitialized variables a bad
programming practice.

Paul



Re: crypt32.dll: Initialize provider pointer to null before calling CryptAcquireContextW()

by Juan Lang-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Checking the return value of CryptAcquireContextW() is also possible but I
> took the path of minimal change in the source.

The change I suggest would be small too.

> Besides, I consider passing pointers to uninitialized variables a bad
> programming practice.

Not when they're out pointers.
--Juan