* Generate Plain data and Description from given Cipher and Entropy data.
*
* PARAMS
* pDataIn [I] Cipher data to be decoded
* ppszDataDescr [O] Optional Unicode string describing the Plain data
* pOptionalEntropy [I] Optional entropy data to adjust cipher, can be NULL
* pvReserved [I] Reserved, must be NULL
* pPromptStruct [I] Structure describing if/how to prompt during decoding
* dwFlags [I] Flags describing options to the decoding
* pDataOut [O] Resulting Plain data, from calls to CryptProtectData
*
* RETURNS
* TRUE If a Plain was generated.
* FALSE If something failed and no Plain is available.
*
* FIXME
* The true Windows encryption and keying mechanisms are unknown.
*
* dwFlags and pPromptStruct are currently ignored.
*
* NOTES
* Memory allocated in pDataOut and non-NULL ppszDataDescr must be freed
* with LocalFree.
*
*/
BOOLWINAPICryptUnprotectData(DATA_BLOB*pDataIn,
LPWSTR*ppszDataDescr,
DATA_BLOB*pOptionalEntropy,
PVOIDpvReserved,
CRYPTPROTECT_PROMPTSTRUCT*pPromptStruct,
DWORDdwFlags,
DATA_BLOB*pDataOut)
{
BOOLrc=FALSE;
HCRYPTPROVhProv;
structprotect_data_tprotect_data;
HCRYPTHASHhHash;
HCRYPTKEYhKey;
DWORDdwLength;
constchar*announce_bad_opaque_data="CryptUnprotectData received a DATA_BLOB that seems to have NOT been generated by Wine. Please enable tracing ('export WINEDEBUG=crypt') to see details.";