Modify ↓
#3619 closed Bug (Fixed)
Return value of _WinAPI_LocalFree() is not consistent with what the documentation says
| Reported by: | Owned by: | J-Paul Mesnage | |
|---|---|---|---|
| Milestone: | 3.3.15.1 | Component: | Standard UDFs |
| Version: | 3.3.14.5 | Severity: | None |
| Keywords: | LocalFree _WinAPI_LocalFree | Cc: |
Description
Return Value according to the documentation
Success: True
Failure: False, call _WinAPI_GetLastError() to ...
In WinAPIMem.au3
Func _WinAPI_LocalFree($hMemory)
Local $aResult = DllCall("kernel32.dll", "handle", "LocalFree", "handle", $hMemory)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>_WinAPI_LocalFree
If the error is caused by the DllCall(), the documentation is correct.
However, the return value of LocalFree() itself according to MSDN is:
- If the function succeeds, the return value is NULL.
- If the function fails, the return value is equal to a handle to the local memory object. To get extended error information, call GetLastError().
Thus, if LocalFree() returns 0 (which means successful), _WinAPI_LocalFree() returns False (which means failed).
Attachments (0)
Change History (2)
comment:2 by , on Mar 23, 2018 at 9:09:31 AM
| Milestone: | → 3.3.15.1 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [12082] in version: 3.3.15.1
Note:
See TracTickets
for help on using tickets.

You right, doc will be fixed next release