Changeset 21354 for trunk/src/crypt32/protectdata.c
- Timestamp:
- Feb 21, 2010, 5:32:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crypt32/protectdata.c
r21311 r21354 264 264 /*if (pSerial->cbData<256) pSerial->cbData=256;*/ 265 265 266 pSerial->pbData= LocalAlloc(LPTR,pSerial->cbData);266 pSerial->pbData=(BYTE*)LocalAlloc(LPTR,pSerial->cbData); 267 267 if (!pSerial->pbData) return FALSE; 268 268 … … 338 338 ERR("struct size changed!? %u != expected %u\n", 339 339 ptr - pSerial->pbData, dwStruct); 340 LocalFree( pSerial->pbData);340 LocalFree((HANDLE)pSerial->pbData); 341 341 pSerial->pbData=NULL; 342 342 pSerial->cbData=0; … … 410 410 411 411 /* cipher_alg */ 412 if (!unserialize_dword(ptr,&index,size, &pInfo->cipher_alg))412 if (!unserialize_dword(ptr,&index,size,(DWORD*)&pInfo->cipher_alg)) 413 413 { 414 414 ERR("reading cipher_alg failed!\n"); … … 439 439 440 440 /* hash_alg */ 441 if (!unserialize_dword(ptr,&index,size, &pInfo->hash_alg))441 if (!unserialize_dword(ptr,&index,size,(DWORD*)&pInfo->hash_alg)) 442 442 { 443 443 ERR("reading hash_alg failed!\n"); … … 598 598 pInfo->null0=0x0000; 599 599 600 if ((pInfo->szDataDescr=CryptMemAlloc((dwStrLen+1)*sizeof(WCHAR))) )600 if ((pInfo->szDataDescr=CryptMemAlloc((dwStrLen+1)*sizeof(WCHAR))) != NULL) 601 601 { 602 602 memcpy(pInfo->szDataDescr,szDataDescr,(dwStrLen+1)*sizeof(WCHAR)); … … 613 613 614 614 /* allocate memory to hold a salt */ 615 if ((pInfo->salt.pbData=CryptMemAlloc(CRYPT32_PROTECTDATA_SALT_LEN)) )615 if ((pInfo->salt.pbData=CryptMemAlloc(CRYPT32_PROTECTDATA_SALT_LEN)) != NULL) 616 616 { 617 617 /* generate random salt */ … … 794 794 { 795 795 TRACE_DATA_BLOB(pOptionalEntropy); 796 TRACE(" %s\n", debugstr_an((LPCSTR)pOptionalEntropy->pbData,pOptionalEntropy->cbData));796 TRACE(" %s\n", debugstr_an((LPCSTR)pOptionalEntropy->pbData,pOptionalEntropy->cbData)); 797 797 } 798 798 … … 1071 1071 /* prepare for plaintext */ 1072 1072 pDataOut->cbData=protect_data.cipher.cbData; 1073 if (!(pDataOut->pbData= LocalAlloc( LPTR, pDataOut->cbData)))1073 if (!(pDataOut->pbData=(BYTE*)LocalAlloc( LPTR, pDataOut->cbData))) 1074 1074 { 1075 1075 ERR("CryptMemAlloc\n"); … … 1087 1087 SetLastError(ERROR_INVALID_DATA); 1088 1088 1089 LocalFree( 1089 LocalFree((HANDLE)pDataOut->pbData ); 1090 1090 pDataOut->pbData = NULL; 1091 1091 pDataOut->cbData = 0; … … 1098 1098 if (ppszDataDescr) 1099 1099 { 1100 if (!(*ppszDataDescr = LocalAlloc(LPTR,dwLength)))1100 if (!(*ppszDataDescr = (LPWSTR)LocalAlloc(LPTR,dwLength))) 1101 1101 { 1102 1102 ERR("LocalAlloc (ppszDataDescr)\n");
Note:
See TracChangeset
for help on using the changeset viewer.