1292 {
1294 {
1296 phHash.Dispose();
1297 throw hRForLastWin32Error.ToCryptographicException();
1298 }
1299 try
1300 {
1301 int pbData = 0;
1302 int pdwDataLen = 4;
1303 if (!global::Interop.Advapi32.CryptGetHashParam(phHash, global::Interop.Advapi32.CryptHashProperty.HP_HASHSIZE, out pbData, ref pdwDataLen, 0))
1304 {
1306 throw hRForLastWin32Error2.ToCryptographicException();
1307 }
1308 if (pbData != hash.Length)
1309 {
1310 if (throwOnSizeError)
1311 {
1312 throw (-2146893821).ToCryptographicException();
1313 }
1314 return null;
1315 }
1316 if (!global::Interop.Advapi32.CryptSetHashParam(phHash, global::Interop.Advapi32.CryptHashProperty.HP_HASHVAL, hash, 0))
1317 {
1319 throw hRForLastWin32Error3.ToCryptographicException();
1320 }
1322 phHash = null;
1323 return result;
1324 }
1325 finally
1326 {
1328 }
1329 }
static bool CryptCreateHash(SafeProvHandle hProv, int algId, SafeKeyHandle hKey, global::Interop.Advapi32.CryptCreateHashFlags dwFlags, out SafeHashHandle phHash)
static int GetHRForLastWin32Error()
override void Dispose(bool disposing)
static SafeKeyHandle InvalidHandle