if(CryptProtectData(
&DataIn,
L"psw", // A description string
// to be included with the
// encrypted data.
NULL, // Optional entropy not used.
NULL, // Reserved.
NULL, // Pass NULL for the
// prompt structure.
0,
&DataOut))
{
printf("The encryption phase worked.\n");
int count=0;
while ( count <= (int)DataOut.cbData )
{
// 因为一个unsigned int 占32位
// 转换成成16进制要占两位
// 所以这里需要用%02
char t[3] = {0};
sprintf(t,"%02X",DataOut.pbData[count]);