Skip to content

Commit 06cf24b

Browse files
authored
Possibly fix #480
Increase buffer size
1 parent 6056d60 commit 06cf24b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Includes/_URLModifications.au3

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ EndFunc
471471
; $dFlag - [Optional] WinAPI Function parameters
472472
; Return values .: The URL unescaped string
473473
; Author ........: mistersquirrle, rcmaehl
474-
; Modified ......: 2/8/2024
474+
; Modified ......: 3/28/2025
475475
; Remarks .......: URL_DONT_UNESCAPE_EXTRA_INFO = 0x02000000
476476
; URL_UNESCAPE_AS_UTF8 = 0x00040000 (Win 8+)
477477
; URL_UNESCAPE_INPLACE = 0x00100000
@@ -480,13 +480,15 @@ EndFunc
480480
; Example .......: No
481481
; ===============================================================================================================================
482482

483+
; TODO: Make buffer dynamic. However 4096 should be more than enough.
484+
483485
Func _WinAPI_UrlUnescape($sUrl, $dFlags = 0x00040000)
484486

485487
; https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-urlunescapew
486488
Local $aUrlUnescape = DllCall("Shlwapi.dll", "long", "UrlUnescapeW", _
487489
"wstr", $sUrl, _ ; PWSTR pszUrl - A pointer to a null-terminated string with the URL
488490
"wstr", "decodedUrl", _ ; PWSTR pszUnescaped - A pointer to a buffer that will receive a null-terminated string that contains the unescaped version of pszURL
489-
"dword*", 1024, _ ; DWORD *pcchUnescaped - The number of characters in the buffer pointed to by pszUnescaped
491+
"dword*", 4096, _ ; DWORD *pcchUnescaped - The number of characters in the buffer pointed to by pszUnescaped
490492
"dword", $dFlags) ; DWORD dwFlags
491493
If @error Then
492494
FileWrite($hLogs[$URIFailures], _NowCalc() & " - " & "UrlUnescapeW call failed with error: (" & @error & "," & @extended & ")" & @CRLF)

0 commit comments

Comments
 (0)