Custom Query (3927 matches)
Results (58 - 60 of 3927)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2132 | Fixed | _WinAPI_GetModuleHandle incorrect param handling | ||
| Description |
The doc says to pass 0 for the current process handle. This code expects an empty string instead: Func _WinAPI_GetModuleHandle($sModuleName) Local $sModuleNameType = "wstr" If $sModuleName = "" Then $sModuleName = 0 $sModuleNameType = "ptr" EndIf Either the code or doc should be fixed (MSDN says to use NULL, so I vote for sticking with the doc and fixing the code). |
|||
| #2263 | Completed | Add CryptGenRandom Function to Crypt.au3 UDF | ||
| Description |
Here's the function: ; #FUNCTION# ===================================================================
; Name...........: _Crypt_GenRandom
; Description ...: Fill a buffer with cryptographically random data.
; Syntax.........: _Crypt_GenRandom($pBuffer, $iSize)
; Parameters ....: $pBuffer - Pointer to buffer to fill with random data.
; $iSize - Size of the buffer pointed to by $pBuffer.
; Return values .: Success - Returns True
; Failure - Returns False and sets @error.
; Author ........: Erik Pilsits (wraithdu)
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ CryptGenRandom
; Example .......: Yes
; ==============================================================================
Func _Crypt_GenRandom($pBuffer, $iSize)
_Crypt_Startup()
Local $aRet = DllCall(__Crypt_DllHandle(), "bool", "CryptGenRandom", "handle", __Crypt_Context(), "dword", $iSize, "ptr", $pBuffer)
Local $nError = @error
_Crypt_Shutdown()
If $nError Or (Not $aRet[0]) Then
Return SetError(1, 0, False)
Else
Return True
EndIf
EndFunc ;==>_Crypt_GenRandom
|
|||
| #3054 | Fixed | _Crypt_GenRandom always returns False and sets @error | ||
| Description |
The function sets $iError = @error + 10 without checking @error. Further, I see no documentation or reason for @error + 10 at all. Func _Crypt_GenRandom($pBuffer, $iSize) _Crypt_Startup() Local $aRet = DllCall(__Crypt_DllHandle(), "bool", "CryptGenRandom", "handle", __Crypt_Context(), "dword", $iSize, "struct*", $pBuffer) Local $iError = @error + 10, $iExtended = @extended _Crypt_Shutdown() If $iError Or (Not $aRet[0]) Then Return SetError($iError, $iExtended, False) Else Return True EndIf EndFunc ;==>_Crypt_GenRandom |
|||
Note:
See TracQuery
for help on using queries.
