On Wed, 2010-08-18 at 10:14 +1000, Austin Lund wrote:
#define MAGIC_CRYPTPROV 0xA39E741F +#define MAGIC_CRYPTKEY 0xA39E741F +#define MAGIC_CRYPTHASH 0xA39E741F
The app might pass a crypto handle of the wrong type, so it would be better to use different magic values.
On 18 August 2010 18:34, Hans Leidekker hans@codeweavers.com wrote:
On Wed, 2010-08-18 at 10:14 +1000, Austin Lund wrote:
#define MAGIC_CRYPTPROV 0xA39E741F +#define MAGIC_CRYPTKEY 0xA39E741F +#define MAGIC_CRYPTHASH 0xA39E741F
The app might pass a crypto handle of the wrong type, so it would be better to use different magic values.
Are there any rules to these magic values? Why was 0xA39E741F chosen?
On Wed, 2010-08-18 at 20:02 +1000, Austin Lund wrote:
On 18 August 2010 18:34, Hans Leidekker hans@codeweavers.com wrote:
On Wed, 2010-08-18 at 10:14 +1000, Austin Lund wrote:
#define MAGIC_CRYPTPROV 0xA39E741F +#define MAGIC_CRYPTKEY 0xA39E741F +#define MAGIC_CRYPTHASH 0xA39E741F
The app might pass a crypto handle of the wrong type, so it would be better to use different magic values.
Are there any rules to these magic values? Why was 0xA39E741F chosen?
They are often built from four character ascii strings to help find out where the structures come from. I don't know why this one was chosen but I guess you could use something like 0xA39E741E and 0xA39E741D.
On 08/18/2010 12:22 PM, Hans Leidekker wrote:
They are often built from four character ascii strings to help find out where the structures come from. I don't know why this one was chosen but I guess you could use something like 0xA39E741E and 0xA39E741D.
Yep, there are some magic values at http://en.wikipedia.org/wiki/Hexspeak FYI, MAGIC_CRYPTPROV comes from the following commit http://source.winehq.org/git/wine.git/?a=commitdiff;h=44cb0906da3dddbca1fe67...
On 18 August 2010 20:44, GOUJON Alexandre ale.goujon@gmail.com wrote:
On 08/18/2010 12:22 PM, Hans Leidekker wrote:
They are often built from four character ascii strings to help find out where the structures come from. I don't know why this one was chosen but I guess you could use something like 0xA39E741E and 0xA39E741D.
Yep, there are some magic values at http://en.wikipedia.org/wiki/Hexspeak FYI, MAGIC_CRYPTPROV comes from the following commit http://source.winehq.org/git/wine.git/?a=commitdiff;h=44cb0906da3dddbca1fe67...
None of that answers the "why" question except perhaps the part about unaligned pointer values which isn't really relevant for modern architectures.
I'll wait for any further feedback, try something like above and resubmit tomorrow.