X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Frandom%2Fwindows%2Fwindows.factor;h=f6918eb8f8197ab7ed011bf5e19245f7dc171e2f;hp=72b908a32fcfefd3b3bed953080d18418ffb539e;hb=70a99e1cdb02548627e928196e686b06a078467d;hpb=c9ad0856d5de6321c672936e6fc507a155ee8d98 diff --git a/basis/random/windows/windows.factor b/basis/random/windows/windows.factor index 72b908a32f..f6918eb8f8 100644 --- a/basis/random/windows/windows.factor +++ b/basis/random/windows/windows.factor @@ -16,24 +16,22 @@ M: windows-crypto-context dispose ( tuple -- ) CONSTANT: factor-crypto-container "FactorCryptoContainer" -:: (acquire-crypto-context) ( provider type flags -- handle ret ) - HCRYPTPROV :> handle - handle - factor-crypto-container - provider - type - flags - CryptAcquireContextW handle swap ; +:: (acquire-crypto-context) ( provider type flags -- handle ) + { HCRYPTPROV } [ + factor-crypto-container + provider + type + flags + CryptAcquireContextW + ] [ ] with-out-parameters ; : acquire-crypto-context ( provider type -- handle ) CRYPT_MACHINE_KEYSET (acquire-crypto-context) - 0 = [ + swap 0 = [ GetLastError NTE_BAD_KEYSET = [ drop f ] [ win32-error-string throw ] if - ] [ - *void* - ] if ; + ] when ; : create-crypto-context ( provider type -- handle ) flags{ CRYPT_MACHINE_KEYSET CRYPT_NEWKEYSET }