<div dir="rtl"><div dir="ltr">The actual data type is <span style="font-family:Consolas,Courier,monospace;font-size:14.166666030883789px;line-height:16.66666603088379px;color:blue">typedef</span><span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace;font-size:14.166666030883789px;line-height:16.66666603088379px"> ULONG_PTR HCRYPTPROV;</span></div>
<div dir="ltr">I found two conflicting descriptions in <a href="http://microsoft.com">microsoft.com</a> for ULONG_PTR:</div><div dir="ltr"><br></div><div dir="ltr">The first <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx</a> says it's always 64 bits:</div>
<div dir="ltr"><br></div><div dir="ltr"><pre style="padding:5px;margin-top:0px;margin-bottom:0px;font-family:Consolas,Courier,monospace;overflow:auto;word-wrap:normal;color:rgb(0,0,0);font-size:14.166666030883789px;line-height:16.66666603088379px">
#<span style="color:blue">if</span> defined(_WIN64)
<span style="color:blue">typedef</span> <span style="color:blue">unsigned</span> __int64 ULONG_PTR;
#<span style="color:blue">else</span>
<span style="color:blue">typedef</span> <span style="color:blue">unsigned</span> <span style="color:blue">long</span> ULONG_PTR;
#endif</pre></div><div class="gmail_extra"><div dir="ltr">The second <a href="http://msdn.microsoft.com/en-us/library/cc230394.aspx">http://msdn.microsoft.com/en-us/library/cc230394.aspx</a> says it's essentially int, 32 bit or 64 bit.</div>
<div dir="ltr"><br></div><div dir="ltr">Looking in the MingW header file <font face="courier new, monospace">basestd.h,</font> ULONG_PTR is defined to either __int64 in WIN64 or long in WIN32, so it is always 64 bit.</div>
<div dir="ltr"><br></div><div dir="ltr">uintptr_t will be 32 bits in WIN32.</div><div dir="ltr"><br></div><div dir="ltr">The ideal would be to use the correct typdef <span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace;font-size:14.166666030883789px;line-height:16.66666603088379px">HCRYPTPROV </span>but this would require exposing it in random header which is probably wrong. So my question is if private member __f_ must be an int or is it an implementation detail and a uint64_t will be OK.</div>
<div dir="ltr"><br></div><div dir="ltr"><font face="arial, sans-serif"><span style="font-size:12.499999046325684px">Yaron</span></font></div><div dir="ltr"><font face="arial, sans-serif"><span style="font-size:12.499999046325684px"><br>
</span></font><br></div><div class="gmail_quote"><div dir="ltr">2013/10/7 Richard <span dir="ltr"><<a href="mailto:legalize@xmission.com" target="_blank">legalize@xmission.com</a>></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
In article <<a href="mailto:CANa4zJo%2BYND%2BHH3vz1Y-JymaLCjR2-QJkdLgFCWW27AYbP0YyA@mail.gmail.com">CANa4zJo+YND+HH3vz1Y-JymaLCjR2-QJkdLgFCWW27AYbP0YyA@mail.gmail.com</a>>,<br>
<div class="im"> Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> writes:<br>
<br>
> Is it OK to modify the private member __f_ type from int to uint64_t?<br>
<br>
</div>Wouldn't intptr_t or uintptr_t be more appropriate?<br>
<br>
"Handles" in Windows are more likely to be pointers masquerading as an<br>
integer for opacity purposes.<br>
<span class=""><font color="#888888">--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
The Computer Graphics Museum <<a href="http://computergraphicsmuseum.org" target="_blank">http://computergraphicsmuseum.org</a>><br>
The Terminals Wiki <<a href="http://terminals.classiccmp.org" target="_blank">http://terminals.classiccmp.org</a>><br>
Legalize Adulthood! (my blog) <<a href="http://legalizeadulthood.wordpress.com" target="_blank">http://legalizeadulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>